Home   Help Search Login Register  

Author Topic: nearestobject(s) does not include foliage, fences and trees  (Read 1778 times)

0 Members and 2 Guests are viewing this topic.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
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
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: nearestobject(s) does not include foliage, fences and trees
« Reply #1 on: 03 Apr 2008, 21:05:18 »
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.
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Loyalguard

  • Former Staff
  • ****
Re: nearestobject(s) does not include foliage, fences and trees
« Reply #2 on: 03 Apr 2008, 21:42:13 »
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

Quote
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:
Code: [Select]
_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.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: nearestobject(s) does not include foliage, fences and trees
« Reply #3 on: 03 Apr 2008, 22:25:36 »
Thank you Loyalguard.
It works perfectly except for the damn streetlamps... they still stand. ???

Laggy
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.

Offline Loyalguard

  • Former Staff
  • ****
Re: nearestobject(s) does not include foliage, fences and trees
« Reply #4 on: 03 Apr 2008, 23:50:11 »
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.

Offline laggy

  • Members
  • *
  • "Behold a pale horse"
Re: nearestobject(s) does not include foliage, fences and trees
« Reply #5 on: 04 Apr 2008, 01:56:17 »
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
And I looked and beheld a pale horse and his name that sat on him was Death and Hell followed with him.