[i7] strange runtime error when redirecting persuasion

Hi,

I planned not to use the persuasion system much (at least for most NPCs in my game), instead I want to use the regular conversation system. So the idea was to rely on “ask person for object” for the few cases where you need to ask people for things, instead of the “person, give object to me” persuasion command. The latter however should still work and simply fall back to the former, so that things wouldn’t break entirely for players familiar with the persuasion system.

To achieve this, I tried the following:

Persuasion rule for asking person (called askedperson) to try giving something (called askedthing) to player: try asking askedperson for askedthing instead.
Now, when I use “ask person for somespecialthing”, the regular conversation code triggers. But “person, give somespecialthing to me”, which I expected to yield the exact same result, gave this output (tested in gnome inform 7):

At this point I figured I am supposed to do this in a different fashion. :smiley: Can anyone point me to the right direction?

Also, could I make this fallback only happen when “ask person for xyz” has an actual conversation rule in place?

In addition, I had trouble figuring out how to change the default “Xyz has better things to do.” to something neater - any hints on that are appreciated aswell!

One problem is that your rule should not be a persuasion rule – those are only for deciding whether the persuasion succeeds or not. You should just make it a check rule or an instead rule instead.

The other problem is that Inform already has a rule that tries to do the exact opposite, i.e. to convert “ask person for object” into “person, give me the object”. So your rule is causing an infinite loop.

You could either work with the existing convention (and thus code your “asking person for” rules to apply to apply to the “asking person to try giving” action), or just remove the existing rule with: The translate asking for to giving rule is not listed in any rulebook.

Ps. A useful way to debug these kinds of things is to use the commands “rules” and/or “actions”, which will cause Inform to print a list of the rules it considers and/or the actions you perform. In this case, either of those command would’ve revealed that your code gets stuck in a loop.

Hm ok, the runtime error is gone now. However, instead just nothing happens. (“person, give specialthing to me” results in empty response, and “ask person for specialthing” still works as usual)

Edit:
Let me sum up what is roughly the relevant code I have in place right now:

Include Conversation Package by Eric Eve.

[ other code here ]

The probing device version 1 is a thing with printed name "probing device".
Edward carries the probing device version 1.

Response for Edward Cross when asked for probing device:
	if Edward carries probing device version 1:
		say "'Sure, here you go!', Edward says. 'Tell me as soon as you run into something interesting!'

(taking probing device)";
		move probing device version 1 to player;
	otherwise:
		say "'I don't have another one, sorry!', Edward responds.".

The translate asking for to giving rule is not listed in any rulebook.
Persuasion rule for asking person (called askedperson) to try giving something (called askedthing) to player:
	try asking askedperson for askedthing instead.

Edit 2:

Ohh, actions/rules revealed the problem. Edward appears to be asking himself for the device :smiley: I suppose the try needs to be modified to ensure he asks the player and not himself :stuck_out_tongue: will ponder that for a moment.

Thanks for the actions/rules hint!

I think it’s because of the “persuasion rule” thing. You should just try using a normal check or instead rule; see my edited reply above.

Anyway, the following example works for me:

"Gimme!" by Vyznev Xnebara

The story headline is "An Interactive Test".

The Testing Chamber is a room.
Bob is a man in the chamber.
Bob carries a note and a key.

The translate asking for to giving rule is not listed in any rulebook.

Instead of asking a person (called askedperson) to try giving something (called askedthing) to the player: try asking askedperson for askedthing.

Instead of asking Bob for the note when Bob has the note:
	say "Bob gives you the note, saying: 'Here, take a look.'";
	now the player carries the note.

Check asking a person for something held by the noun: say "[The noun] says: 'No, that's mine!'" instead.
Check asking a person for something: say "[The noun] says: 'I don't have that.'" instead.

Test me with "ask bob for key / bob, give me the key / ask bob for note / g".

Ok I’m still stuck with this, I tried to make use of your quoted example code (thanks!) like this:

