lose inv not working? [SOLVED]

Started by YotamElal, Tue 08/03/2005 07:43:43

Previous topic - Next topic

YotamElal

In room3 in my game there are two hotspots that I use a inv on and the loseinventory isn't working????????? (REALLY WIERD)

code for hotspot 3 (if inv 10 was used)
Code: ags

MoveCharacterToHotspot(EGO, 3);
ObjectOn(8);
LoseInventory(10);  

object 8 turns on but inv 10 isn't lost???


code for hotspot4 (if inv 11 was used)
Code: ags

MoveCharacterToHotspot(EGO, 4);
ObjectOn(9);
LoseInventory(11);

object 9 turns on but inv 11 isn't lost???


Wierd...
I don't have any problems like that anyware else in my game.

Radiant

Maybe the player was carrying multiples of item #10 or #11? If you call AddInv multiple times, then you do.

strazer

Keep in mind that you can have more than one of the same inventory item, so if you do
  AddInventory(10);
  AddInventory(10);
you have two of these items, occupying the same slot in the inventory (Check "Display multiple inventory items multiple times" in the General settings pane to change that).
If you then do
  LoseInventory(10);
you lose only one of the two items, so you will still have the item in your inventory.

Are you sure you only have one of these items in your inventory?
As I said, check the option in General settings to verify.

YotamElal

It's working and I have no idea what caused the problem & how it got solved.

monkey0506

It's probable that you did have more than one copy of the inventory item.  And perhaps inadvertently deleted one of the AddInv commands.  Glad to hear you got this fixed.  With no clue how you did it.

SMF spam blocked by CleanTalk