Remove first character from the value of a Dynamic Property

Hello programmers,

I need (would be nice) to remove the first character from BasicName and write it to another [DP] SimpleName.

$SimpleName$ would be referenced in a [Report Action].

There is a set of units with BasicName = vFrigate (or vCruiser, or v)
I want to use SimpleName = Frigate (or Cruiser, or )

In [DP] SimpleName, tried to use (set value directly) :: {Regex.Replace(BasicName, “v”, “”)} which results in errors (of course).

Could a Regex smarty help format the expression or perhaps know a Vassal way to do this. I’ve exhausted my web-fu tonight.

Thanks!

Flaney

From the top of my head, you may want to look at Calculated Property trait – it, at least in theory, allows to use so-called BeanShell, enabling you to insert Java functions.

I found a fix. Instead of messing with regex and trying to ‘delete’ a portion of the text, I decided to use Property Layer Name to report the unit. I have a layer called Status that updates the piece image depending if it’s damaged or crippled. The nominal layer was without a Name, so I put the piece name I wanted there. In the report property, I referenced $Status_Name$.

Works fine.

flaney