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

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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 :)
 
Last edited by a moderator:

Missile Punch

Warper
Member
Joined
Oct 7, 2013
Messages
2
Reaction score
0
Primarily Uses
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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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 ;) )
 
Last edited by a moderator:

Missile Punch

Warper
Member
Joined
Oct 7, 2013
Messages
2
Reaction score
0
Primarily Uses
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.)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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.
 

Khas

Detective lv73
Veteran
Joined
Sep 16, 2012
Messages
282
Reaction score
380
First Language
Portuguese
Primarily Uses
RMMV
@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.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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?
 

Khas

Detective lv73
Veteran
Joined
Sep 16, 2012
Messages
282
Reaction score
380
First Language
Portuguese
Primarily Uses
RMMV
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! :D
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
okay, thanks - I'll give it a go :)
 

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
Is there a quick way to change the default speed of the airship, or does this warrant its own thread?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

seita

Donn_M
Veteran
Joined
Feb 6, 2013
Messages
2,254
Reaction score
611
First Language
English
Primarily Uses
Thanks Shaz. I actually meant to lower the speed, so it shouldn't be a problem.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
lol - yeah, that shouldn't be a problem :)
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
Quick question. How to prevent displaying blank space when you press pagedown in Window_Selectable?

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)
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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.
 
Last edited by a moderator:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,599
Reaction score
6,552
First Language
Indonesian
Primarily Uses
RMVXA
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
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
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.
 
Last edited by a moderator:

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
in battles, can I check if the player has escaped the battle and do something if so??
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
823
First Language
Hungarian
Primarily Uses
RMVXA
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.
 
Last edited by a moderator:

FeaR616

Veteran
Veteran
Joined
Nov 22, 2014
Messages
277
Reaction score
52
First Language
german
Primarily Uses
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..
 

Users Who Are Viewing This Thread (Users: 0, Guests: 3)

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,035
Messages
1,018,454
Members
137,821
Latest member
Capterson
Top