The Dink Network

Reply to Re: 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:46 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
An "else" needs braces around it too.

if (&foo == &bar)
{
//blah
}
else
{
if (&foo == &baz)
{
//other blah
}
}

If you reverse the order of your ifs, you can do without the elses completely:

if (&convo == 3)
{
//blah
&convo += 1;
}

if (&convo == 2)
{
//blah
&convo += 1;
}

Another alternative:

if (&convo == 1)
{
//blah
&convo +=1;
//use return if there is nothing more to be done in the talk procedure.
return;
//use goto if you need to continue.
goto convdone;
}

if (&convo == 2)
{
//blah
&convo += 1;
//either return; or goto convdone;
goto convdone;
}

convdone:
//blah!

The local variable will reset once you leave the screen, though. If that's not a problem, this will do. If you want him to remember what he said last even after screenchange, ask again. Globals can do, but there's a better trick to be used, and this post is getting too long to explain it.