S
Shizuky
Guest
Hi, I have been using a dialogue system and I wanted to make a quest where , if you click on bad choice u will be returned to beginning, but I do not know how to return when the choice is bad to the beginning.
I want the line 3 to return the the line 0 but don't know what code to use to change the var i to 0 again or how to repeat the case 1
Here are the codes:
I want the line 3 to return the the line 0 but don't know what code to use to change the var i to 0 again or how to repeat the case 1
Here are the codes:
Code:
//
reset_dialogue_defaults();
switch(choice_variable){
case -1:
#region First Dialogue
//Line 0
var i = 0;
myText[I] = "Tri eurá dvadsat...";
mySpeaker[I] = id;
myScripts[I] = [create_instance_layer, 170,120,"Instances",obj_emote];
//Line 1
i++;
myText[I] = "Styri eura sedemdesiat...";
mySpeaker[I] = id;
//Line 2
i++;
myText[I] = ["Co to robis?", "Uuuu tolko penazí, zoberiem si pár."];
myTypes[I] = 1;
mySpeaker[I] = oPlayer;
myScripts[I] = [[change_variable, id, "choice_variable", "1"], [change_variable, id, "choice_variable", "2"]];
myNextLine[I] = [3,4];
//LINE 3
i++
myText[I] = "Zlá moznost. skus znova!";
myEmotion[I] = 1;
myEmote[I] = 0;
mySpeaker[I] = objSystem;
//Line 4
myText[I] = "...... ";
myEmotion[I] = 1;
myEmote[I] = 0;
mySpeaker[I] = id;
//Line 5
i++;
myText[I] = "!";
mySpeaker[I] = id;
myNextLine[i] = -1;
//Line 6
i++;
myText[i] = "Ale ja ich potrebujem!";
mySpeaker[i] = id;
//Line 12
i++;
myText[i] = ["Otazkou je , ci sa mi Ta chce znova zbalit.", "Easy."];
myTypes[i] = 1;
myNextLine[i] = [0,0];
myScripts[i] = [[change_variable, id, "choice_variable", "1"], [change_variable, id, "choice_variable", "2"]];
mySpeaker[i] = oPlayer;
#endregion
break;
case "1":
#region If you chose green
var i = 0
myText[i] = "Stalc E pre zaciatok.";
myEmotion[i] = 1;
myEmote[i] = 0;
mySpeaker[i] = objSystem;
choice_variable = -1;
#endregion
break;
//
Last edited by a moderator: