How do I stop this?

0 favourites
  • 8 posts
From the Asset Store
Control your space ship in a weird space-time environment and destroy as many enemies as you can!
  • Hello i create eq and inventory system for my game, but i Got problem.

    When player equip chest armor he Got armor but armor caunter dont stop... And still adding armor and i cant stop this.

    youtu.be/v8P7t6tHpZc

  • You would need to set armor to armor+items.armor, since the event is constantly running. Or you can make it a trigger once style event for example 'on drop item' you can put all that logic in a function and run it once.

  • So i need create variable for item items.armor and set player armor variable as player.armoe + item.armor Yes?

  • You are adding item.armor to Armor so you already have the 2 variables right? If you set Armor to (player)Armor+item.armor then it will increase. So if your armor is 0 and the item armor increase is 10 it will set armor to 10. A more usual thing is to create a one time trigger like on the mouse click - add the item stats to player one time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Im doing something wrong.. I set player armor like u said (player.armor+items.armor) counter dosnt stop, and player armor variable is 0 and when i start game it is 15

  • Delete the bottom events for overlap. On your event for mouse click call a function. Create the function below that adds values to the player, like an Add Stats function. Pass through as parameters all the stats like items.crit items.armour etc. In the function set the player stats based on parameters. This means when you click the item and it moves to the slot it will run the function and add the stats, try this.

  • Thanks lionz for responding, but i fix that with setting value on start = 0

  • That is not a good fix unfortunately you will run into bugs as you expand the inventory. I've seen the events and what is happening you are setting it back to 0 and then to an appropriate value every tick, flip flopping between 0 and the correct value, it's better to just set it once for simplicity and to avoid bugs. Also you can get performance issues from doing this.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)