Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Digital Mosaic Games on Mon 11/04/2011 20:07:39

Title: "Programmers Cheats"
Post by: Digital Mosaic Games on Mon 11/04/2011 20:07:39
Hey AGS-Friends,

I call them "Programmers-Cheats". They help you to test your game quicker. You know the keycombos with which you can teleport to every room or get all Inventoryitems or make walkable areas visible. Usually you delete these pieces of code.
I deleted them for a demo and now I don't know where I got it from! Can someone tell me these lines? :-\

Thanks!
Title: Re: "Programmers Cheats"
Post by: Dualnames on Mon 11/04/2011 20:26:57

function on_key_press(int keycode) { 
  if (keycode == eKeyCtrlS)  Debug(0,0);  // Ctrl-S, give all inventory
  if (keycode == eKeyCtrlV)  Debug(1,0);  // Ctrl-V, version
  if (keycode == eKeyCtrlA)  Debug(2,0);  // Ctrl-A, show walkable areas
  if (keycode == eKeyCtrlX)  Debug(3,0);  // Ctrl-X, teleport to room
  if (keycode == eKeyCtrlW && game.debug_mode) player.PlaceOnWalkableArea(); //Ctrl-W, move to walkable area
}
Title: Re: "Programmers Cheats"
Post by: Digital Mosaic Games on Mon 11/04/2011 20:50:34
Thanks a lot my friend! :)
Title: Re: "Programmers Cheats"
Post by: Ryan Timothy B on Mon 11/04/2011 21:05:44
If you're releasing a demo or game, you'll want to disable debug mode entirely. Go to the General Settings tab and in the Compiler section turn Enable Debug Mode to false. Then it won't matter if you have the debug keycodes, it won't run them anyway.

But it is probably good practice to comment or delete those lines if it's a full release game along with disabling debug mode.