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
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old April 1st, 2007, 11:02 AM
I've written a rule to make sure that the named characters in the game I'm working on are not duplicated.

Unit-Level scope, test expression: Notes.Character, script:

if (this.overall.tagunique[unitid.?] = this.overall.tagcount[Notes.Character]) then
@valid = 1
endif

This works as expected, but the problem is that if it does have an error, every character model shows the error. I'd rather not have the same error show up many times in the error list (I can understand it showing up twice - for each of the duplicates).

Is there a better way to write a rule for uniqueness? The majority of units in this game are characters, so I don't want to write a rule for every unit.
Mathias is offline   #1 Reply With Quote
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old April 3rd, 2007, 12:48 PM
If I am understanding you correctly you can take any number of characters (or a game based limit) but no character can be taken more than once?

If so, take a look at the 40k files, particularly the generalstuff.dat file and the rule that handles the multiple items. The way we have it running is you can tag a unit so it can be limited ot the number of times it can be taken, once twice or more etc. If the user exceeds this limit then only the applicable units are highlighted.

The beauty of this is it only needs a tag adding to a unit and is flexible enough to handle any number of restrictions. When I can get near ABC will post up the particular rule name and tag group name.
harkan is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old April 3rd, 2007, 03:46 PM
Thank you, that worked.

For the benefit of anyone running a search on this topic later, what worked was:

Merge-level scope (note that change), test expression: Notes.Character, script:

if(count[basic] <=1) then
@valid = 1
endif

The 40K version checks the tag on the right-hand side of the boolean, to allow ranges greater than 1.
Mathias is offline   #3 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old April 22nd, 2007, 04:47 AM
At 12:02 PM 4/1/2007, you wrote:
Quote:
I've written a rule to make sure that the named characters in the game I'm working on are not duplicated.

Unit-Level scope, test expression: Notes.Character, script:

if (this.overall.tagunique[unitid.?] = this.overall.tagcount[Notes.Character]) then
@valid = 1
endif

This works as expected, but the problem is that if it does have an error, every character model shows the error. I'd rather not have the same error show up many times in the error list (I can understand it showing up twice - for each of the duplicates).

Is there a better way to write a rule for uniqueness? The majority of units in this game are characters, so I don't want to write a rule for every unit.
I believe the solution would be to write a rule with "merge" scope. This will cause the rule to be fired for each disctint unit within the roster. You'll need to verify that you only test named characters with the rule. Then you'll be able to verify that the total number of models of each unit equals one.

Hope this hels,
Rob
rob is offline   #4 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old April 22nd, 2007, 04:52 AM
At 04:46 PM 4/3/2007, you wrote:
Quote:
Thank you, that worked.
Oops. I saw the email for this one and answered it before seeing it was already handled. Sorry about that....
rob is offline   #5 Reply With Quote
thebutcher
Senior Member
Volunteer Data File Author
 
Join Date: Apr 2005
Posts: 220

Old April 25th, 2007, 06:22 PM
Would it be possible to have the warning alert the user as to which unit has gone over it's limit?
I'm guessing this would require rules for each unit? Say, instead of "You are limited to X units." It could be "You are limited to X Blue units."

Thanks
Butcher

Warmachine/Hordes ('Retired' Confrontation and AT-43) Army Builder Author.
Magic the Gathering Card Vault Author.
thebutcher is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old April 25th, 2007, 10:41 PM
Butcher, what I used does this. The error it reports (only once) is: "Unit 'Akjo Kageshima': You may only have one of a character model".
Mathias is offline   #7 Reply With Quote
harkan
Senior Member
Volunteer Data File Author
 
Join Date: Mar 2005
Posts: 345

Old April 26th, 2007, 10:03 AM
The merge option does highlight the relevant units that are breaking it in red and you can tailor the rule message in the usual way
harkan is offline   #8 Reply With Quote
thebutcher
Senior Member
Volunteer Data File Author
 
Join Date: Apr 2005
Posts: 220

Old April 26th, 2007, 06:56 PM
Awsome! Just tried it out and she's a beauty!
Exactly what I was looking for!!

Thanks, everyone!
Butcher

Warmachine/Hordes ('Retired' Confrontation and AT-43) Army Builder Author.
Magic the Gathering Card Vault Author.
thebutcher is offline   #9 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 03:41 AM.


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