Jump to content

Recommended Posts

RK5 Debug Console

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

Version: 1.2.1

 

DKjNHO2.gif
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
 
uN42O57.gif
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
 
qNtvtcn.gif
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
 
tfN3Jnq.gif
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
 
sAP5wYN.gif
def create_screenshots
# Screenshots

 

 

 

vrenWvp.png

Npysnn2.png

OWS0dql.png

 

 

 

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

 

KpQLo8w.gif


@> 'HOOK' Command!

 

Y6Iky0N.gif


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

hDKZwJa.gif
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. Contact me first.
-=> You ARE allowed to edit this script to your needs.
-=> You ARE NOT allowed to repost or post modified versions of this script without my permission.
-=> You ARE DEFINITELY NOT allowed to claim this script as your own. Just to be clear. ^,^
-=> 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 terms of use, 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
 
iOyXLPo.gif
def put_download_link
download_link = RK5 Debug Console V.1.2.1 by Rikifive.txt +8
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

Share this post


Link to post
Share on other sites

Besides that input method it's pretty short ~ less than 1000 lines is actually pretty short I think? :D

 

Also I fixed a typo (with $game_switches) in script, that I noticed in gifs. Nobody saw a thing. (▀̿Ĺ̯▀̿ Ì¿) :D

Share this post


Link to post
Share on other sites

Initially seems functionally similar to Yanfly's Debug Extension.

However, the additional information provided with the secondary display, and the quick commands are quite promising. Already can see some of it being useful to me over the former. Well done.

Additionally. Taking from Yanfly, because your final code evaluation is capable of crashing, might I suggest a begin, rescue clause?

    begin
      SceneManager.scene.console_eval_string(@string)
      Sound.play_ok
    rescue
      Sound.play_buzzer
    rescue SyntaxError => se
      Sound.play_buzzer
    end

This will prevent, or more precisely, ignore errors brought up by invalid entries, and just process a failed sound notification instead.

Speaking of sound, having an option to disable everything except success/failiure confirmation might appeal to some.

Share this post


Link to post
Share on other sites

What a shame, I didn't even know, that such a script exists! :o =P

 

Why, thank you!

 

*epic gasp* Now that's a pure gold!!! That will save tooooooons of troubles and time!! Thank you!

 

Hah I knew somebody will point this out sooner or later. =P I'll make sounds configurable then.

 

 

 

Now that's all I always needed! When it will be not crashing, then I'll be able to test stuff out all over the place now! =3

That's a shame I have overlooked Yanfly's script though, but well ~ at least I learned so much about strings and arrays as well as using few functions. =3

 

Thank you very much for your suggestion and help!

Share this post


Link to post
Share on other sites

WARNING! There are some heavy gifs in these spoilers. Opening them may cause lags.

A lot of people seems to think that if something is in a spoiler tag, it will not be loaded when the page loads.

Well, it will be loaded, with or without a spoiler tag, it doesn't matter, so opening them or not won't matter either.

 

I have a suggestion regarding these GIFs, btw...

I guess, I am not the only one who thinks that long (really, long ones) GIFs for instructions/explanations/demonstrations are pure annoyance to watch.

There is no way to pause them, there is no way to jump to a specific time, the only thing the watcher can do is to re-watch all of it until it finally reaches the point which we wanted to see again.

A video is much better to show these things.

It's just a suggestion and a random rant about long GIFs from me. :P

 

Anyway, the script seems cool! Although, you should probably shorten some method names. I mean, at least that very long one. :D

There is really no point in adding 'currently_available' in that very, very long method name, 'show_commands' is perfectly fine. Unless you already got a method named like that, in which case it might be better to use the longer name for the non-usable or rarely used method (in the console) and keep the shorter name for the commonly used method.

 

NeonBlack/CP has a debug console script as well similar to this one, at least judging by the screenshots, never used it thou, so no idea about the functional differences between his and yours.

But this one certainly seems promising. Might just save me some time debugging, especially for sprite positioning in menus. Gonna try it out the next time I make a menu/graphical code for sure.

Share this post


Link to post
Share on other sites

I quite liked the gifs. Lol. But that's just me.
Not having a capture card, I'm always stuck using fraps, converting it in WMM, and uploading it. (Trust me, this is not easy when you live in a town where the entire internet is funneled through microwave towers. x.=.x) Seems a much more elegant solution, considering I should be able to do the same with gyazo.

 

if I weren't so busy with my own stuff, I'd love to poke around Yan's, Neon's, and your code just to see if it's possible to make a single optimized console entry system that does everything, in one spot.

Edited by BLACK WYVERN

Share this post


Link to post
Share on other sites

 @Cookie  Thank you! :D And thank you for giving a love! xD ~ Actually I was thinking about something like this, just of curiosity, but I'm not sure how I can achieve that. =P
 
 @Sixth  Since they don't run before opening a spoiler, I assumed that they're less resource-consuming until then. Thanks for clarifying that, I'll try to change stuff later, though I'm not sure about videos, since I'm not using YT that much.
 
I'm not sure if I understood. There's no such a method in script. There's even no 'currently_available' phrase find-able at all. Do you mean the one in thread? =P
 
Seriously there are so many of them? xD I think I should have check the internets before doing anything. =P
Anyway, thank you for your opinions and suggestions! =3
 
 @BLACK WYVERN  I also like gifs, because you can show more using one spot and keep it pretty simple, but Sixth is right - too long gifs can be bad. The first one is pretty short, so I guess it'll be fine there, but for the rest - I'll try to replace them by more meaningful presentations.

 

