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

Nilom

Veteran
Veteran
Joined
Sep 9, 2013
Messages
178
Reaction score
40
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
2,270
Reaction score
1,288
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,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
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
31,769
Reaction score
7,869
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
40
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
2,270
Reaction score
1,288
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.
 

Latest Threads

Latest Posts

Latest Profile Posts

This profile banner thing is great! Not sure on the size needed, but it's still a nice feature.

Made mine nice and edgy because I'm still 15 at heart.
Anyone ever played Chrono Cross? I have been dying to create another micro-biome tileset that is heavily inspired by the Isle of the Damned in that game. So, a Micro Biome Bones edition. Anyone interested in this?
Wait, we have profile banners now?!
We have profile banners now! :D
D-does anyone know the size for them? 'Cause no matter what size image I upload, it doesn't look good haha; obviously my image sizes are too big.
Currently trying to figure out how to add custom objects to the character generator.

Forum statistics

Threads
107,611
Messages
1,030,902
Members
139,718
Latest member
maxwellbor
Top