Identification for DEBUGing - Short Script Thread

***************Short Script Thread******************

I actually got bored, and came up with a simple DEBUGGING script to let all the insecure people know they are in the right mode.

Script Spoiler
print "You are in debug\n" if $DEBUG
Expand to see the code.


Not much to comment on, other then if it works or not.

Or you can use this.

Choice 2 SCRIPT Spoiler
if $DEBUG = true
then print "debug\n"
else
end
Expand to see the code.




Edit: Dec 23, 2007 at 8:20 PM EST

Shutdown on Startup Spoiler
def command_shutoff
   $scene = nil
end
Expand to see the code.

Just put command_shutoff anywhere in a automatic script, and the game shuts down ^_^ tested.

next script: need ideas =.=

edit: heres another way to null your game, and it is a bitch to find.
main Spoiler
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
#  After defining each class, actual processing begins here.
#==============================================================================

begin
  # Prepare for transition
  Graphics.freeze
  # Make scene object (title screen)
  $scene = Scene_Title.new
  # Call main method as long as $scene is effective
  while $scene != nil
#    $scene.main
  end
  # Fade out
  Graphics.transition(20)
rescue Errno::ENOENT
  # Supplement Errno::ENOENT exception
  # If unable to open file, display message and end
  filename = $!.message.sub("No such file or directory - ", "")
  print("Unable to find file #{filename}.")
end
Expand to see the code.
First "one-line script" I've ever seen  ;D Although, honestly, what is the point of this? You can just hold "Ctrl" and see if you walk through walls or not, if you can you're in debug mode  :P
That involves wasting time. Besides one line scripts are fun, and plentiful. For example...
$scene = nil
Expand to see the code.

Put that in the boot-up area for the game, and the game will never run.

When you think about it, most things are affected by 1 line.
@shiroun: you made a little mistake:
it's not = it's ==
so here is the code without any mistakes:
if $DEBUG == true
then print "debug\n"
else
end
Expand to see the code.
$scene = nil is the same as exit

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=35703