The Dink Network

I'm back! And I need help :p

October 24th 2012, 08:00 PM
knightgl.gif
castman
Peasant He/Him Brazil
Some day I'll finish my mod... Some day... 

Hyo,

I'm back into Dink edit (No one can simply stop Dink editing) and I got some trouble with this:

void talk ( void )
{
 freeze(1);

 say_stop("Another page!", 1);
 wait(200);

 show_bmp("tiles\page-02.bmp", 0, 0);

sp_brain_parm(&current_sprite, 300);
sp_brain(&current_sprite, 12);
sp_timing(&current_sprite, 0);

  //kill this item so it doesn't show up again for this player
  int &hold = sp_editor_num(&current_sprite);
  if (&hold != 0)
  editor_type(&hold, 1);

 unfreeze(1);

}


If I keep pressing space, Dink 'talks' to the book page again and the game freezes... I know how to avoid this bug with a local variable but that is too much work and open room for more bugs to come...

Is there anyway to kill this script so it unfreezes Dink but Dink can't talk to it right after?
October 24th 2012, 08:03 PM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Would kill_this_task(); work?
October 25th 2012, 02:45 AM
anon.gif
shevek
Ghost They/Them
 
Is there anyway to kill this script so it unfreezes Dink but Dink can't talk to it right after?

Not sure where it happens, but I think the problem is that the script is killed, not that it isn't. I'm guessing the editor_type kills the sprite which in turn kills the script. This means unfreeze (1) is never executed, so Dink stays frozen.

The solution would be to attach the script to 1000 so it doesn't die (save &current_sprite before doing that, as it will be changed). Then kill the sprite, and then kill the script manually (kill_this_task).
October 25th 2012, 02:51 AM
dinkdead.gif
The problem is probably at the wait(200) which is where you'll be able to interrupt the script, so attach it to sprite 1000 as shevek said first thing after the freeze.
October 25th 2012, 08:04 AM
spike.gif
I believe Mr. Lepor Chum is right on this one, actually. The script runs fine the first time. However, setting the brain to 12 (which is the grow to this size then die brain) kills the sprite in about a second, so if you talk to the sprite again during that time, you're screwed.
October 25th 2012, 08:09 AM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Glad to see you're back into it Castman I still use your FreeMap from time to time, handy stuff^^
October 26th 2012, 05:54 PM
knightgl.gif
Castman
Peasant He/Him Brazil
Some day I'll finish my mod... Some day... 

Yea, what really happens is that i talk to it twice and then the script dies, leaving me frozen... Today I pressed space with correct timing and Dink said the first talk of the script again.

Thx Mr. Lepros, kill_this_task(); Will do, how haven't I thought of it xD

Thx Kyle, good to know something I made is useful ^^

October 27th 2012, 03:40 AM
wizardg.gif
leprochaun
Peasant He/Him Japan bloop
Responsible for making things not look like ass 
Oh hey, look at me not being DinkC illiterate.

I'm not sure why you didn't think of it. You've been making these longer than I have. Oh well, we all need refreshers from time to time.