Download the latest KolMafia build here.
Every new revision posted within the hour.
New EXE builds every Monday.
This is a breaking change for a substantial number of popular scripts, including ZLib and Ezandora’s Guide, and should be flagged as such.
It might be worth considering rolling this back, changing it to warn users if a script would break under the change, then reapplying the change in a week or so.
Last edited by Saklad5; 09-01-2018 at 06:10 PM.
Is it a breaking change, or does it just produce a lot of warning messages ?
Ok, I suspect fix for this will be somehow fixing the $monster[xxxx] ash code to produce a warning if capitalisation doesn't match, but to match.
This change also makes to_monster("a.m.c. gremlin") return none. I would suggest it try a case-insensitive match and print a warning, similar to to_item():
Otherwise, to_monster() can silently fail in older scripts. That would be difficult to track down.Code:> ash to_item("staff of ed") Multiple matches for "staff of ed"; using "Staff of Ed". () Clarify by using one of: "Staff of Ed" "Staff of Ed"
Additionally, the following monsters have incorrect capitalisation in mafia's data files:
Code:Book of Faces Tome of Tropes crazy bastard
We have "spider queen" (monster 1732) and "Spider Queen" (monster 2080).
What should $monster[spider queen].id return?
What should $monster[Spider Queen].id return?
What behavior do you want for $monster[Spider queen]?
I suppose there could be int  MonsterDatabase.getMonsterIds( name ), similar to what we have for items and effects, which could be consulted if the name is not found verbatim in the monster database. It could give a "friendly warning" if there is a single match, or a "multiple matches" error if there is more than one.
Or we could just let people fix their buggy scripts now.
Revision 18837 fixes the capitalization for three monsters.
I'll consider this evening what else could be done; Adding "friendly warnings" a la items and effects would work for $monster literals, although it would be harder.
The issue is not quite the same as items and effects, where you have multiple different objects which have, literally, the same name and same capitalization. We also have "Mob Penguin goon (2008)" and "Mob Penguin Goon (2009)" where we punted on the problem by changing the monster names to differ in more than capitalization. Perhaps we should have tackled this issue at that time.
Part of the problem is that every item and effect has a numerical ID, which we know - and we assume monsters all do too, but we don't really know them all. I assigned pseudo ids (negative numbers) to the 100 or so we don't know.
I tried just doing case insensitive match if the case sensitive one failed, but which mostly stopped zlib and guide errors, but the ghost of Vanillica "Trashblossom" Gorton failed, probably string comparison and "'s.
Although the script failures shout, I think this will also break CCS, as all monster names there are lower case, as well as the monster decoration already reported.
CCS has a method to return the “encounter key” or something. It has options to convert to lower case or leave case intact.
FindMonster used to look up monsters based on lower case encounter key. Seems like CCS would look up using the lower case one.
Do you actually know that CCS is broken?