• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Modular Title Screen

Squeaky Duck

Squeaky Duck
22
Posts
4
Years
    • Seen Mar 14, 2021
    How do I install the Modular Title Screen?
    I mean, I made everything that is in the site, but when I put the script above Main, this happens:

    Script 'Main' line 274: ArgumentError ocurred.

    wrong number of arguments(2 for 1)

    Code:
    #=============================================================
    
    class Scene_DebugIntro
      def main
        Graphics.transition(0)
        sscene=PokemonLoadScene.new
        sscreen=PokemonLoad.new(sscene)
        sscreen.pbStartLoadScreen
        Graphics.freeze
      end
    end
    
    
    
    def pbCallTitle #:nodoc:
      if $DEBUG
        return Scene_DebugIntro.new
      else
        # First parameter is an array of images in the Titles
        # directory without a file extension, to show before the
        # actual title screen.  Second parameter is the actual
        # title screen filename, also in Titles with no extension.
        return Scene_Intro.new(['intro1'], 'big_chartest') 
      end
    end
    
    def mainFunction #:nodoc:
      if $DEBUG
        pbCriticalCode { mainFunctionDebug }
      else
        mainFunctionDebug
      end
      return 1
    end
    
    def mainFunctionDebug #:nodoc:
      begin
        getCurrentProcess=Win32API.new("kernel32.dll","GetCurrentProcess","","l")
        setPriorityClass=Win32API.new("kernel32.dll","SetPriorityClass",%w(l i),"")
        setPriorityClass.call(getCurrentProcess.call(),32768) # "Above normal" priority class
        $data_animations    = pbLoadRxData("Data/Animations")
        $data_tilesets      = pbLoadRxData("Data/Tilesets")
        $data_common_events = pbLoadRxData("Data/CommonEvents")
        $data_system        = pbLoadRxData("Data/System")
        $game_system        = Game_System.new
        setScreenBorderName("border") # Sets image file for the border
        Graphics.update
        Graphics.freeze
        $scene = pbCallTitle
        while $scene != nil
          $scene.main
        end
        Graphics.transition(20)
      rescue Hangup
        pbEmergencySave
        raise
      end
    end
    
    loop do
      retval=mainFunction
      if retval==0 # failed
        loop do
          Graphics.update
        end
      elsif retval==1 # ended successfully
        break
      end
    end
    This is my Main Script
    If you know how to fix it, PLEASE, help me.
     
    Last edited:

    Luka S.J.

    Jealous Croatian
    1,270
    Posts
    15
    Years
  • The Main script doesn't have anywhere close to 274 lines of code, so you might want to elaborate on what it is that you did exactly. When instructions tell you to put a script above Main, they mean create a new script section that is directly above the Main one, and paste the script in that blank section. Not to put it in Main, but above the other pieces of code.
     

    Squeaky Duck

    Squeaky Duck
    22
    Posts
    4
    Years
    • Seen Mar 14, 2021
    Code:
    The Main script doesn't have anywhere close to 274 lines of code, so you might want to elaborate on what it is that you did exactly. When instructions tell you to put a script above Main, they mean create a new script section that is directly above the Main one, and paste the script in that blank section. Not to put it in Main, but above the other pieces of code.

    Oh, thanks Luka, I'll try to fix it now.

    Edit: I separated the two scripts, but now, it appears this:

    Script 'Main' line 49: ArgumentError ocurred.

    wrong number of arguments(2 for 1)

    And again, the only solution I found is to remove it
    Also, the code looks like this now:
    Code:
    class Scene_DebugIntro
      def main
        Graphics.transition(0)
        sscene = PokemonLoad_Scene.new
        sscreen = PokemonLoadScreen.new(sscene)
        sscreen.pbStartLoadScreen
        Graphics.freeze
      end
    end
    
    
    
    def pbCallTitle
      if $DEBUG
        return Scene_DebugIntro.new
      else
        # First parameter is an array of images in the Titles
        # directory without a file extension, to show before the
        # actual title screen.  Second parameter is the actual
        # title screen filename, also in Titles with no extension.
        return Scene_Intro.new(['intro1'], 'splash')
      end
    end
    
    def mainFunction
      if $DEBUG
        pbCriticalCode { mainFunctionDebug }
      else
        mainFunctionDebug
      end
      return 1
    end
    
    def mainFunctionDebug
      begin
        getCurrentProcess = Win32API.new("kernel32.dll","GetCurrentProcess","","l")
        setPriorityClass  = Win32API.new("kernel32.dll","SetPriorityClass",%w(l i),"")
        setPriorityClass.call(getCurrentProcess.call(),32768) # "Above normal" priority class
        $data_animations    = pbLoadRxData("Data/Animations")
        $data_tilesets      = pbLoadRxData("Data/Tilesets")
        $data_common_events = pbLoadRxData("Data/CommonEvents")
        $data_system        = pbLoadRxData("Data/System")
        $game_system        = Game_System.new
        setScreenBorderName("border") # Sets image file for the border
        Graphics.update
        Graphics.freeze
        $scene = pbCallTitle
        while $scene!=nil
          $scene.main
        end
        Graphics.transition(20)
      rescue Hangup
        pbEmergencySave
        raise
      end
    end
    
    loop do
      retval = mainFunction
      if retval==0 # failed
        loop do
          Graphics.update
        end
      elsif retval==1 # ended successfully
        break
      end
    end
     
    Last edited:

    Squeaky Duck

    Squeaky Duck
    22
    Posts
    4
    Years
    • Seen Mar 14, 2021
    Hi, I'm back and I discovered that I wasn't in Pokémon Essentials V17, I'm so stupid that just realized yesterday, I already updated and now it works!
     
    Back
    Top