A pair of dialogue conditions I'm not certain about
chimeric
Member Posts: 1,163
This is a simple Intelligence check in a Weidu dialogue:
IF ~CheckStatGT(Myself,14,INT)~ THEN DO ~SetGlobal("KAZAKER_TEACHES","GLOBAL",1) FadeToColor([0.0],0) Wait(2) AddexperienceParty(200) AdvanceTime(FOUR_HOURS) FadeFromColor([50.0],0) ApplySpellRES("SYSTEM_#",LastTalkedToBy("KAZAKER")) Wait(1) ActionOverride("KAZAKER",Dialogue(LastTalkedToBy("KAZAKER")))~ EXIT
IF ~CheckStatLT(Myself,15,INT)~ THEN DO ~SetGlobal("KAZAKER_TEACHES","GLOBAL",2) FadeToColor([0.0],0) Wait(2) AdvanceTime(ONE_HOUR) FadeFromColor([50.0],0) Wait(1) ActionOverride("KAZAKER",Dialogue(LastTalkedToBy("KAZAKER")))~ EXIT
The first series of actions is supposed to happen if the PC is smart, the second - if less so. There is a problem with executing these series from inside the conversation, and I'd like to know why they fail, but my main question here is why does only the first option ever get selected. Even if I talk to the NPC with a stupid character, they still get the smart outcome. I can see it by the glow in the custom spell. Is it that it's actually the NPC's Intelligence that gets measured? His is 18.
IF ~CheckStatGT(Myself,14,INT)~ THEN DO ~SetGlobal("KAZAKER_TEACHES","GLOBAL",1) FadeToColor([0.0],0) Wait(2) AddexperienceParty(200) AdvanceTime(FOUR_HOURS) FadeFromColor([50.0],0) ApplySpellRES("SYSTEM_#",LastTalkedToBy("KAZAKER")) Wait(1) ActionOverride("KAZAKER",Dialogue(LastTalkedToBy("KAZAKER")))~ EXIT
IF ~CheckStatLT(Myself,15,INT)~ THEN DO ~SetGlobal("KAZAKER_TEACHES","GLOBAL",2) FadeToColor([0.0],0) Wait(2) AdvanceTime(ONE_HOUR) FadeFromColor([50.0],0) Wait(1) ActionOverride("KAZAKER",Dialogue(LastTalkedToBy("KAZAKER")))~ EXIT
The first series of actions is supposed to happen if the PC is smart, the second - if less so. There is a problem with executing these series from inside the conversation, and I'd like to know why they fail, but my main question here is why does only the first option ever get selected. Even if I talk to the NPC with a stupid character, they still get the smart outcome. I can see it by the glow in the custom spell. Is it that it's actually the NPC's Intelligence that gets measured? His is 18.
0
Comments
But about my other question: who knows what kind of action sequence I can put at the end of a dialogue, in a DO before EXIT? Simple actions do trigger, but anything with Wait() seems thrown off. And if this is not a reliable way of running actions, then what is the alternative? I wanted to set a global, fade out the screen, quickly, apply a short wait, then under this cover of darkness give some XP, advance time, apply a spell and fade in again. The final command in my intended sequence before EXIT was this: ActionOverride("KAZAKER",Dialogue(LastTalkedToBy(Myself))).
KAZAKER is the script name of this NPC, and after an ActionOverride the subject of the action, i.e. Myself, becomes the new creature. For example, with ActionOverride("KAZAKER",Kill(Myself)) he would commit suicide. And in the case at hand Kazaker should have addressed the same PC as the last time around, i.e. resume the conversation. And, with the global set, he should have started with the proper state line. Well, if I'm writing about it on the boards, it means that doesn't happen - he doesn't begin to talk, though the fade-out occurs. Am I missing some technical detail everyone's learned ages ago, or it's just impossible to put an elaborate sequence like that before EXIT?
Re teleport thing - no idea, doesn't ring any bells.
To your "NPC is back with PC" problem: Are you sure there was no command / no script running that made the NPC return to the PC in some way? How did you apply the spell, for example, maybe it was executed by KAZAKER who had to return to the PC for it? Dialogue() makes the NPC walk all the way to the character he wants to initiate dialogue with, so maybe the NPC walked across the area before and you didn't notice because he walked back for the Dilalogue() action (I am doing wild guesses here).
As Ardanis said, StartDialogNoSet() is to preferred, because a lot can go wrong and interrupt the NPC's action while he is still walking towards the dialogue target with Dialog() (I am writing this out of my own experience.)
With argrent77's code I should be able to do ActionOverride(LastTalkedToBy("KAZAKER"),JumpToObject("KAZAKER")).