Im now trying to make on every tick make the game check how many of the devices are ON, and based on that obtain the energy used in that tick. The more devices ON, the more energy wasted. As said by someone giving me advice, I have created the In use boolean on the devices that will use power, but i cant find a way to make it work. I cant get the game to check what devices are on or off.
Advice given to me:
I would suggest that you have, at the very least, a global variable for the amount of electricity available (the first game based the gameplay on managing energy), then have every energy-consumable device (doors, lights, cameras, etc) have an "In Use" boolean variable, just to let the program know when they are ON or OFF.
Now, on every tick make the game check how many of the devices are ON, and based on that you can obtain the energy used in that tick. The more devices ON, the more energy wasted.
Make use of the "In Use" boolean to toggle the lights and doors ON and OFF as well! That way, if Door_1 is "ON", then show the graphic for Door_1 closed. More or less like that.