OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Mad Pup on 15 Jun 2010, 07:25:54
-
Hello OFPEC members,
I was wondering is there such a command, used in a script, to synchronize ''Load'', and ''Get In'' waypoints?
Thanks!
~MadPup~
-
There isn't, but the equivalent would be a slowish loop which checks for all of the "getting in" group to be in (http://www.ofpec.com/COMREF/index.php?action=details&id=169&game=OFP) before issuing any move command to the vehicle.
-
Okay, so like in a script I would put
? player in _jeepOneCorrect?
-
Yeah, or to check if an entire group is in a vehicle,
{_x in _jeepOne} count (units _groupOne) == {alive _x} count (units _groupOne)
In other words, "number of groupOne units boarded in jeepOne equals number of alive groupOne units."
And you can also put that in the condition field for a waypoint, or a trigger synchronized to one, of course.
-
The "_" underscore identifies a variable that is local to the script (which means it is unknown outside of the script). In order for it to work, you must pass the name of the jeep to the script through an array and then assign a local to it at the start of the script. But since editor assigned names are global variables (which means they are known in and out of scripts), it's best to refer to the jeeps editor assigned name which is whatever you name it, without the underscore.
#wait
? player in jeepOne : goto "proceed"
~1
goto "wait"
#proceedThe words with a # symbol before them are called labels. You use them to jump around within scripts when specific conditions are met. It must be used with a goto command.
Below is an example I'm using in a mission to make sure the player and his group are in a vehicle before executing a cinematic. I have the player separate from the rest of the group just in case he/she boards and then decides at the last minute to get out and do something outside of the vehicle before the rest of his group has boarded.
#wait
? vehicle player != vehiclename : exit
? ({alive _x} count units group player) == ({_x in vehiclename} count units group player): goto "proceed"
~1
goto "wait"
#proceed
vehiclename setfuel 1
The ": exit" bit is used to exit the script if the player gets out.
vehiclename must obviously be changed to whatever you desire.
Hope this helps.
-
waypoint the desired chopper to the desired location.
Put a HeliH at the location.
Put a MOVE waypoint for the chopper right beside or on the helih,
type in on act :
helicoptername land "land"
Note : just type like that, no changes required!
NOTE: using 'this' instead of helicopter name might not work sometimes.
And put another MOVE waypoint right beside the first MOVE wp.(must be close)
Put the desired condition,in this case :
player in helicoptername
NOTE : using 'this' here might not work too!
Go on with the extraction....
Regards,
Haroon1992