Jump to content
_Ronald_Reagan_

Trigger activation by vehicle distance

Recommended Posts

Hello,

 

My goal is to spawn a suicide truck (  _shilux  ) by script, and have it explode when it reaches the location (  rock1  ).

 

wave4_p1.sqf

_shilux = createvehicle ["B_mas_cars_Hilux_Unarmed", getMarkerPos "espawn", [], 30];

sleep 4;

_grp1 = createGroup east;
"CUP_I_TK_GUE_Soldier" createUnit [getMarkerPos "espawn", _grp1, "this moveindriver _shilux", 0.5];

sleep 3;

_wp1 = _grp1 addWaypoint [getPos rock1, 0];
_wp1 setWaypointType "MOVE";
_wp1 setWaypointSpeed "FULL";
_wp1 setWaypointCombatMode "BLUE";
_wp1 setWaypointBehaviour "CARELESS";

sleep 4;

_strigger = createTrigger ["EmptyDetector", getPos rock1, true];
_strigger setTriggerArea [0,0,0, false];
_strigger setTriggerActivation ["EAST", "PRESENT", false];
_strigger setTriggerStatements ["_shilux distance rock1 <30", "_bomb = 'M_Mo_82mm_AT_LG' createvehicle (getpos _shilux)", "hint 'Trigger off'"];

My success with this is limited; The truck follows the waypoint to rock, but does not explode.

The truck just sits there waiting

 

What am I missing here?

 

 

Any help would be greatly appreciated, thanks

 

 

 

 

Share this post


Link to post
Share on other sites
6 minutes ago, pierremgi said:

try with 'Bo_Mk82' instead of 'M_Mo_82mm_AT_LG'

 

Thanks for reply. I Just tried it , with no luck unfortunately.

 

The bomb isn't even spawning for some reason.

Share this post


Link to post
Share on other sites
1 hour ago, _Ronald_Reagan_ said:

_strigger setTriggerStatements ["_shilux distance rock1 <30", "_bomb = 'M_Mo_82mm_AT_LG' createvehicle (getpos _shilux)", "hint 'Trigger off'"];

 

_shilux is undefined under the trigger scope. Convert it to global variable if you can = myshilux (and reference that inside the trigger instead).

  • Like 4

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

×