Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: 18835: Add images for God Lobster and Wall of Meat. Monster names are case sensitive.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Feed Reader RSS Bot's Avatar
    Join Date
    Jul 2009
    Posts
    11,481

    RSS 18835: Add images for God Lobster and Wall of Meat. Monster names are case sensitive.

    Add images for God Lobster and Wall of Meat. Monster names are case sensitive.

    by veracity0 on 2018-09-01 16:04:51

    M /src/data/monsters.txt (view) (diff)
    M /src/net/sourceforge/kolmafia/persistence/MonsterDatabase.java (view) (diff)
    Download the latest KolMafia build here.
    Every new revision posted within the hour.
    New EXE builds every Monday.

  2. #2
    Senior Member
    Join Date
    Apr 2018
    Posts
    133

    Default

    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.

  3. #3
    Developer
    Join Date
    Apr 2010
    Posts
    4,881

    Default

    Is it a breaking change, or does it just produce a lot of warning messages ?

  4. #4
    Developer
    Join Date
    Apr 2010
    Posts
    4,881

    Default

    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.

  5. #5
    Senior Member
    Join Date
    Jan 2014
    Posts
    189

    Default

    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():

    Code:
    > ash to_item("staff of ed")
    
    Multiple matches for "staff of ed"; using "[7961]Staff of Ed". () Clarify by using one of:
    "[2325]Staff of Ed"
    "[7961]Staff of Ed"
    Otherwise, to_monster() can silently fail in older scripts. That would be difficult to track down.

    Additionally, the following monsters have incorrect capitalisation in mafia's data files:
    Code:
    Book of Faces
    Tome of Tropes
    crazy bastard

  6. #6
    Developer
    Join Date
    Apr 2010
    Posts
    4,881

    Default

    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():
    Originally Posted by Ezandora View Post
    I would like that, but may not be quite that easy. I think the item code already had handling for multiple matches, as it allowed fuzzy matching. For monsters all that code would have to be added and debugged.

    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.

  7. #7
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,449

    Default

    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.

  8. #8
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,449

    Default

    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.

  9. #9
    Developer
    Join Date
    Apr 2010
    Posts
    4,881

    Default

    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.

  10. #10
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    11,449

    Default

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •