If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

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.

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.

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

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.