Knuckle Cracker

Creeper World 3 => The Coder's Corner => Topic started by: Grayzzur on February 04, 2014, 03:30:09 PM

Title: "debug" command
Post by: Grayzzur on February 04, 2014, 03:30:09 PM
What does the CRPL command debug do?
Title: Re: "debug" command
Post by: knucracker on February 04, 2014, 03:47:48 PM
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)
Title: Re: "debug" command
Post by: Grayzzur on February 04, 2014, 08:06:49 PM
Interesting. Should we document it or remove references to it?

Next question... push?
Title: Re: "debug" command
Post by: knucracker on February 04, 2014, 08:18:50 PM
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.
Title: Re: "debug" command
Post by: Grayzzur on February 04, 2014, 08:27:23 PM
Thanks for the explanation.

I pulled them from the wiki.