Reply to Re: wrong
If you don't have an account, just leave the password field blank.
That's because you shouldn't use the global variable &magic - it's used by the engine to store Dink's stats (Attack = &strength, Defense = &defense and Magic = &magic) so you can't use those. So in your case, if Dink's magic level was anything but 0, your script wouldn't work.
So, change the variablename and after you've done that, you also need to change the order of the two if-statements: if (&hasmagic == 1) should be done before (&hasmagic == 0). Because, now the variable is 0, a conversation follows and the variable is 1. Then immediately there's another if-statement to check if it's 1 (which is now the case) so that conversation runs as well which you likely didn't intent to. If you change the order, it won't do that:
void talk(void)
{
freeze(1);
freeze(¤t_sprite);
if (&hasmagic == 1)
{
//code
}
if (&hasmagic == 0)
{
&hasmagic = 1;
}
unfreeze(1);
unfreeze(¤t_sprite);
}
So, change the variablename and after you've done that, you also need to change the order of the two if-statements: if (&hasmagic == 1) should be done before (&hasmagic == 0). Because, now the variable is 0, a conversation follows and the variable is 1. Then immediately there's another if-statement to check if it's 1 (which is now the case) so that conversation runs as well which you likely didn't intent to. If you change the order, it won't do that:
void talk(void)
{
freeze(1);
freeze(¤t_sprite);
if (&hasmagic == 1)
{
//code
}
if (&hasmagic == 0)
{
&hasmagic = 1;
}
unfreeze(1);
unfreeze(¤t_sprite);
}