Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Dusk

#101
Hello everybody - I hope this question is not too dumb for this forum, because I'm quite new to AGS and maybe there's a simple solution.

I can't find a not-really-dirty way to re-order inventory items. I'm making a personalized inventory window (hope to show you soon) that needs a "filler" item in its "n" first position. So i display mulptiple items multiple times, and that's ok... I "lose" a filler adding new items, and it works... but if I had to lose item and wanna insert a filler in the first inventory position? If I AddInventory(FILLER) it goes to the last position, I need it in the first.
How to specify the position? I've read many docs and found that the inventory is in practice an array where the key is the item number and the value is the amount of that item the player has.
So I tried character[GetPlayerCharacter()].inv[FILLERNUMBER]++ , but the problem remains, the new filler goes in the last position.
So the question is: where does AGS store the inventory items order? I hope it's not an hardcoded thing, maybe a not documented one, or maybe I simply didn't  search enough well.
Any links/suggestion/functions/reference to old post appreciated, help me or I will "backup" the real inventory items somewhere, place a right number of fillers in the inventory and then "restore" the saved "real" items. It should work, but it's REALLY DIRTY... :)

Sorry for poor English, writing from Italy - first written post - great community, great software (thanks CJ)
Bye :)

SMF spam blocked by CleanTalk