GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 Re: Script Submission » place meeting for 3d » 2009-07-02 20:38:01

BUMP!
i re-made the function. i couldn't re-name the topic name.
plz try to improve it.

#2 Script Submission » place meeting for 3d » 2009-04-30 18:36:31

slayer64
Replies: 3

this is the same thing as instance_place, but works in 3d.
plz critique it all over.

//
//    Usage:
//        i=d3d_instance_place(x,y,z,par_solid);
//
//  Arguments:
//      x
//      y
//      z
//      obj
//
//  Returns:
//      the id of the instance of type obj met when
//      the current instance is placed at position (x,y,z).
//      obj can be an object or the keyword all. If it
//      does not exist, the special object noone is returned.
//
//  slayer 64
//

var nn;

while(1)
{
    nn=instance_place(argument0,argument1,argument3);
    if nn=noone
    {
        break;
    }
   
    if argument2+height-1>nn.z
    if argument2<nn.z+nn.height-1
    {
        break;
    }
   
    nn.x+=room_width;
    ds_list_add(global.list,nn);
}

repeat(ds_list_size(global.list))
{
    with(ds_list_find_value(global.list,0))
    {
        x-=room_width;
        ds_list_delete(global.list,0);
    }
}

return nn;

#3 Re: Script Submission » instance_nearest_notme » 2009-04-30 18:28:08

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;

Board footer

Powered by FluxBB