[ZIL] - Pronouns for NPCs

Hi, I’m fairly new to ZILF, and have limited experience with Inform 7. However I am really loving ZILF in general! Currently I am making a small little game where the player has to interact with an NPC (asking questions and whatnot). I have the NPC flagged as a person (via PERSONBIT) but I don’t know how to make it so that you can refer to the NPC with pronouns. For example, if you said something like > ask him about … it would respond with “they are no longer here.” But when you use the actual name, it works. What’s going on?

(Here’s the definition of the NPC who is a Clerk)

       (ACTION CLERK-F) ;"<~ Where questions are handled"
       (LDESC "A helpful looking person, who seems willing to help.")>

Just to check, have you done an EXAMINE CLERK or such before trying to use the pronoun? By default, pronouns are only “bound” to objects when those objects are used in a command.

(If you want to “bind” a pronoun at some other point, you can call the THIS-IS-IT routine to make the parser “notice” something.)


Yeah, just to make sure I am not going crazy or something, even after examining the clerk it doesn’t allow you to use pronouns to refer to them.

> examine the clerk
A helpful looking person, who seems willing to help.

> ask him about flights
The clerk is no longer here.

It worked for me (with ZILF 0.9) when I simply pasted the CLERK into the Cloak of Darkness sample game. (Well, almost. Of course I had to add a synonym for the clerk, an “ask about” verb and an action routine.) In fact, simply putting him in the room for me to see made the game set “him” to be the clerk.

Does the “pronouns” command give any hints?

1 Like

FYI, since I forgot to add it to the original definition. I do have a synonym for CLERK, and such. I tried using the pronouns command, and examining, then the pronouns command. I still got the same behavior described above. However it did confirm HIM means the clerk. I am using ZILF 0.9, I am compiling to VERSION 8. I could be totally daft and doing something stupid, idk :confused:

For anyone looking at this post in the future, and if you happen to be learning ZILF for the first time, and happen to be a twat like me, remember to have a room’s location as ROOMS.
Literally that was the only problem I was having, because I am a twat.
Thank you everyone for helping me out.


Glad you sorted it! :slightly_smiling_face:

I often use cheats for stuff like this, so I’d probably just add HIM to <SYNONYM …>