Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Army Builder Forums > Army Builder
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
k9monkey
Junior Member
 
Join Date: Sep 2014
Posts: 14

Old September 11th, 2014, 10:26 AM
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
k9monkey is offline   #1 Reply With Quote
Harkan_again
Senior Member
 
Join Date: May 2012
Posts: 206

Old September 12th, 2014, 09:10 AM
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
Harkan_again is offline   #2 Reply With Quote
k9monkey
Junior Member
 
Join Date: Sep 2014
Posts: 14

Old September 12th, 2014, 05:59 PM
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
k9monkey is offline   #3 Reply With Quote
Harkan_again
Senior Member
 
Join Date: May 2012
Posts: 206

Old September 12th, 2014, 10:44 PM
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
Harkan_again is offline   #4 Reply With Quote
Harkan_again
Senior Member
 
Join Date: May 2012
Posts: 206

Old September 13th, 2014, 03:31 AM
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
Harkan_again is offline   #5 Reply With Quote
k9monkey
Junior Member
 
Join Date: Sep 2014
Posts: 14

Old September 15th, 2014, 08:26 AM
Thanks this is perfect. I will play around and fit it into the system
k9monkey is offline   #6 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:43 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.