Home   Help Search Login Register  

Author Topic: Trigger to check player/unit inside vehicle?  (Read 681 times)

0 Members and 1 Guest are viewing this topic.

Cheo

  • Guest
Trigger to check player/unit inside vehicle?
« on: 29 Jun 2005, 17:22:42 »
Hi all,
I'm a noob and I red almost all posts, but I can't find out how to check 2 or more units (player and/or AIs) to be inside a vehicle.
I want this to start a conversation using game logics (which is done) when BOTH the player and the AI are inside the vehicle. I managed to do this when either the player is inside the vehicle or the AI, but not both at the same time.
I use the condition field of the trigger but I think a need to call a script for this.
Anyway, any comment would be really a useful help. :-\

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Trigger to check player/unit inside vehicle?
« Reply #1 on: 29 Jun 2005, 17:32:49 »
condition field of trigger -

(unit_1 in vehicle_name) and (unit_2 in vehicle_name)

see attached missionette, and look at the trigger...

Cheo

  • Guest
Re:Trigger to check player/unit inside vehicle?
« Reply #2 on: 29 Jun 2005, 17:46:13 »
Thanks a lot!

It works perfect. The more simple the better (more easy imposible).

Cheo

  • Guest
Re:Trigger to check player/unit inside vehicle?
« Reply #3 on: 29 Jun 2005, 19:42:27 »
What if I want to check when the player/unit is out from a vehicle?
What's the command?

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Trigger to check player/unit inside vehicle?
« Reply #4 on: 29 Jun 2005, 20:27:15 »
Code: [Select]
not (unit_name in vehicle_name)....  ::)

thing is, if you put that in a trigger it will fire straight away if the unit starts outside the vehicle. i would declare another variable, something like 'has_been_in_vehicle', set it to false at the very start, and then once the unit gets in, set it to true.

then in the 'getting out' trigger's condition field, put

Code: [Select]
has_been_in_vehicle and not (unit_name in vehicle_name)
don't worry, it gets easier as time passes ;)
« Last Edit: 29 Jun 2005, 20:30:37 by bedges »

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Trigger to check player/unit inside vehicle?
« Reply #5 on: 01 Jul 2005, 10:17:56 »
Or if you want check for any vehicle;

vehicle player == player

Use this command to check if player is not in a vehicle.

And;

vehicle player != player

Use this command to check if player is inside any vehicle

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted