Item sorting from oldest to newest

Viuys

Villager
Member
Joined
Jan 20, 2013
Messages
5
Reaction score
0
First Language
Polish
Primarily Uses
N/A
I'm making an inventory system for my Survival Horror game and I wanted to make the items in the inventory to be sorted from oldest to newest acquired.
I'm using FenixFyreX's Manual Item Sorting if it helps in any way.
Can anyone help?
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,821
Reaction score
623
First Language
English
Primarily Uses
RMVXA
I believe you would have to add in an item time tracking. By default there is no option to sort by time acquired.
After doing so you could use Hime's Inventory sorting to reorganize them by the data you created.
I can only see this being done by adding a game time parameter to the items.
Someone better than me could probably do it.
 

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
809
Reaction score
1,360
First Language
English
Primarily Uses
N/A
This script was from this thread- (sort newest to oldest)
https://forums.rpgmakerweb.com/index.php?threads/skill-item-list-based-on-learn-obtain-order.19050/

Allows you to show the skill and item list based on the order that you learned the skills (obtained items) instead of the default which uses the database ID to determine sort order.

I wonder if this can be edited to do the opposite.

Code:
class Game_Actor < Game_Battler
  def skills
    (@skills | added_skills).collect {|id| $data_skills[id] }
  end
end
class Game_Party < Game_Unit
  def items
    @items.keys.collect {|id| $data_items[id] }
  end
  def weapons
    @weapons.keys.collect {|id| $data_weapons[id] }
  end
  def armors
    @armors.keys.collect {|id| $data_armors[id] }
  end
end
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,821
Reaction score
623
First Language
English
Primarily Uses
RMVXA
edited to do the opposite.
You would just encompass the statement with brackets and then put .reverse!
Ruby:
(@items.keys.collect {|id| $data_items[id] }).reverse!
This is from Hime's Inventory sorting script
 

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
809
Reaction score
1,360
First Language
English
Primarily Uses
N/A
Neat!

Potion will be the first for both test. Original script is based on the order obtained.

vanilla script
-
1. Potion
2. Hi-Potion
3. Full Potion

.reverse script
-
3. Full Potion
2. Hi-Potion
1. Potion

Note: Order doesn't update for duplicate items that you already have in your inventory.

Works like a charm! I appreciate your input.

Ruby:
class Game_Actor < Game_Battler
  def skills
    (@skills | added_skills).collect {|id| $data_skills[id] }
  end
end
class Game_Party < Game_Unit
  def items
    @items.keys.collect {|id| $data_items[id] }.reverse!
  end
  def weapons
    @weapons.keys.collect {|id| $data_weapons[id] }
  end
  def armors
    @armors.keys.collect {|id| $data_armors[id] }
  end
end

Edit: found Hime's Inventory Sorting script that you're referring to
 

Latest Threads

Latest Posts

Latest Profile Posts

Starting work on some stuff for the community. Hopefully it will be fun, and useful to somebody.
Searching what to play in my dead times, the nostalgia hit me hard and ended downloading the Patapon trilogy, hope I can avenge my child self and beating all the games hahaha
Finished the frontier and...I apologize to anyone who saw the trailer I posted and actually tried it. Technical marvel, crazy disjointed fetish story hidden inside a cheap milsim skin that has no idea what it's trying to be except sanctimonious and failing at even that. As much as I hate fallout 4's story, even it was better. I guess there just won't be another non-parody fallout after all.
Anyone else having trouble posting in the forum? I have no reply box in posts or in messages. This is the only place I can type. @Archeia?

Forum statistics

Threads
107,763
Messages
1,031,987
Members
139,911
Latest member
Katara
Top