OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: BensTooCool on 04 Mar 2007, 23:59:54

Title: blowing up bridges
Post by: BensTooCool on 04 Mar 2007, 23:59:54
I'd like to know how to blow up a bridge in Armed Assault, I played a mission in the campaign where you blow the bridge in Dolores and I thought if i extracted that mission from the campaign I could figure it out but when I opened it the editor it didn't show anything ;/
Title: Re: blowing up bridges
Post by: D_P_ on 05 Mar 2007, 02:42:46
Have you tried using a good old fashioned bomb? Hardliners prefer the IED...

To make a BOMB:
Place an empty object in your mission at the base of the bridge you plan to destroy. Name the object TARGET.
Then create an trigger and choose how you want to activated it, for example we'll use Radio Alpha.
In the the trigger's Activation Field put the following:

Code: [Select]
BOMB = "Bo_GBU12_LGB" createVehicle getpos TARGET;
Start your mission, activate radio alpha and watch it light up the bridge :)

To make a your BOMB an IED:
Follow the above instructions and save your mission.
Then access the mission.sqs file in the mission's folder and use the Ctrl+F feature to find the object named TARGET.
Once you've located your object, change the object vehicle name to bomb.
Then save and reload the mission and your bomb now looks like a pretty IED :)

Code: [Select]
id=0;
side="EMPTY";
vehicle="bomb";
leader=1;
skill=0.600000;
text="TARGET";

(Another serving suggestion is to name your player TARGET  :D)

The above is proberly the hardest way to achieve your objective Ben, but it does work.
Hope it helps.
Title: Re: blowing up bridges
Post by: BensTooCool on 05 Mar 2007, 12:29:05
Well in the mission I'm making the idea is you blow the bridge up using satchel charges stopping the enemy from chasing you.
Title: Re: blowing up bridges
Post by: Cheetah on 05 Mar 2007, 13:33:47
Not much editing needed for that to work. Just make sure that the player has enough satchels available and he knows where to place them. You could weaken the bridge with setDamage but I don't think that that's what you want.

Anyway the correct position to place the satchels is marked on the attached image. I placed three satchels.
Title: Re: blowing up bridges
Post by: BensTooCool on 05 Mar 2007, 18:49:58
I just had a brainwave, If I place a hidden object in the area of the satchel charge then when you detonate and the object is destroyed i can make a trigger set the bridge section to setdamage 1 thus destroying the bridge.  :)
Title: Re: blowing up bridges
Post by: BensTooCool on 05 Mar 2007, 21:00:47
I managed to get it working in Operation Flashpoint but one bit won't work in ArmA.

Triger
Condition: not alive <name>
Activation: (object <number>) setDamage 1   <--- Works in ofp but not in ArmA

anyone know how to make it work?
Title: Re: blowing up bridges
Post by: Trash Can Man on 05 Mar 2007, 23:42:02
One question... how can you link a bridge to a trigger? I was able to do this with buildings but I can't seem to link a bridge to a trigger. Can this be done?
Title: Re: blowing up bridges
Post by: BensTooCool on 06 Mar 2007, 00:06:00
Well if you select ShowIDs then it should show the ID numbers for each section of bridge, In operation flashpoint I just took one of the IDs then in the trigger activation field i put "(object <ID>) setdamage 1" this basically will destroy a section of the bridge....but as i say it wont work in ArmA
Title: Re: blowing up bridges
Post by: h- on 06 Mar 2007, 08:14:03
Quote
but as i say it wont work in ArmA
Actually, the method does, the command object does not..

This is what was learned in couple of threads (here (http://www.ofpec.com/forum/index.php?topic=28760.0) and here (http://www.ofpec.com/forum/index.php?topic=28759.0)) here some time ago:

Anyway, if the bridge is in player's viewdistance range you can use the method BensTooCool suggests, only modified to work in ArmA by using the nearestObject command:
Code: [Select]
((position player) nearestObject objectID) setDamage 1
Title: Re: blowing up bridges
Post by: BensTooCool on 06 Mar 2007, 16:51:01
thanks h- that worked a treat but I have one more thing I hope you can help me with, how would I edit that line to put it in a condition field so I can tick off an objective when the bridge is destroyed?
Title: Re: blowing up bridges
Post by: h- on 06 Mar 2007, 23:13:10
Code: [Select]
!alive ((position player) nearestObject objectID)
At least that worked for me..