[code]The translate asking for to giving rule is not listed in any rulebook.

Instead of asking a person (called askedperson) to try giving something (called askedthing) to the player: try asking askedperson for askedthing.[/code]
This is the result: (please note the latter ask for works perfectly fine)

It seems that it wants to trigger the conversation rule, then somehow just doesn’t and fails. No idea why it would do that! :confused: Accessing the conversation topic directly appears to be working, as usual.

OK, that has something to do with the Conversation Package extension. I’ve never used it, so I can’t really say much about it.

That said, what if you tried simply ignoring the extension in this case and just using an “instead of asking Edward Cross for the probing device” rule, like in my example? It might at least be worth a try.

I tried this which doesn’t work either:

instead of asking Edward Cross to try giving the probing device to the player: try player asking Edward Cross for probing device.
Your suggestion confuses me a bit, why would I want to redirect the ask for device command? (Since that is what I want to redirect TO)

Edit: ah, you want me to replace the rule to work without the extension. Hangon, will give it a try…

Ok, so this actually works:[code][ NO extension include at the top - now without Conversation Package! ]

Edward Cross is a person.
The probing device version 1 is a thing with printed name “probing device”.
Edward carries the probing device version 1.

Instead of asking Edward Cross for probing device:
if Edward carries probing device version 1:
say "‘Sure, here you go!’, Edward says. ‘Tell me as soon as you run into something interesting!’

(taking probing device)";
move probing device version 1 to player;
otherwise:
say “‘I don’t have another one, sorry!’, Edward responds.”.

The translate asking for to giving rule is not listed in any rulebook.

Instead of asking a person (called askedperson) to try giving something (called askedthing) to the player: try asking askedperson for askedthing.[/code]So the extension is the culprit. A bit sad, it seemed useful. However, I will be able to work without it I suppose. Thanks a lot for the help and hints!

It’s a rather fantastic extension, actually. The problem is that the extensions tears down and rebuilds the conversation system. Using the extension, you’d put your response to the order in a ‘response when implored for’ rule. The extension may already convert ‘ed, give me the thing’ to the same imploring it for action.

Hmm that sounds nice, however:

Response for Edward Cross when implored for probing device: do nothing. results in the compiler error:

The previous “response for edward cross when asked for probing device” works fine.

I’ve probably got the names of the actions wrong. Check out the index for the accurate ones. The short of it is that you need to write instead/before/after rules against the extension’s activities if you’re using the extension.

What sort of index are you referring to? Is that some other sort of debug function I’m still unaware of?

Regarding implore, I checked the source code of the various sub-extensions involved in the Conversation Package and “imploring X for Y” definitely appears to exist. So I have no idea why it wouldn’t work. :confused:

Right now, I’m using this suboptimal solution:

[code]A person can be controllable or not controllable.
A person is usually not controllable.

Instead of asking a person (called askedperson) to try giving something (called askedthing) to the player when askedperson is not controllable:
say “Try asking [askedperson] for it instead.”.

Persuasion rule for asking a person (called askedperson) to try doing something:
if askedperson is controllable:
persuasion succeeds;
otherwise:
persuasion fails.[/code]I would still prefer a solution similar to this one though:[code]A person can be controllable or not controllable.
A person is usually not controllable.

The translate asking for to giving rule is not listed in any rulebook.
Instead of asking a person (called askedperson) to try giving something (called askedthing) to the player when askedperson is not controllable: try asking askedperson for askedthing.

Persuasion rule for asking a person (called askedperson) to try doing something:
if askedperson is controllable:
persuasion succeeds;
otherwise:
persuasion fails.[/code]… so if someone knows how to make that work with Eric Eve’s Conversation Framework (I had it work like that without), I’d be happy to know how to do it. (defining “Response for Edward Cross when implored for probing device: … stuff to do here …” doesn’t work, see previous posts) For now, I can probably stick to this current workaround.