The Dink Network

Unfreezing after say_stop

November 18th 2007, 09:29 PM
dinkdead.gif
Why won't Dink unfreeze after choosing "yes" in this script? If I change the last say_stop(); to just say(); then it works.

void talk (void)
{
freeze(1);
say_stop("Ooh, a mushroom!", 1);

choice_start()

set_y 240
set_title_color 15

title_start()
Eat it?
title_end()

"Yes"
"No"

choice_end()

if (&result == 1)
{

//playsound
sp_brain_parm(&current_sprite, 10);
sp_brain(&current_sprite, 12);
sp_timing(&current_sprite, 0);
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 1);

say_stop("Word", 1);
}

unfreeze(1);
}
November 18th 2007, 09:51 PM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
You are essentially killing the sprite when you change its brain to 10. When the sprite dies, the script stops executing. This only occurs at the end of a script function, or when there is a pause in script execution (i.e. in a 'wait' or a 'say_stop' command).
November 19th 2007, 06:14 AM
dinkdead.gif
Ah I see. Thanks!
November 19th 2007, 06:37 AM
dinkdead.gif
Is there any way I can carry on the script for longer after shrinking it, or will I just have to make it disappear when picked, without shrinking?
November 19th 2007, 06:56 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
You may be able to use script_attach(0); like this:

if (&result == 1)
{

//playsound
sp_brain_parm(&current_sprite, 10);
sp_brain(&current_sprite, 12);
sp_timing(&current_sprite, 0);
int &hold = sp_editor_num(&current_sprite);
if (&hold != 0)
editor_type(&hold, 1);

//the script will die unless we attach it to the screen
script_attach(0);

say_stop("Word", 1);
}

unfreeze(1);
November 19th 2007, 09:55 AM
dinkdead.gif
Yep, that's great.