[messages] [Module Design] Calculating Value of Cards and show in Hand

cjmeate mikeebmusic at aim.com
Mon Aug 19 22:32:50 MST 2013


Create a global property. Let's call is G_Value

Give it an initial value of 0 and make it numeric.

Next, in the window you would like to sum up the values (player hand?),
create an At-Start Stack. Give it the following traits:

Trigger Action- Description : Whatever you want to name it.
                       Trigger When: Leave blank I will explain this
below.
                       Menu Command: If you want a right click option,
put in what you'd like it to say. I leave this blank
                       Keyboard Command: Ctrl X
                       Perform These Keystrokes: Ctrl 1
For the above,                       
Have the keyboard command be the same as the map key command. You can
edit map key command by clicking on the player hand, and looking at the
selection, "Key Command To Apply To All Units Ending On This Map"
For learning purposes, let's say you have that set as Ctrl X. 

Set Global Property: 
      Description: Again, whatever you'd like.
      Global Property Name: Input the G_Value name that you created just
before. You will be taking this constant property, and increasing it to
what you need.
      Minimum Value: Set this to the same as how you have it in the
property already. Might be -10 or 0 or something. Same with maximum.
That is most likely at 100.

Check the IS NUMERIC box.
Then add the following key commands:

Menu Command: Again, the right click words. I try not to use them as it
clutters things.
Key Command: CTRL 1. This is the key that will be triggered by the
Trigger Action trait. So essentially, the trigger is getting hit by the
map standard key, and then hitting this Set Global Property trait.
Type: Increment numeric value.
Increment by: Use your marker name here. If you have a marker on the
cards called value let's say, this space would say $value$  . Use the
dollar signs, as it makes it numeric. The dollar signs essentially say
THIS IS THE VALUE of marker "value"

Text Label: Here is where you will be displaying your new card sum. 
                 Description: Whatever you'd like to call it.
                 Text: $G_Value$    . Feel free to put words before or
after that <--. That essentially is calling the VALUE (remember, dollar
sign is reporting the value of G_value property) . So maybe you want to
write, Combat Level = $G_value$ , or something like that. 
                  All the other properties here you can mess around with
yourself. 

Does Not Stack:  Select Peice: Normally. 
                         Move Piece: Never.
     This will stop you from being able to move the button around. If
you would like it to slide around, do not put this trait.


NOW, THERE ARE TWO VERY CRITICAL THINGS YOU MUST REALIZE. 

1) The order of the traits I just listed, goes from bottom to top, So in
your list, the top trait would be Does not stack, and the last one would
be the Trigger Action. That is because the top most trait is the boss,
it can see everything else in process, while the bottom traits are more
blinded and can only see what is below them.

2) Your TRIGGER ACTION WILL RECORD EVERY POINT AND MOVEMENT. This is
because you did not set up a gate or requirement to restrict it from
working sometimes. As of now, every single time you move a card, it will
add that to the total. In order to stop this, you need to set up
provisions. To do this, go back into the Trigger Action Trait 

Mine for comparison: Trigger When: {CurrentMap ==
GetProperty("playerSide") + " Hand" && LocationName != Screened &&
(OldLocationName ==Screened || OldMap == "Main Map")}


In this scenario, each player has a Map Hand called 1P Hand, 2P Hand, 3P
Hand, and so on. So, the first thing I am saying in the following
requirement, is that the current Map that this is happening on changes
depending on who is controlling it. So, if you had something like 1P
Hand, that part would be the same. If you had 1P Barracks for example,
replace the Hand part with Barracks. Next, I have the requirement that
the LocationName cannot be a special zone called Screened. I created
this zone as a private part of the hand in which cards would always be
masked. The points begin to total when the cards are inside the
playerhand Map, but not in that specific zone called Screened. The last
part is very important for you. OldLocationName is what I used in order
to stop the card value from adding up non stop. It says (essentially),
"if this card was just in this map right before you moved it here, (or
zone if you create one) then it will or will not trigger depending on
what you want. SO for me, if a player moved a card from screened on to
the equip zone (all of this is in his hand, remember I have special
zones for masking purposes) then it would register. However, if i tried
moving it back and fourth INSIDE THE SAME ZONE, it would not register,
because the old location was not screened. In order to offer myself more
flexibility, I said that it could have moved from my Screened zone, OR
from the main map. This way if a player moves it from the main map OR
screened, it would register, but would stop adding points from double
movements. Here it is again for review: 

Trigger When: {CurrentMap == GetProperty("playerSide") + " Hand" &&
LocationName != Screened && (OldLocationName ==Screened || OldMap ==
"Main Map")}

Now, that should get you started. However, there is one final thing to
note. You are going to have to get this all to apply to the cards
somehow. You may need to split up these steps, try adding them to a
prototype, and putting them onto the cards or pieces or whatever you are
using, individually. Or you can add it to another prototype that you
already have, if you do.

Using all of these steps I have told you should help. I have only been
at this for a few weeks, but I understand how frustrating it is sitting
on a problem, unable to find the applicable solution. You have stolen me
away from "Tales Of Xillia" for about 30 minutes so I could write this
post, (the game is SICK by the way, definitely recommend it) but
hopefully this may help someone with further questions in the future. If
you have any other questions, feel free to ask. I probably won't be of
much help, but I can try my best.

Good Luck

M

_______________________________________________
Read this topic online here:
http://www.vassalengine.org/forum/viewtopic.php?p=41718#p41718


More information about the messages mailing list