Action success definition

This part of the manual throws me off:

“Every action ends in success or failure. In this context, success means only that the player’s intention has been fulfilled. If the player sets out to take the napkin, but finds a million-pound banknote in its folds instead, the action will be deemed to be a failure.”

How I would think this works is that if nothing actually stops a “taking” action, then it succeeds. Finding a banknote in the napkin should not count as failure because the player still took the napkin, right? Unless this wording is meant to imply that the banknote was found before the taking action took place and thus that somehow stopped the action? This idea of “intention” is kind of muddy unless it means exactly that: “Player intended to take the napkin and nothing prevented them from doing so.”

If something happens during or after the action, I would think that means the action was still a success. So for example, “taking the napkin” leads to the response: “As you take it, a million-pound banknote falls out.” How would that action be “deemed to be a failure” in the words of the manual?

I think I see it. I think it’s probably just loose wording in the manual, regarding “intention.” Action and intent are different things in normal usage.

If my “intent” is to take a napkin and nothing stops that intent, then by definition of how these games work my intent is turned into action and the action succeeds.

If my “intent” is to take the napkin BUT I notice, as I’m about to, that there’s a poisonous spider near it, I won’t take it. Thus my “intention” has been “thwarted.” No action takes place.

If my “intent” is to take the napkin AND as I do so, I find a poisonous spider in its folds AND I drop the napkin, “intent” was successful, but the “action” ultimately failed.

If my “intent” is to take the napkin AND as I do so, I find that poisonous spider BUT I shake the spider off, keeping the napkin, the “intent” and the “action” were successful.

That passage of the manual seems unhelpfully metaphysical to me in some ways. I think your second post basically has it right, but it’s probably more helpful to think of it in terms of which rules run; the idea, I think, is that if the action makes it to the Carry Out rules, then it is considered to succeed. So some of your scenarios:

Code:

[code]Kitchen is a room.

The napkin is in Kitchen.

Test me with “actions/take napkin”.[/code]

Output:

The action went through all the standard carry out and report rules, because nothing stopped it.

[code]Kitchen is a room.

The napkin is in Kitchen.

There is a hundred dollar bill.

After taking the napkin when the hundred dollar bill is nowhere:
say “As you take the napkin a hundred dollar bill falls out!”;
now the hundred dollar bill is in the location.

Test me with “actions/take napkin”.[/code]

Output:

The After rule cut off the standard report rules, but the action is still considered to have succeeded because the Carry Out rules ran.

[code]Kitchen is a room.

The napkin is in Kitchen.

There is a hundred dollar bill.

Instead of taking the napkin when the hundred dollar bill is nowhere:
say “You see a hundred dollar bill in the napkin and take that instead.”;
now the player carries the hundred dollar bill.

Test me with “actions/take napkin”.[/code]

Output:

The “Instead” rule cut off the action before you reach the carry out rules, so the action is considered to have failed.

[code]Kitchen is a room.

The napkin is in Kitchen.

There is a poisonous spider in the kitchen.

Check taking the napkin when the spider is in the location and the napkin is in the location:
say “You try to get the napkin, but the spider scares you off.” instead.

Test me with “actions/take napkin”.[/code]

It failed because the check rule cut it off; note that check rules that fail get put into the “reason the action failed” variable.

[code]Kitchen is a room.

The napkin is in Kitchen.

There is a poisonous spider in the kitchen.

Before taking the napkin when the spider is in the location and the napkin is in the location:
say “You’re not even going to think about taking the napkin while that spider is around.” instead.

Test me with “actions/take napkin”.[/code]

To tell you the truth, I wasn’t expecting “ended without result” here.

[code]Kitchen is a room.

The napkin is in Kitchen.

There is a poisonous spider.

After taking the napkin when the spider is nowhere:
say “As you pick up the napkin, you find a poisonous spider in its folds and drop them both.”;
now the napkin is in the location;
now the spider is in the location.

Test me with “actions/take napkin”.[/code]

Because the carry out rules ran, the action is considered to have succeeded, even though the After rule means that you didn’t wind up with the napkin.

…and now, another point: For a lot of purposes, maybe most, you don’t really have to worry about whether the action succeeded or not. It plays a big role in printing messages about orders you give to NPCs, but I’m not sure where else it makes that much of a difference. Anyone else got any opinions on this?

This is a misleading statement in the documentation. You can write your I7 code to conform to this principle, but you don’t have to.

I find the action-success model awkward enough that I ignore it entirely. I have my own habits for check and instead rules, and I just don’t care whether an action ends in success or failure; I don’t write code that depends on that. Works fine.