OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: penguinman on 13 May 2005, 05:09:55
-
I need a script that makes the player go out of the gunner position of a vehicle and go in the cargo of that same vehicle.
but instantly using movincargo and stuff.
I tried
player action ["eject,h1"]
~.01
player moveincargo h1
exit
but no luck
thanks
-
I think you have syntax error in
player action ["eject,h1"]
Try instead--> player action ["eject",h1]
But the moveincargo command should work. Look at http://www.ofpec.com/editors/comref.php?letter=M#moveInCargo (http://www.ofpec.com/editors/comref.php?letter=M#moveInCargo)
Maybe those comments can help.
-
Yep, syntax definitely looks dodgy there.
However, I don't think you need to eject him first, unless you really want to.
The action command is actually movetocargo and not moveincargo.
unitname action ["movetocargo",vehiclename]
Will immediately move a unit to cargo.
If you order a pilot to do this, he will, and if the aircraft is flying it will no longer have a pilot unless there was a unit/units in cargo already, in which case they will swap positions.
Choppers sometimes fly erratically and even fly backwards when you swap pilots like this.
This works with player as well as AI.
Planck
-
ahh, I did not know about movetocargo,
thanks,
and also, if a unit is already in a vehicle you can not use the movein command on him.