Home   Help Search Login Register  

Author Topic: spawned vehicle/unit detected by a specific trigger  (Read 1168 times)

0 Members and 1 Guest are viewing this topic.

Offline D_P_

  • Members
  • *
  • YAY! I'm a lama again! ...oh wait.
    • ArmaAddons
spawned vehicle/unit detected by a specific trigger
« on: 17 Mar 2007, 04:29:47 »
i have a mission where fuel and supply trucks need to make it across the island. When they arrive at the supply point/s I want the trigger to detect the vehicles and award the appropriate scrore and/or script. Here's the hard part... I want the trucks to be spawned, but i don't know how to have a spawned vehicle/unit detected by a specific trigger.... any ideas?
just setpos & forgetpos!

Offline genji

  • Members
  • *
Re: spawned vehicle/unit detected by a specific trigger
« Reply #1 on: 16 May 2007, 17:58:29 »
hey amigo,

im working on a similar problem to open a gate when spawned vehicles enter a triggers area. I have this code in a script to check if the unit is a vehicle:

Code: [Select]
_unit = _this Select 0
? vehicle _unit != DRIVER _unit: goto "inveh"

If the _unit being tested is a vehicle, then the above test should be true (vehicle will not equal driver). IF the _unit being tested is a human on foot, then vehicle and driver will both return the same unit (and the above condition is false).

plus this might also be useful:

Code: [Select]
? vehicle _unit != _unit
Is the code to check if the unit is in a vehicle or not. If a unit is not in a vehicle then

Code: [Select]
? vehicle _unit == _unit
will return TRUE.

check out the entire thread if you need more info on how to use these commands:
http://www.ofpec.com/forum/index.php?topic=28690.0

another thing im aware of is that the Explosion FX version 1.02 BETA script by MadDogX has some code in it to detect the exact type of vehicle if you need to be sure the vehicle is a supply truck.





Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: spawned vehicle/unit detected by a specific trigger
« Reply #2 on: 16 May 2007, 22:55:38 »
Does the trigger fire only once or does it need to keep counting vehicles?
urp!