Overriding a Dynamic Property

Okay, working on a new idea for my Federation & Empire module:

Most ships in F&E can be ‘crippled’ where they have reduced capabilities. The module keeps track of many of these capabilities for reporting in the inventory or stack viewer. So, a Klingon D6P has a Dynamic property for Attack Factor that reports ‘5’ normally, and ‘2’ when crippled, and an EW dynamic property that reports ‘2’ normally and ‘0’ when crippled.

However, the D5P isn’t actually able to use its full Attack and EW at the same time. So what I want is a way for it to have an ‘attack mode’ where it has 5 Attack and 1 EW, and an ‘EW mode’ where it has 2 Attack and 2 EW. And then a separate command that cripples it and sets Attack to 2 and EW to 0. And then going back to the others when uncrippled (always going to, say, EW mode when uncrippling is fine).

I pretty much know how I would want to visually flag this, and how I should be able to make a couple different layer properties switch off for that to work, but I can’t think of any way to do something this complicated with dynamic properties or markers.

your halfway there if you can visually flag this. All you would do next is hook the visual flagging aspect (the layers) to follow values of needed linked dynamic properties and control them accordingly

Thanks! That tells me a thought I had later yesterday is on the right track (haven’t had time to look at Vassal since). I’m so used to using Dynamic properties purely for cycling values, that I had forgotten that you can have multiple different triggers.

Okay, got things mostly set up. Don’t have the Dynamic Properties set up, but I think I can hook that in with the current set up.

But, something I hadn’t thought through: Is there any good way to block a command while the unit is crippled? (Cripple_Active) I figure there is, but it’s too late at night for me to fiddle around any more. :stuck_out_tongue:

Sure, add a restrict command trait - it allows use of property expressions so you can set it to block the command when Cripple_Active = true

Looks like calculated properties can lift a lot of the burden for the initial task.
Typically, set a DP “crippled” (yes/no) and another DP “mode” (atk/def) with the correct triggers to switch them.
Next, have a CP “attack value” set to something like “if crippled=true then 2 else (if mode=atk then 5 else 2)”, and same for defence. Now you don’t have to set up a complicated set of triggers to track the correct attack and defence values. With slight modifications, you may also have a similar CP that can be used to feed the “layer follow property” trait, et voilà.

To be even more generic, I’d do a prototype with the crippled and mode DPs, as well as the “attack value” CP where you replace the numbers by names (eg ‘crippled_atk’, ‘full_atk’ and ‘partial_atk’). Then on your counter, define first three markers ‘crippled_atk = 2’ and so on, and next include the prototype.

All right! Those two suggestions are what I need. I’m too used to the earlier traits and am not used to more advanced things like Restrict Commands and Calculated Properties.

And good call on how to do the prototype, I’ve been wondering how not to be doing a separate one for each specialty ship.

Okay, new wrinkle:

I’m working on bases, which have more options to trade off attack for EW. In general, not a problem. Command ‘Boost EW’ steps through a layer, and a pair of calculated properties work through the proper AF and EW settings.

But, bases still have a limited ability to do this while crippled. Expanding the ‘if’ in the calculated properties to see if Cripple_Active is true handles that part well.

However, the number of different steps of available EW is different when crippled. Having two different layer traits is fairly easy, and restricting commands allows me to trade off between them. But this ends up with two different identical menu commands. Is there any way to make them trade off in the menu?

Okay… just had a thought. The reason I was figuring on two different layer properties was that I wasn’t seeing a way to stop the first one from going too high when crippled. But I just realized a restrict commands can be set to check Cripple_Active and the current layer level for the EW flag.

To make it all consistent, I need to have the decrease command in, and turn off the loop through levels, which isn’t how I normally set that up, but it will work.

  • Have two commands with different names, not appearing in the menu.
  • Restrict them according to the correct property.
  • Have a “trigger action” (I think that the Vassal name) that calls both commands and make that appear in the menu. The restriction will do the trick and only the correct command will actually be executed.

Having a single layer for a single stuff still seems a better design to me, so it’s probably good to keep the solution you’ve already found.