I'm back! And I need help :p
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(¤t_sprite, 300); sp_brain(¤t_sprite, 12); sp_timing(¤t_sprite, 0); //kill this item so it doesn't show up again for this player int &hold = sp_editor_num(¤t_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?
Would kill_this_task(); work?
October 25th 2012, 02:45 AM
shevek
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 ¤t_sprite before doing that, as it will be changed). Then kill the sprite, and then kill the script manually (kill_this_task).
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 ¤t_sprite before doing that, as it will be changed). Then kill the sprite, and then kill the script manually (kill_this_task).
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.
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.
Glad to see you're back into it Castman I still use your FreeMap from time to time, handy stuff^^
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 ^^
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.
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.