Mike1072 Posted May 7, 2007 Share Posted May 7, 2007 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
Domi Posted May 7, 2007 Share Posted May 7, 2007 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
Mike1072 Posted May 8, 2007 Author Share Posted May 8, 2007 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
Avenger Posted May 8, 2007 Share Posted May 8, 2007 state conditions are checked on the start, but transitions (dialog options) can always have a condition. Link to comment
Mike1072 Posted May 8, 2007 Author Share Posted May 8, 2007 state conditions are checked on the start, but transitions (dialog options) can always have a condition. Yeah, I've got a couple of those already too, heh, thanks for the reply. Link to comment
berelinde Posted May 8, 2007 Share Posted May 8, 2007 Hey, if this is an NPC mod you're writing, I'd love some details! Link to comment
Mike1072 Posted May 8, 2007 Author Share Posted May 8, 2007 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
Domi Posted May 8, 2007 Share Posted May 8, 2007 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.