Method or Function to return right order of item pick-ups

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
Hello!

Is there a method or a function in the RPG Maker built-in methods/functions that will return the inventory items in the correct order which they have been picked up?

$gameParty._items seems to just sort the items by database ID.

I know an array could be used for this but that would make the person using this need to handle script commands instead of just handling items within the database and the eventing system.

Thanks in advance. :LZSsmile:
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
1,877
Reaction score
889
First Language
Spanish
Primarily Uses
RMVXA
no, because the item pool stacks items by class, so there's no way to track individual pickups. (outside of reworking the item pool itself, obviously)

$gameParty._items seems to just sort the items by database ID.
precisely that.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,641
Reaction score
2,971
First Language
Tagalog
Primarily Uses
Is there a method or a function in the RPG Maker built-in methods/functions that will return the inventory items in the correct order which they have been picked up?
I know an array could be used for this but that would make the person using this need to handle script commands instead of just handling items within the database and the eventing system.
What do you intend to do? Where do you need it to return the pick-up order?

Even if a built in JS function exists, as long as its a JS function then the person using it will still be using a script call...

Anyway as gstv said, it needs a modification of the system because right now it doesnt track the moment when you obtained an item..

When you add an item (or weapon or armor) to the inventory, all the game does is increase the amount of that item in the ._item array using the database ID as its key/index. This is why it defaults to simply using the database ID for sorting..
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
28,952
Reaction score
6,665
First Language
German
Primarily Uses
RMMV
@XZINED
What you want does not exist, because the engine never stores the order in which items are gained.
You would need a plugin to store that order - and that would NOT be a simple plugin because you want a dynamic order (changes based on player actions) and not a static order (always the same).

About two month ago someone else asked the same and we gave a detailed description on the complexity of a plugin that could do this - you might want to search for that topic to get those details, but I think the idea was shelved and never happened.
 

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
39
First Language
German
Primarily Uses
RMMV
What do you intend to do? Where do you need it to return the pick-up order?

Even if a built in JS function exists, as long as its a JS function then the person using it will still be using a script call...
It is for a grid based inventory. If such a function would have existed it would have been possible to just use database items and handle the inventory based on that. But as it doesn't exist I guess that needs an array.

@XZINED
What you want does not exist, because the engine never stores the order in which items are gained.
You would need a plugin to store that order - and that would NOT be a simple plugin because you want a dynamic order (changes based on player actions) and not a static order (always the same).

About two month ago someone else asked the same and we gave a detailed description on the complexity of a plugin that could do this - you might want to search for that topic to get those details, but I think the idea was shelved and never happened.
Oh okay I see. Then I will just use an array for that. Thanks.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
1,877
Reaction score
889
First Language
Spanish
Primarily Uses
RMVXA
there are native methods to handle all operations related to an inventory management, from a simple array (adding, removing, retrieving, accounting, etc)
the problem is tying that to the GUI and the party and troop events, and making it compatible with other plugins you might have.

if you're going to make a new GUI, you're better off designing it from scratch.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I've noticed that the website has changed a lot since I left in August last year...
One of my kitties after a long, tiring day of being adorable.
We have good wifi here now thanks to a guy who had the audacity to tell the Director "Sir, the wifi sucks. Make it faster and increase the bandwidth" in this arrogant tone. The Director is a complete sweetheart so he did just that. So you may see me around often now, being disturbing as usual.
To compensate for me feeling too sick to interact properly, have an old recording of me calming you with Zelda's Lullaby. https://vocaroo.com/jqTcbzdQTw5 :kaojoy:
Finally found someone to make battlers for me. Just wants $50 for a small one. And $75 for a big one. So who wants to help me make a GoFundMe page? Scratch that. How much can I get for a kidney on the black market?

Forum statistics

Threads
93,361
Messages
911,669
Members
122,853
Latest member
Ordan
Top