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,305
Reaction score
1,330
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,005
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
32,050
Reaction score
7,976
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,305
Reaction score
1,330
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 Profile Posts

AeroPergold wrote on LUKElcs's profile.
Its-a me, Pergold from Gamejolt!
I added footstep sounds to our content that I posted in a previous thread. I was unable to edit the post, so if you're interested, see below.

DOWNLOAD LINK

I've started working on rpg maker again, and I can see a lot of improvement from when I was 13. I still have a long way to go, but I'm proud that I've gotten this far.
Animated Title screen is by SharkerrBlue(SB)
I am using the Nightmare Land pack.
I just can't walk to the store for lunch without walking past people smoking. It not only smells bad, it's probably poisoning me. I'm afraid I'll eventually have to be hospitalized. I can't take another path because there's too much traffic and drivers in the plaza are reckless sometimes. I almost got run over once, even after looking both ways.
RyanYe wrote on whtdragon's profile.
Your art works about Wyrvens and Dragons are sooooooooo cooooooooool~! I like them so bad
Can you create more? like Archangels, Devils, Titans, Cyclops!!

Forum statistics

Threads
108,808
Messages
1,039,638
Members
141,255
Latest member
yam655
Top