Discworld-like inventory system

Started by stryker, Mon 11/08/2003 21:59:24

Previous topic - Next topic

stryker

I don't mean the multi-inventory support (I don think it's possibile with the actual version of AGS), but the way you can take items from inventory.
In discworld when you pick an item from inventory to use it, the inventory just disappears and appears only on the cursor.
I attempted to simulate this stuff on my interaction system, but I don't know even if it's possibile.
I attempted two eays, and both are laking somewhere:

1) the more simple. set active inventory the item i just clicked, and delete it from inventory, hoping that it remains on the cursor. it is not: the active inventory MUST be an item you have in the inventory (maybe it should be changed on the next version of AGS?)

2) the more complex: change the image of item i picked to a "trasparent" one, and change it back when you put it back in the inventory, but this way doesn'to work too. The image on the cursor will change too and you will have an invisible cursor.

Any idea?

thanx

Download Discworld Template ODIS ver1.2
(right-click and "save as")

Pumaman

You'd have to check "Don't use inventory graphics as cursors" in the game settings to stop AGS doing anything automatically.

Then yes, remove the item from the inventory, and manually change the inventory cursor with ChangeCursorGraphic. You'd have to remember to add the item back if the player changes back to Walk mode rather than using the item.

stryker

Thanks Pumaman, I tried that, but there a big problem: there is no way to get the sprite number of the object i clicked. I mean, there a SetInvItemPic but no GetInvItemPic!

Here's the code that should be on_mouse_click for the leftinv button:

     else if (player.activeinv==-1) {
       SetActiveInventory(invitemclick);
       ChangeCursorGraphic(MODE_USE, GetInvItemPic(invitemclick));
       SetInvItemPic(invitemclick, 2042);

this should work fine, but, of course, there is no "GetInvItemPic".
What did you mean with the above post? How can I retrive the item sprite to set it for the cursor?

Download Discworld Template ODIS ver1.2
(right-click and "save as")

Pumaman

Um good question, you'd have to manually hardcode in the sprite number for each item I guess ;)

I'll add GetInvItemPic to my to-do list.

SMF spam blocked by CleanTalk