Junior Member
Join Date: Sep 2014
Posts: 14
|
I am trying to make it so I have two groups, heroes and troops. In the game you can only have 1 hero per 100 points of troops. Anyone able to help me with setting this up?
Noob, CmB |
#1 |
Senior Member
Join Date: May 2012
Posts: 206
|
You could either set up a script on the profile in the minmax or final sections or alternatively you could try stat calcs then use a tag to mark troops and hero (assuming you are using something along the lines of a "group" or "type" tag group to filter them in the display?) and then use the statval to count the number of heroes and the total points for troops then use a rule to compare and flag up errors
My own Warlord Games gallery and the home of the Warlord Games datafiles: http://www.facebook.com/ABDataFileWarlordGames |
#2 |
Junior Member
Join Date: Sep 2014
Posts: 14
|
Thank you for the suggestions. I am tagging them as heroes and fighters. do you have a sample script I could put on the profiles. Sorry I am not well versed in scripting, still learning all the things I can do.
Thanks, CmB |
#3 |
Senior Member
Join Date: May 2012
Posts: 206
|
Using stat calcs and a rule would be something like:
stat calc for heroes (this will count how many heroes there are): Unique ID: scTotHero Scope: unit Test expression: tagGroup.hero Tally expression: @value = @value + 1 stat calc for fighters (this works out how many points spent on fighters): Unique ID: scTotFight Scope: unit Test expression: tagGroup.fighters Tally expression: @value = @value + this.cost[total] Rule: Message: You can only take one Hero for every 100 points spent on Fighters Summary: 1 Hero per 100 points Script: ~ define variables var totHero as number var totFighter as number var upperLim as number ~ get values totHero = statcalc[scTotHero] totFighter = statcalc[scTotFight] upperLim = round(totFighter/100, 0, 1) ~ check values if (totHero <= upperLim) then @valid = 1 endif I've tested this and it does work, it does assume that you need Fighters to take a Hero so no Fighters = no Hero and also it works on the basis of: 0 - 100 points = 1 Hero 101 - 199 points = 2 Heroes etc, if this assumption is wrong you can adjust the round statement so it rounds down instead I'll put the minmax script for a profile up later on, off out now for family time My own Warlord Games gallery and the home of the Warlord Games datafiles: http://www.facebook.com/ABDataFileWarlordGames |
#4 |
Senior Member
Join Date: May 2012
Posts: 206
|
Using statcalcs and profile:
This assumes you have a profile for Heroes! stat calc for heroes (this will count how many heroes there are): Unique ID: scTotHero Scope: unit Test expression: tagGroup.hero Tally expression: @value = @value + 1 stat calc for fighters (this works out how many points spent on fighters): Unique ID: scTotFight Scope: unit Test expression: tagGroup.fighters Tally expression: @value = @value + this.cost[total] Profile: Min Value: 0 Max Value: 1 Dynamic: ticked Minmax script: ~ define variables var totHero as number var totFighter as number var upperLim as number ~ get totals totHero = statcalc[scTotHero] totFighter = statcalc[scTotFight] upperLim = round(totFighter/100, 0, 1) ~ set min/max, deal with no Fighters chosen first then use calculated totals if (totFighter < 1) then @maxvalue = 1 @maxtext = "1" else @maxvalue = upperLim @maxtext = upperLim endif This works on the same assumption above, i.e. 0 - 100 points of Fighters = 1 Hero etc The advantage this one has is that the user gets immediate feedback in that the profile bar will change to red immediately if they choose too many Enjoy! My own Warlord Games gallery and the home of the Warlord Games datafiles: http://www.facebook.com/ABDataFileWarlordGames |
#5 |
Junior Member
Join Date: Sep 2014
Posts: 14
|
Thanks this is perfect. I will play around and fit it into the system
|
#6 |
|
|