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.

Scene_Title ( Problem )

I'm new on scripting, I have started just a couple of weeks ago, I have read some titles and such.

I want to create a new option on the Title Menu, I would like to know how to do it, but I don't want the codes, I would like advices, on how to create the window and the option, the window will be for information.

I hope I am clear enough.
Thank you for your time.
Sorry for the bothering.
 
I have created the window, and add a new option on the Title Menu, but I fail to call the window, and of course to dispose it and get back to Scene Title.

I add a s4 command with it, and I'm creating a window_command, but I don't know what to code there.

Can someone help me?
I just want to call the window and then dispose it.
 
It didn't worked

As I said, in the when method in when 3 I coded the following
command_window

And now, I'm tring to code the command-window
Right now I have the following

def command_janela
$game_system.se_play($data_system.decision_se)
@my_window = My_Window.new
end

I have add the line you said in this method, however, it did not worked.
It gives me a NameError, uninitialized constant Scene, something like that.
 
I managed to call it.

Now I'm trying to create a scene to manage the window, I already have it coded, however when I try to call it, trough a call script event I get a error.

NameError
Uninitialized Constant Interpreter

and it trowns me to line 8 of the scene script.

Here are the scripts:

Window Script
Code:
#-------------------------------------------------------------------------------
# Janela T?tulo
#-------------------------------------------------------------------------------
class JanelaTitulo < Window_Base


def initialize
 
  
  super (0,0,640,480)
  
  
  self.contents = Bitmap.new(width - 32, height - 32)
  self.contents.font.name = $fontface
  self.contents.font.size = $fontsize
  
  
  refresh
  
  
  self.z = 50
  
end 


def refresh
  
  
  self.contents.clear
  
  
  @windowskin_name = $game_system.windowskin_name
  self.windowskin = RPG::Cache.windowskin(@windowskin_name)
  
  
  self.contents.font.color = normal_color

 end 

end

Scene Script
Code:
#-------------------------------------------------------------------------------
# Scene_JanelaTitulo
#-------------------------------------------------------------------------------
class Scene_JanelaTitulo
  
  def main
    
    @janela_titulo = Janela_Titulo.new
    
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      Update
      if scene != self
       break
     end
   end
  
   Graphics.freeze
  
   @janela_titulo.dispose
 end

  def update
    
    @janela_titulo.update
    
    if Input.trigger?(Input::B)
      @game_system.se_play($data_system.cancel_se)
      @scene = Scene_Map.new
    end
  end
end

And here is what I'm using to call the scene
Code:
$scene= Scene_JanelaTitulo.new

I apologize for the lack of comments, they were in another language so deleted them. This also modified the structure of the script, so it's kinda messy.

If someone could tell me where I fail and if something is missing, please help me.
Thank 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