Jump to content
Sign in to follow this  
meatball

Trigger on Bridge Destruction

Recommended Posts

Trying to figure out how to fire a trigger based on the destruction of a bridge and the few old threads I've found don't seem to work. So the bridge in question is on the Altis map between Kavala and Aggelochori. Looking at the object ID's there appears to be two ID's associated with the bridge. So I've set up a game logic object next to each ID giving each object a name with the following Init:

bridgeA = nearestObject [gl_bridgeA,"Land_Bridge_HighWay_PathLod_F"];

I then have a "!alive bridgeA" that spawns some debug text.

Through trial and error I figured out it was the Highway bridge because the other Bridge objects would fire the trigger before the I even blew up the bridge. But...when I do blow up the bridge, the !alive trigger never fires even though I see the bridge collapse.

Any thoughts?

Man, it sure would be nice if there was an easy way to translate object ID's from the editor into object class names...

Edited by Meatball

Share this post


Link to post
Share on other sites

I tried the old methods, grouping the trigger to the bridge and a few other tricks but nothing seems to work.

The bridge when destroyed still seems to register.

Share this post


Link to post
Share on other sites

Tried several things myself. Nothing. Also the Satchels have been dialed WAY back in power.

Used to be 2 and I think I had to use over 9 this time. Yikes. Would like to know myself.

Share this post


Link to post
Share on other sites
I tried the old methods, grouping the trigger to the bridge and a few other tricks but nothing seems to work.

The bridge when destroyed still seems to register.

Yeah, I've done that in the past, but there's a major issue with that. When you group a trigger to a building/object it groups it to the object ID #. And I've noticed that almost every patch, the ID's of the buildings change, which breaks all those triggers and they have to be redone. That's why I've found that using nearestObject with the object class name works the best, because that doesn't generally change from patch to patch.

If you look in the config viewer there appears to be 4 bridge classnames. "Land_Bridge_01_PathLod_F", "Land_Bridge_Asphalt_PathLod_F", "Land_Bridge_Concrete_PathLod_F", "Land_Bridge_HighWay_PathLod_F". Setting the nearestObject to any of them but the Highway one immediately fires the trigger, and with the Highway one the trigger does not fire, which leads me to believe that that is the correct class for the bridge. I'm just not sure why the !alive trigger won't fire then when I do destroy the bridge.

Edited by Meatball

Share this post


Link to post
Share on other sites

Place your Logic on the bridge, next to the ID tag (I used bridge 70188 in Agia Marina)

Put this in its init box:

bridgeA = nearestBuilding this; initHeightbridgeA = getPos bridgeA select 2;

Then for your trigger, put this as the Condition:

getPos bridgeA select 2 < initHeightBridgeA

And whatever code you need on the onAct box (I just put hint "dead";)

Then when you blow the bridge, the object sinks and you know it's "dead".

Untested on any other bridges but principle should be the same.

Share this post


Link to post
Share on other sites

Yea I never thought about checking the height of the bridge after it's destroyed or should we say sunk.

Good thinking.

Share this post


Link to post
Share on other sites

Good idea, however I just tested that on the bridge in question and for some reason the initial height returns less than the destroyed height. So the condition could be

getPos bridgeA select 2 != initHeightBridgeA

Share this post


Link to post
Share on other sites

Man..that's awesome. Works perfectly, thanks guys! That also makes sense now. When you blow up the bridge it doesn't actually seem to 'destroy' the bridge, just sink it into the ground, so a !alive will never be true, but the height comparison works great. Thanks again.

Share this post


Link to post
Share on other sites

this looks good I will try and use it in my next MP mission.

Share this post


Link to post
Share on other sites
Good idea, however I just tested that on the bridge in question and for some reason the initial height returns less than the destroyed height. So the condition could be

getPos bridgeA select 2 != initHeightBridgeA

Lol that's totally bizarre :)

I noticed though the bridge only sinks by 2 cm when I tried it in the editor (good enough for this purpose though). IIRC, it was 1.91m and 'sank' to 1.89m. Good call on the !=, it's more agnostic in case weirdness like this persists.

Share this post


Link to post
Share on other sites

Funny thing...I tried this exact same thing on the bridge on south Altis near Edessa and for some strange reason, when I'm on a dedicated server, the trigger fires immediately on that bridge, yet it doesn't fire with the exact same game logic/triggers for the bridges near Kavala.

So, I have a game logic parked right next to the Edessa bridge with the following "bridge46A = nearestBuilding this;initHeightBridge46A = getPos bridge46A select 2;"

And then a trigger that fires on "getPos bridge46A select 2 != initHeightBridge46A;"

Why the trigger will fire right on mission start only in a dedicated server and not when locally hosted. And why just that trigger and not the other ones in Kavala go is beyond me. :)

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  

×