How do I set the conditions to do x action -once-?

0 favourites
  • 4 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • Hey C3 world.

    Essentially, I'd like to see the global value (NumberofPowerPlants) to increase once when the conditions are met. However, I suck at this and the global value increases to a very large number.

    Or if you recommend a different approach, I'm all game.

    I just want the NumberofPowerPlants to increase one when it has the POW_WorkerAssigned instance variable = 3 which is manually assigned in a different part (POW is the 3 letter abbrevation for powerplant). There could be additional power plants built which will require 3 more workers assigned it each of them.

    Any help/guidance/time would be greatly appreciated!

  • Try using the condition: Trigger Once while true

  • So when a second one is built and the conditions are met, will that run again or how does that work? I saw the trigger once while true but it didn't seem to be the solution for future conditions that would need to be met. Again, only asking as you may see something I don't.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could also try giving each powrplant a boolean called IsActive. It starts false, but when the plant gets activated by three workers, you set it to true.

    Then, whenever you run a check to see if a powerplant should get activated, also check if IsActive is false. So you'll only ever activate plants that have false booleans.

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