Can't Deselect Active Inventory Item : Solved

Started by Rainbow Guy, Thu 12/08/2004 17:35:20

Previous topic - Next topic

Rainbow Guy

I'm having trouble deseleting an inventory item, i have this in my GUI


if (button==6) {Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, // My Use Button
Ã,  SetCursorMode(MODE_USE);
Ã,  SetMouseCursor (4);
Ã,  SetLabelText (0, 11, "Use @OVERHOTSPOT@");
Ã,  display ("222");
Ã,  SetActiveInventory(-1);
Ã,  }

It displays "222" but the last item selected still comes upÃ,  Ã, :o What's going onÃ,  ???

======================================
Solution !

put the line :-

Ã,  SetActiveInventory(-1);

before you set the mode :-

Ã,  SetCursorMode(MODE_USE);
Ã, 

I don't know why but it worksÃ,  ;D

Proskrito

Selected or displayed as cursor pic?

Mr Jake

change -1 to 0

-1 calls Last Inventory.

Proskrito

no, -1 should deselect the active inventory.
Why do you have that 'SetMouseCursor(4)' in your script? do you really need it?
if so, maybe you could try to put SetMouseCursor(4) after SetActiveInventory(-1) and see if that helps

Rainbow Guy

#4
Your right i don't need "'SetMouseCursor(4)" but i still can't get the thing to workÃ,  >:(

i have "SetActiveInventory (-1);" all over the script now, and still no

Proskrito

#5
if (button==6) {                       // My Use Button
  SetCursorMode(MODE_USE);
  SetActiveInventory(-1);
  SetLabelText (0, 11, "Use @OVERHOTSPOT@");
  Display ("Active inventory: %d", character[GetPlayerCharacter()].activeinv);

  }

Try this and tell us what does it display

Rainbow Guy

Yep that works fine, thanxÃ,  ;DÃ,  ;D ;D

but i still don't see why mine didn't  ???

Proskrito

#7
you did this:
- SetCursorMode(MODE_USE);
Changed the cursor mode to mode 2
- SetMouseCursor (4);
Changed cursor mode 2 appearance to look like mode 4 (which had a item as cursor pic, because you hadnt deselected the active inv. item yet)
- SetLabelText (0, 11, "Use @OVERHOTSPOT@");
....
- display ("222");
....
- SetActiveInventory(-1);
Now the active item isnt selected, but the cursor mode 2 (in wich you are currently) still have the item as cursor pic, as you told it to have before

This is what _i think_ was happening, the item wasnt really selected, but you had its pic as the cursor.
Maybe you mistaken the purpose of SetMouseCursor, because i think it has no use in what you wanted to do, and that might be causing the problem

Rainbow Guy

I thought SetMouseCursor only effected the picture, not the mode  :-\
and the reason for me wanting to change the cursor, is eventurely i want the game to use just one Cursor

Thanx again for your help  ;)

edmundito

Quote from: Rainbow Guy on Fri 13/08/2004 16:46:29
I thought SetMouseCursor only effected the picture, not the modeÃ,  :-\
and the reason for me wanting to change the cursor, is eventurely i want the game to use just one Cursor

Thanx again for your helpÃ,  ;)

The easiest way to make your game use one cursor is to change the cursor graphic in every action (in the Cursor editor) to be the exact same cursor sprite. That way it will be invisible to the player, but not to you.

SMF spam blocked by CleanTalk