@noggin-the-nog @khaosadz @grandad
Thanks again - great!!
I must have been keyboard bashing at literally the same time as you posted these - this is what I came up with...
func UpdateRoom_7_1()
{
idx = ObjFind(3423466);
if (ObjGet(idx,O_STATUS)==3) \\picks up items with status of 9 when you wake up
{
idx = ObjFind(34234662);
pocket = ObjGet(idx,O_STATUS); \\use this status to update which object you're checking the status of
pocket +=1;
idx = ObjFind(34234662);
ObjSet(idx,O_STATUS,pocket);
idx = ObjFind(pocket);
if (ObjGet(idx,O_STATUS)==9) \\pick up objects with a status of 9
{
InventoryAdd(idx);
}
idx = ObjFind(34234662);
if (ObjGet(idx,O_STATUS)==1106) \\stop checking when you get to the last object
{
idx = ObjFind(3423466);
ObjSet(idx,O_STATUS,2); \\turn off the pick-up loop
}
}
idx = ObjFind(3423466);
if (ObjGet(idx,O_STATUS)==1) \\set objects in your inventory to status 9 when you fall to sleep
{
idx = ObjFind(34234662); \\status of this object is 1048 - first item that might still be available at this point in the game
pocket = ObjGet(idx,O_STATUS);
pocket +=1;
idx = ObjFind(34234662);
ObjSet(idx,O_STATUS,pocket);
if (ObjGet(idx,O_STATUS) !=1106) \\keep setting inventory objects to 9 until you get to the last possible item
{
idx = ObjFind(pocket);
inpocket = InventoryFind(idx);
if (inpocket !=-1)
{
idx = ObjFind(pocket);
ObjSet(idx,O_STATUS,9);
}
}
idx = ObjFind(34234662);
if (ObjGet(idx,O_STATUS) ==1106)
{
idx = ObjFind(3423466);
ObjSet(idx,O_STATUS,2); \\stop the loop
}
}
}
Then I actually clear the inventory in the next step.
Once again, it's not pretty - and to be honest it causes a slight delay (which is fine when he's going to sleep..I had a delay baked in there anyway..but has required a little bit of 'funny' dialogue when he wakes up to accound for it :D).Also...only a tiny minor thing, but the items don't go back in in the order you dropped them...but, I'm not going to lose sleep over that.
So....it's really close to done now!!
(And next time I'll deffo either swap the character out or do a neat inventory back-up :tup: )