Jump to content
Sign in to follow this  
Cold Evil

Trigger condition set when explotion accur

Recommended Posts

Hi

I'm trying to make a trigger to be activated when a planted explosion is set of.

Am i on the right track when i type it like this?

Condition: count ?explotionA? > 1 || count ?explotionB? > 1

OnAcc: ([5232, 5012] nearestObject 32012) setDamage 1;

Share this post


Link to post
Share on other sites

Hi,

Can I ask; Is the object of this exercise to:

1- Determine when the explosive is set off?

2 - Determine when the building is dead?

I need to know what the overall goal is before I can help. Plus, is this SP, or MP?

Thx :)

Edited by Das Attorney
added smiley

Share this post


Link to post
Share on other sites

Multiplayer and when the explosive is set off. To destroy a radio tower. Cause one charge is not doing it. :)

Share this post


Link to post
Share on other sites

Okay cool - looks like the best way to do this is to:

Add a "HandleDamage" eventHandler to the building.

It will fire whenever the building is damaged and let us know what caused the damage.

If the cause is a satchel charge, then we set the buildings damage to 1.

I need to do a bit of research as to the locality, but this is totally doable. Will start checking out how we can do this :)

---------- Post added at 01:46 AM ---------- Previous post was at 12:20 AM ----------

Good news and bad news.

The (best solution imo) to your problems is this:

([5232, 5012] nearestObject 32012) addEventHandler ["HandleDamage",  
{  
_house = _this select 0;
_damage = _this select 2;
_projectile - _this select 4;
if (_projectile isKindOf "TimeBombCore") then 
{ 
	_damage = 1;  
}
else
{
	_damage = 0;
};
_damage
}];

But....

I tested it and apparently the HandleDamage EH is broken.

See here and other related tickets on FT:

http://feedback.arma3.com/view.php?id=13648

Take this code and paste it into your debug console. It will add the EH to the nearest building to you. When you shoot it, it will display the returned elements as sideChat.

For some reason, _this select 4 (the projectile) returns nothing (any). Any commands based on this are broken :(

The returned array should return this:

Passed array: [unit, selectionName, damage, source, projectile]

(nearestBuilding player) addEventHandler ["HandleDamage",  
{  
_house = _this select 0;

	player sideChat format ["HOUSE: %1", _house];
	diag_log format ["HOUSE: %1", _house];

_damage = _this select 2;

	player sideChat format ["DAMAGE: %1", _damage];
	diag_log format ["DAMAGE: %1", _damage];

_projectile - _this select 4;

	player sideChat format ["PROJ: %1", _projectile];
	diag_log format ["PROJ: %1", _projectile];

_condition = _projectile isKindOf "TimeBombCore";

	player sideChat format ["ISKINDOF TIMEBOMB: %1", _projectile];
	diag_log format ["ISKINDOF TIMEBOMB: %1", _projectile];

if (2>1) then 
{ 
	_damage = 1;  
}
else
{
	_damage = 0;
};

	player sideChat format ["FINAL DAMAGE: %1", _damage];
	diag_log format ["FINAL DAMAGE: %1", _damage];
_damage
}];

You can see from the debug commands that some of the elements from the handleDamage array return <any>, so at the moment it is broken and not good for your purpose.

Share this post


Link to post
Share on other sites

That sucks...

But is it possible to bypass this by using the first idea I had of just recognizing the charge exploding and activate a trigger to set damage?

Cause I actually need that code for a nother thing to :P

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  

×