Ruby/RGSSx questions that don't deserve their own thread

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,764
Reaction score
954
First Language
Dutch
Primarily Uses
N/A
Hmm yes then it would surpass the max stat. What would be the best way?
Yes, maybe wouldn't mean much but does look visually pleasing
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,206
Reaction score
7,476
First Language
Indonesian
Primarily Uses
RMVXA
If your stat has the same value when they're in the same number, I would suggest this.

The maximum is based on the highest stat. So if strength is 50, that stat will have a full gauge bar. Everything else is going to depend on it. So if the defense is 40, it will get 80% of the bar filled because the maximum is 50.

Whether if it's a good design or not, it's another story.
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,764
Reaction score
954
First Language
Dutch
Primarily Uses
N/A
But what is the code to draw the parameter bar? How would I do it?
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,206
Reaction score
7,476
First Language
Indonesian
Primarily Uses
RMVXA
But what is the code to draw the parameter bar? How would I do it?
I did say, draw_gauge
Maybe you can try to look at how the HP bar is drawn?
 

ShinNessTen

Valedictorian of Wonderland
Veteran
Joined
May 25, 2015
Messages
88
Reaction score
154
First Language
German
Primarily Uses
RMVX
Is it possible to add a force action Event into this little snippet?Screenshot_1.png
It's a Retry Battle script and under the #Setup battle I would like to immediently force an Enemy to use a specific Skill in the Database upon loading the battle.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,206
Reaction score
7,476
First Language
Indonesian
Primarily Uses
RMVXA
@ShinNessTen since it's using $scene, I assume it is either RMVX or RMXP. Although either way, I can not help you, at least mention which engine you're using.
 

ShinNessTen

Valedictorian of Wonderland
Veteran
Joined
May 25, 2015
Messages
88
Reaction score
154
First Language
German
Primarily Uses
RMVX
Yeah it's VX. Forgot to mention.
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,042
Reaction score
5,705
First Language
English
Primarily Uses
RMVXA
@ShinNessTen I've received a request to move your question into a thread of its own. Given that Force Action is one of the few event commands that it actually fairly complicated to add into existing code, I think that's a good idea, but I'll leave you with the final call. If you'd like, go ahead and ask this question in its own thread on the RGSS2 Script Requests board where it may have a better chance to find a good answer.
 

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
98
Reaction score
19
First Language
português
Primarily Uses
RMVXA
for a Window_HorzCommand window: how do you make a window that has one visible option at a time?
 

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
98
Reaction score
19
First Language
português
Primarily Uses
RMVXA
@zeroscares overwrite col_max to return 1.
Using that, for me, it stays stuck on the first command selected. it doesn't even seem to process any input options, except for enter hahaha

Tested it quickly with Window_TitleCommand
Code:
#==============================================================================
# ** Window_TitleCommand
#------------------------------------------------------------------------------
#  This window is for selecting New Game/Continue on the title screen.
#==============================================================================

class Window_TitleCommand < Window_HorzCommand
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    update_placement
    select_symbol(:continue) if continue_enabled
    self.openness = 0
    open
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return 160
  end
  #--------------------------------------------------------------------------
  # * overwrite
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end
  #--------------------------------------------------------------------------
  # * Update Window Position
  #--------------------------------------------------------------------------
  def update_placement
    self.x = (Graphics.width - width) / 2
    self.y = (Graphics.height * 1.6 - height) / 2
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_command(Vocab::new_game, :new_game)
    add_command(Vocab::continue, :continue, continue_enabled)
    add_command(Vocab::shutdown, :shutdown)
  end
  #--------------------------------------------------------------------------
  # * Get Activation State of Continue
  #--------------------------------------------------------------------------
  def continue_enabled
    DataManager.save_file_exists?
  end
end
 

A-Moonless-Night

WINTER IS COMING
Veteran
Joined
Mar 17, 2012
Messages
692
Reaction score
448
First Language
English
Primarily Uses
RMVXA
@zeroscares ah true, that's because of how the window draws items. I quickly whipped up a window that will just show one item at a time; you can inherit from this.
Ruby:
class Window_SingleHorzCommand < Window_HorzCommand
 
  def col_max; return 1; end
 
  def draw_all_items
    draw_item(@index)
  end
 
  def select(index)
    super
    refresh_cell
  end
 
  def draw_item(index)
    change_color(normal_color, command_enabled?(index))
    draw_text(item_rect_for_text(0), command_name(index), alignment)
  end
 
  def cursor_right(wrap = false)
    if (index < item_max - 1 || (wrap && horizontal?))
      select((index + 1) % item_max)
    end
  end

  def cursor_left(wrap = false)
    if (index > 0 || (wrap && horizontal?))
      select((index - 1 + item_max) % item_max)
    end
  end

  def update_cursor
    if @cursor_all
      cursor_rect.set(0, 0, contents.width, row_max * item_height)
      self.top_row = 0
    elsif @index < 0
      cursor_rect.empty
    else
      ensure_cursor_visible
      cursor_rect.set(item_rect(0))
    end
  end
 
  def refresh_cell
    clear_item(0)
    draw_all_items
  end
 
end
 

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
98
Reaction score
19
First Language
português
Primarily Uses
RMVXA
@zeroscares ah true, that's because of how the window draws items. I quickly whipped up a window that will just show one item at a time; you can inherit from this.
thank you! What license does this script have? Do you have a name/URL you want to be credited to?
 

zeroscares

Veteran
Veteran
Joined
Oct 17, 2020
Messages
98
Reaction score
19
First Language
português
Primarily Uses
RMVXA
Back again hahahaha, another question for RMVXA

"Reduce screen flickering" does what, exactly? Apart from the obvious :guffaw: Is it just a pointless feature?
Also, more important: Is it a boolean value that could be directly set in the script?
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
300
Reaction score
74
First Language
English
Primarily Uses
RMXP
Screen flickering is the effect of watching the game make many frame drops every so often. Imagine Alex or Ralph or Eric are in the middle of the map but after walking for a second or two it has reached the eastern boundary and you've missed all the action inbetween. That's what it means. IIRC you usually increase the framerate to make sure the movements or changes or animations will look as smooth or fluid as any player is expecting the game to behave.
 

Ninjakillzu

Veteran
Veteran
Joined
Aug 19, 2013
Messages
329
Reaction score
308
First Language
English
Primarily Uses
RMVXA
What script call do I use for opening a sub-menu of the skills section? This is for VX Ace.

For instance, I have a skill section called Feats. I want to forcefully make this part of the skills menu open for the player.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
6,206
Reaction score
7,476
First Language
Indonesian
Primarily Uses
RMVXA
Where are you going to use this? on map?
 

Latest Threads

Latest Profile Posts

Create MiniMaps, Sprites for MV Enemies, & Aethereal Plane Battlebacks | RPG Maker News #74

Vtubers Vs MOTHER.png

This might be my next project. You like it?
I'm off to search the master script list for my skill issue. HOORAY! FUN!
Fun fact: Digimon is an isekai :kaoswt2:
The problem with being a perfectionist is that you are never done with something.

Forum statistics

Threads
112,326
Messages
1,067,403
Members
145,963
Latest member
Nekonix
Top