[I7] NPC trying to do custom verb with two objects

Been messing around with Inform for the first time and can’t for the life of me figure this out:

I created a custom verb called “noticing with” that works on two things. Originally I called it noticing but tried to add the “with” to fix the issue below.

Basically I want to have an NPC in code do a notice X with Y. I have tried:

try the guard noticing the first with the second
try the guard noticing with the first the second
try the guard noticing with the first, the second
try the guard noticing with the first and the second

(all of the above but inserting the word "trying" after "the guard")

All fail to compile (the first and the second are valid objects). There’s not really any good examples I can find for the try command and NPCs which is a bit of a pain.

Is the action just called “noticing with”? Actions that apply to two objects I think usually need an “it” in their definition to help Inform figure out how to parse the two nouns, so maybe try changing the definition to “noticing it with”? Sorry, I’m on my phone now so can’t test to be sure but while this might not completely fix things I’m pretty sure it’s part of the puzzle.

EDIT: just adding that this is something that confused the heck out of me, and many other people have posted questions about this so I think this is something that could use better explanation in the docs.

1 Like

Lol that worked. Damn.

My feelings about Inform started with “Wow, this natural language syntax style is so cool” and are now at “how in the nine hells does it want me to conjugate this verb” as I watch the build bar move from left to right over and over and…

1 Like

That’s the normal progression with Inform!

Noticing it with is an action applying to two things. Understand "notice [something] with [something]" as noticing it with.

Carry out the guard noticing the first noun with the second noun: [...]

Realize you can do this stuff programatically without supplying specific action for your NPCs. In most cases, you only need to create an action if the player needs to perform it, or if you want to write a rulebook for the action.

Every turn when the guard is in the location (this is the guard notices the gun rule):
     if the player encloses the gun and the bullets:
          say "The guard shouts 'Halt! Loaded weapons are not allowed in here!";
          [and more stuff if necessary]

It’s possible I’m using all the wrong tools, but here’s my logic:

Guards move around and do some logic on objects that aren’t where they’re supposed to be/etc. I do this by having single guard action which in turn triggers a “inspecting” action on each object which, if that object is suspicious, triggers a “noticing” action.

I decided to do it this way because then the action is easily reusable on more guards, I just have to type “Every turn, try Eric guarding” and now Eric is also a guard.

The other reason is customized reporting per guard. If Eric has a different voice than Sally the guard, it could be as easy as:

Report Eric noticing the gun: say, “Hey… are you trying to… murder someone?”
Report Sally noticing the gun, say “Drop the weapon, now!”