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

If we're talking about custom menu's, as in from scratch, then no matter how you go about it, you would always need to position things up 🙂
Just a simple question, how would I go about slightly repositioning the face graphic in the message window? My fumbled attempts end up with me losing the bottom of the image.
In what way do you want to reposition it? The message window is sized correctly for the face to be displayed where it is. If you want to move it up or down or around, and still keep it the same size, you are going to have to change the size of the window.


(also, "simple question" does not mean "simple solution". "I can say it in 10 words or less" does not mean it's easy to do 😉 )
Heya, thanks for the response, I want to lower it by a few few pixels so it lines up a little nicer with the picture im using as a message box (with the default one set to transparent.)
I'm trying to make the selection rectangle of a Window_Selectable invisible temporarily (by setting a visible parameter on the correct object, or by changing its opacity). Does anyone know what command to use?


I don't want to just use a blank windowskin as I want to make it visible again at a certain point.
@shaz
I suggest you to implement control over the update_cursor method:
 

  #--------------------------------------------------------------------------  # * Update Cursor  #--------------------------------------------------------------------------  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(@index))    end  endYou may set a variable @cursor_visible and only run this method if the variable is true. Also, when setting @cursor_visible as false you need to call cursor_rect.empty. That way the update method won't refresh the cursor's rect and it will be invisible. To show the cursor again just set @cursor_visible to true - the update method does the work of restoring the cursor.
what is ensure_cursor_visible?


Can I just call @cursor_visible = false and cursor_rect.empty to make it invisible, then @cursor_visible = true when I want it to appear again?
It's a method to ensure that the cursor is in the screen:

  #--------------------------------------------------------------------------  # * Scroll Cursor to Position Within Screen  #--------------------------------------------------------------------------  def ensure_cursor_visible    self.top_row = row if row < top_row    self.bottom_row = row if row > bottom_row  end Yes! But you need to alias the update method to call it only if @cursor_visible is true.

Code:
alias restricted_update_cursor update_cursor def update_cursor    restricted_update_cursor if @cursor_visibleenddef show_cursor    @cursor_visible = trueenddef hide_cursor    @cursor_visible = false    cursor_rect.emptyend
Also, don't forget to set @cursor_visible = true when initializing! 😀
okay, thanks - I'll give it a go 🙂
Is there a quick way to change the default speed of the airship, or does this warrant its own thread?
In Game_Vehicle:

def init_move_speed @move_speed = 4 if @type == :boat @move_speed = 5 if @type == :ship @move_speed = 6 if @type == :airship endHowever, I always thought 6 was the maximum. It may be that you can't go above 6 in the editor, but modifying the script will allow it.Actually, it must. Because when you dash it adds an extra 1. So you should be able to change that to 7 with no worries.
Thanks Shaz. I actually meant to lower the speed, so it shouldn't be a problem.
lol - yeah, that shouldn't be a problem 🙂
Quick question. How to prevent displaying blank space when you press pagedown in Window_Selectable?

Spoiler
zKuRKVQ.jpg
I believe it's something to do in cursor_pagedown. Though, I dont have any idea where do I need to get started.

(P.S: dont ask what are those commands. It's might be more complicated than you thought)
So like shortening the window to fit the currently displayed data on the fly?


IDK how you could do it without either removing the background and border parts of the windowskin (so you won't really have a "blank" space) or recreating the window itself. At first I thought refreshing it also redraws the actual window to account for any size changes and such but no, it doesn't... I haven't tried to look really deep though as I tried it yesternight (actually morning, around 1am before I went to sleep)


PS: I tried it with changing the values that visible_line_number return depending on certain things then refresh the window. And it still retains the original size of the window.
lol, no. Do not resize the window. I just want not to scroll the window oy too much so that it wont display the blank space.

EDIT:

Seems I solve this myself.

Code:
  def cursor_pagedown    select([@index + page_item_max, item_max - 1].min)  end
Ah... then just look for where it adjusts the .oy and modify how it adjusts or modify how the pagedown/up works. I think I've done that before somewhere. You would then just need to figure out the correct formula to use.


It's there somewhere on Window_Selectable if I'm remembering correctly.
in battles, can I check if the player has escaped the battle and do something if so??
In the BattleManager module:

#--------------------------------------------------------------------------# * End Battle# result : Result (0: Win 1: Escape 2: Lose)#--------------------------------------------------------------------------def self.battle_end(result)@phase = nil@event_proc.call(result) if @event_proc$game_party.on_battle_end$game_troop.on_battle_endSceneManager.exit if $BTESTendYou can put in a check like:
Code:
if result == 1#do somethingend
This should work in theory.Or you can do your stuff directly here:

Code:
 #--------------------------------------------------------------------------# * Abort Processing#--------------------------------------------------------------------------def self.process_abortreplay_bgm_and_bgsSceneManager.returnbattle_end(1)return trueend
This one will only execute on a successful escape, so no extra checks are needed.
ah, thank you, that is great!! especially the "Abort Processing" where it only executes if successfull. another question is still there... can I check from what battler the player escape?? so the player gets a reward if he let a monster alive, but not for every monster..

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