The Dink Network

unfreezing when leaving (almost rhymes!)

December 31st 2003, 05:51 PM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
WHY doesn't dink unfreeze when he chooses "leave"?

I have an almost excact same script where he dóes unfreeze when he leaves. Grrrr.

//script
void talk( void )
{
freeze(1);
freeze(&current_sprite);
choice_start()
"huh?
"blah"
"Leave"
choice_end()
if (&result == 1)
{
say_stop("poop", 1);
wait(200);
say_stop("`6shut up.", &current_sprite);
wait(200);
unfreeze(1);
unfreeze(&current_sprite);

}
if (&result == 2)
{
say_stop("...", 1);
wait(200);
say_stop("`6i guess you'd like to know what the real content of this script is, right?", &current_sprite);
wait(200);
unfreeze(1);
unfreeze(&current_sprite);
}
December 31st 2003, 08:30 PM
spike.gif
Since you don't have unfreeze(1); in the end of the script?
January 1st 2004, 04:31 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
What scratcher said: you need to have an extra three lines for the Leave option at the end of your script:

//your script here plus these lines
unfreeze(1)
unfreeze(&current_sprite)
}
//not enough closing brackets, so that's why there's another one here.
January 1st 2004, 06:38 AM
bonca.gif
Christiaan
Bard They/Them Netherlands
Lazy bum 
D'oh! Ofcourse
But, I have an exact same script only the charachter says different lines, and there Dink dóes unfreeze, even without the unfreeze(1); after choice end. I copied it from the original Dink hunter script, and there it works too.

Weird?
January 1st 2004, 07:13 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Are you sure it's an exact copy of the script? It could also have to do with your bracket-placement, that you've placed a closing bracket for an if-statement but before the unfreeze lines for that if-statement..
January 1st 2004, 09:18 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
I always do it like this:

void talk( void )
{
freeze(1);
freeze(&current_sprite);
choice_start()
"huh?
"blah"
"Leave"
choice_end()
if (&result == 1)
{
say_stop("poop", 1);
wait(200);
say_stop("`6shut up.", &current_sprite);
wait(200);
}
if (&result == 2)
{
say_stop("...", 1);
wait(200);
say_stop("`6i guess you'd like to know what the real content of this script is, right?", &current_sprite);
wait(200);
}
unfreeze(1);
unfreeze(&current_sprite);
return;
}

I know the return; is unnecessary, but I still add it for some reason.
January 1st 2004, 09:42 AM
fish.gif
Simeon
Peasant He/Him Netherlands
Any fool can use a computer. Many do. 
Yeah, that's how I script it as well, yet without the return; . Only when the situation requires it, I add the unfreeze lines in the if (&result == xy) code.
January 1st 2004, 11:19 AM
spike.gif
I usually do like that too. With the return. (I also use return after kill_this_task(); although I'm trying to get rid of that habit )

I once had some sort of an issue with my dmod that caused all my scripts to run from the top to the very bottom unless I had return; in the end of every procedure.
January 1st 2004, 11:27 AM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Probably, you then forgot a '}' or something. But that's weird.
January 2nd 2004, 08:12 AM
wizardb.gif
merlin
Peasant He/Him
 
Yeah, the Dink parser sucks. It involves a whole bunch of stricmp's. Haha.