Create account / Log in

How to have a global property change based on card count

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

How to have a global property change based on card count

Postby bigdirt32 » April 7th, 2012, 8:26 pm

I cannot seem to get one Global Property value to change based on another Global Property Value. I have a card count that when it reaches a certain number I want a prompt to pop up for the player to choose the value of another GP.. Any ideas how I can do this.

Thanks.
bigdirt32
 
Posts: 8
Joined: February 16th, 2010, 1:01 am

Re: How to have a global property change based on card count

Postby barbanera » April 8th, 2012, 9:12 am

Presumably the change in the second gp (let's call it A) is triggered by some move or command executed by some player, correct? After all there is no other way things change in Vassal (no background processes, no time related triggers etc), afaik.

Then just add a trigger on that piece to prompt users for the value of the other gp (B) when A has reached the threshold value..?
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm

Re: How to have a global property change based on card count

Postby bigdirt32 » April 8th, 2012, 7:21 pm

Thanks.

I tried to add a trigger but for whatever reason it does not activate when the card count reaches a particular number. Any ideas?
bigdirt32
 
Posts: 8
Joined: February 16th, 2010, 1:01 am

Re: How to have a global property change based on card count

Postby barbanera » April 9th, 2012, 9:12 am

Where did you put the trigger? It should be put on the piece(s) that influence the card count in the given deck.

Whatever the case, at the end of the given action (dragging, sending-to-location, moving-fixed-distance etc) I presume some cards end up being added to your deck and you want to query the new value of the number of cards in the deck, correct?

If so, you should probably investigate use of the "key command to apply to all units ending movement on this map" option, that you can find in the map definition (obviously of the map where the deck is). Add CTRL-A or similar there and then add a trigger on the cards (prototype) to fire on CTRL-A when <deckname>_numPieces >= <threshold value> && DeckName=<deckname> and issue, say, CTRL-B. The latter will just be a Set Global Property trait on the cards (prototype) to prompt users for the value of your other variable. Also make sure no other piece on the same map uses CTRL-A for something else (or use more exotic key combo, or use Vassal 3.2.0 beta and forget about key comboes).

I have never used that map level option myself, but I think it should work like as described above.
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm

Re: How to have a global property change based on card count

Postby bigdirt32 » April 9th, 2012, 3:56 pm

I will try that although these are not physical cards it is just a random text button that generates a result and then a start statck with a textfiled that shows the global property. Where can I get the 3.2 beta?

Thanks.
bigdirt32
 
Posts: 8
Joined: February 16th, 2010, 1:01 am

Re: How to have a global property change based on card count

Postby barbanera » April 10th, 2012, 11:06 am

Wait, you mentioned a card count in your original post, and that's why I thought you were talking about decks and the deckname_numPieces variable...

How do you generate the random text? Rolling a die? Then just have the text label in the other at start stack print out $diename_result$ (Substitute diename with the actual name of your die).
barbanera
 
Posts: 377
Joined: January 12th, 2012, 2:27 pm


Return to Module Design

Who is online

Users browsing this forum: Google [Bot] and 1 guest