Jump to content

Special Encounter


Nicothodes

Recommended Posts

I gave my party a quest that is completed through going to another place in town and answering 'yes' to a special encounter(the quest doesn't give experience, it's just to advance the plot). When you answer yes, you are told by the special encounter to go to your house and go to sleep. If the party answers no, the special encounter is just go away. However, whenever the party activates the special encounter, no matter what it answers, it repeats the question and when the party answers again, the special encounter goes away.

 

Code:
 beginstate 10;reset_dialog ();add_dialog_str (0, "text", 0);add_dialog_str (1, "text", 1);add_dialog_choice (0, "Yes");add_dialog_choice (1, "No");choice = run_dialog(0);if (run_dialog(0) ==1) {set_flag (0, 1, 1);set_state_continue(11);}break;beginstate 11;reset_dialog ();add_dialog_str (0, "text", 0);break; 
Link to comment
Share on other sites

That is what I would indeed expect for your coding. The problem is that you can run_dialog(0) twice. In your conditional statement, use the variable choice instead of run_dialog. It should read:

 

Code:
beginstate 10;  reset_dialog();  add_dialog_str(0, "text", 0);  add_dialog_str (1, "text", 0);  add_dialog_choice (0, "Yes");  add_dialog_choice (1, "No");  choice = run_dialog(0);  if (choice ==1) {    set_flag (0, 1, 1);    set_state_continue(11);  }break;beginstate 11;  reset_dialog ();  add_dialog_str (0, "text", 0);break; 
Link to comment
Share on other sites

Code:
beginstate 10;  reset_dialog();  add_dialog_str(0, "text", 0);  add_dialog_str (1, "text", 0);  add_dialog_choice (0, "Yes");  add_dialog_choice (1, "No");  choice = run_dialog(0);  if (choice ==1) {    set_flag (0, 1, 1);    set_state_continue(11);  }break;beginstate 11;  reset_dialog ();  add_dialog_str (0, "text", 0);  RUN_DIALOG(1);break; 
You forgot a line Stareye.

Edit: Apparently, you can't make coded text bold. Grr. I capitalised it instead.
Link to comment
Share on other sites

I didn't forget a line, I figured he just submitted incomplete code which I purposely did not complete. It would have fixed the error he was stating.

 

The answer to your question is yes. Put your dialogue script inside of an if-then statement to check to see if a flag is zero. If it is, call the dialogue. If "yes" is selected, set that flag to one. That way if the player picks "yes" you will never see it again (unless you set the flag back to zero somewhere of course).

Link to comment
Share on other sites

Use a SDF. If the SDF is set to one, have the special encounter end there. If it isn't, then the encounter continues to run. You already have the set_flag command if the party chooses yes. Just add a get_flag at the beginning and {} to enclose everything after else.

 

Code:
if (get_flag(0,1) == 1)end();else{reset_dialog ();add_dialog_str (0, "text", 0);add_dialog_str (1, "text", 1);add_dialog_choice (0, "Yes");add_dialog_choice (1, "No");choice = run_dialog(0);if (run_dialog(0) ==1){set_flag (0, 1, 1);set_state_continue(11);}}break;beginstate 11;reset_dialog ();add_dialog_str (0, "text", 0);break;
Dikiyoba thinks it should work but hasn't tested it.
Link to comment
Share on other sites

More briefly:

 

Code:
 beginstate 10;if (get_flag(0,1) != 0)  end();  reset_dialog();  add_dialog_str(0, "text", 0);  add_dialog_str (1, "text", 0);  add_dialog_choice (0, "Yes");  add_dialog_choice (1, "No");  choice = run_dialog(0);  if (choice ==1) {    set_flag (0, 1, 1);    set_state_continue(11);  }break; 
This is described here , under One-Shot Specials.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...