If you have defined the marker trait Cost below the Set Global Property trait in the list of traits, then the Set Global Property trait will not see it. The general rule in Vassal counters is that a trait can only affect/see otehr traits that are defined above it. So try just moving your Marker Cost further up the list.
Ahhh, gotcha, what you are probably seeing is the bug I fixed in the 3.1.0 beta last week. If you have a ‘Set Global Property’ trait in a counter, then you cannot display the value of the Global Property in a text label in the same counter. This is a bug that is fixed in the soon to be release 3.1.0 beta. In the meantime, try displaying the current value of G_Cost using a different counter to the one you are trying to update it with.
No, that is not right. You are making a mistake in the way you are setting up your counter.
As I said in an earlier post, If you use a ‘Set Global Property’ trait, then the ‘Marker’ it is referencing MUST be defined above it in the trait list, not after it. If you do this, you will find that a simple Marker trait works exactly the same as a dynamic property. I have just tried this in a small module under Vassal 3.0.17.
If you are using prototypes, then you must make sure that the property traits are in the correct order after all of the prototypes have been expanded.
The problem was not the order, but the use of marker trait. Because he was
performing basic math addition, a marker trait will not work. He needed to
use a numeric DP.
A marker trait with the value 100 on one counter and a marker trait with the
value of 50 on another will not set the GP to 150 when the variables are
passed
This is news to me, considering I just created a module that adds a fixed marker trait = 4 to a Global Variable = 6 and came up with a result of 10.
Sorry, not sure what you mean by ‘when the variables are passed’. Can you create me a noddy module that shows that behavior? I must be misunderstanding what you are doing. It sounds like a bug to me.
Regards,
Brent.
Brent Easton
Analyst/Programmer
University of Western Sydney
Email: b.easton@uws.edu.au
My little test mod shows using marker trait does also work in this capacity.
Not sure why it wasn’t working in Grigory’s module then except possible misnamed $property$ or buildfile corruption on save.
I dont remember the labeling (capitalization,spelling) being wrong though, maybe it was the trait order but I dont remember moving DP / Marker about - just swapping them out. Possible though
Since Marker also can work this way, I might suggest for editor consistency it also have a simple checkbox for ‘numeric’ like DP and GP except without the min/max values part.
Nothing really - just for consistency was my thought so it is understood.
Only other reason I could think of is if when doing so on a DP or GP the
value is recognized/stored in the game code as an int as opposed to a
string, then in which case require likewise with marker
Perhaps it could enforce a numeric validation on the value entered?
All properties are typeless. They are stored as strings. If you try and add them, they are converted to integers, added, then the result stored as a string again.