RK5 Debug Console

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by Rikifive, Apr 25, 2016.

  1. Rikifive

    Rikifive Bringer of Happiness Veteran

    Messages:
    1,442
    Likes Received:
    676
    Location:
    Poland
    First Language:
    Polish
    Primarily Uses:
    Other
    RK5 Debug Console


    "I was tired of testing stuff in the Editor - Now I can do that on move"


    Version: 1.2.1


    [​IMG]
    def draw_introduction
    This script adds an in-game console, that can be brought in any scene to perform a script call, that can be typed during gameplay.
    There are many, many, many possibilities of using that console, starting from simply changing variables to even performing advanced codes to 
    affect objects or even create them.
    Besides freely typed strings, the console contains build-in commands, for quicker debugging like teleporting player to specific maps and coordinates or hooking objects like windows to move or resize them and print their parameters into a txt file to allow developers configure them in the script properly.

    end
     
    [​IMG]
    def features

    -=> Use build-in commands! Think of cheats or commands in Minecraft lel
           (spawn items/gold, noclip and stuff like this)
    -=> Hook objects like windows to adjust their position, size or opacity
           and print the results into a txt file!
    -=> Change variables, actor/enemy stats and many, many more
    -=> Check values maintained by variables etc.
    -=> Everything is up to you!
     
    Planned Features:
    -=> More commands - because why not?
     
    end
     
    [​IMG]
    def draw_instructions
    ► SCRIPT DIFFICULTY: ★★☆☆☆ ★★★★☆
                                from build-in commands - to advanced usage
     
    ► REQUIRED SCRIPTS!
      [■] CP Keyboard Input script by Neon Black
        └►[profile] http://forums.rpgmakerweb.com/index.php?/profile/626-neon-black/
        └►[script] http://pastebin.com/raw/rD4rQtKP
     
    ► USAGE:
    -=> Place script(s) below ▼ Materials; above ▼ Main Process
    -=> Plug & Play
    -=> Press '~' (tilde) to bring up the console or exit from it.
    -=> Type /help in console to view available commands and such.
    end
     
    [​IMG]
    def draw_currenty_available_commands

    #==============================================================================#
    # CURRENTLY AVAILABLE COMMANDS #
    # ---------------------------- #
    # [■] Commands - Call pre-made codes. #
    # └► Toogle Noclip Mode | /noclip #
    # | Desc: Allows to go through impassable objects. #
    # | Usage: /noclip #=> Toogles Noclip Mode ON/OFF #
    # | #
    # └► Give Item | /give [type] [id] [amount] OR /give <item name> [amount] #
    # | Desc: Spawns an item in inventory. Types: 1=item 2=weapon 3=armor #
    # | Usage: /give 1 5 10 #=> Gives 10x item with ID 5 from item category #
    # | /give Small Potion 10 #=> Gives items based on their names #
    # | (If there will be multiple items with the same name, it will #
    # | give them all, even from various item categories) #
    # | #
    # └► Give All | /give all #
    # | Desc: Fills your inventory with everything. #
    # | Usage: /give all #=> Gives EVERYTHING x 99 #
    # | #
    # └► Lose All | /lose all #
    # | Desc: Cleans up your inventory. #
    # | Usage: /lose all #=> Removes EVERYTHING x 999 #
    # | #
    # └► Spawn Gold | /gold [amount] #
    # | Desc: Adds or removes a specified amount of gold to/from inventory. #
    # | Usage: /gold 1000 #=> Adds 1000 gold to player's inventory #
    # | #
    # └► Transfer Player | /tp [map_id] [x] [y] #
    # | Desc: Moves player to specific map and coordinates. #
    # | Usage: /tp 2 4 5 #=> Moves player to [4,5] position on MAP002 #
    # | #
    # └► Scene Call | /sc scene ("Scene_" is automatically added) #
    # | Desc: Calls a specific scene. #
    # | Usage: /sc Menu #=> Calls a Scene_Menu #
    # | #
    # └► Escape From Battle | /run #
    # | Desc: Successfully escapes from battle. #
    # | Usage: /run #=> Escapes from battle and gets back to Map #
    # | #
    # └► Force Victory | /win #
    # Desc: Forces victory by instant-killing all enemies. #
    # Usage: /win #=> Kills all enemies - Your new secret OP weapon #
    # #
    # [■] Functions - New logical keywords used by this console. #
    # └► Check Value | [var] == ? #
    # | Desc: Returns current value from object to the console. #
    # | Usage: $game_variables[5] == ? #=> Returns value from Variable #5 #
    # | #
    # └► Hook Object | /hook [object] #
    # Desc: Hooks an object to allow moving/resising by input. #
    # Usage: /hook @status_window #=> Hooks f.e. a party window from menu #
    # #
    # [■] Shortcuts - Replaces keyword into a string when pressing [TAB] button. #
    # └► Variables | #v #
    # | Desc: Code used to handle variables. #
    # | Usage: #v =[TAB]=> $game_variables => $game_variables[3] #
    # | #
    # └► Switches | #s #
    # | Desc: Code used to handle switches. #
    # | Usage: #s =[TAB]=> $game_switches => $game_switches[3] #
    # | #
    # └► Party Members | #a #
    # | Desc: Refers to a member similar to eg. 'a.hp' in Damage Formulas. #
    # | Usage: #a =[TAB]=> $game_party.members => $game_party.members[3].hp #
    # | #
    # └► Party Members | #b #
    # Desc: Refers to an enemy similar to eg. 'b.hp' in Damage Formulas. #
    # Usage: #b =[TAB]=> $game_troop.members => $game_troop.members[3].hp #
    # #
    # REMEMBER: You can use negative numbers to subtract values / remove items #
    # #
    # - More to come in future updates - #
    #==============================================================================# 


    end
     
    [​IMG]
    def create_screenshots
    # Screenshots

    [​IMG]
    [​IMG]
    [​IMG]


     
    #Some gifs showing this script in action:
    @> Testing stuff on fresh project

    [​IMG]


    @> 'HOOK' Command!

    [​IMG]


    @> Testing commands ~ Uses version under development
    @> Toying with menu ~ Uses version under development
    end

    [​IMG]
    def terms_of_use
    -=> You ARE allowed to use this script in non-commercial projects.
    -=> You ARE NOT allowed to use this script in commercial projects.
    -=> You ARE allowed to edit this script to your needs.
    -=> You ARE NOT allowed to repost or post modified versions of this script!!!
    -=> You ARE DEFINITELY NOT allowed to claim this script as your own.
    -=> Crediting me, Rikifive would be heavily appreciated.
    -=> You ARE obligated to read and follow the terms of use of
             CP Keyboard Input script created by Neon Black as well
     
    While I won't kill anybody for breaking these rules, it still would be
    a violation of personal rights, that shouldn't happen.
    By using this script you accept these terms of use.
    Not reading them DOES NOT exempt you from liability.
    end
     
    [​IMG]
    def put_download_link
    download_link =  View attachment RK5 Debug Console V.1.2.1 by Rikifive.txt
    required_script = CP Keyboard Input script v1.0a by Neon Black
     
    #CHANGELOG

    #==============================================================================#
    # UPDATES #
    # ------- #
    # [■] 03.05.2016 | Version 1.2.1 #
    # └► you can print hooked object's parameters by pressing [CTRL] #
    # └► added changeable opacity of the object to hook command #
    # #
    # [■] 29.04.2016 | Version 1.2 #
    # └► added 'Give' command #
    # └► added 'Give All' command #
    # └► added 'Lose All' command #
    # └► added 'Spawn Gold' command #
    # └► added 'Noclip' command #
    # └► improved help window - it displays information more clearly #
    # #
    # [■] 27.04.2016 | Version 1.1 #
    # └► added 'Hook' function #
    # └► incorrect codes don't crash the game anymore #
    # | (Thanks to BLACK WYVERN for help with this) #
    # └► all sounds can be configured or disabled #
    # └► 'optimized' script code a little to make it shorter and more effective #
    # #
    # [■] 25.04.2016 | Version 1 #
    # └► initial release #
    #==============================================================================# 


    end
     
    Last edited by a moderator: May 4, 2016
    #1
  2. Rikifive

    Rikifive Bringer of Happiness Veteran

    Messages:
    1,442
    Likes Received:
    676
    Location:
    Poland
    First Language:
    Polish
    Primarily Uses:
    Other
    def update
      #Script has been updated!
      Current version = 1.1
     
      #Changelog
    [■] 27.04.2016 | Version 1.1
      └► Added 'Hook' function
             You can attach objects to input and move/resize them during gameplay. The console shows parameters.
      └► Incorrect codes don't crash the game anymore
             Your game shouldn't crash anymore due to wrong codes!
            (Thanks to BLACK WYVERN for help with this)
      └► All sounds can be configured or disabled
             Sound Effects annoy you? Disable them!
      └► 'Optimized' script code a little to make it shorter and more effective
             The code is shorter and more effective (neat)
     
      #gif
      http://i.imgur.com/Y6Iky0N.gif
    end
     
    #2
  3. Rikifive

    Rikifive Bringer of Happiness Veteran

    Messages:
    1,442
    Likes Received:
    676
    Location:
    Poland
    First Language:
    Polish
    Primarily Uses:
    Other
    As suggested by the user, I've implemented more commands~


    def update
      #Script has been updated!
      Current version = 1.2
     
    #Changelog
    # [■] 29.04.2016 | Version 1.2
    #   └► added 'Give' command
    #   └► added 'Give All' command
    #   └► added 'Lose All' command
    #   └► added 'Spawn Gold' command
    #   └► added 'Noclip' command
    #   └► improved help window - it displays information more clearly
     


    Besides that I've slightly improved the whole code to make stuff clearer.


    Special Code detection has been improved and it formats stuff better and more automatically.


    Putting params to commands doesn't need comma [ , ] between them (like /tp 3, 5, 3) anymore. 


    Now, Instead of that, just put spaces. (like /tp 3 23 8)


    You can spawn/erase items in inventory by putting their ID's or names.


    So, putting for example /give 2 10 99 will give 99x items with ID 10 from second category (weapons).


    Entering /give Small Health Potion 60 will give items named "Small Health Potion" from all categories; x 60 each.


    Give All command simply adds EVERYTHING to the inventory. All items, weapons and armors. x99 each.


    Lose All command removes EVERYTHING from the inventory. All items, weapons and armors have quantity decreased by 999.


    Spawn Gold command just adds or subtracts party's Gold.


    Noclip command allows to move through impassable objects without needing to hold CTRL button or be on playtest mode.


    Help window now displays more information about commands when typing them.


    And there seems to be a bug. ~

    For example when you type few commands in the console like:


    > 1


    > 2


    > 3


    > 4


    > 5


    and then use [UP] to bring up the previous commands and put a command after that, the console actually overwrites that position.


    So let's press [UP] few times:


    >


    > 5


    > 4


    > 3


    > 2


    And let's stop on the second one. Now, let's type a command:


    > WUT


    And press enter. Now let's get back the console~


    >


    And press [UP]'s again~


    > WUT


    > 5


    > 4


    > 3


    > WUT


    > 1


    ... Wait What? That's the bug. I have no idea what kind of sorcery is this ~ I was trying and trying to fix that, but despite changes all over the place and many tries ~ the array goes wild every single time. Perhaps I'm overlooking something, but holy balls, I can't figure out why it does that. D:


    Nothing major, but still annoying. =/

    end
     
    Last edited by a moderator: Apr 30, 2016
    #3
  4. Rikifive

    Rikifive Bringer of Happiness Veteran

    Messages:
    1,442
    Likes Received:
    676
    Location:
    Poland
    First Language:
    Polish
    Primarily Uses:
    Other
    def update#Script has been updated!  Current version = 1.2.1 #Changelog# [■] 03.05.2016 | Version 1.2.1# └► you can print hooked object's parameters by pressing [CTRL]# └► added changeable opacity of the object to hook command #DetailsPress [CTRL] when having an object hooked to print its parameters into txt file, to be able to read them later and tweak stuff in scripts!Now you can change the opacity of the hooked object as well! #Screenshots

    [​IMG][​IMG][​IMG]
    end
     
    #4

Share This Page