J
Johnathan
Guest
I have been fighting this for days now and its time I find some help...
there are 10 stores.
It falls into a inventory kind of thing. Basically, you pick the store (global.store) the item (global.item) rather its going in or out, (global.in_out) and quantity (global.qty1).
After you pick all these it creates an instance (object_pos_transfers) that stores all of this into local variables.
What I need it to do after that is when a new instance of object_pos_transfers, is check ALL other instances of pos_transfers and combine them if they have the same local variables.
they are persistent if that matters as they go through multiple rooms
i can get the first store mooresville to combine the items to the new object of mooresville. but once i do any other store it doesn't combine and also mooresville no longer combines. I understand that the collision circle is only returning 1 instance. I tried to cycle trough a temporary ds_list with all the instances of object_pos_transfers but I can't get it to work.
there are 10 stores.
It falls into a inventory kind of thing. Basically, you pick the store (global.store) the item (global.item) rather its going in or out, (global.in_out) and quantity (global.qty1).
After you pick all these it creates an instance (object_pos_transfers) that stores all of this into local variables.
What I need it to do after that is when a new instance of object_pos_transfers, is check ALL other instances of pos_transfers and combine them if they have the same local variables.
they are persistent if that matters as they go through multiple rooms
i can get the first store mooresville to combine the items to the new object of mooresville. but once i do any other store it doesn't combine and also mooresville no longer combines. I understand that the collision circle is only returning 1 instance. I tried to cycle trough a temporary ds_list with all the instances of object_pos_transfers but I can't get it to work.
collID = collision_circle(x,y,2000,object_pos_transfer,false,true)
if( collID ) {
if( canCreate ) {
canCreate = false;
collID.canCreate = false;
if month = collID.month{
if day = collID.day{
if year = collID.year{
if this_store = collID.this_store{
if in_out = collID.in_out
{
with( instance_create( x, y, object_pos_transfer ) )
{
mooresville_transfers = other.mooresville_transfers
if this_store = "Mooresville#(4223)"
{
for(var i=0; i<ds_list_size(mooresville_transfers); i++)
{
if ds_list_find_value(mooresville_transfers,i) = global.item
{
inv = false
}
}
}
if inv = true
{
ds_list_add(mooresville_transfers,global.item)
}
with (other)
{
instance_destroy()
}
with (other.collID)
{
instance_destroy()
}
}
}
}
}}}}
}
else{
canCreate = true;
}
if( collID ) {
if( canCreate ) {
canCreate = false;
collID.canCreate = false;
if month = collID.month{
if day = collID.day{
if year = collID.year{
if this_store = collID.this_store{
if in_out = collID.in_out
{
with( instance_create( x, y, object_pos_transfer ) )
{
mooresville_transfers = other.mooresville_transfers
if this_store = "Mooresville#(4223)"
{
for(var i=0; i<ds_list_size(mooresville_transfers); i++)
{
if ds_list_find_value(mooresville_transfers,i) = global.item
{
inv = false
}
}
}
if inv = true
{
ds_list_add(mooresville_transfers,global.item)
}
with (other)
{
instance_destroy()
}
with (other.collID)
{
instance_destroy()
}
}
}
}
}}}}
}
else{
canCreate = true;
}
Last edited by a moderator: