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

i have a problem.

i want to know how can i change the equipment menu?

i want to use buttons.png and window.png for the windows any tips were can i get the info needed?
You would need to learn how to edit the scripts so that you can modify it in any way that you want... or find a script that does that.
That is not a question that doesn't deserve its own thread. Please start a new thread.


ALL of the menus use the default windowskins. You would need to find a script that uses images instead. Luna Engine might be a good starting point if you can't find anything else.
@Bloodmorphed:

If you want to only give the actor the skills he'd have learned from his class you could use

actor.init_skills

after doing the class switch.

Usually learn_skill and forget_skill are the only way a character changes his learned skills, so it's possible (although probably not very likely) other scripts rely on this behavior.

However, in this case, you probably also could divide all skills into different categories, and let only the right classes provide a certain skill category for the actor. In this case the actor won't forget the skills, but they are not shown in the skills menu.

At least you could reduce the loop a bit, so you don't have to create a new skills array for every iteration:

actor = $game_party.target_actor
actor.skills.each { |skill| actor.forget_skill(skill.id) }


actor.change_class ...
I want to properly draw an actor's graphic / sprite in a window. For example, here's what I do: 

class Window_Murggs < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1)) refresh end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear $game_party.members.each do |mem| draw_actor_graphic(mem, 0, 0) end end #-------------------------------------------------------------------------- # * Open Window #-------------------------------------------------------------------------- def open refresh super endendBut it doesn't show the sprites...
What does it give you? Have you compared that to the other classes? I remember having some similar trouble a while ago, and I wasn't calling create_contents.
Yes, I seem to have been getting nothing whenever I display the sprites. I created a new method called create_contents and called it this way:

#-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear create_contents end def create_contents $game_party.members.each do |mem| draw_actor_graphic(mem, 0, 0) end endBut still no sprites 🙁
You can't overwrite that method! Well, you can, but that won't help. 😀

What Shaz meant is that after the 'contents.clear' line, just simply add a 'create_contents' line. That is a default method in Window_Base, so you can call it without defining it in the class itself.

If that won't help, how does your character graphic looks like?

Maybe it is not using the right sheet setup. If your graphic got a $ sign before it's name, it should be a 3x4 sheet, if not, it should be a 12x8 sheet.

Also fitting_height(1) is not enough to display the graphic fully, unless your character's height is not bigger than 24 pixels. But I doubt this would prevent it to be displayed fully.

Add a 'p mem' line before the 'draw_actor_graphic' line. Start the game, open your scene and watch the console. If it prints out the members, than it iterates the members without problems. If not, than the problem lies in your party having no members, I guess..
I am using the default sprites, as this is a fresh project. I did it this way:

class Window_Murggs < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1) + 90) refresh end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh contents.clear create_contents $game_party.members.each do |mem| draw_actor_graphic(mem, 0, 0) end end #-------------------------------------------------------------------------- # * Open Window #-------------------------------------------------------------------------- def open refresh super endendBut still the sprites doesn't seem to show. I just want to display the sprites of those certain members Turning Down (in the Set Move Route, where the position Turn Down is). However, this seems to be getting nowhere in my script :\ 
In case of the draw_actor_graphic method, the x/y parameters do not specify the upper left corner of the operation rect but the middle of the line below it.

Drawing your character sprites at 0/0 will therefore draw them outside of the bitmap. You could try 16/32 instead.
Ahh yeah, that should be the problem.

Which leads to another problem in your code.

You can't specify a direct value for x and y in an iteration when drawing something. It would result them being drawn on top of each other, and I guess, that's not what you want. So, depending on how you want to show them (vertically or horizontally lined up), you will need to add at least +32 to either Y or X after each drawings.
Great, the problem is solved. However, is there a way I can separate the sprites? They're being drawn on one place. I want them to be drawn in line in the window... like this:

| | | |

since everyone of them is cluttered on the same position.
as sixth mentioned it, you have to add 32 to your Y variable to show the sprites horizontal in line.

just make sure to add 32 every time a new sprite is shown.
as sixth mentioned it, you have to add 32 to your Y variable to show the sprites horizontal in line.

just make sure to add 32 every time a new sprite is shown.
Y variable would place the position of the sprite in its vertical format, not the horizontal format. X uses the horizontal format. 

Somehow I was able to do it, but rather, everyone of them is drawn in line :\

Code:
  def refresh    contents.clear    create_contents    for i in 0..$game_party.members.size      $game_party.members.each do |mem|        draw_actor_graphic(mem, 32 * i, 32)      end    end      end
The most simple way would be:

Code:
$game_party.members.each_with_index do |mem,i|      draw_actor_graphic(mem, x+i*36, y)    end
This will draw each sprite 36 pixels to the right from the previous sprite, so it lines them up horizontally.
The sprites suddenly disappeared, sadly. Anything I've done wrong here?

Code:
class Window_Murggs < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize    super(0, 0, window_width, fitting_height(1) + 180)    refresh  end  #--------------------------------------------------------------------------  # * Get Window Width  #--------------------------------------------------------------------------  def window_width    return 160  end  #--------------------------------------------------------------------------  # * Refresh  #--------------------------------------------------------------------------  def refresh    contents.clear    create_contents      $game_party.members.each_with_index do |mem,i|        draw_actor_graphic(mem, x+i*36, y)      end    end  #--------------------------------------------------------------------------  # * Open Window  #--------------------------------------------------------------------------  def open    refresh    super  endend
Replace x and y with an actual number.


I just gave the syntax, not a direct solution.


x should be at least 16, and y should be at least 32.
Fixed, thank you very much.
Y variable would place the position of the sprite in its vertical format, not the horizontal format. X uses the horizontal format. 

Somehow I was able to do it, but rather, everyone of them is drawn in line :\

def refresh contents.clear create_contents for i in 0..$game_party.members.size $game_party.members.each do |mem| draw_actor_graphic(mem, 32 * i, 32) end end end
whoops, my bad, sorry. of course X is for horizontal! ^^"
Trying to get the line spacing in this description field (the five lines just below "Copper Spear") to be consistent. The line spacing between the first two lines are spaced properly, but the next three are spaced much too further down. With the correct spacing, there should be enough space for 5 lines of description without the text overlapping (underlapping?) the Base Price area.

YBjaWmm.png


Here are the relevant methods involved (minus irrelevant methods):

module DEK::YANTH::STW  #-----------------------------------------------------------------------------  # // Item Description  #-----------------------------------------------------------------------------  def self.item_desc    return $game_variables[196] #"Item Description goes here.  endend class Window_Yanth_Barter_Main < Window_Base  #-----------------------------------------------------------------------------  # // Overwrite From Super  #-----------------------------------------------------------------------------    def draw_text_ex(x, y, text)    reset_font_settings    text_size = 14    self.contents.font.size = text_size    text = convert_escape_characters(text)    pos = {:x => x, :y => y, :new_x => x, :height => text_size}    process_character(text.slice!(0, 1), text, pos) until text.empty?    reset_font_settings  end  def draw_item_desc    w = contents_width - 96    draw_text_ex(96,24,DEK::YANTH::STW.item_desc)  endendLet me know if that isn't enough information ;o

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