EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
965 stars 183 forks source link

DynRPG whitelist + easyrpg_raw command #3137

Open jetrotal opened 8 months ago

jetrotal commented 8 months ago

Whitelist selected dynRPG commands, so people can use them without enabling the dynRPG plugin. image


Invoke a command using raw input, similar to how maniacs patch raw work. easyRPG raw syntax:

@easyrpg_raw 10110, "test", [1,2,3,4,V1],1 
//Message box
@easyrpg_raw $ShowMessage, T1, [1,2,3,4,V1],1
//Also Message box
Ghabry commented 8 months ago

We need to parse deeper

grafik

Ghabry commented 8 months ago

The crossover nobody asked for

grafik

Ghabry commented 8 months ago

btw that "frame pushing" looks like a safe solution for this Call Command thing of Maniacs. Is this event command hard to implement?

jetrotal commented 8 months ago

btw that "frame pushing" looks like a safe solution for this Call Command thing of Maniacs. Is this event command hard to implement?

https://jetrotal.github.io/CSA/#MNC%20|%20Call%20Command image

It's similar but uses an array of variables in sequence for the arguments

Ghabry commented 8 months ago

That PR is kinda the wrong location for this, so one final question before we move this maybe somewhere else:

I think that CSA example needs more permutations and a 3rd argument to figure out how this works. E.g.

@cmd 1, "", .args v[2], 3 gives parameters: 0, 1, 2, 3. How is v[2] encoded? o_O

jetrotal commented 8 months ago

@Ghabry I also set up a collection of useful constants, that came from destinyScript. Those could be useful for parsing common values: image

made in two formats, the second one is a Map, I guess that's the one that would work with current code: https://www.diffchecker.com/YAS7V0Mi/

copy the text at the bottom of the page.

jetrotal commented 8 months ago

image image

jetrotal commented 8 months ago

image

jetrotal commented 8 months ago

Hey guys, I removed a lot of repeated code, and included some functions we already have in Utils.

I think this is good enough for a working raw command interpreter. I wanted to break it into a multi-line command interpreter, but Ghabry suggested writing in the future an eval command for that (maybe easyrpg_eval "prefix", "string" ?)

Other things that may be important for this in the future is setting up the "constants.h" content as auto-generated entries from liblcf.


As soon as this this pr is aproved, I can rework #3124 as you guys asked.

jetrotal commented 8 months ago

Ok, multi-line is done. I had to add something similar to the "," on the part of the code that parses text to arg[n]: It parses ';' as ',' too with an extra input in case of being "easyrpg_raw". I hope that's not too invasive...

image

Ghabry commented 7 months ago

I talked with Jetrotal: I will help getting this in when I'm done with my remaining issues for 0.8.1 milestone. Likely in one or two weeks.

My current plan is to split it into two PRs. One for the DynRPG refactor, one for easyrpg_raw. Makes reviewing this a bit easier :)

Ghabry commented 7 months ago

Would you mind when I swap the argument order to:

$ControlVars "A", 1, 0, 3, 4, 6, 8

Makes "indent" the 2nd parameter and the numeric list everything from 3rd to the end. Makes the parsing simpler and is not ambigious.

jetrotal commented 7 months ago

Would you mind when I swap the argument order to:

$ControlVars "A", 1, 0, 3, 4, 6, 8

Makes "indent" the 2nd parameter and the numeric list everything from 3rd to the end. Makes the parsing simpler and is not ambigious.

hm... I made it this way to let people ignore the indent parameter, and read each type of parameter by group

jetrotal commented 7 months ago

@Ghabry asked for me to post the event2string command I was working on, here it is: https://gist.github.com/jetrotal/e8b35118b94ddbe8ee10885e220f706c image