Hi! I know there is a way to show the number of steps the player has taken in an event, but I wanted the number of steps to also show up in the menu. It should be right above gold in a different box. Thanks!
Step Counter
RGSS3 Script RequestsHere you go:
You haven't told us how it should look so I made a few settings for you.
You can set the descriptive text and the alignment of the descriptive text and step number shown.
If you want anything changed, just say so.
#===============================================================================module Steppy_Win # Properties of the step window. # The properties are measured in pixels. Window_Prop = { :x => Graphics.width - 160, # X position. :y => Graphics.height - 96, # Y position. :w => 160, # Width. :h => 48, # Height. } # Descriptive text. StepText = "Steps" # Alignment for the texts. # 0 - left, 1 - middle, 2 right Align1 = 0 # For the description text. Align2 = 2 # For the step number text. # Set when the step display will stop displaying the number of steps # accurately. MaxStepsDisplayed = 9999999 # If the player stepped more than the number set for the above settings, # text set up here will be displayed instead of the number of steps taken. AfterMaxStepText = "9999999+" end#===============================================================================class Scene_Menu < Scene_MenuBase alias stepbox_12223 start def start stepbox_12223 create_step_window end def create_step_window @steppy = Window_Steppy.new end endclass Window_Steppy < Window_Base include Steppy_Win def initialize x = Window_Prop[:x]; y = Window_Prop[:y] w = Window_Prop[:w]; h = Window_Prop[:h] super(x, y, w, h) refresh end def refresh contents.clear change_color(system_color) draw_text(0,0,contents.width,contents.height,StepText,Align1) change_color(normal_color) if $game_party.steps > MaxStepsDisplayed draw_text(0,0,contents.width,contents.height,AfterMaxStepText,Align2) else draw_text(0,0,contents.width,contents.height,$game_party.steps,Align2) end end end
You can set the descriptive text and the alignment of the descriptive text and step number shown.
If you want anything changed, just say so.
Wow, thanks! I haven't tested it out yet, but I will do it right now! Thanks!
EDIT: Everything is perfect except, I just downloaded Yanfly's Menu Engine script and made it so everything is on the opposite side. Could you make it so the steps box is on the right, not left?
EDIT: Everything is perfect except, I just downloaded Yanfly's Menu Engine script and made it so everything is on the opposite side. Could you make it so the steps box is on the right, not left?
Sure, no prob!
I edited the snippet above, so grab it while it's hot! 😀
Now you can simply change the position and size of the window how you want in the settings. 🙂
The default settings will put it on the right side where you wanted.
I edited the snippet above, so grab it while it's hot! 😀
Now you can simply change the position and size of the window how you want in the settings. 🙂
The default settings will put it on the right side where you wanted.
Well, I didn't exactly get it while it was hot, but I tested it out and it works perfectly now! Thanks!
EDIT: I just thought of something, what happens when the number of steps gets too big? Will it clash with the words 'Steps'?
EDIT: I just thought of something, what happens when the number of steps gets too big? Will it clash with the words 'Steps'?
It is possible, yes.
No idea how would anyone get around that issue, because there is no limit of the amount of steps taken, right?
That is why I never display non-capped things in my menus. 😛
I could make it that if the steps taken is bigger than X amount, it will display a text instead, like "99,999,999+" indicating that the player stepped more than that already.
No other idea pops up in my head for this.
No idea how would anyone get around that issue, because there is no limit of the amount of steps taken, right?
That is why I never display non-capped things in my menus. 😛
I could make it that if the steps taken is bigger than X amount, it will display a text instead, like "99,999,999+" indicating that the player stepped more than that already.
No other idea pops up in my head for this.
Oh ya. That's a good idea! Could you do that?
Done. Edited the snippet above. 🙂
Thanks! Sorry I'm 12 hours late. I had to go somewhere. But this can be closed now! Thanks again!
If you could just convert your text string that shows the amount of steps from something like... 1000 to 1k, that would remove some digits and give you more space up to a certain amount!
Oh ya, that would also work! Sixth, umm... Do you mind adding that?
Original thread: https://forums.rpgmakerweb.com/threads/step-counter.35765/