dop2000's Forum Posts

  • Try running the game in debug mode and check what's going on. If both Platform and MoveTo behaviors are active at the same time and both try to move the object, this may prevent "On arrive" event from triggering.

  • According to the documentation:

    So you need something like this:

    .

  • If you are exporting your game for desktop using "NW.JS" option, then you can add NWJS object to your project (the same way you add other objects like Mouse, Touch etc.)

    And then use NWJS Write File action.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use "Browser Invoke Download" action if it's a browser game, or "NWJS Write File" in NWJS export.

  • It's difficult to understand the problem without a project file. But my guess is you need to regenerate the obstacle map for Pathfinding, after changing the Tilemap. Use "Regenerate map" or "Regenerate region", then "Wait 0.1", then "Find path"

  • I don't know Javascript that well. I think you can do something like runtime.GlobalVars.forEach(....), and compare prefix.

    But like I said, there is no way to get the default value for each variable, so you can only reset them all to 0 or "".

  • Code will detect the variables declared in the current event sheet and reset only them

    No, this is not possible, because global variables are not really assigned to event sheets.

    Maybe if you add a specific prefix to a group of variables (for example EnemySpeed, EnemyDamage), you will be able to loop through all variables with this Enemy* prefix in a script. But still I don't think it's possible to get their default values to reset them to.

  • Local static variables are similar to global, but you can't reset them all with one action.

    If you need lots and lots of variables, you can use a global object (invisible sprite) to store them. This way if you need to reset them, you can destroy and recreate the sprite.

    You can have several of such "dummy" objects, for example one to store variables related to game settings, another to store game statistics/scores etc.

    Or use dictionaries.

  • jobel Variables placed inside a group will become local. Local variables are reset on every tick, unless they are set as static. And there is no easy way to reset all static local variables. So OP will still have to reinitialize each such variable individually on start of the layout.

  • I've tried the persist

    And you were on the right path, but you needed to add "Timer is NOT running" condition to the first event.

    Question with global objects that text box will take up that space on all layouts and how can I stop the running timer, lets say the user went to a home page?

    You will have to destroy this text on all other layouts. I don't like Global objects, but they may be useful sometimes.

  • You do not have permission to view this post

  • Your are adding 40px margin on the left and top of the snapshot, but you didn't add the same margin to the right and bottom. I think you need to change it to Body.Width+80 , Body.Height+80

  • This is not possible. You will have to reset each variable one by one with "System Set variable" actions.

  • It probably has been asked so many times, but, how do I move sprites with different ids to match other sprites with the same id?

    You can use families for that. Define id on the family. Pick one family instance and one sprite instance with the same id. And then you'll be able to refer to both instances in the same event, for example: Sprite MoveTo Family

  • Timer is reset because you are restarting it in "On start of layout" event.

    There are several alternative and easier solutions:

    1. I see you've added Persist behavior to the text object. It will ensure that the Timer continues to run after layout is restarted, but you need to add "Timer is NOT running" condition to the first event, to prevent it from resetting.

    2. Instead of Persist behavior, you can make the text Global. It will have the same effect, but you need to be aware that global objects are not destroyed when you switch to another layout.

    3. You can do this without Timer behavior - add this event:

    int(TimerVariable)%12=0
    Trigger Once 
    ..........Audio Play