Jump to content
tommytom1

Complete task (activate trigger) after assembling uav drone?

Recommended Posts

Im trying to have a task succeed after assembling a ar-2 darter drone, wats the best way to accomplish this?

Share this post


Link to post
Share on other sites

Probably not the best way but couldn't think of anything better. Have a trigger with following condition:

!isNull (nearestObject [getPos player, "B_UAV_01_F"])

It will fire when nearestObject for player is the Darter. If you have more drones of the same type that are already assembled near player, this will trigger too soon.

In trigger's On Activation field put whatever you need to change your task's status to completed.

  • Thanks 1

Share this post


Link to post
Share on other sites

You can also solve it with an event handler, which may save performance every so slightly.

player addEventHandler ["WeaponAssembled", {
    params ["_unit", "_staticWeapon"];
    
if (typeOf _staticWeapon == "B_UAV_01_F") then {
_tskUAV setTaskState "Succeeded";
 };

  }];

See syntax examples Event Handlers and  setTaskState.

 

Note that I typed this on phone... Errors likely...

 

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

×