SUGGESTION: Debug constants/variables

Started by SSH, Thu 26/10/2006 13:52:19

Previous topic - Next topic

SSH

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

12

Pumaman

These seem like reasonable requests -- would anyone else find them useful?

monkey0506


Kweepa

Yes, sounds good!
Useful for reporting problems from modules.
Still waiting for Purity of the Surf II

Ghost

#4
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

SSH

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).
12

Kweepa

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? :=
Still waiting for Purity of the Surf II

Radiant

Quote from: Pumaman on Thu 26/10/2006 19:47:44
These seem like reasonable requests -- would anyone else find them useful?

Yes.

gypsysnail

Believe in afterlife! It's true in a metamorphical way ;)
Ken & Roberta - my inspiration!! 20 years.
U are what you love doing and passionate about - keep up what you love most.


SMF spam blocked by CleanTalk