Jump to content
Sign in to follow this  
Hoot1988

Giving a name to a building in game

Recommended Posts

i want to blow up a building in a intro.

now then i assume i have to give it a name to get my trigger to spawn a bomb at the building. i have tried the buildings ID and that didnt work some sort of getpos error. Is there away of doing this?

Share this post


Link to post
Share on other sites

You will have to use nearestObject. Find the correct type of building with nearestObject. You could for example place an object of type 'gamelogic' on top of the building and give the location of the gamelogic as a parameter to the nearestObject function.

So the gamelogic object would be there only to mark the location where the 'nearestObject' search starts from. When you place the gamelogic on top of the building then that has to be the closest one of that type of objects.

You need to know the classname of the building to be able to do this.

After you find that building with nearestObject then you just drop a bomb onto the building.

And then there is the function nearestBuilding of course. I remember that in Operation Flashpoint I could not get nearestBuilding to detect any building which didn't have pre-determined positions in them (the positions you can order an AI to walk into). That problem may still exist in Arma but I have not tested if it does. Be aware it could be a problem. If you face that problem then use nearestObject.

Or you could even just drop a bomb into the location of the gamelogic. If you place the gamelogic in the mission editor into the right spot then it should be enough to get its position and send the bomb into that spot. This is obviously better than what I at first suggested. But if you have a reason to get directly at the building then use nearestBuilding/nearestObject.

Share this post


Link to post
Share on other sites

Create a Gamelogic and name it i.e. "housefinder". Move it on top of the house you want to blow up

Now to blow up the house, use a trigger, settings to whatever you need and in the on activation line write:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

my_house = (position housefinder) nearestObject 123456; bomb = "Bo_GBU12_LGB" createvehicle (position my_house)

You have to replace 123456 with the ID of the house, you'll get this by clicking "ShowID's" at the right and zoom in.

Although i guess also a my_house setdammage 1 would work if collapsing is good enough.

Myke out

Share this post


Link to post
Share on other sites

cheers guys. i tested you ways and they all worked well.

however i originally tried some pallet objects. me being dumb forgot about the invisible H object os i used that and it still works, i wanted a big boom and the building to go up in smoke.:D

thank you anyway.

Share this post


Link to post
Share on other sites

Any idea if this process would also work with the doTarget/doFire set?

So, something like -

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">my_house = (position housefinder) nearestObject 123456;

helo1 doTarget my_house;

sleep .5;

helo1 doFire my_house;

Perhaps a reveal, mixed with a doWatch before that, too, with a selectweapon sprinkled in? smile_o.gif

TIA.

Share this post


Link to post
Share on other sites

Just drop an empty marker whereever you want a bomb and createvehicle on the marker name. Simple easy.

Share this post


Link to post
Share on other sites

Ahh.. right... I see now that I wasn't clear/thorough. smile_o.gif

I really need the AI to target something specific. I've tried a marker and setting a unit (each with a name) and using the doTarget/doFire commands in a script, launched from a trigger.

Nothing.

I use hints to make sure the script is being run, and it looks like it is.

The one thing I haven't tried is using the "script" field in a waypoint, but will that operate any differently than a trigger?

Thanks for any ideas (particularly if someone has actually gotten AI to target something specific - and even better if it is a static object). smile_o.gif

Share this post


Link to post
Share on other sites

This is one of those things that was much easier to do in OFP. It seems that AI will only target certain things making this a real pain in the a**. I have not tried this but AI will target a car, so try placing a car on the building and using the "SetPos" command to put it inside the building.

If that wont work Ive got nothing.

Share this post


Link to post
Share on other sites

Right... familiar with the invisible target thing. smile_o.gif Was hopeful that some other way had been worked out.

Here's something interesting, though - I don't think AI will target specific units, either. (Ok, the rest of ya'all may already know this.) smile_o.gif To have an AI helo attack a specific unit, I'd need to use a getpos/setpos for the unit/invisible target for as long as the unit was functioning, eh?

Thanks muchly!

Share this post


Link to post
Share on other sites
Search the forum for "invisible target addon"

Oof.

Tried to even get that working - no joy. sad_o.gif

Apparently, the UH-60 FFAR AI doesn't want to attack anything.

I can get it to fire with the fire command, but it just fires at whatever trajectory it happens to be pointing at the time. By triggering it with a waypoint, it can actually have a neat effect, but the hits are more or less random. It is unaimed fire. I tried using MAP's invisible targets - just about every type (if someone knows the exact type to get UH-60s to fire, I'd much appreciate it). smile_o.gif

One thread on the invisible targets mentions that there is a similar problem with a Sov helo. So, I guess it is just something to work around. :thumbs:

(Sry for the double postage.)

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  

×