How do I detect Construct 3 release version in the game?

0 favourites
  • 10 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • We are preparing a big game for release and need to stay on Construct version 344-2. But because the editor constantly prompts to update, it's easy to accidentally save the project in a new version.

    Is there any way to check C3 version in runtime? I want to display an alert if this happens.

  • editor.construct.net/r344-2

    Open the editor from the link.

    But I recommend that you periodically raise the stable version on which the project is being developed.

    I usually do this.

    I leave the save on the stable version of c3p and in the new version of the build project. If there are bugs, I always have an old save.

    For example like this

    GameName_00123_r3442.c3p

    GameName_00123_r350.c3p

  • Thanks, but that's not what I was asking.

  • You can't get C3 version from the game using standard means, maybe javascript means you can do it.

    But it will not guarantee against version upgrade. There will still come a day when before launching the project you will click save.

    The most reliable method is to run the editor by version link. This way it will never update itself.

  • The most reliable method is to run the editor by version link. This way it will never update itself.

    Of course we are launching the editor by direct link (editor.construct.net/r344-2/), but several people are working on the project and human errors do happen. I had to spent several hours once manually editing project files because the game was saved in wrong version. I want to prevent this from happening in the future.

  • I understand.

    Once I also upgraded the version of the game and third-party plugins were not ready for it.

    It took me a long time to change everything inside the archive. I kept thinking of Ashley!

    Maybe if you tag the creator of C3 they will show you how to use JS to output the engine version into a global variable. Or better yet, add it to system expressions!

  • In js, c3_runtimeBaseUrl returns the current url. You could extract the version from there :)

  • In js, c3_runtimeBaseUrl returns the current url. You could extract the version from there :)

    Thanks.

    I used your tip and created a simple example of checking the C3 version.

    dropmefiles.com.ua/en/y9KCVL8As

  • GeoffB This is promising! How do I use it in a script?

    I tried console.log(c3_runtimeBaseUrl) and it didn't work.

    EDIT: seems like it doesn't work with worker enabled.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I guess another option is try to use any of the recently added scripting methods, which didn't exist in r344.2

    And catch an exception with try-catch.

    Edit: This code seems to work!

    const inst = runtime.objects.Text.getFirstPickedInstance();
    try {
     console.log(inst.getTagCount("mytag"));
    } 
    catch {
     // exception means that the version is correct
    }
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)