Let's make a '9999 in 1 Console Script'. ( ͡° ͜ʖ ͡°) (reference to NES cartridges)

JK! ^^

Share this post


Link to post
Share on other sites

Ohh, I thought that is a real usable method for the console. :D

 

Now that I look on the structure of your post, those are just sections noted in it as "defined methods" just for the lulz, right? Good one! :D

Share this post


Link to post
Share on other sites

 @Sixth  Yup! These are just as a kind of a decoration, that most likely would crash the game anyway. :D

 

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
end

Share this post


Link to post
Share on other sites

Oh gods that hook function.

 

Had to add a 'Graphics.transition(0)' to line 752 to get it (the console itself) compatible with my Chrono Menu system. But otherwise damn sexy.

Edited by BLACK WYVERN

Share this post


Link to post
Share on other sites

Hope it is useful! ^^ (For me and my menus it will definitely be =3)

 

Were there any issues there? Is that something I should be interested in? I tried to not touch many things in the base scripts to avoid any potential incompatibilities - That's why almost everything is handled by the window. I'm curious what was happening there. =P

~ Thank you!

Share this post


Link to post
Share on other sites

Think I found a bit of a bug. Whenever I use the /tp command, if either the map_id or either coodinate has the number 1 anywhere in it (be it map 1, x of 1, or y of 21), it boots me to the title. :/

 

Also, if I could make a suggestion for a feature, it would be really nifty to see a /give command, something like:

 

/give a,b,c

 

a being either armor, item, of weapon

b being the id

c being amount

 

Edit: Another interesting idea could be being able to enable the noclip feature (holding ctrl in play-test mode) through something like /noclip true  and  /noclip false. This would mainly be useful for play-testers who don't have Ace, although I don't know how difficult something like this would be to implement. 

Edited by Vis_Mage

Share this post


Link to post
Share on other sites

Hope it is useful! ^^ (For me any my menus it will definitely be =3)

 

Were there any issues there? Is that something I should be interested in? I tried to not touch many things in the base scripts to avoid any potential incompatibilities - That's why almost everything is handled by the window. I'm curious what was happening there. =P

~ Thank you!

 

It's probably not something you need to worry about. The only reason I had to, is because my menu system stacks two scenes on top of each other, and I use Graphics.freeze to make a smooth transition between items and moving to the selected scene. But, the frozen graphic appears above the console, and rather than looking to find a z value, I just called the transition. Lol.

 

Think I found a bit of a bug. Whenever I use the /tp command, if either the map_id or either coodinate has the number 1 anywhere in it (be it map 1, x of 1, or y of 21), it boots me to the title. :/

 

Also, if I could make a suggestion for a feature, it would be really nifty to see a /give command, something like:

 

/give a,b,c

 

a being either armor, item, of weapon

b being the id

c being amount

 

Edit: Another interesting idea could be being able to enable the noclip feature (holding ctrl in play-test mode) through something like /noclip true  and  /noclip false. This would mainly be useful for play-testers who don't have Ace, although I don't know how difficult something like this would be to implement. 

VX and VX Ace do not use the same code base. IIRC VX is RGSS2, whereas Ace is RGSS3. They're almost completely incompatible with each other.

Share this post


Link to post
Share on other sites

My bad, I guess I didn't word that too well. I was referring to giving play testers the game to test, when they themselves don't have RPG maker, and thus can't access play test.

Share this post


Link to post
Share on other sites
# ** Main ==
$TEST = true
rgss_main { SceneManager.run }

Done. Test mode in the .EXE file. Don't need anything elaborate. If you have other scripts (Say Mog's Debug view that grant all items and whatnot in test mode, this'll kick those in too. [should anyways.])

Share this post


Link to post
Share on other sites

 @BLACK WYVERN  I see, okay then!
 
 @Vis_Mage  That's odd. I sincerely have no idea what's wrong there - I'm suspecting an incompatibility issue. I can't recreate this as it works for me. This command is almost like the one, that can be set in events. What I can do, is to fully 'recreate' the event command to the console one, so it would work absolutely like the one in events.
~ Does anybody else have that issue or know something more about this?
 
As for suggestion - These totally should be doable! I'm working on these right now! Thanks for suggesting!  (=

Share this post


Link to post
Share on other sites

Okay, stuff is done! ^^

 

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

Share this post


Link to post
Share on other sites

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
 
#Details
Press [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


vrenWvp.png
Npysnn2.png
OWS0dql.png


end

Share this post


Link to post
Share on other sites

Indeed! Now I don't have to create temporary events to check something. =P

Thanks ~ I hope everything will be working for you.

 

 

 

If anybody would have troubles with the Input System, for example caused by having another one already, then I can always port the script to the one you're using~

Share this post


Link to post
Share on other sites

Every game should have a console!

No way! Every game should remove their consoles before they get published!

It encourages cheating, which really should not be the point of playing games, especially not in single player games.

 

Or at the very least, console commands should be disabled in the published game, so that they can't be used at all.

Instead, the console should pop out some funny phrases when the player tries to enter something in it. Actually, this is a good idea, great to annoy those wannabe cheating players. :D

Share this post


Link to post
Share on other sites

Yes, that's true they should be removed in the published version, because cheats will ruin everything. =P

 

You could always enable the console in new game+ so that, players could 'break' the game after finishing it. ^^

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×