The Dink Network

Reply to Alternate conversations

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
February 16th 2007, 06:20 AM
dragon.gif
I want to make it so that a lot of NPC's sometimes say 2 different things, and don't say the same thing twice in a row. I've been trying to make it so that it uses a local variable. So far, however, I have had no luck, and I've tried rearranging stuff as much and as many times as I can think of.
So is this possible with local variables, and if so, am I using them wrong, or is it certain things in the wrong place or order. So far what I have is:

void main(void)
{
int &convo = 1;

}

void talk(void)
{

if (&convo == 1);
{
freeze(1);

//conversation

&convo += 1;

unfreeze(1);
}

else

if (&convo == 2);
{
freeze(1);

//conversation 2

unfreeze(1);
}
}
Most of the times after I've rearranged the if, else, and variable assignment positions, both conversations just run together as one (like what happens in the example above.) There was only one time I got it to just go through the first conversation only, but the next time I talked to the NPC, they still had the 1st conversation only. (I've rearranged them too many times to remember exactly how I had it that time)

So am I doing it wrong, or is it just not possible to do with a local variable? I'm tired of messing with it for now and searching through other sources for examples, heheh.

Thanks