OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Bad Maniac on 28 Apr 2003, 02:39:03
-
I have finally got my follow script to work, it's basically an infinite loop of move commands, that tells a group to move to the position of a given unit at set intervals.
Now I want them to STOP following me when they reach a certain waypoint, or trigger.
How can I stop a script from repeating again when a certain event has occurred?
-
One way is to have a variable that is set to true when you want the script to stop. It goes something like this:
Init.sqs or any units init field
Stopnow = false
Script
#loop
~0.5
...blah blah blah...
? not Stopnow: goto "loop"
Waypoint OnActivation field
Stopnow = true
So when the unit gets to their waypoint, Stopnow becomes true. This means your script will no longer loop ;)
-
Will that work in Multiplayer?
If it does, then it was easier then I though :D
-
Hmm.... should do, though you will have to Publicvariable your variable.
It depends on a lot of things... I'm sure as hell no expert when it comes to Multiplayer editing ;)
-
I'll try it out now, thanks Sui :)