OneShot
12-29-2005, 03:58 PM
This was originally written and posted by Laglos on the SubSim Forums ...
*** Laglos - HowTo : Setting Battery Level ***
I'm posting this because I've seen several people asking about it, so in the hopes that in the future at least a few will try the search function and thus find their answer. :smile:
Here's a step by step guide for setting the battery level of a sub when creating your own mission:
1. Create a DrainBattery script
Click on the Add Script button (lower right corner; looks like a movie clapper).
Set Apply To ALL
Set the name of the script to something like "DrainBatteryS"
Go to page 2 of the script panels
In the #1 box, select "SetBattery" from the pulldown. Two other windows will appear. In the first, select the object you wish to drain the battery of. In the second, enter the percentage you wish the battery level to be.
2. Create a DrainBattery trigger
Click on the Add Trigger button (lower right; looks like an arrow pointing to an X). Then click on the map somewhere to "place" the trigger (doesn't matter where....pick somewhere where it'll be out of the way)
Select Apply to ALL
Give the trigger a name, i.e. "DrainBatteryT".
Set the type to "Event trigger"
Set the activation to "Automatic"
Enter a short description of this trigger if desired (i.e. "Trigger which runs the DrainBatteryS script at the beginning of the mission).
Don't select "Can Refire".
Skip page 2; the defaults are fine. (don't need Doctrine Lang; start and end times and duration should be all zeros)
If you want to inform the player, set the stuff on page 3 at your whim. Otherwise, skip to page 4.
On page 4, set the Action to "Run Script", and, in the pulldown that appears, select the script you created in part #1 above.
And you're all done! There's other interesting things you can do by fooling with the Apply To settings and by using the Doctrine Language in the trigger to apply other tests, or by fiddling with the start time of the trigger, but this should get you started in the wonderful world of triggers and scripts. :smile: Enjoy!
*** Laglos - HowTo : Setting Battery Level ***
I'm posting this because I've seen several people asking about it, so in the hopes that in the future at least a few will try the search function and thus find their answer. :smile:
Here's a step by step guide for setting the battery level of a sub when creating your own mission:
1. Create a DrainBattery script
Click on the Add Script button (lower right corner; looks like a movie clapper).
Set Apply To ALL
Set the name of the script to something like "DrainBatteryS"
Go to page 2 of the script panels
In the #1 box, select "SetBattery" from the pulldown. Two other windows will appear. In the first, select the object you wish to drain the battery of. In the second, enter the percentage you wish the battery level to be.
2. Create a DrainBattery trigger
Click on the Add Trigger button (lower right; looks like an arrow pointing to an X). Then click on the map somewhere to "place" the trigger (doesn't matter where....pick somewhere where it'll be out of the way)
Select Apply to ALL
Give the trigger a name, i.e. "DrainBatteryT".
Set the type to "Event trigger"
Set the activation to "Automatic"
Enter a short description of this trigger if desired (i.e. "Trigger which runs the DrainBatteryS script at the beginning of the mission).
Don't select "Can Refire".
Skip page 2; the defaults are fine. (don't need Doctrine Lang; start and end times and duration should be all zeros)
If you want to inform the player, set the stuff on page 3 at your whim. Otherwise, skip to page 4.
On page 4, set the Action to "Run Script", and, in the pulldown that appears, select the script you created in part #1 above.
And you're all done! There's other interesting things you can do by fooling with the Apply To settings and by using the Doctrine Language in the trigger to apply other tests, or by fiddling with the start time of the trigger, but this should get you started in the wonderful world of triggers and scripts. :smile: Enjoy!