Golden Unicorn Gaming

Savior of Astoria
Regular
Joined
Sep 10, 2013
Messages
271
Reaction score
644
First Language
English
Primarily Uses
N/A
Hello All,

I've looked and haven't found anything, and am now looking for help.  I use VX ACE, and the yanfly engines as add ons.  I made my game mostly stream of consciousness (so spells and items weren't planned out beforehand) and now that it's gigantic I'm looking to make searching through menus easier for the player.  As an example, the spell Heal is acquired early, so I created the skill early (it's slot #3 on skill list).  The Heal 2 spell is found much later in the game, probably after 40 more spells have become available to the player (it's slot #44 on skill list).  Rather than have to scroll through those 40 spells to find Heal 2, is there a script out there that will alphabetize the skill list, or the item list, or weapon/armor lists?  It would make things much easier on the player, IMO. 

I realize that I can solve this by redoing all of my skills but that ain't gonna happen.  Thanks in advance.

Luke
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,961
Reaction score
11,897
First Language
German
Primarily Uses
RMMV
That is not as easy as you think it is, because the engine itself doesn't know any skill names, it works with the skill numbers.

If you have for example an event where the player learns "Skill # 10", then that event will always teach skill #10, even if you changed the skills in the database - as soon as you do, that event would list the new name and skill under #10 as learned.

Your only option is to have only the display in the engine resorted, and that

1) requires a script

2) that script will need some time to resort every time you open the skill menu

I've moved this thread to Script Request. Please be sure to post your threads in the correct forum next time. Thank you.
 

Sixth

Regular
Regular
Joined
Jul 4, 2014
Messages
2,207
Reaction score
877
First Language
Hungarian
Primarily Uses
RMVXA
Insert this little snippet anywhere below Materials but above Main:

class Window_SkillList < Window_Selectable alias sort_skills9974 make_item_list def make_item_list sort_skills9974 if @data && @data != [] @data.sort_by! {|sk| sk.name} end endendclass Window_ItemList < Window_Selectable alias sort_items9974 make_item_list def make_item_list sort_items9974 if @data && @data != [] @data.sort_by! {|it| it.name} end end end
This will sort the skill/item lists automatically for you.

And no, it won't slow down your game at all.
 

MeowFace

Meow
Regular
Joined
Feb 22, 2015
Messages
1,034
Reaction score
189
First Language
Meowish
Primarily Uses
2) that script will need some time to resort every time you open the skill menu
And no, it won't slow down your game at all.
Sorting has nothing to do with the graphic, so unless it's over 10k items in the list, the sort process should be instant.

But the graphical fonts for item/skill name + icons should cause the slow down, if the list is gigantic as the OP said, the lag is already there. He might already suffer the random crash in battle/menu opening skill/item scene if he's using a custom font. Mithran's cache script should prevent those lag/crashes in a way.

edit:

A question though, are you sure you want to sort things by alphabetic? That won't help much in easing the player's selection imo. Since you will be mixing strong/weak skill/items by name that way. Why not sort skills by mp/tp cost and items by price?
 
Last edited by a moderator:

Sixth

Regular
Regular
Joined
Jul 4, 2014
Messages
2,207
Reaction score
877
First Language
Hungarian
Primarily Uses
RMVXA
Custom fonts got nothing to do with lag. Every font is drawn the same way, all of them takes the same time to draw.


I tested the above snippet with 140 items on the list without Mithran's script. Not even a single frame lag time. I would test with more, but I am too lazy to make hundreds of items just to test it.


Point is, the sorting will not slow down anything, like you wrote. It is from the drawing, but even so, only if you got a really huge amount of items/skills on the list, or maybe if your PC is a toaster. :D


Mithran's script surely helps for any scene with lotsa text displayed, and honestly, everyone who values their game enough should already use it.


Everyone who can play RPG games knows the alphabet, therefore if the list is sorted alphabetically, the players knows exactly where to look for the specific item/skill without even knowing what that item/skill is for, regardless of the list's size.


