[messages] Edit: Re: [Feature Requests] In-line expressions in global properties

barbanera barbanera at fantafoot.com
Thu Sep 6 03:23:35 MST 2012

[This message has been edited.]

> .. a Global property would not be able to to reference any values
> within a counter, so I am not sure how useful it would be.

Well, my idea was that any Global Calculated Properties would be
"global" just in the sense it is not specific to the given counter. It
would only reference global properties. 

For example, to let people individually choose language specific images
(see other thread[1]) I need layers to follow something like 
_$playerSide$_language_. Once you have actually updated the layer trait
to accept in-line expressions (see this thread[2]) I could do that
easily, but at the moment I need to add to every single piece/prototype
the same Calculated Property, such as _Language_ with value
_GetProperty(playerSide+"_language")_, and have layers follow that

It would be much easier, I think, to add that CP just once at module
level, instead. Extend this simple example to cases where a lot of
pieces/prototypes need to use a much more complex in-line expression/CP
(but one still only using global properties).. Any re-working of the
in-line expression/CP would need to be copied over all over the module
(pieces and prototypes), with much scope for error, instead of just one
single edit trickling done nice and easy.

I have never really done any OOP, so please forgive me my approximate
language/understanding of it.. but I guess that the Global Calculated
Properties could just be the exact same lines of code already there for
"normal" CP's, but placed at top level.. inheritable from every other
class, couldn't they?

> Adding this feature would be difficult.

I understand, so that does it then, no problem. I guess a workaround for
me is to simply add the common CP's to a new "library" type prototype
shared by every single piece in my module (still scope for error if I
forget to add it to some piece somewhere, though).

[1] http://www.vassalengine.org/forum/viewtopic.php?f=4&t=5101
[2] http://www.vassalengine.org/forum/viewtopic.php?f=5&t=5481

Read this topic online here:

More information about the messages mailing list