Have you tried chapter 7.15. Kinds of action in the docs?
Kissing Mr Carr is unmaidenly behaviour.
Doing something to the painting is unmaidenly behaviour.
Instead of unmaidenly behaviour in the Inn, say "How unmaidenly!"
Edit: One more thing, do you have any more specificinstead of rules that fire instead of your banking rule?
I can’t test this right now, so take it with a grain of salt, but I believe Inform forbids kinds of action (like your “banking”) that end in -ing, so they can’t be confused with actual actions. You have to name them with nouns instead of verbs.
Account-opening is a financial transaction.
Account-closing is a financial transaction.
Withdrawing money is a financial transaction.
Depositing money is a financial transaction.
Instead of a financial transaction:
No, that didn’t work. I did get a slightly different error message. It says that to redefine something, that something should end with -ing. However example in 7.15 says
Doing something to the painting is unmaidenly behavior.
I wonder if it is because I am trying to make a synonym of actual actions I have.
Open_account is an action applying to nothing.
Understand "open account" as open_account.
Closing_account is an action applying to nothing.
Understand "close account" as closing_account.
The example does not look like a new action created by the author.
The Bank is a room.
The Park is north of the Bank.
Open_account is an action applying to nothing.
Understand "open account" as open_account.
Report open_account:
say "Your account is now open."
Closing_account is an action applying to nothing.
Understand "close account" as closing_account.
Report closing_account:
say "Your account is now closed."
Withdrawing money is an action applying to one number.
Understand "withdraw [number]" as withdrawing money.
Report withdrawing money:
say "Your account is already overdrawn."
Depositing money is an action applying to one number.
Understand "deposit [number]" as depositing money.
Report depositing money:
say "Let's see the cash pal!"
Open_account is banking.
Closing_account is banking.
Withdrawing money is banking.
Depositing money is banking.
Instead of banking when the location is not the Bank:
say "You'll have to go to the bank for that."
test me with "open account / deposit 200 / withdraw 50 / close account / n / open account".
It would help to know how the response you get differs from the response you expect.
If you’re using an instead rule to check to see if banking is possible, you’d probably be better off using check rules. To avoid repetition, you can do something like this:
Check an actor open_account (this is the bank transactions are done in banks rule):
if the location is not the bank:
say "You'll have to go to the bank for that." instead.
Check an actor closing_account:
abide by the the bank transactions are done in banks rule.
Open_account is banking.
Closing_account is banking.
Withdrawing money is banking.
Depositing money is banking.
This is exactly what I want, except, as you say, they are actions that don’t end in -ing.
Opening an account is banking.
Closing an account is banking.
Opening an account is an action applying to nothing.
Understand "open account" as open_account.
Check opening account:
and I get the following error: The sentence ‘Opening an account is banking’ appears to say two things are the same - I am reading ‘Opening an account’ and ‘banking’ as two different things, and therefore it makes no sense to say that one is the other.
I get the same error for
Open_account is banking.
Close_account is banking.
and of course, changing the Check and Carry Out rules accordingly.
What is the principle behind this error?
Perhaps the error is misdirecting me and the cause is something else entirely?
If you get nothing as output, that indicates that your instead rule is not continuing when the situation passes all tests. To illustrate, in my code, if you have:
Instead of banking:
if the location is the Park:
say "You'll have to go to the bank for that."
The result is something like this:
Bank
>test me
(Testing.)
>[1] open account
>[2] deposit 200
>[3] withdraw 50
>[4] close account
>[5] n
Park
>[6] open account
You'll have to go to the bank for that
.
>
Remember, instead rules automatically “stop the action.” If no conditions in the rule apply, it will simply stop without producing an output.
Try putting the action definitions (“ Opening an account is an action applying to nothing”, etc.) above the lines where you say they’re banking - I think that’s what’s confusing the compiler here.
(Similarly I’d try putting “banking is a kind of action” above the lines where you start assigning actions to it).
I moved the synonyms BELOW the declaration of the actions, and it worked.
Apparently, the compiler must have the actions defined BEFORE they are used in a group action name.
A J Mako did that in his example and it worked.
Isn’t that unusual? Usually it doesn’t matter in what order things are defined.
I don’t know the full rules, but yeah usually it doesn’t matter, but since there are exceptions it’s better to write things the way that minimizes errors if you can, which is to fully declare things before you start using them. Makes for more readable code too!