• 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.

Simple Dual Screen System

664
Posts
16
Years
  • Great script CNG, this is what I have so far. Took forever getting X and Y coordinates...then I finally thought "Hey, Paint tracks XY coordinates...why not make the mock up then record the XY of the top left pixel of each icon". That's when I went "...OMG" xD.
    dualscreenscreenie.png


    Just need to make menus pop-up and everything when I click on each icon with the mouse...when I PM you of course, helps if I get the script beforehand >.>

    Btw, how do I fix the resolution issue? I mean when I switch resolutions in the Options the Dual Screen disappears even if I change back to 480x320.

    Add this is a new script section above main

    Code:
    class PokemonOptionScene
    def pbStartScene
     @sprites={}
     @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
     @viewport.z=99999
     @sprites["title"]=Window_UnformattedTextPokemon.newWithSize(
      _INTL("OPTION"),0,0,Graphics.width,64,@viewport)
      # These are the different options in the game.  To add an option, define a setter and 
      # a getter for that option.  To delete an option, comment it out or delete it.
      # The game's options may be placed in any order.
     @PokemonOptions=[
      EnumOption.new(_INTL("TEXT SPEED"),[_INTL("SLOW"),_INTL("MID"),_INTL("FAST")],
      proc { $PokemonSystem.textspeed },  # Getter
      proc {|value|  
         $PokemonSystem.textspeed=value 
         MessageConfig.pbSetTextSpeed(pbSettingToTextSpeed(value)) 
      } # Setter
      ),
      EnumOption.new(_INTL("BATTLE SCENE"),[_INTL("ON"),_INTL("OFF")],
      proc { $PokemonSystem.battlescene },
      proc {|value|  $PokemonSystem.battlescene=value }
      ),
      EnumOption.new(_INTL("BATTLE STYLE"),[_INTL("SHIFT"),_INTL("SET")],
      proc { $PokemonSystem.battlestyle },
      proc {|value|  $PokemonSystem.battlestyle=value }
      ),
      EnumOption.new(_INTL("FONT STYLE"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")],
      proc { $PokemonSystem.font },
      proc {|value|  
         $PokemonSystem.font=value
         MessageConfig.pbSetSystemFontName($VersionStyles[value])
      }
      ),
      NumberOption.new(_INTL("FRAME"),_INTL("TYPE%d"),1,$TextFrames.length,
      proc { $PokemonSystem.frame },
      proc {|value|  
           $PokemonSystem.frame=value
           MessageConfig.pbSetSystemFrame($TextFrames[value]) 
      }
      ),
      EnumOption2.new(_INTL("MAP VIEW"),[_INTL("ORIGINAL"),_INTL("CUSTOM"),_INTL("PERSPECTIVE")],
      proc { $PokemonSystem.tilemap ? $PokemonSystem.tilemap : 0 },
      proc {|value|  
        oldvalue=$PokemonSystem.tilemap
        $PokemonSystem.tilemap=value 
        if value!=oldvalue
         ObjectSpace.each_object(TilemapLoader){|o| next if o.disposed?; o.updateClass }
        end
       }
      ),
      NumberOption.new(_INTL("SPEECH FRAME"),_INTL("TYPE%d"),1,$SpeechFrames.length,
      proc { $PokemonSystem.textskin },
      proc {|value|  $PokemonSystem.textskin=value;
         MessageConfig.pbSetSpeechFrame(
           "Graphics/Windowskins/"+$SpeechFrames[value]) }
      )
     ]
     @sprites["option"]=Window_PokemonOption.new(@PokemonOptions,0,
       @sprites["title"].height,Graphics.width,
       Graphics.height-@sprites["title"].height)
     @sprites["option"].viewport=@viewport
     @sprites["option"].visible=true
     # Get the values of each option
     for i in [email protected]
       @sprites["option"][i]=(@PokemonOptions[i].get || 0)
     end
     pbDeactivateWindows(@sprites)
     pbFadeInAndShow(@sprites) { pbUpdate }
    end
    end

    I managed to combine this script with the mouse script of Cybersam, but as Soul.//Silver i can´t do pop-up menus or interactive icons and functional.

    Please anyone can share their knowledge about this.

    thanks in advance

    Well it's quite simple really, take the PokemonMenu Script.
    And this is how you would set it out so if an icon is clicked, something happens.

    Code:
       if Mouse.mouse_in_area?(x, y, width, height)
         if Mouse.click?(1)
           pbFadeOutIn(99999) {
           scene=PokemonPokedexScene.new
           screen=PokemonPokedex.new(scene)
           screen.pbStartScreen
           @scene.pbRefresh
           }
         end
       end

    That would take you to the Pokedex Screen.
    Hope that helped :)
     
    38
    Posts
    14
    Years
    • Seen Dec 8, 2010
    Sorry Crazyninjaguy, but I must be very clumsy because anything doesn´t work. As [FONT=&quot]Soul.//Silver[/FONT][FONT=&quot] [/FONT]I had the problem of resolution, I added the script above main but doesn´t work, I tried to replace the same lines of Pokemon Option script, but doesn´t work, so I left waiting for help.

    In terms menus and interactive icons didn´t work either, because instructions you have given me only work with Glitchfinder's Input Module and I have to Cybersam´s Module, Do you know how I could do with the latter or another possibility would?

    thanks in advance and for your excellent scripts.
     
    489
    Posts
    16
    Years
  • Add this is a new script section above main

    Code:
    class PokemonOptionScene
    def pbStartScene
     @sprites={}
     @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
     @viewport.z=99999
     @sprites["title"]=Window_UnformattedTextPokemon.newWithSize(
      _INTL("OPTION"),0,0,Graphics.width,64,@viewport)
      # These are the different options in the game.  To add an option, define a setter and 
      # a getter for that option.  To delete an option, comment it out or delete it.
      # The game's options may be placed in any order.
     @PokemonOptions=[
      EnumOption.new(_INTL("TEXT SPEED"),[_INTL("SLOW"),_INTL("MID"),_INTL("FAST")],
      proc { $PokemonSystem.textspeed },  # Getter
      proc {|value|  
         $PokemonSystem.textspeed=value 
         MessageConfig.pbSetTextSpeed(pbSettingToTextSpeed(value)) 
      } # Setter
      ),
      EnumOption.new(_INTL("BATTLE SCENE"),[_INTL("ON"),_INTL("OFF")],
      proc { $PokemonSystem.battlescene },
      proc {|value|  $PokemonSystem.battlescene=value }
      ),
      EnumOption.new(_INTL("BATTLE STYLE"),[_INTL("SHIFT"),_INTL("SET")],
      proc { $PokemonSystem.battlestyle },
      proc {|value|  $PokemonSystem.battlestyle=value }
      ),
      EnumOption.new(_INTL("FONT STYLE"),[_INTL("Em"),_INTL("R/S"),_INTL("FRLG"),_INTL("DP")],
      proc { $PokemonSystem.font },
      proc {|value|  
         $PokemonSystem.font=value
         MessageConfig.pbSetSystemFontName($VersionStyles[value])
      }
      ),
      NumberOption.new(_INTL("FRAME"),_INTL("TYPE%d"),1,$TextFrames.length,
      proc { $PokemonSystem.frame },
      proc {|value|  
           $PokemonSystem.frame=value
           MessageConfig.pbSetSystemFrame($TextFrames[value]) 
      }
      ),
      EnumOption2.new(_INTL("MAP VIEW"),[_INTL("ORIGINAL"),_INTL("CUSTOM"),_INTL("PERSPECTIVE")],
      proc { $PokemonSystem.tilemap ? $PokemonSystem.tilemap : 0 },
      proc {|value|  
        oldvalue=$PokemonSystem.tilemap
        $PokemonSystem.tilemap=value 
        if value!=oldvalue
         ObjectSpace.each_object(TilemapLoader){|o| next if o.disposed?; o.updateClass }
        end
       }
      ),
      NumberOption.new(_INTL("SPEECH FRAME"),_INTL("TYPE%d"),1,$SpeechFrames.length,
      proc { $PokemonSystem.textskin },
      proc {|value|  $PokemonSystem.textskin=value;
         MessageConfig.pbSetSpeechFrame(
           "Graphics/Windowskins/"+$SpeechFrames[value]) }
      )
     ]
     @sprites["option"]=Window_PokemonOption.new(@PokemonOptions,0,
       @sprites["title"].height,Graphics.width,
       Graphics.height-@sprites["title"].height)
     @sprites["option"].viewport=@viewport
     @sprites["option"].visible=true
     # Get the values of each option
     for i in [email protected]
       @sprites["option"][i]=(@PokemonOptions[i].get || 0)
     end
     pbDeactivateWindows(@sprites)
     pbFadeInAndShow(@sprites) { pbUpdate }
    end
    end



    Well it's quite simple really, take the PokemonMenu Script.
    And this is how you would set it out so if an icon is clicked, something happens.

    Code:
       if Mouse.mouse_in_area?(x, y, width, height)
         if Mouse.click?(1)
           pbFadeOutIn(99999) {
           scene=PokemonPokedexScene.new
           screen=PokemonPokedex.new(scene)
           screen.pbStartScreen
           @scene.pbRefresh
           }
         end
       end

    That would take you to the Pokedex Screen.
    Hope that helped :)

    Extremely helpful CNG =D. I'll show you the results later, one more question. How would I make it so the icons change graphics when I...
    a: Hover the mouse over it and also for that split second between clicking on it and Scene.new
    b: when I click on it then click on it again (the Running Shoes, in HGSS you touch it to make it so you constantly run then touch it again to turn it off).

    Never mind about a:, I could easily do that. But I still need b:...

    P.S. Any news on V2?

    Edit: The if Mouse.mouse_in_area?(x, y, width, height) doesn't seem to be working. I have Glitchfinder's Mouse Input and Key Input module...is there any specific place that the small script you provided should go? I did enter the correct x, y, width and height...
     
    17
    Posts
    14
    Years
    • Seen Nov 7, 2010
    Someone could go through mp pictures of the lower screen of heart pokemon gold?
     
    489
    Posts
    16
    Years
  • 664
    Posts
    16
    Years
  • Mouse.mouse_in_area?(x, y, width, height) only works with the mouse module with my edited methods :)

    @jefelin, it should work if you just put it above main :/
     
    38
    Posts
    14
    Years
    • Seen Dec 8, 2010
    Thanks Crazyninjaguy, On the resolution, in the end the problem was compatibility between versions of Starter, I tried it in the current version and it worked but no old mine, however you gave me the idea to do it and got it to work with my older version, (;

    The mouse issue is more complicated for me, because with my limited knowledge of scripts, I think I can do little... ): I'll have to wait for a second version of this great script or to quit a module compatible with the starter, because to see the mouse on the screen to make it work is a great distance, or I think.

    Only to return to thank you for this wonderful script, and hopefully they appear new (:
     
    69
    Posts
    14
    Years
    • Seen Nov 19, 2014
    Yesterday the script works, now i have this error:
    ---------------------------
    Pokemon Versión Titanio
    ---------------------------
    Exception: RuntimeError

    Message: Script error within event 1, map 51 (Intro):

    Exception: NameError

    Message: (eval):1:in `pbExecuteScript'uninitialized constant Interpreter::Show

    ***Full script:

    Show.picture("art")


    Interpreter:239:in `pbExecuteScript'

    Interpreter:1583:in `eval'

    Interpreter:239:in `pbExecuteScript'

    Interpreter:1583:in `command_355'

    Interpreter:492:in `execute_command'

    Interpreter:191:in `update'

    Interpreter:104:in `loop'

    Interpreter:196:in `update'

    Scene_Map:96:in `update'

    Scene_Map:94:in `loop'



    Interpreter:274:in `pbExecuteScript'

    Interpreter:1583:in `command_355'

    Interpreter:492:in `execute_command'

    Interpreter:191:in `update'

    Interpreter:104:in `loop'

    Interpreter:196:in `update'

    Scene_Map:96:in `update'

    Scene_Map:94:in `loop'

    Scene_Map:107:in `update'

    Scene_Map:63:in `main'



    This exception was logged in ./errorlog.txt.

    Press Ctrl+C to copy this message to the clipboard.
    ---------------------------
    Aceptar
    ---------------------------
     
    69
    Posts
    14
    Years
    • Seen Nov 19, 2014
    Thanks.
    Now talking about the mouse script, i use this:
    if Mouse.mouse_in_area?(x, y, width, height)
    if Mouse.click?(1)
    pbFadeOutIn(99999) {
    scene=PokemonPokedexScene.new
    screen=PokemonPokedex.new(scene)
    screen.pbStartScreen
    @scene.pbRefresh
    }
    end
    endin the end of the pokemonmenu script.
    And i get this error:
    uninitialized constant PokemonMenu::Mouse

    Thanks alot

    EDIT: Oh! and i can´t see the cursor ^^
     
    664
    Posts
    16
    Years
  • You have to change the x, y, width, height to your X and Y coordinates :)

    As for the mouse module, i'm putting it on the first post.
     
    489
    Posts
    16
    Years
  • Hey CNG, what script do I actually place this in? I tried at the end of the Dual Screen script....wouldn't work (as in Syntax Error), tried what VEGET@ did (even though I didn't think it would work) still got a Syntax Error...
    Code:
       if Mouse.mouse_in_area?(x, y, width, height)
         if Mouse.click?(1)
           pbFadeOutIn(99999) {
           scene=PokemonPokedexScene.new
           screen=PokemonPokedex.new(scene)
           screen.pbStartScreen
           @scene.pbRefresh
           }
         end
       end
    Also, how do I make it so the normal menu is disabled and make it so when you press Start only the Bug Catching contest info or Safari Zone info appears (if your in one of them)?
     
    664
    Posts
    16
    Years
  • You have to put the little 'scriptlet' into a script, preferably a new method after calling it from the update method.

    As for the second question, try editing the Pokemon Menu script :)
     
    1
    Posts
    14
    Years
    • Seen Oct 8, 2010
    Where i need to put this code?


    Sorry for disturbing --"

    If you dont know rgss, mmm best dont try it ;P
    But you put this:

    Mouse.update
    $mouse.x = Mouse.pos_x
    $mouse.y = Mouse.pos_y

    In the all scripts that has:
    pbUpdate


    Um crazy or another person xD I dont understand the mouse u.u it is workly, but I cant make it functionally:


    if Mouse.mouse_in_area?(340, 0, 340, 0)
    if Mouse.click?(1)
    pbFadeOutIn(99999) {
    scene=PokemonPokedexScene.new
    screen=PokemonPokedex.new(scene)
    screen.pbStartScreen
    @scene.pbRefresh
    }
    end
    end
    I put at the end of the pokemonmenu script, I get this:
    lalalalapokemonmenuscriptlalala
    end

    end
    if Mouse.mouse_in_area?(340, 0, 340, 0)
    if Mouse.click?(1)
    pbFadeOutIn(99999) {
    scene=PokemonPokedexScene.new
    screen=PokemonPokedex.new(scene)
    screen.pbStartScreen
    @scene.pbRefresh
    }
    end
    end

    And this error..:
    ---------------------------
    Pokemon Darkrai Revenge
    ---------------------------
    ????? 'PokemonMenu' ? 243 ??? NameError ????????

    uninitialized constant Mouse
    ---------------------------
    Aceptar
    ---------------------------


    Sorry if the dude it is noob xD But if I maker one, I make all xD
    Im Spanish, sorry for my bad english

    Byee, bye

    PS: The script of the mouse has a bug, that when do you go with the mouse out quickly, the mouse in the game(mouse sistem) it is quiet, and no how really succes xD
    In other words, the mouse of the game cant touch the bord.
     
    Last edited:

    Glitchfinder

    Let's all get along, please?
    477
    Posts
    17
    Years
  • This may just be me, but it's looking like you took the mouse_in_area? bit of the mouse Module is actually from vgvgf's AWorks series of scripts. Not to mention the fact that I'm pretty sure DerVVulfman put a pretty strict license on his scripts after mostly leaving RMXP.org.

    As for these scripts, I do have a few comments. The first one appears to merely be a pretty addon, as it requires scripting knowledge to fix up and give actual functions. As for the mouse addon, it looks functional, but appears to be an edit of someone else's script, which leaves potential issues regarding the original script's license.

    None of this is intended to keep you from scripting, or to force you to take this script offline. I'm merely commenting on some things that I see potential problems with. One thing to note is that vgvgf, creator of the AWorks scripts, has dropped development on the series, and has released them with no license, meaning that using the method from the presents no issues, except with the script you are inserting the method into.
     
    2,048
    Posts
    16
    Years
    • Seen Sep 7, 2023
    You do know that Essentials already has a Mouse module, right? You don't need to add your own.
    The Mouse::getMousePos method returns an array of the x and y coordinates of the cursor in relation to the window; if the mouse is outside the window, it returns nil. You can add some more methods to the module if you want.

    And finally, wouldn't it be best to add the mouse sprite updating code to the Graphics.update method? That way, each time the screen is refreshed, the mouse is automatically also updated. This saves people from having to look through every single script and manually add the code to every single update method.
     

    nmorr

    Takin a brake. -_-
    214
    Posts
    15
    Years
  • Cool! This is nice, I hope I can make the bottom screen with buttons. How do you do that? Please do tell.

    EDIT: Also, where do you put this code??

    Spoiler:
     
    Last edited:
    Back
    Top