Home   Help Search Login Register  

Author Topic: Driver/Pilot waits for player  (Read 1904 times)

0 Members and 1 Guest are viewing this topic.

Offline eegore

  • Members
  • *
Driver/Pilot waits for player
« on: 18 Sep 2009, 09:33:20 »

  Ive always had the driver/pilot outside a vehicle then "getindriver" to have them take me somewhere.

  I've looked but can't find the command to have a pilot wait on the ground until the player or player's group enters the vehicle, then take off.  Same with convoys drop off/pick up I always use "setfuel 0" to stop and move the trucks around the map.

  Is there a better way to do this?

Offline Kneehi

  • Members
  • *
Re: Driver/Pilot waits for player
« Reply #1 on: 19 Sep 2009, 00:10:29 »
let me see if i understood, you want to know how to make the vehicle wait for the troops to get in, than move to next waypoint?
 
Quite simple, you can create a "get in" Waypoint  from the troop, than a "load" Wp from the vehicle, than synchronize them. With this, if the vehicle arrives before the unit(s) to the Wp, it will wait untill the load is done, than move to next Wp.
To make a unit get out from a vehicle:
After the load, that i explained before, crate a "transport Unload" (from the vehicle)Wp where you want the troops to get out, than, next to it, create a "get out" Wp(from the unit(s)).
You don't need always to use commands, only if you want the unit to get into a specific location of the vechile.

PS: if you want to make the chopper wait for the units on the ground, i think you can use the land command: Just put in the "In Activation" field: Choppername land "land". I haven't tried this, but seems pretty obvious, i don't know.



Sorry for the bad English, i'm BR. Hope i could help. :D :D
War ain't fair.

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Driver/Pilot waits for player
« Reply #2 on: 19 Sep 2009, 17:03:24 »
The stop command may work , i think...
pilot1 dostop true

? count crew vehicle pilot1 > anynumber you wish here : pilot1 dostop false

Or :
setting the fuel to 0 may cause the pilot to hop out,isn't it????
I think you can disable the chopper's engine to be started....
Or for future uses....create a script....
Code: [Select]
_mypilot=_this select 0;
_myveh=_this select 1;
_leadergroup=_this select 2;
_mygroup=group _leadergroup
_county=count units _mygroup
?
#loop
?_mypilot in _myveh : _mypilot dostop true
? count crew _myveh==_county+1 : _mypilot dostop false;exit
;+1 because the pilot had to be counted!
_myveh engineon false
~0.01
goto "loop"
;Syntax is : [pilotname,vehiclename,Leadername] exec "getin.sqs"

And create a folder called "Scripts" in My Docs/ArmA/ where other folders like missions exists.
So now the script is in global folder...you can call it from any mission....!
This script works only with 1 pilot per chopper....

I am not expert so there may be better methods....
Haroon1992..................
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Driver/Pilot waits for player
« Reply #3 on: 20 Sep 2009, 07:31:17 »
Very simple
One trigger- no radius/ repeatedly
Code: [Select]
Condition: ?(player in vehiclename)
Onactivation: vehiclename setfuel 1
OnDeactivation: vehiclename setfuel 0

The only problem this presents is once the player is inside the vehicle and it is at full speed, ejecting could cause damage to the player.

This would work perfectly with waypoints if you place short delays on the waypoint to allow the player to get out.

If you want to use the variable "(player in vehiclename)" in a waypoint condition, just make sure you use it in the waypoint following the one that you want the driver/pilot to wait at. That way the driver/pilot will not take off until the player is in the vehicle.

To keep pilots in a chopper with the rotors turning, use vehiclename flyinheight 0 on a move or getin waypoint.

Use a delay on move waypoints with the flyinheight command when the chopper is moving to allow the chopper to come to a full stop before descending.

Example:
Waypoint # /  WP command /           Condition           /         Onactivation            /Time delay
WP1          /      GETIN       /   true                          / vehiclename flyinheight 0   /0-0-0
WP2          /      MOVE       /  (player in vehiclename)  / vehiclename flyinheight 40 /0-0-0
WP3          /      MOVE       /   true                          / vehiclename flyinheight 0   / 10-10-10
WP4          /      MOVE       /  (player in vehiclename)  / vehiclename flyinheight 40 /

Offline eegore

  • Members
  • *
Re: Driver/Pilot waits for player
« Reply #4 on: 20 Sep 2009, 08:29:46 »
  Thanks for the help.

  I really try to stay away from player waypoints as much as possible so some of these codes should work better.  

  The ? type conditions always seem to mess me up, I ty to find missions with them and make sense of it but I'm not the best at distinguishing what each part does.  
  
Such as this:

  ? count crew vehicle pilot1 > anynumber you wish here : pilot1 dostop false

I assume thats a trigger condition and when I put 4 guys in that helo it will then go to a waypoint and dump us off.  But it took me a while to figure out that it was counting the gunner also, therefore it wasn't working and I reverted to "setfuel 0" and ended it up falling out of the sky and landing on me.  

  I screw things like that up all the time.  So these replies are really handy.


  Thanks

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Driver/Pilot waits for player
« Reply #5 on: 20 Sep 2009, 14:10:00 »
sorry for being not simple.....
You have to remove the " ?" and " : " if you used it in the Condition line of a trigger....
And it is NOT " > " and IT SHOULD  BE " == " (that's my fault)
Also the " pilot1 dostop true " is to be written in On Activation Line of  the trigger.

If the chopper should be with both a pilot and a gunner, then :
count crew vehicle pilot1 == yourgroupunitsnumber + 2
Example :
If there were 10 units in the boarding group , and the chop has 2 operators.
Then
count crew vehicle pilot1 == 12
That way the pilot will take off only when there is 12 units in the vehicle/chopper.
Haroon1992..............................................................
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Driver/Pilot waits for player
« Reply #6 on: 26 Sep 2009, 12:47:06 »
I agree that player waypoints are a no no. I was speaking about the waypoints of the vehicles AI driver though.