Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: piere on February 11, 2012, 02:56:01 AM

Title: Quick intentory question...
Post by: piere on February 11, 2012, 02:56:01 AM
How would I change what inventory items in the list appears first? For example, say I have a few book items in the inventory and a cell phone in there as well, but it is displayed all the way to the right. How would I change the position on the cell phone to appear first in the inventory? Thanks all
Title: Re: Quick intentory question...
Post by: metamorphium on February 11, 2012, 09:09:21 PM
not explicitly. You can however add that item as the first item in the game, or you can modify the inventory window to have this as a omnipresent button (outside the inventory logic).

Or you can do a cheat - in Game.FadeOut() drop and retake all items starting with the phone. :)
Title: Re: Quick intentory question...
Post by: piere on February 11, 2012, 10:13:41 PM
Hey metamorphium,

How would I add that item as the first in the game, or how would I modify it to have it as a omnipresent button? Thanks
Title: Re: Quick intentory question...
Post by: metamorphium on February 11, 2012, 11:30:33 PM
omnipresent button would have been done by modifying the window in the window edit
(inventory.def)

and adding a button outside of the Inventory box object (you can position it whenever you want).

If you want to have it as a regular inventory item, you can either:

1. design your game so the cell phone is the very first item player can pick up
or
2. start the game with the item already picked up (eg. calling Game.TakeItem("cellPhone"); before player does any action).
Title: Re: Quick intentory question...
Post by: piere on February 12, 2012, 01:44:26 AM
Thanks but I am still a little confused. If I have an omnipresent button, what exactly will it do? I would want the player to be able to "organize" their inventory when they want, so having the cell phone as the first item may not work. Any other ideas?
Title: Re: Quick intentory question...
Post by: metamorphium on February 12, 2012, 02:17:41 AM
the idea was that the cell phone will not be the part of the inventory logic. It would have separate on "CellPhone" handler
Title: Re: Quick intentory question...
Post by: Jose on February 13, 2012, 07:16:30 PM
Hi Piagent, I've never tried but maybe you can use the InsertAfter parameter of the TakeItem method so you can order the inventory items as you want.
Title: Re: Quick intentory question...
Post by: metamorphium on February 13, 2012, 09:35:33 PM
the problem with InsertAfter is that you'd need to know the name (not the index) of the item in question. But if you want to insert it as the very first item, it (IMO) wouldn't work.
Title: Re: Quick intentory question...
Post by: Prote1n on February 14, 2012, 02:25:32 PM
Could it be possible to rearrange the items.items file and reload it with Game.LoadItems ?

Does the Inventory Window will be updated in real time ?