ThePix / QuestJS

A major re-write of Quest that is written in JavaScript and will run in the browser.
MIT License
66 stars 13 forks source link

NPC agenda is triggered by "look x" actions, even if look does not count as an action #4

Closed Kln95130 closed 4 years ago

Kln95130 commented 4 years ago

Hello again.

I'm dabbling in QuestJS again, and I encountered this behaviour. I do not know if this is a bug, an oversight, or working as intended.

My NPC's agenda is triggered when using a look x action, even if the LOOK_COUNTS_AS_TURN setting is at false. This does not happen if I simply use look.

In the picture below, I programmed the biker's agenda to go through a series of text commands, each one a greeting in a different language. I expected the texts to be displayed only after using wait, or going back-and-forth the room.

image

Kln95130 commented 4 years ago

Nevermind, I was looking at the look command, not at the look at. Once I did, the solution appeared relatively simply. One needs to define the examine attribute of the item the player looks at as a function, and add a return false.

A QoL evolution could be of adding a "default return" option, allowing you to declare that such and such command returns false, when in string form or no return is specified.

I'm closing the issue.