1) muParserSSE doesn't have support for string vars. Are you planning to use another?
I won't be using the variable support from either MathPresso or muParserSSE, whichever one will be used. I'm parsing them myself.
2) what's the "tn" and "id" prefixes? "e" should be expression right?
That will be explained in time. "tn" is table-int (by coordinates) as opposed to "ts" table-string (by col-row name), id is identifiers (I could theoretically want to compare one EA with another EA, etc.). "e" is expression for the expression parser.
3) I like allowing using the evaluator in assignments. I'd forgotten that it might be useful to use a expression to access parts of tables for other assignments etc.
Yes you can.
4) What's the reason you put in Types in the Eval function?
I am forcing the modder to give explicit types for everything. If a type mismatch occurs, TobEx will bail out and not assign anything. If bDebugVerbose is active, you will swamp your TobEx console with warnings/errors.
For the arguments, just consider TRIGGERS.IDS and ACTION.IDS, the information of the type of argument expected is already there, given the 3rd position parameter.
No, the argument is given by the Trigger construction. Assign will always expect an int in the 3rd position. That doesn't tell you whether I should put a int into the position or a string into it.
5) it seems that assignments got a whole lot more complicated, when you start allowing the use of variables inside them.
Not really, variables are replaced first. As stated above, I will parse them myself rather than rely on the math expression library.
And the Type 2nd argument, it's like a cast right?
See above. I am forcing modders to explicitly indicate the type to return (Assign)/replace (Eval). If you tried to Assign("v[GLOBAL.test]", STR, 1), you will just get an error in you have verbose on, and if not, TobEx will bail out without assigning anything.
As long as there should be a way to set them equal to more permanent variables (LOCALS, GLOBALS, MYAREA, etc.) before they are cleared, I think this is just fine.
Yes, always.
May i suggest another scheme for finding the data to assign? Tell me i'm dumb if it won't work.
[HPCLASS.0.1] for table (starts with [ )
G.data for a global named data (starts with G.)
L.data for a local named data (starts with L.)
C.LEVEL (for stats; character level, character strength etc).
Expression can use the string delimiter that weidu ends up choosing for the transformation, imagine it's < and >:
<#5+5>
(all of these strings)
I'd like this stuff to be easy to read and easy to distinguish. If someone has better suggestions, please post them!
I would argue that my current system is easy. I think your method is harder because the syntax is different for each different statement. Plus, you are making my life harder coding the parser to check for multiple syntaxes. Hence, the Statement syntax will always be of the form "<type>[<a>.<b>.<c>....]".
I hope you use that as a comment, not as synthax
Yes, it is a comment.
Assign("e[2]", INT, 4)
NextTriggerObject("Imoen")
Eval("#4",INT,1)
Global("foo", "LOCALS", -33)
Global() is evaluated on "Imoen".
Assign("e[2]", INT, 4)
Eval("#4",INT,1)
NextTriggerObject("Imoen")
Global("foo", "LOCALS", -33)
foo is compared with 2.
Assign("e[3]", INT, 4)
Eval("#4",INT,1)
Global("foo", "LOCALS", -33)
Hmm, epic fail if foo is compared to 2. Where's the 2? foo is compared with 3.
Oh, right. If Assign() are valid for the entire block, while Eval() must be repeated for every trigger, I can see how Foo(<#1>,5) -> Eval("#5",INT,1) Foo(-33,5) would be a time saver.
You can compound this if you want by:
Foo(Eval("<v[GLOBAL.test],INT,1> + 6",INT,1), 5) -> Assign("v[GLOBAL.test],INT,1) Eval("#1 + 6",INT,1) Foo (-33,5)
Is there any script action that saves points in globals/locals?
If there is, a Assign for points X_INT and Y_INT would be nice, to do some geometry.
I'm specifically thinking that if it can get a holdoff the location of the center of the "cloud" spells, can save that in a global somewhere and get my character location and do some simple geometry with those variables, i can avoid/flee the clouds ratio. Maybe something for spell revisions.
As I said, let's fix up the trigger implementation before thinking about actions. In fact, when thinking about this, the action implementations should be exactly the same, just you get more options. Essentially, Eval() can specified to replace the pt.x or pt.y in addition to the three ints.
And here are the trigger constructions:
0x411A Assign(S:Statement*,I:Type*ArgType,I:Local*)
0x411B Eval(S:Expression*,I:Type*ArgType,I;Loc*)
Edited by Ascension64, 02 May 2012 - 01:00 AM.