In the presence of. . .

Hi! I7 project going. I’m trying to get some code working involving “in the presence of” as per the documentation 7.12.

So, here’s a facsimile of my code that I can’t get to work:

every turn while in Tea Party Grove: if player is holding the tea cup: if player is in the presence of a person: say "You should drink some more tea so as not to be rude!"; otherwise: do nothing; otherwise: do nothing.

This doesn’t work, nor does “in the presence of someone”. I get this error:

Thanks for any advice!

“In the presence of” is rather specialized; it can only be used as a condition on an action rule.

“if the player can see someone” should be equivalent. Although the player can (nearly) always see him/herself, so you’ll need to put on additional requirements.

Rockin’! Thank you!

Trouble again. I’m sorry. :blush:

every turn while in Church: if player is holding the dildo: if the player can see someone: if the person is the player: do nothing; otherwise: say "You should put your dildo away as it is getting you some angry and confused looks."; otherwise: do nothing; otherwise: do nothing.

This compiles fine but doesn’t work correctly. Now the message won’t display even when near an NPC.

“if the person is the player” doesn’t mean what it looks like it means. It means the same thing as “if a person is the player,” which is always true, so your condition isn’t firing. (In the next edition of Inform “the person” won’t compile.)

You could try “if the player can see someone who is not the player,” though I’m not positive that will compile. If it doesn’t, then you can define NPC as a person who is not the player and use “if the player can see an NPC.”

I also think you probably don’t need any of those "do nothing"s; if you leave them out it’ll still, well, do nothing.

Thank you!! I will keep at it and probably end up defining the NPCs as such. And it’s true, I am very redundant in my coding. :stuck_out_tongue: