OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: snozzdog on 17 Jul 2008, 11:42:04
-
How do i get a unit, say called 'tank' to destroy a bridge or a building using the buildings ID? say for example the ID is 222
Cheers.
-
tank doTarget (position tank nearestObject 222); tank doFire (position tank nearestObject 222)Note that the tank usually attacks buildings with it's MG...
-
Ahh it didnt work, i tried it on a bridge with a Harrier, a building with an M1A1 and another Building with a Humvee
The plane wouldnt even go near the bridge let alone shoot it.
The tank shot about 4 rounds at it with its MG the first time i tried it then for some reason every time after i tried without changing anything it didnt budge and just sat there
And with the Humvee it just aimed at it, and they just sat their aiming at it but not shooting
Please help.
Ideally im looking for a Harrier to some in on Radio Alpha (i can do that bit) and then take out a bridge which code is 161998
Help pleeease it annoying the crap out of me
-
Snozzdog,
Try this,
tank doTarget (position tank nearestObject 222); tank fire "M256";
Harrier doTarget (position harrier nearestObject 222); harrier fire "BombLauncher";
Here's YOUR reply, as always.
Luke
-
This one was a bit better but still didnt work, this time the moment the game started the Harriers bomb dropped. So if i placed it well at the start of the mission the default bomb drop would hit the bridge. But it'd be all done in the first 5 seconds i need it to be on a radio command really and actually be designated to hit the bridge (ID: 607089)
So it swoops inand takes it out.
I could try it setting a waypoint for a bomb to drop then call it to that waypoint by radio, but the thing is a single bomb does destroy the bridge, it'll have to be multiple runs.
Cheers
-
In this thread: http://www.ofpec.com/forum/index.php?topic=29944.0 Mando made some kind of script that has a chopper attack any building (no addons needed) : I'm pretty sure it should be editable to use tanks/harriers/whatever instead. :D
Otherwise, I'd almost suggest using one of the many airstrike scripts around, since even if you did manage to get the harrier to drop its load, it might not hit - unless you've got a LD someplace around, I think.
Also: I don't know if the object-IDs work in ArmA anymore. Better luck with the near(est)Object(s) line of commands. Check them out!
Wolfrug out.
-
I don't know if the object-IDs work in ArmA anymore.
Yes they do, it's the command object that doesn't.
-
Hi, AFAIK Mando Missile is the best way to make a Harrier attack any building.... If you are able to know how it works ;)
-
Ooo all sounds good, i'll try them all out and see what happens
-
You could always just simulate it by having the plane fly over but not necissarily drop the bomb, by creating the waypoint set to move on your alpha radio and then a trigger over the building you want bombed with the following in the condition field,
harrier in thislist
and in the on activation field i believe it is something along the lines of
harrierbomb = "Bo_GBU12_LGB" createvehicle (getpost triggername)
this wont force the harrier to drop its bomb, but will simulate the bomb landing on the target, if you wish to be able to see the bomb drop, use
harrierbomb = "Bo_GBU12_LGB" createvehicle [getpos trigger select 0, getpost trigger select 1, 100]
100 is equal to the height the bomb drops from so can be changed to look like it drops from the harrier.
-
Yes they do, it's the command object that doesn't.
Then what command do you use to get the desired result?
-
KT,
The answer to that can be found here (http://ofpec.com/COMREF/index.php?action=list&game=All&letter=n#659)
So,
getPos player nearestobject 607089
would find the object (bridge, house, building, etc.).
Here's YOUR reply, as always.
Luke
-
Thanks