Jump to content
Sign in to follow this  
bigshotking

Detecting a certain object in a composition

Recommended Posts

I'm trying to create two objectives, one you have to destroy a radio tower, and two you have to destroy 3 artillery guns. These two objectives are spawned as a composition, through a gamelogic.

This is how I'm calling them:

_comp1 = [position this, 0, "Firebase1_TK_EP1"] call (compile (preprocessFileLineNumbers ""ca\modules\dyno\data\scripts\objectMapper.sqf""));

_comp2 = [position this, 0, "RadarSite1_TK_EP1"] call (compile (preprocessFileLineNumbers ""ca\modules\dyno\data\scripts\objectMapper.sqf""));

How can I select the intended objects, so that when they are destroyed then the objective is completed.

Thanks in advance,

-Bigshot

EDIT: After some further searching I have found the answer to my problem.

Here is an example:

This is what I use to spawn the composition:

_comp = [getMarkerPos "test", 0, "AntiAir1_TK_EP1"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

This is what I use to get the objects in the composition:

player sideChat format["objects: %1",_comp];

This is what waits for the object to get destroyed:

waitUntil {!alive (_comp select 1)};  

I just used this to confirm my object was destroyed:

player sideChat "AA Destroyed";

Credits goto sxp2high

Edited by bigshotking

Share this post


Link to post
Share on other sites

had a similar script -

could use

comp = [getMarkerPos "test", 0, "AntiAir1_TK_EP1"] call (compile (preprocessFileLineNumbers "ca\modules\dyno\data\scripts\objectMapper.sqf"));

and then

comp addEventHandler["killed", { (_this select 0) spawn artytakenout; }];

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  

×