PRPL Console with stack and variable visualizer

Started by kajacx, August 28, 2017, 02:15:01 PM

Previous topic - Next topic

kajacx

I have created a basic console that can accept PRPL commands and show stack and local variables. Here is how it looks:
PRPL console
[close]
(The image quality is crap, the text isn't so blury in-game)

So, what can this thing do again? You can type almost any PRPL commands separated by space, and they will get executed in order. After that, you will see immideate change in the stack and variables. This is how it changes once you execute the "add ->z" commands in the screenshot:
Stack and variables changed after execution
[close]

What commands can I use?
Basicly any command except flow control (if, while, loop, etc...), ClearLocal or anything to do with global variables. Other than that, all commands are avaliable, however advanced syntax notation like warp notation or list indexer is not implemented yet. Also you can call 3 pre-defined user functions "@customFunctionA", "@customFunctionB" and "@customFunctionC" (see if you can guess what they do without looking in the source code by calling them from the console).

How do I make it work?
Just download the attached save.pf1 file and put it in a folder inside your /editor subfolder. (If you don't know how to do that, PM me and I'll replace this with link to how to do that). After that, open the map in Mission Editor and hit "Compile" if the window isn't shown.
After that, click into the input field to focus on in, the "Command:" text should change to "Command (active):". You can then type into the command window. Press "Enter" or hit the "Execute" button to then execute your commands.

Beware that different keyboard layout have different binding for keys such as "?", "!", "<" or ">". If you want to use a non-EN keyboard layout, PM me and I can add your layout to the code.
Also key shortcuts are pretty annoying, especially slowing the game (bound to "-" which is used for variable access), because the key and click detection works only 50% of the time when the game is running at 50% speed. I recommend unbinding all shortcuts, you can always reset to default later.

But wait, I don't know anything about PRPL
Well, don't worry. Next I'll be adding a side-window with selecton of all commands with the ability to view input, output, description and code examples of each command. I'll even add a "Tutorial" category where will be the basic commands that a new PRPL programmer should learn first.
Why do work yourself, when you can write a program that will do the work for you.

GoodMorning

A narrative is a lightly-marked path to another reality.

kajacx

Quote from: GoodMorning on August 28, 2017, 07:12:25 PM
While you're there...

Wiki  :)

Yes, improving the wiki significantly will be be a pre-requisite, because I will of course get the data from the wiki by some script or something.
Why do work yourself, when you can write a program that will do the work for you.

GoodMorning

Oh, regarding the read/write irritation, I suggest aliasing with the semicolon key - few scripts need it, but I don't think it's bound to any shortcut. "P" is also annoyig, but there's not much to be done about that.
A narrative is a lightly-marked path to another reality.