"debug" command

Started by Grayzzur, February 04, 2014, 03:30:09 PM

Previous topic - Next topic

Grayzzur

What does the CRPL command debug do?
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

knucracker

Whoops.  Left that one in the list did I... :)

It peeks at the top of the stack and prints to log.txt the type and value.  It actually prints the int, float, and string versions of the item on the top of the stack.  Note that it only peeks at the top of the stack, it doesn't pop the item.  And by log.txt, I mean the game's log file ( c:\Users\YOURUSER\AppData\Roaming\CreeperWorld3\log.txt)

Grayzzur

Interesting. Should we document it or remove references to it?

Next question... push?
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker

knucracker

It's mostly useless to map makers I think, so it could be removed.

PUSH is the internal keyword for when you put a constant in the language.
So
1 2 add

becomes

PUSH 1
PUSH 2
ADD


It doesn't need to be in the list either.  It was my mistake for including it in the source list that ended up on the wiki.

Grayzzur

Thanks for the explanation.

I pulled them from the wiki.
"Fate. It protects fools, little children, and ships named 'Enterprise.'" -William T. Riker