LOGIN
SEARCH
PROFILE
keys: ↑ ↓
LOGOUT
INDEX
MEMBERS
keys: ↑ ↓
HOME
PORTAL
PLAY ALONG
PLAY with WORDS
PLAY with GRAPHICS
PLAY with SOUNDS
PLAY with CODES
PLAY with PROJECTS
keys: ← →
Guest Access
Register:
Members:



Go to page : 1, 2, 3, 4  Next

View previous topic View next topic Go down Message [Page 1 of 4]

The only one
The only one
#1 Ruby/RGSS Lessons Empty Ruby/RGSS Lessons
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
Someone want to learn to script in Ruby/RGSS? GubiD's RGSS tutorials are here for you! I've found this today and I really wanted to share this with you guys. If you have some ruby video tutorials, share them here. Very Happy


Tutorial 1
Spoiler:

Tutorial 2
Spoiler:

Tutorial 3
Spoiler:

Tutorial 4
Spoiler:

Tutorial 5
Spoiler:

Tutorial 6
Spoiler:

Tutorial 7
Spoiler:
Tutorial 8
Spoiler:
Tutorial 9
Spoiler:

Tutorial 10
Spoiler:

Tutorial 11
Spoiler:

Tutorial 12
Spoiler:

Tutorial 13
Spoiler:

Tutorial 14
Spoiler:

Tutorial 15
Spoiler:

Tutorial 16
Spoiler:

Tutorial 17
Spoiler:
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
Active Member
Active Member
#2 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
self.contents.draw_text(0, 0, 0, 0,"Stage to Display!", 1)

I don't know how to adjust the width and height.
At times the text doesn't show, and when it does it looks funny.

Can you help me out?
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
The only one
The only one
#3 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
You must ajust the window dimensions OR ajust the text size OR make the text shorter.
draw_text(x, y, width, height, "Yo'text!", alignment)
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
Active Member
Active Member
#4 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
The text is like a custom help bar I'll upload a screen shot.

Ruby/RGSS Lessons HelpScreen

In the help screen it changes depending on what the cursor is on(in the left.) Well that's what I'm trying to do. Can I do it?
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
The only one
The only one
#5 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
As mr_wiggles did for me, try to find the answer and I'll keep you on the good way to succeed by yourself. If it's possible, maybe send your code in private or on this topic. For that kind of menu, you must do as for the Scene_Menu script. For such thing, it's better to use a new Scene so you'll use main instead of initialize method. Or you could simply create the four windows separatly and update them in a scene. The problem is maybe only the dimensions. That's why I want you to send me the code. If you want to make the window separatly, use Window_ShopCommand as reference, I won't give you the answer, else, it's not funny Razz.

For a scene:
s1="Title"
s2="Project Rising Sun"
s3="GEt OUt! Teaser"
s4="Hello Sukita."

@command_window = Window_Command.new(160, [s1, s2, s3, s4])
@command_window.index = @menu_index
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
Active Member
Active Member
#6 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
I'm sorry, but I'm lost.

But what I did is edited the title to have a Gallery Scene, replacing Continue.

So if I uploaded it would I give you both my script plus the edited Scene_Title?
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
The only one
The only one
#7 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
Send me all the codes modified/added so I'll understand what you try to make and could help you to achieve it.
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee
EVENTALIST
EVENTALIST
#8 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

mr_wiggles

mr_wiggles
EVENTALIST
 EVENTALIST
EVENTALIST
profile
This site is the best, i reference it all the time.

http://www.ruby-doc.org/docs/ProgrammingRuby/
EVENTALIST
Show Signature
EVENTALIST
Active Member
Active Member
#9 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

handy333

