ZoriaRPG
11-02-2018, 08:35 AM
Some of you are probably aware, that since I've added the ability to type into ZScript, I've made a few text parsing modules.
Recently, I've given some thought to making a more portable version of my complex debug shell (https://pastebin.com/pi77rptH).
The one that I use is rather tightly woven into other things, and it isn't very easy for most people todeduce how it works. Therefore, I started again clean, writing something designed to run a single instruction in a shell, rather than a macro script.
This is now, tested and working. Press F7 to open the debug shell.
Demo Quest (http://timelord.insomnia247.nl/zc/zc_dev/testdebugshell_1.14.2.qst) | Docs (https://pastebin.com/1G2dGSwn)
FFC and Additional Visual and Audio Commands
https://youtu.be/gIHVy6StR7w
In version 1.11, I added the ability to enqueue a series of commands at one time.
Press the down arrow key to enqueue an instruction!
Enqueued Commands
https://youtu.be/T6UecY8XE9c
Basic Commands
https://youtu.be/-0iSkymXrmk
Visual Commands
https://youtu.be/1G_hE1-W5Rc
Sequence Scripts
You can store a sequernce of instructions as a sequence script, that you can run at any time by invoking RunSequence,id.
https://www.youtube.com/watch?v=H-rLwwPq1oE
You may screate up to ten sequence scripts, that function like macros, and you can save them whenj you save the quest, so that you can easily design test macros (like shell/batch scripts).
If anyone is curious on how to do new, insane things, have a look at this beastie! ;)
I designed the code in the link (above) so that when you press the F7 key (you can change this in the CFG settings), ZC opens a shell window. From there, you may type in any of the following commands:
Supported Instructions (https://www.armageddongames.net/showthread.php?98277-ZShell-A-Live-debugging-and-cheat-shell-for-ZC-for-Necromancer-(2-556)&p=918714&viewfull=1#post918714)
Syntax and Usage (https://www.armageddongames.net/showthread.php?98277-ZShell-A-Live-debugging-and-cheat-shell-for-ZC-for-Necromancer-(2-556)&p=918715&viewfull=1#post918715)
Tokens terminate by either a comma, or reaching the end of the string (NULL character).
If anyone is interested in using this, or if any of you are curious and have questions, please let me know. I may expand it to support multiple instructions and macros in the future, if there is any demand for that.
It also does not yet pause the action in ZC. I plan to add some ZScript functions to suspend all of ZC, except for scripts, just as the combo types Freeze All, and Freeze All (except FFCs), as Game->Freeze(int type, bool state), at some future point, so that scripts needn't use messy combo modification (or steal FFCs), in order to pause the game action.
The code for this should be both highly legible, and easy to modify. Adding instructions is relatively simple and straightforward, although you do need to add them in a few places--similar to adding ZASM and ZScript in the ZC Source files pertaining to ZScript (ffscript):
To Expand the Instructions
1. Define a case value after:
define LINKITEM = 12; //item, (BOOL), on / off
2. In the switch statement inside of int num_instruction_params(int instr),
add a case value for the new instruction, and return the number of params that it uses.
3. Determine the actual in-use instruction identifier, and create a case set flow/entry for its characters, in int match_instruction(int token), returning the new case value on a match.
3. Determine the actual in-use instruction identifier, and create a case set flow/entry for its characters, in int match_instruction(int token), returning the new case value on a match.
4. In the switch statement inside of void execute(), add the new case label, and give it instructions to call a normal ZScript function.
5. Args and Stack Size
The present stack supports up to two args, so, if you need more, you will need to modify the value of MAX_ARGS. The size of the stack is automatically determined and generated on compilation.
Script Syntax and Structure
This script makes use of a few new syntax features in ZScript, that require the latest Necromancer alpha builds. These include both typedef instructions, and script-local variables, arrays, and constants.
The details on these new mechanical ZScript components are a bit lengthy, so, for the sake of those shy of <tl;dr>, I'll put it all in a spoiler tag...
-=SPOILER=-
Recently, I've given some thought to making a more portable version of my complex debug shell (https://pastebin.com/pi77rptH).
The one that I use is rather tightly woven into other things, and it isn't very easy for most people todeduce how it works. Therefore, I started again clean, writing something designed to run a single instruction in a shell, rather than a macro script.
This is now, tested and working. Press F7 to open the debug shell.
Demo Quest (http://timelord.insomnia247.nl/zc/zc_dev/testdebugshell_1.14.2.qst) | Docs (https://pastebin.com/1G2dGSwn)
FFC and Additional Visual and Audio Commands
https://youtu.be/gIHVy6StR7w
In version 1.11, I added the ability to enqueue a series of commands at one time.
Press the down arrow key to enqueue an instruction!
Enqueued Commands
https://youtu.be/T6UecY8XE9c
Basic Commands
https://youtu.be/-0iSkymXrmk
Visual Commands
https://youtu.be/1G_hE1-W5Rc
Sequence Scripts
You can store a sequernce of instructions as a sequence script, that you can run at any time by invoking RunSequence,id.
https://www.youtube.com/watch?v=H-rLwwPq1oE
You may screate up to ten sequence scripts, that function like macros, and you can save them whenj you save the quest, so that you can easily design test macros (like shell/batch scripts).
If anyone is curious on how to do new, insane things, have a look at this beastie! ;)
I designed the code in the link (above) so that when you press the F7 key (you can change this in the CFG settings), ZC opens a shell window. From there, you may type in any of the following commands:
Supported Instructions (https://www.armageddongames.net/showthread.php?98277-ZShell-A-Live-debugging-and-cheat-shell-for-ZC-for-Necromancer-(2-556)&p=918714&viewfull=1#post918714)
Syntax and Usage (https://www.armageddongames.net/showthread.php?98277-ZShell-A-Live-debugging-and-cheat-shell-for-ZC-for-Necromancer-(2-556)&p=918715&viewfull=1#post918715)
Tokens terminate by either a comma, or reaching the end of the string (NULL character).
If anyone is interested in using this, or if any of you are curious and have questions, please let me know. I may expand it to support multiple instructions and macros in the future, if there is any demand for that.
It also does not yet pause the action in ZC. I plan to add some ZScript functions to suspend all of ZC, except for scripts, just as the combo types Freeze All, and Freeze All (except FFCs), as Game->Freeze(int type, bool state), at some future point, so that scripts needn't use messy combo modification (or steal FFCs), in order to pause the game action.
The code for this should be both highly legible, and easy to modify. Adding instructions is relatively simple and straightforward, although you do need to add them in a few places--similar to adding ZASM and ZScript in the ZC Source files pertaining to ZScript (ffscript):
To Expand the Instructions
1. Define a case value after:
define LINKITEM = 12; //item, (BOOL), on / off
2. In the switch statement inside of int num_instruction_params(int instr),
add a case value for the new instruction, and return the number of params that it uses.
3. Determine the actual in-use instruction identifier, and create a case set flow/entry for its characters, in int match_instruction(int token), returning the new case value on a match.
3. Determine the actual in-use instruction identifier, and create a case set flow/entry for its characters, in int match_instruction(int token), returning the new case value on a match.
4. In the switch statement inside of void execute(), add the new case label, and give it instructions to call a normal ZScript function.
5. Args and Stack Size
The present stack supports up to two args, so, if you need more, you will need to modify the value of MAX_ARGS. The size of the stack is automatically determined and generated on compilation.
Script Syntax and Structure
This script makes use of a few new syntax features in ZScript, that require the latest Necromancer alpha builds. These include both typedef instructions, and script-local variables, arrays, and constants.
The details on these new mechanical ZScript components are a bit lengthy, so, for the sake of those shy of <tl;dr>, I'll put it all in a spoiler tag...
-=SPOILER=-