OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: NecorB on 30 Sep 2005, 17:35:24
-
Hi!
I need help with creating a script that checks if a scud misile has been launched.
I have this mission where three Scuds are deployed and planing to launch. If anyone of theese three succeds, the mission is going to end.
-
Hello,
Take a look at the ComRef,
scudState scud
Operand types:
scud: Object
Type of returned value:
Number
Description:
Current state of given Scud launcher. Following states are recognized: 0 - No activity, 1 - Launch preparation, 2 - Launch prepared, 3 - Ignition, 4 - Launched. Note: Non-integral values are used to indicate transition between states.
Example:
scudState scudOne>=4
You can use the result of that command to decide what will happen.
-
Yea IÂ've seen that allready but cant make it work. First im not 100% sure how (where) to use the line. Second, im getting error messages like, Type bool - expected number, although in the comref it says line is type Number.
I need the "Scudstate" to be reccognized in a trigger so I can end mission when Launched.
Greatful for anymore help.
-
try
Trigger (any width, just the default options are fine)
Name your scud units, eg scud1, scud2, scud3.
In the activation field, where it says 'this', delete the 'this' and put ' {(scudState _x) > 3} count [scud1, scud2, scud3] > 0 '. Above this field in the trigger, set the delay type as countdown, and the delay max, min, and mid to whatever time period you want the mission to end in once a scud has been launched
Hope it helps
-
That did it Fragorl. Problem solved. Thanks alot for help all
:)
-
Good, glad it is all solved......you can press the 'Solve' button now. 8)
Planck