Definition: A person (called P) is obediant:
Follow the persuasion rules for the action of asking P to try waiting;
If the rule succeeded, yes;
There is room.
Gives this error:
[code] >–> You wrote ‘Follow the persuasion rules for the action of asking P to try
waiting’ (source text, line 9): but the ingredients in this phrase do not
fit it, but I am confused enough by this that I can’t give a very helpful
problem message. Sorry about that.
I was trying to match one of these phrases:
1. follow (persuasion rules - values based rule producing values) for (action
of asking p to try waiting - value)
2. follow (persuasion rules for the action of asking p to try waiting - rule)
This was what I found out:
persuasion rules = a rulebook
action of asking P to try waiting = an instruction to work out a stored
action, which results in a stored action
persuasion rules for the action of asking P to try waiting = something
Since the “ingredients” in this phrase do appear to fit it, at least to me (and, apparently, to the compiler; it’s not complaining about “the action of asking P to…” despite “asking it to” not being mentioned in the index), I have no idea what’s wrong with this. I’ve done some source diving into the standard rules. Here’s where the persuasion rules are defined:
Persuasion rules is a rulebook. 
That means they’re action based, so I don’t see why I can’t just follow them for a given stored action.
Am I just missing something incredibly obvious?
An action-based rulebook always operates on the current action. It’s not the same as a stored action based rulebook.
I don’t see an easy way to do what you’re trying to do. (The not-so-easy way is to tweak the I6 “action” variable, run the rulebook, test for success, and then tweak the variable back.) I suspect it will be easier to just write a bit of redundant code for each NPC.
Ah well. I already had separate flags for “playable” and “following the player”, and had hoped to avoid creating a third for “obeys the player but isn’t actually playable”, as this may ultimately turn into extension code (and I didn’t want to annoy prospective users). On reflection, I think I’ll use a rulebook and leave it up to authors:
A person can be playable.
[snip code involving changing PCs]
A person can be ready to follow.
[snip code involving following]
The obedience rules are a person based rulebook.
An obedience rule for a playable person (this is the... rule):
Besides, the persuasion rules can be responsible for narrating unsuccessful persuasion (i.e. they sometimes print things), so I guess this way is better (read: workable) anyway. I do think authors might confuse the “obedience” and “persuasion” rulebooks, but I can explain that in the docs.
This is probably a simpleminded suggestion, but why not put all the hard stuff in the definition of “obedient” and then just have the first persuasion rule check whether the NPC is obedient? That seems like it might avoid some unnecessary duplication. I guess there’s the issue of narrating unsuccessful persuasion, but that seems kind of doable to me too. I’m thinking something like this (pseudocode I’m not checking, so it probably doesn’t compile):
[code]To decide what text is the persuadability of (stooge - a person):
if stooge hates the player:
decide on “hate”;
otherwise if stooge despises the player:
decide on “despite”;
otherwise if stooge condescends to the player:
decide on “condescension”;
decide on “willingness”.
Definition: a person is obedient if its [?] persuadability is “willingness”.
Last persuasion rule for asking an obedient person to try doing someting: persuasion succeeds.
Persuasion rule for asking someone to do something when the persuadability of the person asked is “hate”:
say “[The person asked] hates your guts and will not do what you ask.”;
Persuasion rule for asking someone to do something when the persuadability of the person asked is “despite”:
say “[The person asked] wouldn’t listen to the likes of you.”;
Persuasion rule for asking someone to do something when the persuadability of the person asked is “condescension”:
say “[The person asked] thinks your suggestion is cute.”;
…and you could have other more specific rules to cover failures like asking Indy to do something in the presence of snakes. But then you don’t have to worry about the obedience rules getting out of sync with the persuasion rules, except when you want them to.
Does that make sense?
@matt w: I’d probably use a kind of value instead of texts (for “hate”, “condescend” etc), but that does look workable. But implementing emotions like that is a little beyond what I’m trying to do, so I think I’ll stick with my solution. Making obedient people also follow persuasion is interesting, but I’d like to use this for a very specific purpose (giving military orders like “take cover” or “regroup”), and I’m not sure if allowing the player to e.g. ALICE, SING (or even BOB, THROW ALICE AT CHARLIE) would fit the context. Thanks anyway, though.
I was thinking of texts to make it easier to add more of them – if you want to add a new reason-as-text, you have to put it in the persuadability decision and the persuasion rules, but if you want to add a new reason-as-value, you have to put it in the definition of those values as well – but it’s probably a bit of a hack. Anyway, it looks like you do want to separate obedience from persuasion somewhat, so you should definitely go with what works for you!