handy333
Active Member
Active Member
Active Member
profile
Code:
class Scene_Gallery
  def initialize
    @gallery_index = 0
    music_change
  end
 
  def main

    # Stop playing ME and BGS
    Audio.me_stop
    Audio.bgs_stop
   
    # Execute transition
    Graphics.transition
   
    # Make title graphic
    @bg = Sprite.new   
    @bg.bitmap = RPG::Cache.title("2473675.png")
    @bg.flash(nil, 3)
   
   
    # Making other Images
    @ima = Sprite.new
    @ima.x = 160 + 4
    @ima.y = 4
    @ima.z = 4
    @ima.opacity = 200
   
    #Help Messages
    @m1 = "Return to Title Screen."
    @m2 = "Project Rising Sun"
    @m3 = "Logo for Project  Rising Sun"
    @m4 = "Promo image for GEt OUt!"
    @m5 = "nil"
    @m6 = "nil"
   
    # Make command window
    s1 = "Title"
    s2 = "Project Rising Sun"
    s3 = "GEt OUt! Teaser"
    s4 = "Hello Sukita."
    # Something with Commands
    @command_window = Window_Command.new(240, [s1, s2, s3, s4])
    @command_window.y = 100
    @command_window.height = 480
    @command_window.opacity = 190
    @command_window.z = 5
    @command_window.active = true
    @command_window.index = @gallery_index
   
    # Make Image window
    @image_window = Window_Image.new
    @image_window.back_opacity = 130
    @image_window.x = 160
    @image_window.y = 0
    @image_window.z = 2
    # Make Title Window and Help Window
    @title = Window_Title.new
    @help = Window_Helping.new
    @help.back_opacity = 230
    @help.z = 6
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Disposing of things
    @command_window.dispose
    @image_window.dispose
    @title.dispose
    @help.dispose
    # Dispose of title graphic
    @bg.bitmap.dispose
    @bg.dispose
    @ima.dispose
  end
 
  def music_change
      @random_bga = rand(5)
      # Play Random BGM
      case @random_bga
      when 0
        Audio.bgm_play("Audio/BGM/Seoleim", 70, 0)
        @random_bga
      when 1
        Audio.bgm_play("Audio/BGM/Temptation", 70, 0)
        @random_bga
      when 2
        Audio.bgm_play("Audio/BGM/I Want YouM", 70, 0)
        @random_bga
      when 3
        Audio.bgm_play("Audio/BGM/Piano Concerto No.1", 70, 0)
        @random_bga
      when 4
        Audio.bgm_play("Audio/BGM/Say it From Your Heart", 70, 0)
        @random_bga
      end
end

#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
  def update
    @bg.update
    @command_window.update   
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    #Skip Song
    if Input.trigger?(Input::L)|| Input.trigger?(Input::R)
      # Fade out BGM, BGS, and ME
      Audio.bgm_fade(800)
      music_change
    end
  end
end
#--------------------------------------------------------------------------
# * Update_Command
#--------------------------------------------------------------------------
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    if Input.trigger?(Input::B)
        # Play decision SE
        $game_system.se_play($data_system.cancel_se)
        # Fade out BGM, BGS, and ME
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        # Shutdown
        @random_bga
        $scene = Scene_Title.new
      end
    # If Cursor is hovered over
    case @command_window.index
    when 0
      if Input.trigger?(Input::C)
        # Play decision SE
        $game_system.se_play($data_system.cancel_se)
        # Fade out BGM, BGS, and ME
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        # Shutdown
        @random_bga
        $scene = Scene_Title.new
      end
      @ima.bitmap = nil
      @help_mess = @m1
    when 1
      @ima.bitmap = RPG::Cache.picture("2473109.png")
      @help_mess = @m2
    when 2
      @ima.bitmap = RPG::Cache.picture("2473675.png")
      @help_mess = @m3
    when 3
      p "Nil"
      @command_window.index = 0
      @help_mess = @m4
    end
    return
   
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 0  # Title
        # Play decision SE
        $game_system.se_play($data_system.cancel_se)
        # Fade out BGM, BGS, and ME
        Audio.bgm_fade(800)
        Audio.bgs_fade(800)
        Audio.me_fade(800)
        # Shutdown and random song
        @random_bga
        $scene = Scene_Title.new
      when 1  # This
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
      when 2  # That
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
      when 3  # Image
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
      end
      return
    end
  end
