paperlined.org
games > pc > Spelunky > cheating
document updated 15 years ago, on Feb 7, 2009
The GM Debug Mode Enabler can be used to start Spelunky with a debug window open. Then, using Tools>Execute Code, you can make almost unlimited changes. (see source code)

resources
global.money = 9999999
global.plife = 99 remaining health
global.bombs = 99
global.rope = 99
global.flares = 99999
global.arrows = 70
equipment
global.hasJetpack = 1
global.hasGloves = 1 climbing gloves
global.hasMitt = 1 pitcher's mitt
global.hasCape = 1
global.hasJordans = 1 not present in-game, but nonetheless works. An enhanced version of Spring Shoes.
global.hasSpringShoes = 1
global.hasSpikeShoes = 1
global.hasUdjatEye = 1
global.hasAnkh = 1
global.hasCrown = 1 AKA the Hedjet
global.hasStickyBombs = 1
global.hasSpectacles = 1
global.hasCompass = 1
global.hasParachute = 1
global.hasNinjaSuit = 1 present in the v0.99 source, but doesn't seem to do anything
items
with oPlayer1 scrHoldItem("Machete");
with oPlayer1 scrHoldItem("Bow");
with oPlayer1 scrHoldItem("Pistol");
with oPlayer1 scrHoldItem("Shotgun");
with oPlayer1 scrHoldItem("Sceptre");
with oPlayer1 scrHoldItem("Mattock");
with oPlayer1 scrHoldItem("Teleporter");
for (i=0;i<50;i+=1){instance_create(oPlayer1.x,oPlayer1.y,oBomb)} Drop a pile of 50 bombs. It's fun to ignite one bomb in the middle of them, especially on the title screen.
instance_create(oPlayer1.x,oPlayer1.y,oDamsel) Why be nice to one, when you can have a second, and a third, and... ?
levels
room_restart(); regenerate the current level (i.e. level scum, albeit in a game that otherwise prevents it)
also, if you've collected any money/objects, you keep those too, so that is definitely serious cheating
global.currLevel=13; room_goto(rTransition1); jump to the desired (normal) level
stopAllMusic(); global.currLevel=6; global.lake=1; room_goto(rLevel3); jump to the rushing water level, where the Giant Piranha lives
global.currLevel=5; instance_create(oPlayer1.x-8,oPlayer1.y-8,oXMarket); create an entrance to the Black Market
global.currLevel=13; instance_create(oPlayer1.x-8,oPlayer1.y-8,oXGold); create an entrance to the City of Gold
for other levels, see more here
shortcuts
global.tunnel1=0; global.tunnel2=0; open up all three shortcuts
global.tunnel1=300001; global.tunnel2=0; open up the first two shortcuts
global.tunnel1=0; global.tunnel2=200001; open up the first shortcut
savestates
game_save("savefile")
game_load("savefile")
other (useful for cheating)
instance_create(oPlayer1.x+4,oPlayer1.y-8,oPushBlock) create a pushblock just to the right of you
instance_create(oPlayer1.x-20,oPlayer1.y-8,oPushBlock) create a pushblock just to the left of you
global.isDamsel = 1 sex change operation
room_speed = 15 make this level play at half-speed (which makes it significantly easier)
global.ghostExists = 1; with oGhost {instance_destroy()}; prevent the ghost from appearing + kill any Ghost that may have spawned
instance_activate_object(oDamsel); obj=instance_nearest(oPlayer1.x,oPlayer1.y,oDamsel); global.hasCompass=1;global.exitX=obj.x;global.exitY=obj.y; make the compass point to the Damsel (or any other object)
other (useful for exploring)
tile_layer_hide(3) hide all of the "extra grass" on lush levels, and other "extra bits" hanging off the edges of the floor


To give yourself everything, copy-n-paste these lines (there's a maximum limit to line length, that's why there's more than one line):

global.hasJetpack=1;global.hasGloves=1;global.hasCape=1;global.hasJordans=1;global.hasSpringShoes=1;global.hasSpikeShoes=1;global.hasUdjatEye=1;global.hasAnkh=1;global.hasCrown=1;global.hasStickyBombs=1;global.hasSpectacles=1;global.hasCompass=1;
global.hasParachute=1;global.money=9999999;global.plife=99;global.bombs=99;global.rope=99;global.flares=99999;
Alternatively, you can put these inside a file and run them with execute_file("filename").



If you use debug mode frequently, it's faster if you make a copy of the game .exe after Debug Mode Enabler has launched the game. All the GM Debug Mode Enabler does is "temporarily" modify the .exe to enable debug mode, and then restore it when you exit the game. This permanently-modified version of the .exe will always start in debug mode, without having to use the Debug Mode Enabler.


Another way to save time is to use this AutoHotkey script. It allows you to use all debug-mode functionality from the main game window itself, which saves a lot of clicking.