Closed curiousdannii-testing closed 2 years ago
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by lpsmith :
(First noticed by Jeremy Freese, and confirmed as a bug by zarf.)
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by zarf :
Well, I've confirmed that it looks like a bug to me, anyway.
Error message: You wrote 'Instead of putting it on' , which seems to introduce a rule taking effect only if the action is 'putting it on'. But that did not make sense as a description of an action. I am unable to place this rule into any rulebook.
A simpler example:
Report putting it on: say "report."Instead of putting it on: say "instead."
The first line works, the second line fails. I can't think of any reason why that action specification should only be valid in check/report rules.
557058:4c095ffd-6d6f-47ce-9e73-77c613347b86:
Comment by mattweiner :
I can think of a reason but it's not a very good reason.... "Report putting it on" is the name of the rulebook, so that rule can go straight into the named rulebook. The "instead" rules are followed by an action specification, and "putting it on" isn't an action specification in the way "putting something on something" is.
This may even be hinted at in §19.2 of WwI:
[quote]If the source text contains the rules
Instead of taking something: say "You have no particular need just now."
Instead of taking a fish: say "It's all slimy."
and a command to TAKE something is tried, then only one of these rules will have any effect. The "instead" rulebook contains:
Rule (1) to be applied if the action matches "taking a fish"
Rule (2) to be applied if the action matches "taking something"[/quote]
This somewhat suggests that "Instead of putting it on" should be applied if the action matches "putting it on," but "putting it on" is an action name and not an action specification.
By similar lights, "Report putting it on Emmett:" doesn't work, since "putting it on Emmett" isn't an action specification and the header isn't the name of the rulebook.
Nevertheless it would probably be desirable to have "it" work uniformly here.
https://github.com/ganelson/inform/commit/e29d0adb2fb68748f4d7e1b0cb6edc57f6a289a9
Comment by Graham Nelson:
I've written a much more helpful problem message to catch this case, advising the use of "something" instead of "it".
Reported by : lpsmith
Description :
The attached source does not compile, and should!
Steps to reproduce :
Additional information :
If you replace 'it' with 'something', it works as expected.
imported from: [Mantis 2068] 'instead' rule requires 'something' instead of 'it