Home   Help Search Login Register  

Author Topic: How Do You Get Guys To Get In A Vehicle You Are Driving When You Get Near Them?  (Read 930 times)

0 Members and 1 Guest are viewing this topic.

Alex

  • Guest
Hi All,
         How Do You Get Guys To Get In A Vehicle You Are Driving When You Get Near Them? Like With A Trigger And Synchs Etc But I Can't Get It To Work. HELP!

gadolinite

  • Guest
Here is how I would do it:

Make a  :D"stalker" trigger that follows the leader of the group of guys (set its position to the getpos of the leader).  When the vehicle enters the trigger area, have the guys enter the vehicle.


If I attempted to script this out for you, this post will be endless.  I hope my idea works and helps :).  

Alex

  • Guest
Sorry Mate I'm Not Really That Advanced At Scripting, What Is A Stalker Script? Could You Simplify Things Plz Mate?

Kammak

  • Guest
For this example:

Player is driver of car named vCar
3 guys waiting are lead by guy named hGuyWaiting

Make a trigger.
Activation=none
Axis a=0, Axis b=0
Type=none

In "Condition" field delete "this" and put:

Code: [Select]
vCar distance hGuyWaiting<10

In "On Activation" field put:

Code: [Select]
{_x assignascargo vCar} foreach units group hGuyWaiting;units group hGuyWaiting orderGetIn true

You can change the 10 to any value in meters you want it to trigger at.  I just tried it and it worked fine.

If the player is not the driver of vCar, then you would need more code to make the driver stop then go...is the player going to be the driver?



Kammak

  • Guest
Second example more in line with what gadolinite was talking about.

Again, the player is the driver of a vehicle named vCar.
In his init field, put

Code: [Select]
[] exec "movetrigger.sqs"

Create a trigger
Asix a and b=10 (or whatever distance you want)
Activation: West, Once, Present
Type: None
Name: triggerPickup
Condition:

Code: [Select]
this && "Man" counttype thislist >0

On Activation:

Code: [Select]
thislist select 1 sidechat "Hey, give us a ride!";{_x assignascargo vCar} foreach units group (thislist select 1);units group (thislist select 1) ordergetin true

Now create a script named "MoveTrigger.sqs" and place it in the mission folder.  The script should be:

Code: [Select]
;MoveTrigger.sqs
#loop
triggerPickup setpos getpos vCar
~.5
goto "loop"


As you drive around, if *any* friendly unit gets within 10 meters of the car they will say "Hey, give us a ride" and get in the vehicle.
« Last Edit: 08 May 2004, 04:01:28 by Kammak »

Kammak

  • Guest
You would probably want the guys that get in your vehicle to join the player's group too?

If so, add the following to the "On Activation" scripts in the example above.

First example
Code: [Select]
[hGuyWaiting] exec "joinonenter.sqs"

Second example
Code: [Select]
[(thislist select 1)] exec "joinonenter.sqs"

And create the script "JoinOnEnter.sqs"

Code: [Select]
;joinonenter.sqs
_arrGuys=units group (_this select 0)
_max=count _arrGuys
_cur=0

#loop

? !(_arrGuys select _cur in vCar):goto "loop"
_cur=_cur+1
? _cur<_max:goto "loop"
_arrGuys join player
exit

That will wait until they all enter the vehicle, then they will join the player's group.
« Last Edit: 08 May 2004, 03:38:27 by Kammak »

Alex

  • Guest
And How Do You Get Them To Get Out Again At A Certain Point?

Alex

  • Guest
Wait This Doesn't Work, I Have Put This in The On Activation Field,
{_x assignascargo vCar} foreach units group hGuyWaiting;units group hGuyWaiting orderGetIn true
And It Says Invalid Number In Expression
Help!
« Last Edit: 08 May 2004, 11:43:15 by Alex »

Offline Davies1

  • Members
  • *
  • Bugger this for a game of soldiers!
alex try a simpler method. Use Advanced mission editor (click the 'easy' part of the editor screen- if you dont know  ;D)

If you are driving give your self a waypoint to the place of pickup called 'load'.

Give the group of people a waypoint called 'get in' and then use the 'synchronise' command to drag a line between the two waypoints. (should be blue)

When you reach the destination your units should get in whatever you are driving.

All you need to do is repeat these steps but with a 'get out' waypoint for the units you picked up and synchronised with a 'transport unload' waypoint for yourself.

Please not that to see the waypoints it should be activated in the WP box selection or the editor should be on cadet mode. (ofp has a bug which sets it automatically to veteren difficulty, so open a single mission then escape back to the menu)

They should get out once you reach the destination. Give me an email or im on msn for gridlocktakedown@hotmail.com if you need further help.

I prefer Waypoints to scripts, but still use both :D.

if you want the units to join you for an assualt give yourself another waypoint called 'join and lead' and the other units a 'join' WP. Sync em together and they will follow you. (just swap it around if you want to follow them, but make sure they have their commands to carry on the mission)
« Last Edit: 08 May 2004, 12:00:50 by Davies1 »
Beer is the fuel for the Heavy Metal Engine.

Kammak

  • Guest
Well I assumed he couldn't do it with simple waypoints due to the specifics of his mission and was asking for a scripted solution....

Yeah placing a few waypoints and synching them is the simplest way if that fits in the context of his mission.


RE: The error you got, check your spelling.  I actually tested everything I posted and it all works...make sure the names all match up and braces are in correct order etc....

Alex

  • Guest
Yeah Thats Perfect Thanks Everyone!