OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: crisbal on 13 Jan 2011, 13:39:18
-
Is tah possible , thanks
-
Simply, use moveingunner or movindriver as a command for the person in question.
If you want something more complicated you can manually manipulate the animations to simulate physically changing seats.
If you need script examples, ask.
-
The Lone Wolf has said is true.
Here's an example of the commands:
-MoveinDriver (http://www.ofpec.com/COMREF/index.php?action=details&id=224&game=All)
-MoveinGunner (http://www.ofpec.com/COMREF/index.php?action=details&id=225&game=All)
REgards....
-Aldo
-
Even using a trigger , I think i need scripting examples, thanks
-
Hi Friend ...
1. It is possible to make the unit goes from driver to gunner in flight.
See this example:
-
1. Give the unit you want to move a name - p1
2. give the heli a name - h1n1
2. assuming you have waypoints for tyhe helicopter, click on the waypoint you want the switch to happen on and enter the following in the "On Activation" field:
p1 moveingunner h1n1;
Then when it reaches that waypoint the switch will occur. You could do the same thing with a trigger if you want. just set it however you want and put the same command in the on activation field
-
Hi pertplus
what you're trying to say is fine, but the unit does not change position in flight. On example I've uploaded I did this:
1. Place names of units:
-Uh = Helo ----> (empty and Flying)
-aP = Driver ---> (uh moveindriver )----> init: this moveindriver uh-aGun = Gunner ---> (Moveingunner uh) ----> init: this moveingunner uh-"1" = Marker ----> (Empty)
-"2" = Marker ---> (Empty)
2. Place a trigger:
Parameters:
Call alfa-radio
-On Activation:
aP setPos getMarkerPos "1" ; aGun setPos getMarkerPos "2" ; aP moveinGunner uh ; aGun moveindriver uh
With this trigger aP changes from driver to be a gunner, and aGun changes from gunner to be driver
The way you have offered don't work .Look at my example
~Aldo
-
One of the side effects of moving units around in positions like this, is that it confuses their orders.
For example, HELO:
You can place an empty unit and name each crew member before moving them into position via their Init field.
Using those names(global variables) at anytime during the mission with a single trigger,o1 setpos getpos temppos1; b1 setpos getpos temppos1; {unassignvehicle _x} foreach [o1,b1]; o1 moveingunner t1; b1 moveindriver t1 you can setposition them to another place and immediately move them back into different positions of that same aircraft without effecting the position of the aircraft. However, this causes them to immediately disregard their current waypoint order. The solution is to order them to move to another position somewhere(perhaps along the way) and then they will continue to their current waypoint.
Ground vehicles are different. You can use the same way to switch units around but they don't seem to respond after the switch, even after ordering them to move somewhere else. However, the better way to switch in ground vehicles is to use the code below in the OnActivation field of a trigger.o1 action ["eject",t1]; b1 action ["eject",t1]; {unassignevehicle _x} foreach [o1,b1]; o1 moveindriver t1; b1 moveingunner t1 This will not work for aircraft because as soon as you eject a unit from an aircraft, they are moved into a parachute vehicle.
To do this without having to name units, a script should be used to perform the switch. Using a script may allow you a chance to use the eject action for aircraft by ejecting them from the aircraft, unassigning them, ejecting them from their current vehicle(which will be the parachute), unassigning them from that chute and then move them back into position. Not sure what that would like visually(may leave behind a floating chute).
Hope this helps some.
-
You can do it using the unassignVehicle command and the setPos command. Like this:
_gunner = gunner _craft
_driver = driver _craft
unassignVehicle _gunner
_gunner setPos [0,0,1000]
unassignVehicle _driver
_driver setPos [0,0,2000]
_driver assignAsGunner _craft
_gunner assignAsDriver _craft
_gunner moveInDriver _craft
_driver moveInGunner _craft
As others have mentioned, existing waypoints may be messed up when you do this swap.