MoscowModder's Forum Posts

  • Sometimes, when I try to use the built in Save function (for checkpoints to load on death), I get the following error:

    Uncaught (in promise) TypeError: this._wasOverJumpthru.GetUID is not a function at PlatformInstance.SaveToJson (runtime.js:9:507) at BehaviorInstance.SaveToJson (behaviorInstance.js:4:172) at Instance.SaveToJson (instance.js:28:407) at objectClass.js:30:45 at Array.map (<anonymous>) at ObjectClass._SaveToJson (objectClass.js:30:30) at C3Runtime._SaveToJsonString (runtime.js:105:420) at C3Runtime._DoSaveToSlot (runtime.js:102:335) at C3Runtime._HandleSaveOrLoad (runtime.js:100:143) at C3Runtime.Tick (runtime.js:76:186)

    Has anyone ever seen this before? This only happens on 2 specific (and large) layouts with a lot of objects using the Jumpthru behavior.

    Case 1: Sometimes when you load the level, some of my Jumpthru objects get despawned immediately (the level changes over the course of the story). The game saves when the player performs a specific action.

    Case 2: The game tries to save 0.1s after the layout starts (to give dynamically-created objects time to spawn). No Jumpthru objects are despawned by this point.

    Take note that the player object (with the Platform behavior) is dynamically created at the start of the layout, as there are multiple players to choose from. Could this be related?

    EDIT: Deleting every Jumpthru object from the layout ahead of time makes the bug go away, so they are definitely the culprit here. I just don't know how to fix this without drastically altering my level design to work without them.

    EDIT 2: Statically placing the player object (instead of spawning it dynamically) does not help.

  • It looks like you're setting the animation to "Crawl" from the beginning every frame. You should either a) make sure it's not already playing the animation you want first, or b) set it to play from the current frame.

  • I know how to convert instances to/from JSON using event sheets - using the expression Object.AsJSON and the action Set from JSON string.

    Is there a way to do the same things from JavaScript? It would be nice to be able to make code that can save/load arbitrary objects of any type without them needing to share a family.

    Tagged:

  • Ah, thanks for the tip. Unfortunately some other issue I can't pin down is preventing me from running the game in NWJS mode at all, so I can't test it immediately. However, once that issue goes away, I'll try out the redraw plugin.

  • Before you ask, "why aren't you using Construct 3?", I have already migrated my new project to C3. However, my old project, already released to Steam, is done in C2 and it isn't feasible to migrate it over. So now I'm stuck supporting an existing game on an unsupported engine with an unsupported Steam plugin.

    I have a bizarre issue when my game runs in Steam. Whenever I pause the game or cover the screen with a blackout wipe, then the transparent background will flicker on and off while the opaque game layers behind it stay still.

    This seems to be a recent issue, and it only happens while I'm playing in Steam (it's fine when running standalone), and this issue retroactively appeared in earlier versions of the game that had been running fine.

    When I first implemented Steam support, I followed the advice of the Steam4C2 creators and created an invisible square object that moves in a sine pattern,

    Tagged:

  • Ah, thank you! Good to know.

  • I'm trying to write a set of unified methods to handle save data using either LocalStorage (for preview and a possible web release) or NWjs (for the desktop release). I'm having trouble getting the former to work, and I wonder if it's because LocalStorage is async while NWjs uses synchronous read/writes.

    Anyway, I'd like to write a JS method to call the correct storage handler internally in one method. Is it possible to access the NWjs object type and its methods (specifically create folder, write to file, and ReadFile) from the JS API? I examined runtime.objects.NWjs.getFirstInstance() and didn't find anything helpful on there.

    Edit: I know I can just make a C3 function that returns the value of NWjs.ReadFile() and call that from JS. I just wonder if there's a more direct approach.

    Edit 2: While I'm asking API questions, can I check the "System | Is in preview" property from JS too?

    Tagged:

  • Well, that's unfortunate. I use the NWJS version because it lets me save to a local file, and I'm building my game as an NWJS app and I use the associated plugin to manage my save data.

    Is migrating to the browser version, and using export instead of save to get local files, my only option for debugging?

  • Whenever I try to start up my project in debugger mode, Construct 3 instantly crashes. I'm using the NW.js version of C3, and this is a very big project so I'm not going to try to reproduce this in a test project.

    Is there any crash log I can look up to try to get some diagnostics or a stacktrace to explain why the debugger isn't working?

    Tagged:

  • I am trying to animate an in-depth cutscene for a game, which involves multiple characters moving and interacting. This will require characters to change their playing animation several times during the cutscene.

    Is it possible to change a sprite's playing animation during a timeline? Or is that something I will have to set up manually using triggers?

    Tagged:

  • Also, a related question - is it possible to get the width and height of the viewport from within JS? This would be analogous to OriginalWindowWidth and OriginalWindowHeight in event sheets.

  • Is there a way to call the System action "Set layout scale" from the JS API? Or will I have to make a function in an event sheet and use runtime.callFunction() to do it?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, I can do that. I was just hoping there would be a more direct fix instead of just trying to kludge my way around it.

  • I have an object called Platform (which has, you guessed it, the Platform property). If some conditions are met, I destroy this object in its On created event.

    In the On start of layout event, I save the game using the built-in save method. When I do so, the game immediately locks up and I get the following error in the console:

    instance.js:8
    Uncaught (in promise) TypeError: this._wasOverJumpthru.GetUID is not a function
     at PlatformInstance.SaveToJson (instance.js:8)
     at BehaviorInstance.SaveToJson (behaviorInstance.js:3)
     at Instance.SaveToJson (instance.js:20)
     at objectClass.js:27
     at Array.map (<anonymous>)
     at ObjectClass._SaveToJson (objectClass.js:27)
     at C3Runtime._SaveToJsonString (runtime.js:88)
     at C3Runtime._DoSaveToSlot (runtime.js:85)
     at C3Runtime._HandleSaveOrLoad (runtime.js:82)
     at C3Runtime.Tick (runtime.js:61)
    

    Is the game trying to save that instance I just destroyed? How can I prevent it from doing so?

  • Ah, that's my problem. I had the text and the masks on different layers. I was using the built-in scroll feature to scroll down the menu "naturally", but I adjusted it to just move the text items up and down like your example.

    Thanks for your help!