Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

A bunch of RGSS questions.

I haven't posted in a while so I have a lot of questions built up. Here goes:

1. How do you continue a single script command on multiple lines?

2. There is a "rect" object for Bitmaps, is there any way to create a "circle" object? Or some way to fill a circular area on a bitmap with color? Or, to even further push the question is there a logical way to select a random pixel given a radius and an origin point? (ex, I want to select a random pixel location that is a radius of 20 pixels away from 150, 150.)

3. Is there a working particle script for rgss?

4. I don't quite understand the Window_Command Class. I have tried looking up some guides but the few I have found wasn't very helpful.

5. What is the newline special character in ruby?

6. How do I display damage display numbers outside of battle?

Sorry, I hope that wasn't too much for one thread. I appreciate the help in advance.
 
1. Please elaborate on this question
2. There is no Circle object, but you can easily make one yourself.
Code:
class Circle
  def initialize(x, y, radius)
    @x, @y, @radius = x, y, radius
  end
  attr_accessor :x, :y, :radius
end
3. There is. Search around for it.
4. Window_Command is easy. What part of it don't you understand?
5. "\n"
6. RPG::Sprite has a damage method. Look into it with the Help File.
 
Thanks Yeyinde. But a lot of your answers only partially answered by questions.

1. To elaborate on my first question, let's say I had to make this command for some reason:

p "This is a very long string that I wish to print in one long command, however I find it very frustrating that I have to scroll horizontally to read all of it, so I wish to make the command several lines of code longer.";

2. While I know how to create a class and initialize data, I don't know how to make the class "act" like a circle. Like for example, let's say I want to make a perfectly circular area on a bitmap completely blue.

3. Thanks. Helpful, but not without work. You know how to answer a question.

4. Basically I don't understand how to use it. I have tried to analyze the class but I cant seem to figure out how to make it work. I know it may seem simple to you but I haven't had much experience with windows and graphical computer functions. Because of this, the nature of such things confuse me. While I understand how a command window would work, and I'm pretty sure I could code my own. I cannot see how to use the already built in one.

5. I have tried "\n", but for some reason it doesn't work with the "p" function. It simply spits back out those exact characters.

6. Excuse me I figured this out, and I am ashamed at how simple it was.
 
1. Use print instead of p. p is used for display arguments in a readable format. When you have the print and the string, add some NewLine characters to break it up.

2. You need a series of fill_rects. I don't know how to work with Radians, so I can't help you with circles.

3. Here is an example on how to use Window_Command
Code:
class Scene_WC_Test
  def main
    @command_window = Window_Command.new(160, ['Command0', 'Command1']
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      break if $scene != self
    end
    Graphics.freeze
    @command_window.dispose
  end
  def update
    @command_window.update
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.decision_se)
      case @command_window.index
      when 0
        print 'Command0 Selected!'
      when 1
        print 'Command1 Selected!'
      end
      return
    end
  end
end

5. Use print instead of p
 
I'd just like to add something for the first question.

You can have anything on mutliple lines but only in a certain way :

Code:
variable =
"hello, this is a string!" *
3 +
" I think 3 of it is enough, right?"
p variable # "hello, this is a string!hello, this is a string!hello, this is a string! I think 3 of it is enough, right?"

If the line ends with an operator, an opening array or hash, etc..., the interpreter will check the next line.
 
Ok, thanks, I understand everything now. The only thing I still have a question on is about the circles, which now I am thinking is more trouble than it is worth. Thanks, both of you.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top