Problem with percentageLimits in datafiles

Posts

[Unknown user]'s Avatar
snowblizz
Veteran Member
Veteran Member
Progress to next rank:
 
61%
 
Posts: 484
Joined: 08 Apr 2009, 06:55

Problem with percentageLimits in datafiles

Postby snowblizz at 28 Aug 2011, 19:55

Not sure if it's entirely a bug or if I just not good enough anymore. Been a while since I made datafiles.
Been running into an issue with the core:percentageLimit.
A unit of 3-10 models can have a choice of 2 weapons for every 3 models in the unit. If I make the percentage 33, a unit of 3 cannot have even 1 weapon. I gather because 1/3 is in reality 33.33.... etc. If I make it 34% round down it's possible to make the program crash by giving the other option a couple of fractions of %, which is possible.
Really whatever I do I get either too many or to few.

Any ideas?

Edit:
Also, for every 5 models 2 may take [list of options], can I even define that? It should be 40%, but a unit of 3 or 4 should not be allowed any. Unit size 3-10.
Damn why did they have to make it this tricky.

I did manage to get the Orks 1 in 10 models can take heavy weapon, but I don't seem to be able to model these.

[Unknown user]'s Avatar
IBBoard
Administrator, Commissar
Administrator
Commissar
Progress to next rank:
 
38%
 
Posts: 4222
Joined: 20 Mar 2001, 20:24
Location: Worcestershire, UK

Re: Problem with percentageLimits in datafiles

Postby IBBoard at 29 Aug 2011, 10:06

If there's a crash with 34% then we'll need some example data files and a bug ticket :) I'm not quite sure what you meant with the "couple of fractions of %", though.

1/3rd will be an awkward one, given that it recurs. 34% would seem like the best compromise as it'd take a large unit for it to have an effect on rounding.

I think the "for every N allow M" rule needs something slightly different, especially if 5 allows 2, 6, 7, 8 and 9 also allow 2 and then 10 allows 4. I might have already foreseen that, although I don't know if we have a ticket for it or if it was just a "allow for extending limits for stuff like that".

As for why they make it tricky: a) to make it hard for people to provide tools like this and b) because we might not quite have perfect rules yet.
Out now: Dawn of War Texture/Skin Downloads
At v0.1: WarFoundry (open source, cross-platform, multi-system army creation application)

[Unknown user]'s Avatar
snowblizz
Veteran Member
Veteran Member
Progress to next rank:
 
61%
 
Posts: 484
Joined: 08 Apr 2009, 06:55

Re: Problem with percentageLimits in datafiles

Postby snowblizz at 29 Aug 2011, 13:26

IBBoard wrote:If there's a crash with 34% then we'll need some example data files and a bug ticket :) I'm not quite sure what you meant with the "couple of fractions of %", though.

Ah yes, it's such a bother making a ticket though. :roll: I was doing this last last night you see...
Oh well, you win, ticket posted.

IBBoard wrote:1/3rd will be an awkward one, given that it recurs. 34% would seem like the best compromise as it'd take a large unit for it to have an effect on rounding.

I seem to have a way of avoiding the possibility of the error.

IBBoard wrote:I think the "for every N allow M" rule needs something slightly different, especially if 5 allows 2, 6, 7, 8 and 9 also allow 2 and then 10 allows 4. I might have already foreseen that, although I don't know if we have a ticket for it or if it was just a "allow for extending limits for stuff like that".
That's basically it. In this case the issues is also the need to allow just 1, or 3-4 when the unit is 10 models strong. The percentage limits would allow 1 or 3 weapons in two small units.

IBBoard wrote:As for why they make it tricky: a) to make it hard for people to provide tools like this and b) because we might not quite have perfect rules yet.

Oh, I was hoping for a "they are idiots trying to make your life difficult".