GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2008-12-19 21:02:20

icuurd12b42
Member
Registered: 2008-12-11
Posts: 303

instance_nearest_notme

/*
**  Usage:
**      id = instance_nearest_notme (x,y,obj);
**
**  Arguments:
**      x        x coord
**      y        y coord
**      obj     object to find
**
**  Returns:
**      id       the id of the instance found or noone if none or self is found
**

**  GMLscripts.com
*/

var xx; xx = x;
x = -10000000
var ret; ret = noone;
with(instance_nearest(argument0,argument1,argument2))
{
    if(id != other.id)
    ret = id;
}
x = xx
return ret;

Last edited by icuurd12b422 (2009-03-13 18:09:59)

Offline

#2 2009-04-30 18:28:08

slayer64
Member
Registered: 2009-04-30
Posts: 3

Re: instance_nearest_notme

i would get rid of that ret variable
var xx;
xx = x;
x = -10000000;

with(instance_nearest(argument0,argument1,argument2))
{
    if(id != other.id)
    {
        other.x=xx;
        return id;
    }
}
x = xx;
return noone;

Offline

Board footer

Powered by FluxBB