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!
Develop games in your browser. Powerful, performant & highly capable.
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.
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.