I have two NPCs in one location. An important topic of conversation might be addressed to either of them, so each of them has a similar AskTellTopic, which is also a StopEventList. If the ask/tell is addressed to NPC #1, I want to advance the topic that belongs to NPC #2, and vice-versa. It would make no sense for NPC #2 to respond as if he hadn’t heard the preceding conversation (and vice-versa).
The problem is, I’m getting a stack overflow. I don’t know if this is a library bug, if it’s my bad code, or if it’s an inherent limitation of the StopEventList design. Below is the code (hidden, as it’s a sort of minor spoiler for the game). The first AskTellTopic is in the ActorState of NPC #1, the second in the ActorState of NPC #2.
[spoiler][code]++ floggLamborghiniResponse: AskTellTopic, StopEventList [lamborghini]
[
'I noticed that bright red Lamborghini out in the parking lot, you comment.
<.p>That fabulous little toy belongs to him, Flogg says, pointing his
bony thumb at Grabby.<<grabbyLamborghiniResponse.advanceState()>>
<.p>Grabby puffs out his chest proudly. Ain’t it a honey? It’s mine. I paid
cash, too, I’ll have you know. ',
'If you want to know anything more about that car, Flogg says, you may
as well ask him. ’
]
;
++ grabbyLamborghiniResponse: AskTellTopic, StopEventList [lamborghini]
[
'I noticed that bright red Lamborghini out in the parking lot, you comment.
<.p>Grabby<<floggLamborghiniResponse.advanceState()>> puffs out his chest
proudly. Ain’t it a honey? It’s mine. I paid
cash, too, I’ll have you know. ',
'<q>You must be proud of that bright red sports car,</q> you say.
<.p><q>Oh, I am, I am!</q> Grabby responds, practically bouncing up and down
in his chair. <q>If anything happened to it, I just don\'t know what I\'d do.
I\'d just about go crazy!</q> '
]
;[/code][/spoiler]
As far as I can see by looking at the library code, advanceState simply increments curScriptState. It shouldn’t be doing anything else. But it appears that somehow, in incrementing the state of the list, the library is also evaluating the embedded expression in the first item in the list. This shouldn’t be happening, should it?
If it’s an inevitable effect of the library’s code, how can I work around it? Possibly with an AltTopic…