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,822
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,361
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,822
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,361
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


When you thought you'd be finished with the grid, and spend ~8-9 hours on an arrow. How is this more difficult to than player movement?

Still some bugs hiding in there, but it's nearly complete.

I'm having it strictly follow the path a user draws, because there will be booby trap and other similar mechanics where you want to avoid specific cells.
I feel like banging my head against a wall every time I want to find that post that shows all the plugin header codes. Then I think "next time I find it, I'm going to bookmark it". Then I think "wait a minute ... maybe I bookmarked it last time because it took me so long to find it". Check bookmarks, and there it is :)
... a few of my main characters standing around doing nothing lol. I mostly wanted to see them together on screen.

Forum statistics

Threads
107,823
Messages
1,032,442
Members
139,975
Latest member
Lucimountfort
Top