Jump to content

Dialogue Noobness


Mike1072

Recommended Posts

I just started scripting err... yesterday... and I'm doing pretty well, but having not read a proper dialogue tutorial I am a little mystified as to why my code isn't working. What I want the creature to say is a one-time intro, then go to their main section, which is what appears if he is talked to again. Right now it works great the first time, but on subsequent times he starts with one of the later dialogue options or has nothing to say to me. Do I need to number the states or add conditions for the later conversation options?

 

BEGIN ~MICHOOSE~

IF ~Global("MIChooseIntro","GLOBAL",0)~ BEGIN Intro
SAY @0
IF ~~ DO ~SetGlobal("MIChooseIntro","GLOBAL",1)~ GOTO Main
END

IF ~~ BEGIN Main
SAY @1
++ @2 GOTO OptionA
++ @3 GOTO OptionB
++ @4 GOTO Goodbye
END

IF ~~ BEGIN Option1
SAY @5
++ @6 DO ~STUFF~ EXIT
++ @7 GOTO Main
END

IF ~~ BEGIN Option2
SAY @8
++ @9 DO ~STUFF~ EXIT
++ @10 GOTO Main
END

IF ~~ BEGIN Goodbye
SAY @11
IF ~~ EXIT
END

Link to comment

IF ~~ BEGIN Main
SAY @1
++ @2 GOTO OptionA
++ @3 GOTO OptionB
++ @4 GOTO Goodbye
END

 

Should be:

 

IF ~Global("MIChooseIntro","GLOBAL",1)~ THEN BEGIN Main
SAY @1
++ @2 GOTO OptionA
++ @3 GOTO OptionB
++ @4 GOTO Goodbye
END

 

You see, only the states with the condition on them can be dialogue-INITIATING states. That's why it's very important to have conditions on them and ONLY them.

 

Hope that helps!

 

P.S. You can also substitute Global condition to NumOfTimeTalkedTo(0) and NumOfTimesTalkedToGT(0) respectively, that's what is usually used on that type of nj characters.

Link to comment
You see, only the states with the condition on them can be dialogue-INITIATING states. That's why it's very important to have conditions on them and ONLY them.

 

Hope that helps!

 

P.S. You can also substitute Global condition to NumTimesTalkedTo(0) and NumTimesTalkedToGT(0) respectively, that's what is usually used on that type of nj characters.

Thanks, that was exactly what I needed to know but didn't. It's working perfectly now :). Just to clarify: conditions are only checked when the dialogue starts, dialogue does not start unless it finds a state with a true condition, and conditions are meaningless when dealing with GOTO statements?

Link to comment
Hey, if this is an NPC mod you're writing, I'd love some details!

Sorry to disappoint - I just needed a chatty guide to assist the PC in kit-related matters. NPCs seem like waaaaaay too much work. :) I think they require more of a creative touch than I possess. I wouldn't mind maybe collaborating on an NPC project in the future, but my strengths definitely do not lie in dialogue writing.

Link to comment

why you want to minimise the amount of conditions on the transitional states, is because that state could become dialogue initiating when you don't want it to. When the script commands the NPC to initiate a dialogue, it grabs the first available dialogue block with the valid condition.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...