How to call a method from and event script call?

Well, I tried to create an event that would call the method "change_value" from Scene_Title. This method should add "1" to the attribute @startup_thing... and depending on what @startup_thing is, it would change @game_restart to either true or false:

when @game_restart == false, show the new_game command

when @game_restart == true, show the new_game_plus command

Does anyone know how I could go about doing this..?

Here are the areas I changed in Scene_Base:

Spoiler
 

class Scene_Title < Scene_Base

 

 

 

 

  #--------------------------------------------------------------------------

  # * Start Processing

  #--------------------------------------------------------------------------

  def start

    super

    @startup_thing = 1

    if @startup_thing == 1

      @restart_game = false                                  

    elsif @startup_thing == 2

      @restart_game = true

    end

    SceneManager.clear

    Graphics.freeze

    create_background

    create_foreground

    create_command_window

    play_title_music

  end

 

 

 

 

 

 

 

  #--------------------------------------------------------------------------

  # * Create Command Window

  #--------------------------------------------------------------------------

  def create_command_window

    @command_window = Window_TitleCommand.new

    if @restart_game == false

      @command_window.set_handler🙂new_game, method🙂command_new_game))

    elsif @restart_game == true

      @command_window.set_handler🙂new_game_plus, method🙂command_new_game_plus))

    end

    @command_window.set_handler🙂continue, method🙂command_continue))

    @command_window.set_handler🙂shutdown, method🙂command_shutdown))

  end

 

 

 

 

 

 

 

  #--------------------------------------------------------------------------

  # * [Change Value] Command

  #--------------------------------------------------------------------------

  def change_value

    @startup_thing += 1

  end

 

 

 

 

  #--------------------------------------------------------------------------

  # * [New Game Plus] Command

  #--------------------------------------------------------------------------

  def command_new_game_plus

    DataManager.setup_new_game

    close_command_window

    fadeout_all

    $game_map.autoplay

    SceneManager.goto(Scene_Map)

  end

 

 

 

 

 
This is the error:

Spoiler
[IMG]http://i702.photobucket.com/albums/ww25/emperor24/z11_zps0f878912.jpg[/IMG]
And here is how I called the method to add "1" to the @startup_thing counter:

Spoiler
[IMG]http://i702.photobucket.com/albums/ww25/emperor24/z111_zpsd137d27e.jpg[/IMG]
Anyone know what I could try to fix the error? Any help would be greatly appreciated!
You're accessing it as a class method so you need to define it as a class method

Code:
class Scene_Title  def self.change_value    ...  endend
You probably want to define the startup_thing as a class variable as well.
You're accessing it as a class method so you need to define it as a class method

class Scene_Title def self.change_value ... endendYou probably want to define the startup_thing as a class variable as well.
Thanks again Tsukihime for your help!! 

I'll keep that in mind to place a self before the method if I want it to be called via event script call.. also changing the startup_thing to a class variable fixed my other problem that I didn't see yet =] (problem 100% solved)
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-call-a-method-from-and-event-script-call.17674/