OFPEC Forum

Editors Depot - Mission Editing and Scripting => Arma2 - Editing/Scripting General => Topic started by: JamesF1 on 16 Mar 2010, 15:37:32

Title: Deleting Craters & Effects
Post by: JamesF1 on 16 Mar 2010, 15:37:32
I've been looking at this issue for a little while now, but I'm a bit stumped.  The only thread I found related to this issue is one I created a while back on a similar topic at the BIS forums :)

The only objects created when an explosion occurs in A2 are of the "CraterLong" class - however, there are numerous effects (such as crater textures, and scorch marks) that are created at the same time.  My question is, is there a foolproof way to remove these as well as the crater (the crater is no problem)?

Thanks in advance, as usual, guys :)
Title: Re: Deleting Craters & Effects
Post by: kju on 18 Mar 2010, 07:54:58
Config or scripting wise?

Maybe you can find them with nearObjects?
Title: Re: Deleting Craters & Effects
Post by: JamesF1 on 18 Mar 2010, 16:17:50
Scripting-wise... nearObjects doesn't seem to appear to grab everything (at least, unless I'm missing something).  I couldn't find a way to get rid of the ground scorching, for example.
Title: Re: Deleting Craters & Effects
Post by: Loyalguard on 18 Mar 2010, 18:27:20
If I recall correctly nearObjects will only find objects with classes, nearestObjects will detect all objects (with and without classes).  To get a list of only objects without classes use the following code (not my invention, I have mooched it for years).  Just change the radius as appropriate (10, 20, etc.), but the bigger the radius the more cpu intensive (10 is not much though):


Code: [Select]
(nearestObjects [player,[], 10]) - ((getPos player) nearObjects 10)
  If the scorch marks are classlesss objects, when they are found they will be referred to by their object number and model name, something like:  156372: foo_bar.p3d.  In order to extract the object ID for use you need to do some string manipulation.

Edit:

Is there a chance that the scorch mark is actually a texture that appears when the ground object is damaged?