With 3.2, there is the Calculated Property that can take expressions Math.sqrt (variable). Is there an equivalent expression for bit-wise operators? For example, Bit.rightShift(n, number). I could use these tools to create masks and use status strings to store piece info efficiently.
Flaney,
Pretty much any place in the editor that you can enter a string to be evaluated, including the Dynamic Property->Set Value field, supports Beanshell expressions, enclosed in curly braces: { }
Beanshell syntax is basically Java syntax, with a very few exceptions regarding property definitions as Beanshell is loosely typed. So I suspect you could do simply:
(in the field for ‘Set Value Directly’)
I have a CV unit that stacks squadron units under it. The CV keeps data on the number and type of squadrons ‘carried’. This data is used to support CV menu commands regarding the squadrons: unit capacity vs current storage, launch availability, bay occupied, et cetera.
This bookkeeping would require many [DP] and corresponding [Trigger] conditional checks. Using a single StatusData [DP] coupled with a common mask operation reduces the numerous properties required (and especially my typing mistakes with repeated named properties (I am not using the CTRL-ALT- methods).
Granted, players could do these operations manually, but it is complicated and prone to error. The module handles these issues and frees players from necessary bookkeeping.
At first it was not too complicated. But then I added more ‘helpers’ and it soon became programing cumbersome. The masking and bit control simplified this mess.