Jump to content
Sign in to follow this  
calo_mir

nearestObjects issue

Recommended Posts

damage.sqm:

_object = this select 0;
_radius = this select 1;

_objects = nearestObjects [_object, ["House"], _radius];
{ _o setDamage 1.0 } forEach _objects;

Created trigger with condition 'true' and:

nul = [b1, 50] execVM "damage.sqm";

Created empty game logic location named 'b1'.

Nothing happens. Arma.RPT says (not exact paste, but it's the only

line in there):

Error position: _objects = nearestObjects [_object, ["House"], _radius];
Expected 3 elements, provided 0.

I'd litter the code with assertions but unfortunately I don't know how

to, for example, assert that a variable is of the right type.

On a side note, the new command line switch (-showScriptErrors)

to redirect script errors to the screen doesn't seem to work.

Share this post


Link to post
Share on other sites

Spot the difference your looking for 3 errors.

_object = _this select 0;
_radius = _this select 1;

_objects = nearestObjects [_object, ["house"], _radius];
{ _x setDamage 1.0 } forEach _objects;

Share this post


Link to post
Share on other sites
On a side note, the new command line switch (-showScriptErrors)

to redirect script errors to the screen doesn't seem to work.

Works wonderfully for me.

Share this post


Link to post
Share on other sites

why did you name your file sqm. the right exstention is sqf

Share this post


Link to post
Share on other sites
Spot the difference your looking for 3 errors.

_object = _this select 0;
_radius = _this select 1;

_objects = nearestObjects [_object, ["house"], _radius];
{ _x setDamage 1.0 } forEach _objects;

Ugh, '_this' twice and 'house'.

Thanks.

---------- Post added at 04:42 AM ---------- Previous post was at 04:42 AM ----------

Works wonderfully for me.

I should be seeing errors for the above script appearing on the screen,

right?

I still have to look in Arma.RPT.

---------- Post added at 04:43 AM ---------- Previous post was at 04:42 AM ----------

why did you name your file sqm. the right exstention is sqf

I would hope the compiler wouldn't care at all. It doesn't seem to.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×