OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: laggy on 03 Apr 2008, 20:11:20
-
Hi all.
I would like to destroy EVERYTHING within a certain radius and this is what I've done:
Radio Alpha trigger:
On Activation: {_x setdamage 1} foreach nearestObjects [spot, ["All"], 500]
spot is a gamelogic.
All buildings, cars and soldiers are destroyed but not fences, trees and foliage. Why is that? Do they not fall under the "nearestObject" category or what? How can I include them as well?
Thanks in advance you scripting guru's
Laggy
-
As far as I know it is impossible.
Foliage does not have any config entries, meaning they are not configged in CfgVehicles in the game config and therefore can not be found like that.
-
Here is a quote from a post I saw in the BIS forums. It was suggested for use with Gigan's nuke Scud but it looks like you could use it by itself. Just change the radius as necessary. I have never tried it but if it works (and doesn't destroy your FPS) it looks it might be what you are looking for.
Quote from: BIS Forums - SCUD - Nuclear Explosion (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=b329ab0435215646840ff23ba70c7996;act=ST;f=70;t=64280)
If someone misses falling trees and walls, place an object called "jebut" near the explosion point and fire this script 1 second before the nuke explosion:
_array1 = (nearestObjects [jebut,[], 350]) - ((getPos jebut) nearObjects 350)
~1.5
{_x setdammage (1.0)} forEach _array1
exit
That 1s delay is for preparing array. If it happened at the same time as the nuke goes boom, there would be an extreme fps dropdown. Right now I have about 0.4s slowdown before the nuke and then it all goes rather smooth.
-
Thank you Loyalguard.
It works perfectly except for the damn streetlamps... they still stand. ???
Laggy
-
Great, I am glad it works. You can find street lamps with the nearXXXObjects series of commands. Just add additional code with "StreetLamp" as the object type and setDamage them to 1 as well.
-
Hi again Loyalguard.
Weird but I couldn't get it to work with NearestObjects "streetlamp" command. NearestObject works but not NearestObjects.
The only thing that worked was a NEARobjects command that has to run parallel with to the script you recommended.
This probably makes it lag a little bit more since it also calculates objects already covered in the other script, but it was the only way I could have absolutly EVERYTHING destroyed within the radius.
Cheers
Laggy