[Suggestion] PRPL Console

Started by GoodMorning, February 13, 2017, 09:39:34 PM

Previous topic - Next topic

GoodMorning

PRPL would be significantly easier to learn and use with a console, where we might (attempt to) run commands immediately.

Currently, we need to leave the editor, create a tiny, only-used-once script, surround it in once commands, recompile (potentially resetting something you want to debug), add a Core, apply the script, run until the bug comes up...

With a console, we could potentially type "X Y 3 0 GetUnitsInRange" to find the UID of the Emitter, or quickly run "512 'Interface.prpl' 'Target' GetScriptVar" to find out what a script is doing.

This would also greatly simplify the learning of PRPL (faster, more specific feedback on their scripts, easily seen effects), and aid people who want to use it only in setting up a map (for example, circles drawn with SetLandBulk).

The output of this could go in the trace, along with (perhaps inevitable) compilation errors for the mini-script typed.

This would need to call upon the PRPL compiling code with user-input strings, to run exactly once. The console would require its own stack, but many commands would not need to be implemented (anything referring to "Self" would need to raise an error in the script.)
A narrative is a lightly-marked path to another reality.

Nicant

CW4 hype!!

kajacx

Great idea, my scripts usually start with 30 lines of commented code because I was testing some functions. The question is what to do with the Self command (probably compilator error or compilation warning and push -1 to stack) or how to handle variables.

Actually you could just have a special variable pool, clearable with ClearLocals, that would work (I think).

Also it would be usefull to see unit's UID when you mouse over it, so that you can run commands on it directly from this console.
Why do work yourself, when you can write a program that will do the work for you.

GoodMorning

The UID-on-mouseover has an independent suggestion thread already, and PRPL Cores now show UID when selected in-editor. See here for my workaround.

I was thinking of something similar w.r.t. variables, given that it's just another stack to work on. Also in map setup, it would be useful for Cores which need to point to specific other Cores and for setting up globals.
A narrative is a lightly-marked path to another reality.