Custom inventory item issue

Started by Andail, Sun 17/06/2012 21:28:17

Previous topic - Next topic

Andail

Ok, I constructed my own inventory window and everything is working splendidly, except for one tiny little thing - I want the item I have selected to be temporarily removed from the inventory window. Right now it remains in the window while being selected, so that it - among other things - can be used on itself.
I think this is the default way, and the way AGS games are typically designed (or?), but I think it would be neater the other way.

I have searched the forum and I've really tried to script my way around this, but I'm just stuck.
My idea is that I can call the
InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
(which I already use to set the active inventory, when the player selects it)
to use with
InventoryItem.Graphics
and make it go away, but I can't get it to work. It's probably much easier than I think. Or it's impossible.

monkey0506

I don't think there's a really clean way of doing this, if I understand you correctly. You could duplicate the player's inventory to a dummy character (or just any NPC at hand) and then remove that item from the dummy when activated.

geork

This might be a long shot (I'm not in a condition to test this atm) but would it be possible to set the inventory item's inventory graphic (not curser graphic!) to blank and move it's index in the inventory window to the last position? The graphic can be restored once the item is no longer selected and, if necessary, restored to it's original inventory index.

I dunno if this helps, it's still a bit of a hassle...

Ryan Timothy B

#3
What I did for JoI was having the active inventory item change to a gray darker inventory graphic. That way it would be understandable that the dark graphic is now the item you're currently holding. I believe the Ben There, Dan That games did this as well - plus many others I'm sure.

Then if you clicked the item on itself, it deselects the item. Same with right clicking. I believe I even turned off the hover description while over the currently held item in your inventory window.

If you actually wanted it to remove from your inventory, the easiest method is you could simply do what Monkey suggested, or code your own inventory window. If you were to code your own, I would use a separate GUI for the inventory window along with however many buttons you need that'll fit your custom inventory window width (plus extras if you have a scrolling effect with the buttons moving smoothly left or right). That way you could actually have a cool transition when you're scrolling. Or when the item is removed or grabbed, you could have the items move together.
OOO> <OO
The blank space being the removed item, having the items around it move nicely into each other.

It would definitely add a beautiful touch to your game.

Andail

Interesting, thanks for the feedback!
I think I shall have to postpone the development of this feature for now, but I might pick it up later :)

SMF spam blocked by CleanTalk