Rexzqy
Member
Hi, I am trying to implement the food spoil system, and for this i either have to check through the backpack every few seconds to see if theres any food item in there, or maybe is there a way to tell the code to store which slot you picked up the item? I uses local variable so i am not sure how am i supposed to do that. Any help will be greatly appreciated! Below is my code:
var yy=0; repeat(inv_slots)
if inst.spoil = ds_inv[# 4,yy]
{
if inst.spoil > -1
{
ds_inv[# 5,yy] = 1;
}
ds_inv[# 4,yy] = inst.spoil;
}
else if inst.spoil != ds_inv[# 4,yy]
{
ds_inv[# 4,yy] = (inst.spoil+(ds_inv[# 1,yy]-1)*ds_inv[# 4,yy])/ds_inv[# 1,yy];
if inst.spoil > -1
{
ds_inv[# 5,yy] = 1;
}
}
So yy is the slot number, and please help me if theres anyway to store this!
var yy=0; repeat(inv_slots)
if inst.spoil = ds_inv[# 4,yy]
{
if inst.spoil > -1
{
ds_inv[# 5,yy] = 1;
}
ds_inv[# 4,yy] = inst.spoil;
}
else if inst.spoil != ds_inv[# 4,yy]
{
ds_inv[# 4,yy] = (inst.spoil+(ds_inv[# 1,yy]-1)*ds_inv[# 4,yy])/ds_inv[# 1,yy];
if inst.spoil > -1
{
ds_inv[# 5,yy] = 1;
}
}
So yy is the slot number, and please help me if theres anyway to store this!