📧 Message Board Archive

Frustration in scripting
:( :( :( :( :( :( :( :(

;( ;( ;( ;( ;( ;( ;( ;(



I am getting really frustrated lately. I got numerous bugs while trying to "improve" the scripts. So much for improvement!

To name a few:



How many scripts can be attached to "1000" at the same time? If you place a screen script at DinkEditor (by pressing B in a screen), can you use script_attach(1000); on that screen? While spawning a script, it is not attached to any sprite. Is it attached to "1000" as well?



When you are running a 1000 attached script, and then your level is raised at the same time. Since lraise.c will stop the entire game, after that, the script you were running before the raise simply vanished. How can you fix this problem?



And more... But I am not going to write any more. Now I understand why DMODs' release dates were always pushed later and later, or to forever...



;( :(
Re: Frustration in scripting
> How many scripts can be attached to "1000" at the same time?



Any number as far as I know, basically 1000 means "no sprite".



> If you place a screen script at DinkEditor (by pressing B in a screen), can you use script_attach(1000); on that screen?



Yes.



Incidently, I found an undocumented feature relating to this. You can also attach a script to sprite 0. This is works like 1000 only the script is automatically killed if Dink leaves the room. I haven't tested if that gets in the way of a room script (set with B) or not. Of for that matter if you can attach more than one script to 0 at once.



> While spawning a script, it is not attached to any sprite. Is it attached to "1000" as well?



Basically, yes.



> When you are running a 1000 attached script, and then your level is raised at the same time. Since lraise.c will stop the entire game, after that, the script you were running before the raise simply vanished. How can you fix this problem?



I don't get that bug (just tested) can you provide any more information?
Re: Frustration in scripting
> When you are running a 1000 attached script, and then your level is raised at the same time. Since lraise.c will stop the entire game, after that, the script you were running before the raise simply vanished. How can you fix this problem?



: I don't get that bug (just tested) can you provide any more information?



After Dink killed a fish, player is offered to have a choice either to eat it right away, store it in the bag, or set the fish free (and Dink is frozen). But if the raise script is activated, the choice menu would become the raise choices. After your choice, Dink will be frozen forever since previous choice was never finished. I believed that this is similar to the bug some people mentioned after Dink killed Seth -- raising level will freeze the game. Over there, it is kind of easy to get rid of the problem simply by putting a unfreeze(1); in lraise.c. But by doing the same thing, I still cannot get back my choice menu.
Re: Frustration in scripting
: After Dink killed a fish, player is offered to have a choice either to eat it right away, store it in the bag, or set the fish free (and Dink is frozen). But if the raise script is activated, the choice menu would become the raise choices. After your choice, Dink will be frozen forever since previous choice was never finished. I believed that this is similar to the bug some people mentioned after Dink killed Seth -- raising level will freeze the game. Over there, it is kind of easy to get rid of the problem simply by putting a unfreeze(1); in lraise.c. But by doing the same thing, I still cannot get back my choice menu.



This still doesn't get to the core of the problem, but you could move the addexp() command after the choice (even if all responses trigger it) so Dink's less likely to gain a level while the choice window is up.