Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#208 closed defect (released)

equipmentslot limit issues

Reported by: Henri Owned by: ibboard
Priority: minor Milestone: WarFoundry 0.1
Component: WarFoundry-GUI-WinForms Version: Unknown or N/A
Keywords: Cc:
Blocked By: Blocking:

Description

Referring to the following post:http://forums.hiveworldterra.co.uk/viewtopic.php?f=41&t=1342#p9153

A certain combination of the new eqipmentslot limits, in this case core:unitSizeLimit doesn't seem quite to work as I'd expect. Now this could very well be due to syntax issues when it comes to using the XML tags.

Now it won't exactly allow to take -100% equipment, however it is what the unit window is suggesting, it will simply delete the equipment in question, as it should as it is "zero" equipment.
I have enclosed an screenshot of the -100%, and the datafile and system where it crops up. It is in the Ork Boyz unit, for the Shoota option, which is a replacement for a Slugga (technically Choppa&Slugga)

Attachments (4)

Image1.jpg (43.3 KB) - added by Henri 10 years ago.
-100% !!!
wh40k - Copy.system (507 bytes) - added by Henri 10 years ago.
Orks.race (2.5 KB) - added by Henri 10 years ago.
Image2.jpg (104.5 KB) - added by Henri 10 years ago.
screenshot

Download all attachments as: .zip

Change History (21)

Changed 10 years ago by Henri

Attachment: Image1.jpg added

-100% !!!

Changed 10 years ago by Henri

Attachment: wh40k - Copy.system added

Changed 10 years ago by Henri

Attachment: Orks.race added

comment:1 Changed 10 years ago by ibboard

There is somewhere that I do some maths, so something must be going wrong with it and rather than doing the expected "10 - 0" it is doing "0 - 10" and getting -10. I'll run in debug mode and see what I can find.

comment:2 Changed 10 years ago by Henri

Additionally this. Since it is technically about equipmentslots and is in the same files I'll reuse this ticket.

A Ork Dreadnaught can have 4 "arms". 2 will always be CCW which can be extended to 4. Now the weapons work OK, I can only add up to 2 of any combination. However the Dread CCW option won't allow me to add "arms". Even though its a 2-4 limit (or so I think), also trying to edit the 2 Dread CCW option when other weapons are chosen tries to change the 2 Dread CCW option to 1 or 0. Which it shouldn't. It seems almost to read the 2 pre-existing arms twice?

Changed 10 years ago by Henri

Attachment: Image2.jpg added

screenshot

comment:3 Changed 10 years ago by Henri

There's no crash, so no debug, but I put a screenshot of the the messages it gives.

comment:4 Changed 10 years ago by ibboard

Owner: set to ibboard
Status: newaccepted

Working on it now and trying to find the best solution. It looks like I've used "get existing equipment in slot" here but "get existing equipment in slot excluding this item" for percentage calculation.

comment:5 Changed 10 years ago by ibboard

(In r383) Re #208: equipmentslot limit issues

  • Fix numeric slot issues by using "amount taken excluding this item" method
  • Rename "without this item" to "excluding this item" to clarify purpose
  • Restructure percentage limits and break some tests (some of which are only broken by rounding errors)

comment:6 Changed 10 years ago by Henri

r383 fixes part of it. However it allows each option to be taken up to 4 times, it seems the equipmentslot maxLimit is not enforced. 4 in total among all equipment tagged as "heavyWeapons".

comment:7 Changed 10 years ago by ibboard

(In r384) Re #208: equipmentslot limit issues

  • Extend unit tests to cover extra situation

comment:8 Changed 10 years ago by ibboard

(In r385) Re #208: equipmentslot limit issues

  • Move more code to a common method
  • Use new IBBMath.Percentage method to ensure consistent calculation of percentages
  • Move subtraction of amount already taken in slot inside IF and ELSE and tailor to situation

Some tests still failing

comment:9 Changed 10 years ago by ibboard

(In r386) Re #208: equipment slot issues

  • Consolidate some code in to one line
  • Make min/max percentage methods get the min/max of the calculated percentage and the percentage based on the numeric limit to ensure percentage is never greater than or less than (as appropriate) the numeric limit

Also:

  • Remove Math.Min and Math.Max calls from Min/Max equipment count methods - we're assuming min < max in the percentages, so assume it here as well

comment:10 Changed 10 years ago by ibboard

(In r387) Re #208: equipment slot issues

  • Make sure that all "min percentage" tests are testing for the lesser of the min percentage or the numeric min as a percentage

comment:11 Changed 10 years ago by ibboard

Deff Dread situation appears to be fixed, but Ork Boyz are still broken.

r383 also seems to have highlighted a bug when editing an item in a slot, but that's another ticket (the list of items in the slot loses the edited item, so it thinks that it can take the full compliment again).

comment:12 Changed 10 years ago by ibboard

Problem with the Ork Boyz has been found - they shouldn't be using slots for the slugga/choppa. Slots are optional and are meant for situations like the heavy weapons where you want more fine-grained control than the "can/can't take it" of exclusivity groups. The default constructor should check the limits, though.

comment:13 Changed 10 years ago by ibboard

Resolution: fixed
Status: acceptedclosed

(In r388) Fixes #208: equipmentslot limit issues

  • Construct units properly by using the UnitEquipmentUtil methods to get the actual minimum amount based on the slot limits as well

comment:14 Changed 10 years ago by ibboard

(In r391) Re #208

  • Make "unitSizeLimit" a percentage so that editing "equip all" type items like the Ork Choppas behaves correctly

no-open-ticket

comment:15 Changed 10 years ago by ibboard

(In r392) Re #208

  • Make sure that the appropriate radio button is set when editing existing equipment instead of defaulting to the equipment type's radio button selection

no-open-ticket

comment:16 Changed 10 years ago by ibboard

released: noyes

Release as part of v0.1b5

comment:17 Changed 10 years ago by ibboard

Resolution: fixedreleased

Mark fix as released under a previous version

Note: See TracTickets for help on using tickets.