As you’ll discover in no time, I am quite new to vassal more “advanced” features. I have no java skills.
I have built a module I am trying to improve by automating its card play mechanics. Of course, I am finding all kinds of problems I am enjoying dealing with, but there is something that is really bugging me big time:
Is <Deckname_numPieces> supposed to be accesible from everywhere in the module or just from the player hand where the deck lives?. From what I have read, it seems to me it should be, but need to be sure to keep going. I don’t know what relevant info you could need to answer my question, if any. Please let me know and I will post it as soon as I can.
In case the answer is no, I found a workaround that involves the use of a global variable whose value I can relate to Deckname_numPieces but it means a lot of work and seems to me unnecessarily convoluted.
The answer is no, <Deckname_numPieces> is not a global property. It is a Map
level property. The workaround is as you have found - to use a global
variable and relay
As you’ll discover in no time, I am quite new to vassal more “advanced”
features. I have no java skills.
I have built a module I am trying to improve by automating its card play
mechanics. Of course, I am finding all kinds of problems I am enjoying
dealing with, but there is something that is really bugging me big time:
Is <Deckname_numPieces> supposed to be accesible from everywhere in the
module or just from the player hand where the deck lives?. From what I have
read, it seems to me it should be, but need to be sure to keep going. I
don’t know what relevant info you could need to answer my question, if any.
Please let me know and I will post it as soon as I can.
In case the answer is no, I found a workaround that involves the use of a
global variable whose value I can relate to Deckname_numPieces but it means
a lot of work and seems to me unnecessarily convoluted.
A map level property, or anything below a module level property, can be sent to a Global Property which then can be referenced from anywhere in the module.
In the above case, somewhere in the player hand window you would have a Set Global Property trait on a piece, which told it to set the Global Property you’ve previously made (I.E. Player1DeckPieces or something) to the map level property you want, which would be “DeckNameHere_numPieces”, or which ever property you want to save.
Then you could reference the Global Property for the information of the map level property, hope that helps.
I am attempting to do the same thing. Can you please link a module that employs this functionality so that I can reference it? I may be reading your explanation wrong because the way you explained it is how I think I’ve coded my module. It’s not working, so I must be doing something wrong.