Spkka 10 Posted July 15, 2009 (edited) Hey I am changing the crcti warfare.07 to fit to my own needs. I added all possible objects in arma to build in your base etc. Now I want make a power generator which is needed before the other buildings will function. Maybe some meter that keeps track of the current power and the power that is needed in total. I don't really have an idea how to start on this. I added a power generator to build and I got the option to turn toggle the power on/off near the generator. I need to create a variable so that I know if the generator is on or off and play a sound if its on, and stop the sound if its off. How does this work? ---------- Post added at 08:23 PM ---------- Previous post was at 06:47 PM ---------- I want to test if toggle works and I added this, I bet i do something wrong but I have no idea really. Turning it on/off should go for each Power Generator and not as 1 variable i guess. ; args: [object, type, si] ? (power): power = false; PublicVariable "power"; power = true; ? !(power): power = true; PublicVariable "power"; power = false; if ( power == true ) then { playsound "track1"; } Edited July 15, 2009 by Spkka Share this post Link to post Share on other sites
Spkka 10 Posted July 16, 2009 Guess this should be under addons/scripting anyways. Anyone? Share this post Link to post Share on other sites
f2k sel 164 Posted July 16, 2009 You could attach a trigger to each PG and when you get within x meters it turns on, you could then set a variable true and run the script. That would just check to see how many variables have been passed by the triggers and display the voltage. When it reaches XX voltage the lights would come on. If you want an on off option then I think you need to look at addaction but it's not something I've looked at much but I believe it give you an option in the menu to execute an action such as on off. I haven't ever added sounds you could attach the motercycle and turn it's engine on for the sound, not forgetting to make it invisible using deletecollection objectname command. I carn't do any tests right now but I've done most of this in the past with OFP, there was an addon switch that you could operate to make it look realistic. Share this post Link to post Share on other sites
Spkka 10 Posted July 16, 2009 Well i got to the point that it shows the "toggle power" parameter. But I have no idea how to add a variable for each generator that is build. Arma2 kinda lack information about scripting in my opinion or Im missing something.. Share this post Link to post Share on other sites