OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Cheo on 29 Jun 2005, 17:22:42

Title: Trigger to check player/unit inside vehicle?
Post by: Cheo 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. :-\
Title: Re:Trigger to check player/unit inside vehicle?
Post by: bedges 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...
Title: Re:Trigger to check player/unit inside vehicle?
Post by: Cheo on 29 Jun 2005, 17:46:13
Thanks a lot!

It works perfect. The more simple the better (more easy imposible).
Title: Re:Trigger to check player/unit inside vehicle?
Post by: Cheo 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?
Title: Re:Trigger to check player/unit inside vehicle?
Post by: bedges 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 ;)
Title: Re:Trigger to check player/unit inside vehicle?
Post by: Chris Death 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