Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: SSH on Thu 26/10/2006 13:52:19

Title: SUGGESTION: Debug constants/variables
Post by: SSH on Thu 26/10/2006 13:52:19
It would be nice if the following constants were defined at compile time:

AGS_SCRIPT_NAME  holds "Global" in global script, quoted module name in module script and "Room NNN" in room script.
AGS_LINE_NUMBER holds the current line number

if it would be easier for these to be static variables, then sobeit. Also, I'd love if you had some runtime access to the calling stack (pehaps in debug mode only):

String Game.Stack

Title: Re: SUGGESTION: Debug constants/variables
Post by: Pumaman on Thu 26/10/2006 19:47:44
These seem like reasonable requests -- would anyone else find them useful?
Title: Re: SUGGESTION: Debug constants/variables
Post by: monkey0506 on Thu 26/10/2006 19:53:14
Of course we would. I. I would. :o
Title: Re: SUGGESTION: Debug constants/variables
Post by: Kweepa on Thu 26/10/2006 21:02:27
Yes, sounds good!
Useful for reporting problems from modules.
Title: Re: SUGGESTION: Debug constants/variables
Post by: on Thu 26/10/2006 23:43:47
Sounds like a "pro" feature (mostly used for mpdules, as steve said), but I see how it could also be useful for testing larger, more elaborate games more comfortably. put them in, by all means!

the stack would hold a list of all code processed? to borrow an idea from inform (text adventure creator)- could you then save your stack and rerun a list of commands, so that you could acutally go through a game up to a certain point, even if major things have been changed? that would be a nice thing, since you cannot load saved games after such changes, which makes playtesting such a meticulous taskÃ,  :P
Title: Re: SUGGESTION: Debug constants/variables
Post by: SSH on Fri 27/10/2006 08:40:23
A stack holds a list off all the functions withing functions that have been called to get to wherever you are in the code just now. You'll see a stack dump after certain AGS runtime errors already, so its really just a matter of making that info available to the game itself...  it wouldn't really be suitable for a saved game.

I was thinking of using one or other of the features for the MultiResponse module, so that you could have a count for responses based solely on where the function was called from. Some people seem to prefer using the module like this, it seems. (It makes autonumbering of speech easier, for a start).
Title: Re: SUGGESTION: Debug constants/variables
Post by: Kweepa on Mon 30/10/2006 03:03:15
Quote from: Ghost on Thu 26/10/2006 23:43:47
could you then save your stack and rerun a list of commands, so that you could acutally go through a game up to a certain point, even if major things have been changed? that would be a nice thing, since you cannot load saved games after such changes, which makes playtesting such a meticulous taskÃ,  :P

Sounds like a job for a script module + template! Some code could record mouse clicks and keypresses, and the frame they occurred (saving to a file every time) and pass them on to the game. To replay, set a variable and the game replays from the file. monkey_05_06? :=
Title: Re: SUGGESTION: Debug constants/variables
Post by: Radiant on Mon 30/10/2006 09:29:16
Quote from: Pumaman on Thu 26/10/2006 19:47:44
These seem like reasonable requests -- would anyone else find them useful?

Yes.
Title: Re: SUGGESTION: Debug constants/variables
Post by: gypsysnail on Mon 30/10/2006 11:30:40
yes I would too :) good idea
Title: Re: SUGGESTION: Debug constants/variables
Post by: strazer on Thu 14/12/2006 12:19:00
Tracker'd: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=594