Sorting the lists based on other criteria (like your examples) won't help the player at all, unless he/she actually memorizes every skill and item on the list, and what they do, what they cost, and so on.


I would surely take alphabetically sorted lists over any other sorted lists.
 

MeowFace

Meow
Regular
Joined
Feb 22, 2015
Messages
1,034
Reaction score
189
First Language
Meowish
Primarily Uses
Custom fonts got nothing to do with lag. Every font is drawn the same way, all of them takes the same time to draw.

I tested the above snippet with 140 items on the list without Mithran's script. Not even a single frame lag time. I would test with more, but I am too lazy to make hundreds of items just to test it.
Nope, the problem with custom font is the draw method. Some custom fonts are a few pixels bigger in size than the standard fonts. Those are the one causing the crashes. And no, 140 items is not much imo.. you will need at least 500+ with an individual icons for each to see the lag.

well, you should see the lag with a large icon sheet even without a large list.

Everyone who can play RPG games knows the alphabet, therefore if the list is sorted alphabetically, the players knows exactly where to look for the specific item/skill without even knowing what that item/skill is for, regardless of the list's size.

Sorting the lists based on other criteria (like your examples) won't help the player at all, unless he/she actually memorizes every skill and item on the list, and what they do, what they cost, and so on.

I would surely take alphabetically sorted lists over any other sorted lists.
Depends on the language they are using. And nope, as a player, some will prefer their skills to be sorted by weak to strong for fast access. If it's a large list. skill cost is more effective than alphabetic order. Especially if you can't remember the skill name/effect, one will have to read through every single skill to check which's stronger or cost effective, because sorting by name will have weak/strong skill scrambled all over the list. A veteran will mostly just press the up key to go to the last skill as it's being expected to be the strongest available. There are other sort like by types, heal/atk/def, and each are further sorted down by cost. That's the best imo.
 

Golden Unicorn Gaming

Savior of Astoria
Regular
Joined
Sep 10, 2013
Messages
271
Reaction score
644
First Language
English
Primarily Uses
N/A
Thanks to all for the help, especially Sixth.  That script works beautifully, and should make things easier on everyone.  My game is intended to be commercial.  Is it alright if I credit you?

Luke
 

Sixth

Regular
Regular
Joined
Jul 4, 2014
Messages
2,207
Reaction score
877
First Language
Hungarian
Primarily Uses
RMVXA
Sure, if you want, you can credit me. I don't require it for that little snippet, but it is always a nice gesture regardless.


You are welcome!
 

tvghost

Regular
Regular
Joined
Dec 22, 2014
Messages
359
Reaction score
115
First Language
English
Primarily Uses
RMVXA
Script snippet reformatted.

Code:
#Credit: Sixth
#Sorts item list alphabetically.

class Window_SkillList < Window_Selectable
  alias sort_skills9974 make_item_list
  def make_item_list
    sort_skills9974
    if @data && @data != []
      @data.sort_by! {|sk| sk.name}
    end
  end
end

class Window_ItemList < Window_Selectable
  alias sort_items9974 make_item_list
  def make_item_list
    sort_items9974
    if @data && @data != []
      @data.sort_by! {|it| it.name}
    end
  end
  end
 

Latest Threads

Latest Profile Posts

Idle.gif
something I'm working on as I decide whether or not I go with frontview or not.
Reworked a bit on the UI. I'm pretty happy with how the status window turned out!
Rafael_UI.png
Be sure to check @casper667's page full of RM stuff as we are collabing together to bring out custom assets :kaohi:
4 more hours til I give my last final. And I couldn't bring my laptop to pass time this time due to the finals taking up all the space in my backpack.

Send help. Or a Steam Deck.
Thanks to my last two calendar days, the goddess can now join your heroes' party and whack your enemies with the power of love!
1702314770604.png
How are you gonna use all those new resources from the calendars?

Forum statistics

Threads
136,922
Messages
1,271,512
Members
180,714
Latest member
firefoxbox
Top