OK, this one’s getting a bit frustrating.
I’m currently using 3.2 SVN 8224 and I’m having issues with the Calculated Property trait. What I am trying to do is take a value that I have just calculated (NWTotal) and perform an absolute value calculation on it. First I created the NWTotal property and attached the simple expression:
Both of these totals are existing Global Properties at the Module level.
Then I created a second Calculated Property, NWAbsValue, and attached the following expression based on an IF statement:
Mathematically, the expression for TRUE should provide the absolute value of NWTotal (unless I’m just too tired to think).
PROBLEM: When I finish entering all the data for the conditional IF statement, I click on the OK button which returns me to the main Calculated Property trait box. However, none of the IF statement information that I just entered is shown in the expression field no matter how much I expand the size of the trait box. When I select IF again from the menu, hoping that it will bring up the data I just entered, I get a box of empty fields, thereby forcing me to re-enter all of my information again–which does nothing, as it all disappears again when I hit OK.
I tried an experiment just for kicks and it seems that when I enter a simple expression directly into the main CP trait box, it shows up on the screen and stays there–when I click OK and then re-open this trait’s properties, my expression is present. However, when I enter any data for an IF, ALERT, etc., nothing appears in the expression field of the main trait box to show that I have already entered any expression data. This is REALLY confusing when I go from CP to CP, entering expressions to calculate various housekeeping values, as I cannot always remember what I have already set up and what is awaiting configuration.
Q1: Am I totally missing something obvious as to how the Calculated Properties and the Expression Builder work? I don’t think I’m doing anything strange, but I didn’t write the code, so maybe I’m just entering the information in an invalid manner. Also, I have programming experience in C and Java, and I’ve modified several VASSAL modules for my own use, so I think I understand how to write valid expressions. Am I just missing the obvious here?
Q2: Is there some way of posting even a rudimentary set of instructions about how to use the Expression Builder? I have several modules that could greatly benefit from all the awesome work you guys have done, but I’m afraid to try anything given these results with my current project. I could continue with my trial-and-error system, but I feel like I will create more mistakes than I solve and I would lose lots of time backtracking later to fix errors. I’ve already contacted mycenae about helping to proofread the next version of the Developer’s Guide, so I’m willing to help with proofing help screens if that speeds things up a bit.
Anything you could suggest or provide would be of immense help. Thanks for all the great work, folks!