Home   Help Search Login Register  

Author Topic: How can i do change player's postion (pilot/gunner) inside an helo IN FLIGHT?  (Read 1833 times)

0 Members and 1 Guest are viewing this topic.

Offline crisbal

  • Members
  • *
Is tah possible , thanks

Offline Lone~Wolf

  • Mission Tools & Mods
  • Members
  • *
  • Vladimir Dmitri Mikhail Andreevich Stamenov
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.
Snarling creature, lurking in the background, still writing in .sqs

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
The Lone Wolf has said is true.
 Here's an example of the commands:

-MoveinDriver
-MoveinGunner

REgards....

-Aldo
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline crisbal

  • Members
  • *
Even using a trigger , I think i need scripting examples, thanks

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
Hi Friend ...

1. It is possible to make the unit goes from driver to gunner in flight.
 
See this example:
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline pertplus

  • Members
  • *
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

Offline Aldo15

  • OFP-addict
  • Former Staff
  • ****
    • My OFP missions
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:
Code: [Select]
this moveindriver uh-aGun = Gunner ---> (Moveingunner uh) ----> init:
Code: [Select]
this moveingunner uh-"1" = Marker ----> (Empty)
-"2" = Marker ---> (Empty)

2. Place a trigger:

Parameters:

Call alfa-radio
-On Activation:
Code: [Select]
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
« Last Edit: 15 Jan 2011, 01:32:38 by Aldo15 »
My OFP stuff
FMF Project by Aldo15. Coming soon.
If in the high school or university, Teachers add a new subject about how to make scripts, missions, for ofp. I'd be number one of my classroom

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
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,
Code: [Select]
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.
Code: [Select]
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.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
You can do it using the unassignVehicle command and the setPos command. Like this:

Code: [Select]
_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.