Home   Help Search Login Register  

Author Topic: Random object and placement IED's  (Read 1321 times)

0 Members and 1 Guest are viewing this topic.

Offline Shadow_Spyder

  • Members
  • *
    • 31st MEU ArmA Realisim Unit
Random object and placement IED's
« on: 16 Nov 2007, 05:09:14 »
Hey, I was wondering if there are any scripts out there that are fairly newb-friendly and will randomly select an object, put it in a random place, and have it explode like an IED when triggerd by whomever. I am using a decent IED script now, and the only random-ness I can manage is to use the condition of presence. It works... but the same object/IED will be in the same place and explode the same every time as long as it actually spawns.

I was thinking along the lines of setting a marker on the map, inside the marker a certain number of IED's will be spawned (not on or in buildings preferable). They will spawn as random objects... trashcans, wood piles, metal scrap piles, ect ect. It will randomly select a type of explosion, so one time it might be a huge GBU sized explosion, the next it might just be a small grenade barley damaging you and not able to kill a vehicle.


I hope I explained this good enough......

Offline Wolfrug

  • Addons Depot
  • Former Staff
  • ****
  • Official OFPEC Old Timer
Re: Random object and placement IED's
« Reply #1 on: 16 Nov 2007, 10:27:20 »
Hm, well. The simple answer is that you use the built-in features of the ArmA engine: if you look at the units, they will have an area called something like "Placement radius": putting a number into this (say 50) will create a circle around the unit inside which it will spawn randomly at mission start. This also works for inanimate objects such as IEDs.

If you however want slightly more precise IED placement, you can also use the marker trick. Basically, create any number of Empty (=invisible) markers and place them whereve you'd like IEDs to be (roadsides, alleyways, etc). Then simply group the IED units with these markers (F2 - draw line) -> the unit will at mission start spawn randomly at one of the markers!

If you combine this with say, a bunch of objects that look the same as IEDs but aren't, as well as varying condition of presence %, you should be able to get a pretty random variation going.  :good:

Good luck!

Wolfrug out.
"When 900 years YOU reach, look as good you will not!"

Offline GRFoxhound

  • OFPEC Patron
  • ****
    • Armaholic.com
Re: Random object and placement IED's
« Reply #2 on: 20 Nov 2007, 17:47:04 »
I already pointed you to my script (wip, still beta and sqs.......forgive me OFPEC :) ).
This script does exactly what Wolfrug says:
http://www.armaholic.com/page.php?id=1180


It creates random objects from an array of objects and also makes those objects IED's at random.
All you have to do is add markers to your map, give those markers names and add the names to my marker array.

I even made it possible for players to destroy possible IED's. So for example if you see a computer next to the road you can shoot it. If it explodes it was an IED, if not well than it was nothing.
The only thing I wasnt able to do was to make the player able to destroy IED's created with already destroyed objects, like jeep wrecks etc. Those objects are already destroyed so they dont register being hit anymore.

[edit]
Ohh and also I added crates to the array of possible IED's but the thing is those crates wont loose their contents. The script runs on the server only and removing the ammo on the server does not remove the ammo for the clients.
Someone explained me how to do that but after I got this far I didnt have time to do any scripting anymore :( :(

« Last Edit: 20 Nov 2007, 17:49:23 by GRFoxhound »