Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

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.

Code:
print "You are in debug\n" if $DEBUG

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

Or you can use this.

Code:
if $DEBUG = true
 then print "debug\n"
else
end



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

Code:
 def command_shutoff
   $scene = nil
end
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.
Code:
#==============================================================================
# ** 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
 

regi

Sponsor

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...
Code:
$scene = nil
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:
Code:
if $DEBUG == true
 then print "debug\n"
else
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top