Jump to content
Sign in to follow this  
djotacon

Destroy custom building

Recommended Posts

Question

Hi! to everyone.

There's a way to group a custom building to a trigger?

The target on the mission is destroy a custom radio tower but the object don't have an ID and can't group a trigger to make a valid task.

Someone knows how to do this?

Thanks.

Problem:

The custom buildings hasn't a proper ID to group a trigger to test his state (!alive) or make a proper destruction of them. Spawn a buiding with his placeholder using a template or model don't create a static ID, to make a destruction with a trigger (static object) is no possible with spawn buildings.

Example:

bomb= "Land_Airport_Tower_F" createVehicle position this;

Dont generate a static ID ( obviously )

Solution:

Given a public name to an object solved the problem and give us a proper solution to control the state of the spawned building:

bomb="Land_Airport_Tower_F" createVehicle (getPos IED); 
nombre_bomba="bomba";
missionNamespace setVariable [nombre_bomba,bomb];
publicVariable nombre_bomba; 
deletevehicle IED;

IED is a marker, object, etc. Now we can destroy the spawned building using his name (bomba)

Example:

bomba setdamage 1;

Edited by djotacon
Solution - update

Share this post


Link to post
Share on other sites

I think you can use triggerAttachVehicle to do it, but if you just want trigger to fire when tower is destroyed, there is a easier way. Put this into trigger's "Condition" field:

!alive radioTower

Don't forget to change "radioTower" to actual tower variable/name.

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  

×