Jump to content

Sign in to follow this  
UbiquitousUK

Unreliable building destruction

Recommended Posts

I am trying to set up my mission so that when the player hits buildiing #268507 in Takistan with a hellfire there is a huge secondary explosion and the building is destroyed.

So far my set-up is:

A trigger with condition set to "true" and on act to

bldg_base1_02 = nearestObject [loc_base1_02,"building"];

where loc_base1_02 is a gamelogic placed right over the building in question.

Next i have a trigger with condition set to

getdammage bldg_base1_02 > 0

and on act to

boom = "Bo_GBU12_LGB" createVehicle (getpos loc_base1_02);
boom setPos (getPos loc_base1_02);
base1_02=TRUE;

This trigger is supposed to detect damage on the building and blow up a GBU12 sized explosion underneath it (which is more than enough to level the whole building) as soon as positive damage is registered. The base1_02=TRUE is just a variable i use to track when the building has been destroyed or not.

My problem is that this works 90% of the time. In the other 10% of cases, hitting the building with a hellfire blows a visible hole in the side of the building so that it looks like damage is being done, but the game does not register positive damge on the building so the GBU12 trigger does not fire. In fact, hitting the building repeatedly with a hellfire in this case fails to trigger the second explosion even when the entire building has been demolished.

Does anyone have any idea why the trigger might mostly work, but sometimes not?

Share this post


Link to post
Share on other sites

Maybe you should add

boom setdamage 1; bldg_base1_02 setdamage 1;

Or have two triggers. One with bldg_base1_02 setdamage 1; and one 3 seconds later that creates the bomb.

I think, spawned bombs and rockets explode when their damage is 100% (or damaged at all).

I also don't know how much damage infantry bullets inflict on a building. Maybe the damage limit should be a bit higher? (Would be strange if one bullet destroys the building?)

Or instead of a trigger try to put this into the init line of the location loc_base1_02 (after bldg_base1_02 = nearestObject [loc_base1_02,"building"]; )

bldg_base1_02 addEventHandler ["Dammaged",  {boom = "Bo_GBU12_LGB" createVehicle (position (_this select 0)); boom setdamage 1; _this select 0 setdamage 1];

or

bldg_base1_02 addEventHandler ["Dammaged",  {if (getdammage _this > 0.01) then {boom = "Bo_GBU12_LGB" createVehicle (position (_this select 0)); boom setdamage 1; _this select 0 setdamage 1}];

I hope I've distributed all (s and [s and {s in a right way...

When you use a trigger however, you should add isServer to its condition line, to prevent all clients to spawn the bomb

isServer and ((getdammage bldg_base1_02) > 0.01)

Edited by RogueTrooper

Share this post


Link to post
Share on other sites

I noticed when you spawn explosives a few meters above the ground they do more damage.

Share this post


Link to post
Share on other sites

This ties in to what I'm looking for. I hope you don't mind me posing my question. I simply want a building to explode. How can I do this with the in-game editor?

Share this post


Link to post
Share on other sites

Place a gamelogic or invisible helipad or cola tin on the building you want to destroy and put this code in the logic/pad/tin's init line:

nearestObject [this,"building"] setdamage 1;

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  

×