Feature - Implemented Request: Monster.article proxy record

phreddrickk

Active member
Different monsters have different articles used to address them in-game--the main ones I've seen are "the", "a", "an", "some", and not having one at all (as is the case for The Man, whose The is part of the monster name.) This recently came up when we had some buggy parsing of text from the miniature crystal ball's ponder page.

It might be useful to internally track which article each monster uses. According to @gausie this information is available in the Monster Manuel, which should make spading less tedious for this (we just need to find someone with incredibly exhaustive factoids, and get them to run a lot of regexps). And if we're internally tracking that, we might as well externally expose it.

"Article" may not be the best name for it. Incredibly open to suggestions there.
 
"article" is what it's called in the MM comment:
Code:
<b><font size=+2>a massive prism of grey goo</font></b><!-- article:a --><ul><li>
 
I wrote a little program to extract all the articles.

Code:
> articles.ash

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
-
2025 found.

a few observations:
Code:
555    The Man
No article, as expected.
Code:
49    Boss Bat    The
Oo la la! Mr Fancy Pants my article is capitalized!
Code:
1352    the ghost of Phil Bunion
Unique monster, no distinct article, but lower case.
Code:
2193    a massive prism of grey goo    a
So if you see one, it is "a a massive prism of grey goo"?
Code:
1435    pygmy orderlies    some
Yes, there are "some" monsters.
 

Attachments

I'm now working on this. I'm starting out by souping up attribute parsing in monsters.txt. I will then add Article: and figure out a way to read-update-write monsters.txt, processing each monster and rewriting the attributes field with Article as supplied by MonsterManuel. It will take a while to write that automation, but it will beat manually updating 2025 monsters and hoping I got it right. :)
 
It will normalize the order of the attributes - the fourth of the tab separated fields, after name, monsterId, and images.

I’ll be creating a utility method which will go through monsters.txt line by line and normalizing that field for each monster. So, you should be OK. If you get you PR in before me, I’ll normalize your data. Otherwise, you’ll have to call the utility yourself.
 
Looking at your thread, you are adding two attributes. I have already whacked how they are parsed. Perhaps I should get that refactoring in, first, so you can modify the new and improved code?
 
Tell you what. I am adding “Article: an”. I’ll also add “Elem: EXPR” and “Group: N”, including the fields in MonsterData and the Proxy Record fields. Those are easy, and are right in the code I am whacking. Then, you can just add the monsters.txt changes whenever you get around to it.

I’ll do my automated extraction of articles from Manuel as a follow up PR.

I should be able to finish up my initial PR - with tests - tomorrow.
 
Thanks Veracity, this will be very helpful.
I currently have my own data for Elem and Group, then wrote a parser to process them into monsters.txt. I will wait for your PR then modify my parser as needed to get monster.txt updated.
 
r26478 adds articles to all monsters on the Manuel, which you can access via

$monster[pygmy orderlies].article -> “some”
$monster[The Man].article -> “”

Note that getting “” means either there is no article or the monster is not in Manuel.

I also added:

int monster.elem
int monster.phys (already existed)
int monster.group

In monsters.txt, Phys: and Elem: can take either INT or [EXPR]. Expressions will evaluate into an int at run time. Note they are ints - percentages from 0-100, not floats from 0.0 to 1.0.

ckb, you should be able to just edit monsters.txt. When you have done so and built your jar, run it and do “test fix-monster-attributes” in the gCLI which will “normalize” the attributes and write monsters.txt in your data directory. Submit that file.
 
r26478 adds articles to all monsters on the Manuel, which you can access via

ckb, you should be able to just edit monsters.txt. When you have done so and built your jar, run it and do “test fix-monster-attributes” in the gCLI which will “normalize” the attributes and write monsters.txt in your data directory. Submit that file.

You give me too much credit. Modifying data files is about the extend of my Mafia Java modification skills. I don't know how to build a jar and I am not sure I would have to time to decipher how to do that... I can make my changes with as much consistency as the current monsters.txt though.
Is there another option to use your “test fix-monster-attributes”?
 
Make changes to monsters.txt, commit and push it to your branch, open a PR, and I believe I could check out that PR branch, build, run the command, and commit the fixed file?
 
Make changes to monsters.txt, commit and push it to your branch, open a PR, and I believe I could check out that PR branch, build, run the command, and commit the fixed file?
ok - that I can figure out how to do. I'll try to commit this week.
 
Back
Top