Jump to content
Sign in to follow this  
st3a1th

Attach Vehicle to Trigger

Recommended Posts

I am trying to attach a empty vehicle to this trigger in a waypoint script so when it is present it will switch. I have named the vehicle in game to veh1 and now trying to associate it with the trigger. Below is the code I am currently using anyone have any ideals ?

_trg0 = createTrigger["EmptyDetector",getmarkerpos"trig1"];

_trg0 setTriggerActivation ["Vehicle", "PRESENT", true]

_trg0 setTriggerArea[50, 50, 0, false];

_trg0 triggerAttachVehicle "_veh1";

_trg0 setTriggerType "SWITCH";

_trg0 synchronizeTrigger [_waypoint1];

Share this post


Link to post
Share on other sites

If you named the vehicle in game to veh1, why you name it in the script _veh1 ?? ;)

Share this post


Link to post
Share on other sites

Yep. Same goes for _waypoint1, if you named it waypoint1 in the editor :)

The underscore prefix is just a convention for naming local variables I think...

Cheers

Share this post


Link to post
Share on other sites
Yep. Same goes for _waypoint1, if you named it waypoint1 in the editor :)

The underscore prefix is just a convention for naming local variables I think...

Cheers

It's not just a convention, adding an underscore will actually define the variable's scope as local to that script.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×