#--------------------------------------------------------------------------
# * Image Window
#--------------------------------------------------------------------------
class Window_Image < Window_Base
  def initialize
    super(0, 0, 480, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.color = system_color
    self.contents.draw_text(0, 0, 50, 50,"")
  end
end

#--------------------------------------------------------------------------
# * Title Window
#--------------------------------------------------------------------------
class Window_Title < Window_Base
  def initialize
    super(0, 0, 160, 100)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.color = system_color
    self.contents.font.size = 44
    self.contents.draw_text(0, 0, 100, 50,"Gallery", 1)
  end
end

#--------------------------------------------------------------------------
# * Help Window
#--------------------------------------------------------------------------
class Window_Helping < Window_Base
  def initialize
    super(0, 430, 640, 50)
    self.contents = Bitmap.new(width - 32, height - 32)
    @help_mess = @m1
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.color = system_color
    self.contents.font.size = 7
    self.contents.draw_text(0, 0, 50, 50,@help_mess.to_s)
  end
end
Active Member
Show Signature
Active Member
http://projectrisingsun.weebly.com/ http://soundcloud.com/handyfox https://www.youtube.com/channel/UCkBX7ZxqoXslAtqsdrmsn_w
The only one
The only one
#10 Ruby/RGSS Lessons Empty Re: Ruby/RGSS Lessons
Loading

NuKa_BuBble

NuKa_BuBble
The only one
The only one
profile
Problem:
Your windows sizes are simply not correctly defined.
@command_window = Window_Command.new(240, [s1, s2, s3, s4])
@command_window.height = 480
super(0, 0, 480, 480) # Window_Image

The game interface dimensions are: (640, 480) (x, y).
Look at your super method. 640 - 480 = 160. So you should set the command to 160 instead of 240 so the width will be the game interface. It's the same problem with the height, you've forgot to substract 32 (I suppose that you made it 64px height Wink ) from your help window to the Window_Image height and @command_window.height .

If I remember, you said that the text looks funny? Try to change the text size. If you want to do it, now could try to alias the Window_Command initialize and refresh methods like this:

Code:
#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#==============================================================================
class Window_Command < Window_Selectable
  attr_accessor :text_size
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    width    : window width
  #    commands : command text string array
  #--------------------------------------------------------------------------
  alias handy333_scenegallery_windowcommand_initialize initialize
  def initialize(width, commands)
    handy333_scenegallery_windowcommand_initialize(width, commands)
    @text_size = 24
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  alias handy333_scenegallery_windowcommand_refresh refresh
  def refresh
    handy333_scenegallery_windowcommand_refresh
    self.contents.font.size = @text_size
  end
end

Personally, I use long and precise aliasing method so I know where and what it's supposed to be aliased. What this code do? It call Window_Command::initialize and add in the method at the top, center or the bottom, depending on where you put the alias name, everything you write. It's like if you create a new method and call it instead of initialize. I added in the attr_writer : text_size too so you could change it later like this:
@command_window.text_size = choosen_size

I don't know actually if that work but, it should.

Suggestions:
Ok, first, at the end, the class Window_Helping, I think it's useles. There's already a class name Window_help in rpg maker that you can call like this: @window_help = window_help.set_text(text, align = 0) and set is position x or y like this: @window_help.x and @window_help.y .

Line 129 to 134, delete one of the comment Laughing .

At the end of the music call, use rescue nil:
Code:
Audio.bgm_play("Audio/BGM/Say it From Your Heart", 70, 0) rescue nil
If the player don't have the music, the game won't crash and simply return nil. Should use it for the pictures too. But, if you do that, in the end of the loop in main, you should do this:
Code:
@bg.bitmap.dispose if @bg.bitmap != nil
@bg.dispose if @bg != nil
@ima.dispose if @ima != nil

Instead of using Window_Image. Just call a dummy_window Cool . @dummy_window = Window_Base.new(x, y, width height) will save your time by creating an empty window.

I may have miss something so ask again if you still have a problem. Still edit on this post.


EDIT: Ok, so the post about aliasing the method don't work. I made this and it does. Just modify your windows sizes now.
Spoiler:

You must unactive $game_temp.scene_gallery when the gallery is disposed and active it when initialize. I give you this because, I want you to read and understand what I made.
The only one
Show Signature
The only one
http://nukabubble.deviantart.com/ http://soundcloud.com/nuka_bubble https://www.youtube.com/user/NuKaBuBble?feature=mhee

Sponsored content

profile

View previous topic View next topic Back to top Message [Page 1 of 4]

Go to page : 1, 2, 3, 4  Next

 

Chatbox system disabled
Personal messaging disabled