Perhaps a way to do this is to use DynamicPropertyTrait
s and LabelTrait
s. E.g.,
- Layer
Images = [Backside] Name = Step ...
- Morale property
Actions = [[Increase Moralse,Some-Key,INCREMENT,{1}], [Decrease Morale,Shift-Some-Key,INCREMENT,{-1}], Name = Morale Numeric = True Min = 0 Max = 10
- Label display
Label = {Step > 0 ? "Morale: "+Morale : ""} ...
The state of DynamicPropertyTrait
s should be written in saves, so they will come up correctly when re-loading the save.
These traits should most likely be done in a Prototype
so that it can be reused across pieces.
The TableInfo
(spreadsheet) trait is a bit tricky because - as far as I can tell from the code - user edits are only stored in the GUI element - not the trait itself. That means user-edits will not persist across sessions.
I think you’re better of with DynamicPropertyTrait
s for this too. The state of those are saved for sure. For example
- Battles won
Actions = [Set battles won,SomeKey,PROMPT,{"Please enter # of battles won (was "+BattlesWon+")"] Name = BattlesWon Numeric = True Min = 0 Max = 1000
This has the added benefit that you can use these properties (e.g. BattlesWon
) elsewhere in the piece properties. For example, if more than 10 net battles have been won by a piece, then that piece earns a veteran status and gets an additional combat factor bonus
- Battles won
TriggerTrait
to set it (similar forBattlesLost
)Command = Set battles won Actions = [KeyCommand1,KeyCommand2]
DynamicPropertyTrait
to store itActions = [,KeyCommand1,PROMPT,{"Please enter # of battles won (was "+BattlesWon+")"] Name = BattlesWon Numeric = True Min = 0 Max = 1000
DynamicPropertyTrait
to set veteran status - note once achieved it will persistActions = [,KeyCommand2,DIRECT,{Veteran?Veteran:(BattlesWon-BattlesLost)>=10}] Name = Veteran Numeric = True Min = 0 Max = 1 Value = 0
CalculatedPropertyTrait
for effective combat factorName = EffectiveCombatFactor Expression = {BaseCombatFactor + (Veteran ? 2 : 0)}
LabelTrait
to show star when a veteranLabel = {Veteran ? "☆" : ""}
Again, these properties should probably be defined in a Prototype
to be re-used across pieces.
Anyway, my 2¢
Yours,
Christian