OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: penguinman on 13 May 2005, 05:09:55

Title: player out of gunner into cargo.
Post 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
Title: Re:player out of gunner into cargo.
Post by: Uldics on 13 May 2005, 07:05:12
I think you have syntax error in
Quote
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.
Title: Re:player out of gunner into cargo.
Post by: Planck on 13 May 2005, 19:11:47
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
Title: Re:player out of gunner into cargo.
Post by: penguinman on 13 May 2005, 23:46:13
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.