OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: Imofexios on 06 Nov 2011, 13:35:05

Title: Trigger on use of truck?
Post by: Imofexios on 06 Nov 2011, 13:35:05
Hello all!

I've tryed to look but could not find any solution so i try asking here.

How i can get trigger go off when player (civilian) enters truck/starts it?
Or can i do something in init to trigger it only once?

The problem is here...The truck placement radius is set to 200 so it wont be sitting same place on any game :)

Thanks in advance.
Title: Re: Trigger on use of truck?
Post by: Wolfrug on 06 Nov 2011, 14:37:13
As long as the truck has a name, this is very simple:

In the trigger's Condition field, simply write:
Code: [Select]
playerName in truckName
Simple as that! The trigger activates when playerName is in truckName. Alternatively you can use just "player", but you should avoid that unless absolutely necessary, because you might for instance want to test the mission from another perspective and let the AI handle the player's tasks - in which case the trigger would never trigger and such.

Here are some alternative conditions:

Code: [Select]
vehicle playerName == truckName
or, if you want to wait until the player starts the truck:

Code: [Select]
isEngineOn truckname && vehicle playerName == truckName
The placement radius doesn't make any difference :)

Wolfrug out.