PDA

View Full Version : Destroy all Walls in city



Khalashnikovf
Dec 20 2010, 11:48
Title says pretty much everything.
I was trying to destroy wall and fences with this...

_array = _pos nearObjects ["NonStrategic", 400];
{_x setDamage 1;} forEach _array;

but every building is destroyed (as I wanted), but all fences, market tents and walls are untouched.
Maybe I have to use other type of Static, but dont know what type.
Some help pls?

Demonized
Dec 20 2010, 13:30
http://www.armatechsquad.com/ArmA2Class/

Khalashnikovf
Dec 20 2010, 14:22
http://www.armatechsquad.com/ArmA2Class/

Not helping at all.

zigzag
Dec 20 2010, 14:29
Maybe you can use this and blacklist the buildings you dont want to destroy.
http://community.bistudio.com/wiki/BIS_fnc_destroyCity

Khalashnikovf
Dec 20 2010, 14:53
Maybe you can use this and blacklist the buildings you dont want to destroy.
http://community.bistudio.com/wiki/BIS_fnc_destroyCity

Unlucky tried, not helping, its not destroying walls too...

Celery
Dec 20 2010, 15:07
If the walls don't have a classname, here's a trigger I've found useful:

Name: demolitiontrigger1
Condition: true
On act: {_x setDamage 1} forEach nearestObjects [demolitiontrigger1,[],10]

The last number is the radius of the effect and the trigger size can be made the same to give a clear picture of what it destroys. The key part is the empty [] array in place of a class that makes the nearestObjects command look for any kind of object and not only ones with classnames.

Khalashnikovf
Dec 20 2010, 15:13
Works fine, but its weird that Static class walls is actually not a class :-/
Thx for help Celery.
-----------------------
Any other solution focusing on walls only is still welcome :)

Igneous01
Dec 21 2010, 01:18
nope just to be made aware plants/trees/vegetation/walls/fences/ and other misc objects dont actually have a class name or library associated with them, so you cant manipulate them like you normally would with objects that do have a classname, only way to access these non classed objects is by passing an empty array, which will force to check all object types.

Tom1
Jan 30 2011, 23:35
@<hidden> thanks