Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Danae

#1
Hi,

I'm trying to create a conversation in my game. When first spoken to, I want 'Sister' to say her first line of text (changed to 'Zero' for now). After she's said 'Zero' once, I want her to say 'Not zero' the second time she is spoken to (and any time after that).

I'm following this tutorial: https://www.youtube.com/watch?v=nj1N6nr5_Ls&channel=densming

I've even typed out the code exactly as it is in the tutorial (replacing the character's names) and it hasn't worked.

I've created a global variable called 'dialogCounter' and set it to '0'.

I've also typed

Code: ags
dialogCounter = 0;


at the top of my script file (same place as in the tutorial).

Here is the code for the conversation:

Code: ags

@2 
    if (dialogCounter == 0) {
      cSister.Say("Zero");
      dialogCounter++;
    }
    else {
       cSister.Say("Not zero");
    }
stop


Instead of saying 'Not zero' the second time around like I want her to, she just keeps saying 'Zero'. If I change 'else' to 'if (dialogCounter > 0)', she says 'Zero' immediately followed by 'Not zero' (I don't want her to say 'Not zero' until she's spoken to a second time). 'else if (dialogCounter > 0)' also doesn't work.

Where am I going wrong?  :confused:

Thanks to anyone who can help. 

SMF spam blocked by CleanTalk