Home   Help Search Login Register  

Author Topic: Destroying buildings in trigger area.  (Read 6955 times)

0 Members and 1 Guest are viewing this topic.

Offline ual002

  • Members
  • *
Destroying buildings in trigger area.
« on: 16 Sep 2010, 23:22:34 »
Is it somehow possible to set up a trigger to destroy all buildings in that trigger area?  And then copy trigger and put somewhere else on the map for more pre-destroyed buildings, quickly allowing the mission designer to proagate battlefield destruction.
« Last Edit: 17 Sep 2010, 03:26:54 by ual002 »

Offline SaOk

  • Missions Depot Staff
  • *****
    • My youtube profile
Re: Destroying builings in trigger area.
« Reply #1 on: 16 Sep 2010, 23:28:35 »
You could create named invisible helipads and then use this to give random damage to every house in the radius:

Code: [Select]
buildings = nearestObjects [helipad1,["Static"], 100];
{_x setDamage (random 2)+1/3;} foreach buildings - [helipad1];

If you have important objects in the area, you can also name them and avoid damageing them by placing in the array that is removed from variable buildings.

Example
Code: [Select]
{_x setDamage (random 2)+1/3;} foreach buildings - [helipad1,objectname1,objectname2];
« Last Edit: 16 Sep 2010, 23:32:06 by SaOk »

Offline ual002

  • Members
  • *
Re: Destroying builings in trigger area.
« Reply #2 on: 17 Sep 2010, 03:26:13 »
Im rather confused about the helipads but ill try it. Thanks

Edit: ok i see now, the trig radius isnt doing it, its the arguments in the nearestobj command
« Last Edit: 17 Sep 2010, 03:29:50 by ual002 »

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Destroying buildings in trigger area.
« Reply #3 on: 17 Sep 2010, 09:37:03 »
Put a gamelogic
put the following in init of logic

Code: [Select]
{_x setDammage (0.2+random 0.8)} foreach (nearestObjects [this,["STATIC"],100])
The radius in this case is 100m.

You can now copy & paste that gamelogic to other places where you want destruction.

To exclude objects,just do what SaOk have described.

Also : i'm not sure that the brackets ( and ) are required for  nearestobj.......IC"],100]
remove them if you get errors.

Just showing a simpler way in which you don't need to have names.

For timed destruction, just put the code in On Act box of the first waypoint of the logic.
(Adjust time in the waypoint)

Regards,
Haroon1992
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(

Offline ual002

  • Members
  • *
Re: Destroying buildings in trigger area.
« Reply #4 on: 17 Sep 2010, 15:36:26 »
excellent, what about walls? Im assuming walls dont fall under the static category...

Offline F2kSel

  • Members
  • *
Re: Destroying buildings in trigger area.
« Reply #5 on: 17 Sep 2010, 18:27:15 »
Code: [Select]
{_x setDammage 1} foreach (nearestObjects [this,[],100])  will destroy everything that can be destroyed.

You can't simply copy a wrecked building and transport to another location, you can do that with editor placed objects only.

I don't know if it's possible to even spawn a wrecked building, I would think not.

The best you could do is write a script to find the objects name and spawn that at a new location and then destroy it but that defeats the object.

Also you can't spawn roads,OA has the ability to create towns any way.


  

Offline ual002

  • Members
  • *
Re: Destroying buildings in trigger area.
« Reply #6 on: 17 Sep 2010, 21:32:21 »
I played with the town generator. Its pretty neat.  Just gotta figure out how to create a chernarus building and object set for it.