Dialogs - You didn't say that last time...SOLVED

Started by harmonicapress, Thu 02/01/2014 01:18:54

Previous topic - Next topic

harmonicapress

I'm wondering how I would code a dialogue to run only the first time I interact with a character. The first interaction involves a long winded introduction from one character. I only want this to run the first time we meet and then I want a different dialog to play any time after that first interaction. All I could figure was that I needed to turn off all the options from the cascading introduction dialogue in which all answers lead to the 2nd dialogue, however when I removed all the options it caused the game to crash. Maybe there's an if command I can use below the @S Dialogue startup entry point??? Thanks pros.

here's my code that did not work, I just tried to turn all the options off hoping that would prevent that part of the dialog from playing...fail.

Code: ags

// Dialog script file
@S  // Dialog startup entry point
return
@1
Archie2: Step Right up! Step Right up here son! Let me take a good look at ya!
    cSam.FaceCharacter(cArchie2);
Sam: Wh-
Archie2: The name's Archibald Ferris, Ferris Goods and Wears. "There's none so fair as Ferris Wears!" Now what'd ya say your name was?
Sam: Sa-
Archie2: Oh, no matter! No matter! We're all friends here! Now whattya say friend!? Where ya headed? What'll you need? I have it all right here in my cart, guaranteed!
option-off 1
option-off 2
option-off 3
option-off 4
goto-dialog 1

@2
Archie2: Step Right up! Step Right up here son! Let me take a good look at ya!
    cSam.FaceCharacter(cArchie2);
Sam: Wh-
Archie2: The name's Archibald Ferris, Ferris Goods and Wears. "There's none so fair as Ferris Wears!" Now what'd ya say your name was?
Sam: Sa-
Archie2: Oh, no matter! No matter! We're all friends here! Now whattya say friend!? Where ya headed? What'll you need? I have it all right here in my cart, guaranteed!
option-off 1
option-off 2
option-off 3
option-off 4
goto-dialog 1

@3
Archie2: Step Right up! Step Right up here son! Let me take a good look at ya!
    cSam.FaceCharacter(cArchie2);
Sam: Wh-
Archie2: The name's Archibald Ferris, Ferris Goods and Wears. "There's none so fair as Ferris Wears!" Now what'd ya say your name was?
Sam: Sa-
Archie2: Oh, no matter! No matter! We're all friends here! Now whattya say friend!? Where ya headed? What'll you need? I have it all right here in my cart, guaranteed!
option-off 1
option-off 2
option-off 3
option-off 4
goto-dialog 1

@4
Archie2: Step Right up! Step Right up here son! Let me take a good look at ya!
    cSam.FaceCharacter(cArchie2);
Sam: Wh-
Archie2: The name's Archibald Ferris, Ferris Goods and Wears. "There's none so fair as Ferris Wears!" Now what'd ya say your name was?
Sam: Sa-
Archie2: Oh, no matter! No matter! We're all friends here! Now whattya say friend!? Where ya headed? What'll you need? I have it all right here in my cart, guaranteed!
option-off 1
option-off 2
option-off 3
option-off 4
goto-dialog 1

Khris

option-off refers to the dialog options that can be chosen by the player.
You should look into Game.DoOnceOnly() (and read the scripting section of the manual front to back to get a feel about what AGS can do and how to find commands).

Does the introduction come up after the first choice? Or before the actual dialog? Because you could do this:
Code: ags
  // talk to character
  if (Game.DoOnceOnly("talk to archie")) {
    cArchie2.Say("Blah...");
    cArchie2.Say("Blah...");
    ..
  }
  dArchie2.Start();

Dualnames

Already responded by Khris, but I'm just gonna suggest a barely different way. Identation.

Code: AGS

// Dialog script file
@S  // Dialog startup entry point
 if (Game.DoOnceOnly("talk_to_archie"))
 {
 cArchie2.Say("Step Right up! Step Right up here son! Let me take a good look at ya!");
 cSam.FaceCharacter(cArchie2);
 cSam.Say("Wh-");
 cArchie2.Say("The name's Archibald Ferris, Ferris Goods and Wears. \"There's none so fair as Ferris Wears!\" Now what'd ya say your name was?");
 cSam.Say("Sa-");
 cArchie2.Say("Archie2: Oh, no matter! No matter! We're all friends here! Now whattya say friend!? Where ya headed? What'll you need? I have it all right here in my cart,    guaranteed!");
 }
return
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

harmonicapress

Genius. Same function I was wanting, cleaner approach and execution. Thank you guys again. And I will pour over the manual, I guess somehow the manual's availability had evaded me and I've been relying on the very VERY helpful youtube tutorial. Thanks for the heads up.

SMF spam blocked by CleanTalk