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

Thanks for you help lavra works like a charm. 😀

(that moment though when I forget to look at one of the help files lol)
I am calling a number input processing on the command window, but I don't know why it keeps saying there's no such thing as digits max method in it when in fact it has. Here's how I'd set it up:

@number_window = Window_NumberInput.new(@command_window) @number_window.digits_max = 3 @number_window.startHowever it says error. What I want to achieve is rather simple I just don't know how. When I select a command from my command window, a number input pops out with say digits max of 7 and then starts me inputting the values, then when confirmed, saves that value in a variable (accessor) created on the scene. Any inputs?
Because @digits_max is a private member of Window_NumberInput. If you take a look at the start method:

def start    @digits_max = $game_message.num_input_digits_max    @number = $game_variables[$game_message.num_input_variable_id]    @number = [[@number, 0].max, 10 ** @digits_max - 1].min    @index = 0    update_placement    create_contents    refresh    open    activate  endYou can see that it's fetched from $game_message.num_input_digits_max, which has an attr_accessor and is writable.
Well that's exactly my problem. I want to call a Window_NumberInput on command, make a maximum digit and store the values being inputted on a variable.
How would I go about editing the tone of window borders? I'd like to do this for scripts that create their own windows.

Just to explain myself better, when a script calls window_base, I use this to change the window tone:

  def update_tone

    tone = Tone.new( 204, 187, 0, 128)

    self.tone.set(tone)

  end

Basically I'm asking for something like this that would change the tone of the border rather than the window itself.

I'm just assuming I'd need to set up the thing in window_base first.
Yeahhh I'm bumping this

EDIT:

Since I know double posting is against the rules, heres another quick question. What is the method for calling a animation in the database?

  def perform_battle_transition

    Graphics.transition(60, "Graphics/System/BattleStart", 100)

    Graphics.freeze

  end

Instead of Graphics.transistion, using an image, Id like to replace that with calling an animation. Is there an easy method for donig this?
I hope this doesn't warrant its own thread, but I was wondering how I could change distance of the cursor on the title screen when going from New Game, to Continue, etc.?


Thanks!
Are you using a script to display a cursor in the first place? I saw the screenshot of your title some time ago, so i have an idea of what you mean, but my title screen has no cursor by default.
What is padding, spacing, and how to measure the space between content and window border?
Padding is the size of the borders of a window. Spacing is used in Window_Selectable classes and is the size between the elements in your window.

You can for example just use contents.rect to get the rect where you can draw in your window.
Note that Spacing is the horizontal space between elements. Vertical spacing is defined by line_height and the position of elements in each line.
Are you using a script to display a cursor in the first place? I saw the screenshot of your title some time ago, so i have an idea of what you mean, but my title screen has no cursor by default.
I am, but I can't seem to find the section that would allow me to do what I need. D:
You could post the script, so other people do that for you. That's what this forum is for 😉
Vertical spacing is defined by line_height and the position of elements in each line.
Vertical spacing got nothing to do with 'line_height' directly. It is just a coincident that the 'item_height' method is hard-coded by default and it's value is set to 'line_height'.
Editing the default 'line_height' method just to increase the vertical spacing between commands is generally a bad idea, in my opinion.


Vertical spacing is affected by the 'item_height' method, which gets used in the 'item_rect' method, which will decide the final position of the item and cursor - by default, that is. Of course, any edit to the 'draw_item' method can change the final position of the drawn items, but if you want your cursor to align properly with each item, you are better off editing the 'item_rect' method, and make only fine tuning in the 'draw_item' method for specific stuffs if needed. This usually reduces the size of the script a bit... usually. 😀
Well that's exactly my problem. I want to call a Window_NumberInput on command, make a maximum digit and store the values being inputted on a variable.
Then do something like this:

Code:
$game_message.num_input_variable_id = YOUR_VARIABLE_ID_TO_STORE_THE_RESULT$game_message.num_input_digits_max = 3@number_window = Window_NumberInput.new(@command_window)  @number_window.start
okay, one question, I am using Yanflys Ace Battle Engine and want to splash an image, if the player gets hit in the battle.

I was able to do that by editing the method "create_popup" in line 1193, but here is my problem: the image is shown if the enemy is hit too!! 

how can I determine if the player is hit or the enemy??
Try to put your code into an 'unless self.is_a?(Game_Actor)' conditional check.
I don't know exactly why, but this works and the image pops up if the enemy takes damage! XD

I changed it to 'unless !self.is_a?(Game_Actor)' and now the image pops up if the player takes damage. ^^

thank you!!
Whoops, forgot the exclamation mark. I thought I typed that in too. 😀


A simple 'if self.is_a?(Game_Actor)' check should work too. I used many unless conditions a few minutes ago in a script, that is why I wrote (or rather wanted to) the unless version.
Hahaha, I think I change it into the if version, it is more difficutl to read "if you are not not an actor" instead of "if you are an actor" XD

main thing is it works! =)
thank for asnwered my question. I want to make a set of text below and beside an image (item image with explanation beside and below it). So, to make rect of item inside a help window? I just know rect is like an area to write something, so if the item is too big, it will be resized.

Original thread: https://forums.rpgmakerweb.com/threads/ruby-rgssx-questions-that-dont-deserve-their-own-thread.150/