Create account / Log in

Army Points Calculation

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Army Points Calculation

Postby variant5g » January 21st, 2008, 4:34 pm

I'm playing with building a module for Warmachine. How would I go about getting Vassal to calculate the total points for an army? (As you drop a unit onto the map, it would add the unit's point value to a running total.) It looks like it would have something to do with Properties, but I can't find a specific example of waht I'm looking to do. Any help would be greatly appreciated.
User avatar
variant5g
 
Posts: 2
Joined: January 21st, 2008, 4:14 pm
Location: Presque Isle, ME

Army Points Calculation

Postby Tim M » January 21st, 2008, 5:16 pm

Add a Trigger action w/ no command name with keystroke CTRL X to perform keystroke CTRL A. Set the property filter to Calculated = false
Add a non numeric dynamic property to the units called Calculated and set value to 'false'. To this DP add a key command CTRL A, give it no command name, in dropdown box specify 'Set value to' and last box enter 'true'
Add a Set Global Property trait: Set the Global Property Name to "Total". Check the is numeric box on and set the max range to largest value total of armies could get to, or at least enough range for plenty of cushion. To this GP add a new key command CTRL A, no command name, set the drop down box to 'Increment numeric value' and enter the unit's value in final box (increment by)

Add a numeric Global Property to the map called 'Total', again check the numeric box and set min to 0 and max to a comfortable cushion, set initial value to 0

In the Map properties Apply Move Key to 'All units that move' and set the Key command (line above) to CTRL X

If you want to see the total as you progress displayed on the map somewhere, add an at start stack piece of some sort, give it a Text Label trait and set the Text to $Total$, remove the menu command and set your text size position etc..

Will put together a small demo tonight if still can't get it - let me know

variant5g <messages@forums.vassalengine.org> wrote:
I'm playing with building a module for Warmachine. How would I go about getting Vassal to calculate the total points for an army? (As you drop a unit onto the map, it would add the unit's point value to a running total.) It looks like it would have something to do with Properties, but I can't find a specific example of waht I'm looking to do. Any help would be greatly appreciated.







_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org


Post generated using Mail2Forum (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1778
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Army Points Calculation

Postby Tim M » January 21st, 2008, 5:18 pm

I should note that the first paragraph gets added to all your armies - you can save some time by prototyping parts of this

Timothy Mccarron <timothy.mccarron@sbcglobal.net> wrote:
Add a Trigger action w/ no command name with keystroke CTRL X to perform keystroke CTRL A. Set the property filter to Calculated = false
Add a non numeric dynamic property to the units called Calculated and set value to 'false'. To this DP add a key command CTRL A, give it no command name, in dropdown box specify 'Set value to' and last box enter 'true'
Add a Set Global Property trait: Set the Global Property Name to "Total". Check the is numeric box on and set the max range to largest value total of armies could get to, or at least enough range for plenty of cushion. To this GP add a new key command CTRL A, no command name, set the drop down box to 'Increment numeric value' and enter the unit's value in final box (increment by)

Add a numeric Global Property to the map called 'Total', again check the numeric box and set min to 0 and max to a comfortable cushion, set initial value to 0

In the Map properties Apply Move Key to 'All units that move' and set the Key command (line above) to CTRL X

If you want to see the total as you progress displayed on the map somewhere, add an at start stack piece of some sort, give it a Text Label trait and set the Text to $Total$, remove the menu command and set your text size position etc..

Will put together a small demo tonight if still can't get it - let me know

variant5g <messages@forums.vassalengine.org> wrote:
I'm playing with building a module for Warmachine. How would I go about getting Vassal to calculate the total points for an army? (As you drop a unit onto the map, it would add the unit's point value to a running total.) It looks like it would have something to do with Properties, but I can't find a specific example of waht I'm looking to do. Any help would be greatly appreciated.







_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org

_______________________________________________
Messages mailing list
Messages@forums.vassalengine.org
http://forums.vassalengine.org/mailman/ ... engine.org


Post generated using Mail2Forum (http://www.mail2forum.com)
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1778
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby Tim M » January 22nd, 2008, 12:13 am

Here is a demo mod for this (inside zip file).

This demo shows for two sides (white/black) their individual totals and reports tally in the chat window. Ive used dice faces on the pieces for obvious reasons - value of the piece
Attachments
Point Calculation.zip
Demonstration mod for adding point values of pieces displaying and reporting the results
(10.32 KiB) Downloaded 325 times
User avatar
Tim M
 
Posts: 1778
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Thanks for the info

Postby variant5g » January 22nd, 2008, 5:43 am

I appreciate all the information. I understand the process much better now. One thing I did notice is that highlighting a piece and typing Ctrl-A will advance the counter forward by the piece's value.

Also, how would I go about tracking two totals for players in a gam that doesn't use distinct pieces for each side? (I'm thinking specifically of Warhammer or Warmachine, where each side has a choice of different armies, even the same army.) Can you tie it in specifically to the Player#?

Thanks again for the great info and helpful demo!
User avatar
variant5g
 
Posts: 2
Joined: January 21st, 2008, 4:14 pm
Location: Presque Isle, ME

Re: Thanks for the info

Postby Tim M » February 5th, 2008, 2:44 am

variant5g wrote:Also, how would I go about tracking two totals for players in a gam that doesn't use distinct pieces for each side? (I'm thinking specifically of Warhammer or Warmachine, where each side has a choice of different armies, even the same army.) Can you tie it in specifically to the Player#?

Thanks again for the great info and helpful demo!


You could do this with a slight adjustment to start up, assuming the pieces/armies/whatever start off in the module piece palette.

Give each piece a dynamic property call it "owner" and set its default value to none. Add two key commands to the DP that will set the value to either 'player1' or 'player2' (CTRL Y & CTRL Z)

Also give each piece 2 triggers. 1 that will act for player 1 and the other for player 2 using the filter CurrentMap = xxxx (see why next) both key off CTRL X and have 1 trigger perform CTRL Y and the other trigger perform CTRL Z

In the module you would need two player side specific restricted maps to act as a start up pool for each side. When the players grab their pieces out of the palette they place them first in their specific pool map. Doing this we fire key to apply movement (last option of map properties) and tie it to both triggers ( CTRL X )
The triggers will set the DP 'Owner' depending on what map the piece is placed in.
After they have done selecting their pieces they would then place them on the game map etc.. having set player ownership in the DP. Now you can calculate the points based off of player side through the set DP "Owner" instead.

This is kind of a very brief version. Let me know if you need a Demo
User avatar
Tim M
 
Posts: 1778
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Postby soft-bug » February 5th, 2008, 10:19 am

Here i put you an another way to do it : Using the Inventory Window ...

You set up your armies on the board and then open the inventory .. Do not forget to refresh if already open ..

Now you have choice .... :wink:
Attachments
Inventory_ Calculation.zip
(10.09 KiB) Downloaded 295 times
founder of The http://www.VassalFactory.org
User avatar
soft-bug
 
Posts: 222
Joined: December 20th, 2007, 9:30 am
Location: Paris / France


Return to Module Design

Who is online

Users browsing this forum: No registered users and 0 guests