lionz's Forum Posts

  • Are they gone for good or is this a bug?

  • Restarting the layout does not reset global variables, on the restart layout event you need to set the player health back to its default value with an action.

  • Put the score object on its own layer and set the layer parallax property to 0.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's no point sharing a tutorial that works, asking us to look for errors. You would need to share the project that has the problems.

  • If you collect the item then that one instance of the object is set to 1 and you store it as 1, but the other instances presumably remain as 0. Then when you load the game and get that item from the local storage you now set all instances to 1. Not understanding that last event. Even if this did work are you really going to repeat those events for each collectable in the game? Also I think you should not be saving instance variables to local storage, probably why you found no information on this.

    If you're doing collectables I would advise using an array where you can list all collectables in Y=0 and then have yes/no or 0/1 in Y=1. Then you can save the full array as JSON format into local storage then you only have to save/load one item. On starting the game you load the local storage item into the array and it's filled with what you have collected, 1s and 0s.

    Or if arrays sound like it's not your thing then please revert back to global variables, that's all you need to store to say that you collected an item. When you overlap the object, you set a GV to 1, not on the object itself.

  • There's too much unknown information. You also shouldn't need to get the item from local storage at the start of each layout, only on first load of the game. I can't see any events for the main menu. Better to share the project to debug the error.

  • Try setting levels to int(localstorage.itemvalue), maybe the stored number is now a str. For the levels being visible I don't see any events or logic relating to that.

  • And what's the problem?

  • That would be my approach based on what you described about using a door to stop them, but I don't know the intricacies of the game design.

  • Sounds like you would need 70 with the variable. My best approach would be to focus on the item/room and only allow objects to pathfind to it if their variable matches the variable of the item/room.

  • As above then, make them separate objects which is the norm. Or change a variable on the item to give illusion that the door is locked.

  • I can't see exactly how your game works and how important doors are. Is there only one door to an object? If so you could give an illusion of doors being locked while pathfinding to an object that is not available. Also if the ally and enemy are separate objects then it should be easy to resolve.

  • When they're created they take the values from the instance in the layout with the lowest UID, the oldest one you created.

  • Yes global is for the object itself. If you want some instances to appear and some not then set an instance variable with two different values to distinguish.

  • I think with a global layer you set it up beforehand, you don't create things on it during runtime to 'make them global' as you're describing. So you could create a HUD UI in the editor and then it's global on all layouts.

    The object is global, why do you need some instances global and some not? I would use different objects.