Jump to content
Sign in to follow this  
SD_BOB

Custom Composition - Detect Not Alive

Recommended Posts

Hi guys, does anybody know of a method with which i can detect if a custom composition is destroyed?

Example:- I have created a number of small custom composition camps to randomly place around my map. I use a game logic location, the call up the composition + spawned AI.

What i would like to do it to be able to tell when that camp has been destroyed, that way i could add say an ammo dump or in this case VC tunnel entrances for a Vietnam mission. If i can detect when they are destroyed, i can make objectives out of them.

Thanks in advance for any help.

Share this post


Link to post
Share on other sites

a composition is not an object its a list of objects, to check if composition is destroyed youd need to check if all objects is destroyed.

checking if a sandbag is destroyed might not work though so you need to define what objects to check for each composition, ofr example all tents, all static guns etc...

Share this post


Link to post
Share on other sites

Ok makes sense..

So this is my composition, how would i go about checking if the objects are destroyed?:o

private ["_objs"];
_objs =
[
["uns_AmmoBoxNVA",[-1.29077,0.97229,0],282.192,1,0,{}],
["uns_AmmoBoxNVA",[-1.72607,1.85974,0],96.6876,1,0,{}],
["LAND_uns_vcshelter3",[-3.15356,-0.69397,0],0,1,0,{}],
["LAND_uns_firepit1",[-3.09839,-0.707397,0],0,1,0,{}],
["LAND_uns_vcshelter6",[2.70239,1.2262,0],270.619,1,0,{}],
["Land_Fire_burning",[-3.09814,-0.687866,0],0,1,0,{}],
["uns_ricebasket2",[-2.69873,2.31323,0],0,1,0,{}],
["LAND_uns_vcshelter6",[2.7334,-2.67578,0],270.619,1,0,{}],
["LAND_uns_vcshelter2",[-1.84497,0.394287,0],90.1001,1,0,{}]
];

_objs

Thankyou for your help.

Share this post


Link to post
Share on other sites

private ["_objs"];
_objs =
[
["uns_AmmoBoxNVA",[-1.29077,0.97229,0],282.192,1,0,{}],
["uns_AmmoBoxNVA",[-1.72607,1.85974,0],96.6876,1,0,{}],
["LAND_uns_vcshelter3",[-3.15356,-0.69397,0],0,1,0,{}],
["LAND_uns_firepit1",[-3.09839,-0.707397,0],0,1,0,{}],
["LAND_uns_vcshelter6",[2.70239,1.2262,0],270.619,1,0,{}],
["Land_Fire_burning",[-3.09814,-0.687866,0],0,1,0,{}],
["uns_ricebasket2",[-2.69873,2.31323,0],0,1,0,{}],
["LAND_uns_vcshelter6",[2.7334,-2.67578,0],270.619,1,0,{}],
["LAND_uns_vcshelter2",[-1.84497,0.394287,0],90.1001,1,0,{}]
];

_objs

waitUntil {!alive _objs};

Other code here....

I do believe that should work, basically this script waits until all the objects created are destroyed.

I'm not sure if my method is correct, only way to find out is to test it your self.

-Bigshot

Share this post


Link to post
Share on other sites

Is destroying a rice basket really strategically important? Just have one or two key items in the camp that need to be destroyed and keep things simple. :) Not even sure you can destroy a camp fire really.

Share this post


Link to post
Share on other sites

@bigshotking: If you lookup alive, you'll see that it takes an object as input, not an array. Code would not work.

And I agree with kylania, seems like a bad approach to check for all objects. But doing it "correctly" is not trivial either:

* Have one list with classnames of the objects you really want to check.

* Create a list of all nearby objects that are found in the first list.

* Count the resulting list, and store it in some variable related to the objective.

* Loop over the resulting list to create eventhandlers (I won't guarantee it will work with all objects). Each "kill" should subtract one from the count above.

* When count reaches zero, objective complete.

I'm sure there are other ways too, but trying to count thislist (triggers) won't work.

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

No i dont need to destroy all the objects. The composition above was just one i had for an example of how to do it. That is just a normal camp which doesnt need to be destroyed.

But i plan to make up some ammo dumps and tunnel entrances that can be destroyed.

Is there a way i can give certain objects in the compositio a name? and check for that?

* Have one list with classnames of the objects you really want to check.

* Create a list of all nearby objects that are found in the first list.

* Count the resulting list, and store it in some variable related to the objective.

* Loop over the resulting list to create eventhandlers (I won't guarantee it will work with all objects). Each "kill" should subtract one from the count above.

* When count reaches zero, objective complete.

Honestly i wouldnt have a clue where to start with that, im still at a pretty basic level with all this.

Edited by Shadow.D. ^BOB^

Share this post


Link to post
Share on other sites

That looks promising, sorry to sound like an idiot but how are you using that? in a trigger, script?

Share this post


Link to post
Share on other sites
I am using that in a script,

Ill send you a demo if you want ?

Post the demo here, others will have similar questions and would like the answer as well I bet.

Share this post


Link to post
Share on other sites

Thats a good idea..

Kylania did you get my PM regarding your "Search Body" script?

Share this post


Link to post
Share on other sites

Any joy with that demo psvialli? Looking forward to seeing how it works.

Cheers.

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  

×