zarqon
Well-known member
The recent change to location names has prompted me to request something I've wished for periodically from time to time.
Script authors, for various reasons (convenience, memory failure, haste, laziness, syntax highlighting), will sometimes not use the complete name when specifying one of mafia's typed constants. Example: $monster[Yog-Urt]. There's more to her name, of course. The Goddess of Hating... er, Elder Demon of Hating... er... Hatred? Ok, I'll just shorten it to "Yog-Urt" for now because I'm concentrating on testing script functionality, not name specifics.
Later, it can be extremely difficult to remember and then locate these instances, in order to flesh them out. Since mafia fuzzy matches them (which is nice) and doesn't complain about it (which is polite), those of us with poor memories for such details (me, at the very least) often completely forget that we left a partial name in our script. Later, when KoL adds a similar thing and our script generates a "multiple matches" error, we remember... but TOO LATE!
I'd find it quite handy if mafia would print warning messages for incomplete names when specified in $type[] (but not for CLI commands, naturally), complete with script name and line number, so that all those instances of partial names could be eliminated. When dealing with user input, the fuzzy matching is extremely helpful. When dealing with hardcoded names in ASH, the fuzzy matching is still helpful when testing, but for a final release, there's no good reason not to use a complete name.
It would be particularly handy now when updating scripts with multiple $locations[] in them (such as CanAdv or BBB), since many of the old location names still match, despite being incomplete!
ETA: Example warning message:
Warning: Incomplete name given for Yog-Urt, Elder Goddess of Hatred (BatBrain.ash, line 812)
Script authors, for various reasons (convenience, memory failure, haste, laziness, syntax highlighting), will sometimes not use the complete name when specifying one of mafia's typed constants. Example: $monster[Yog-Urt]. There's more to her name, of course. The Goddess of Hating... er, Elder Demon of Hating... er... Hatred? Ok, I'll just shorten it to "Yog-Urt" for now because I'm concentrating on testing script functionality, not name specifics.
Later, it can be extremely difficult to remember and then locate these instances, in order to flesh them out. Since mafia fuzzy matches them (which is nice) and doesn't complain about it (which is polite), those of us with poor memories for such details (me, at the very least) often completely forget that we left a partial name in our script. Later, when KoL adds a similar thing and our script generates a "multiple matches" error, we remember... but TOO LATE!
I'd find it quite handy if mafia would print warning messages for incomplete names when specified in $type[] (but not for CLI commands, naturally), complete with script name and line number, so that all those instances of partial names could be eliminated. When dealing with user input, the fuzzy matching is extremely helpful. When dealing with hardcoded names in ASH, the fuzzy matching is still helpful when testing, but for a final release, there's no good reason not to use a complete name.
It would be particularly handy now when updating scripts with multiple $locations[] in them (such as CanAdv or BBB), since many of the old location names still match, despite being incomplete!
ETA: Example warning message:
Warning: Incomplete name given for Yog-Urt, Elder Goddess of Hatred (BatBrain.ash, line 812)
Last edited: