The Better Mousetrap... er, Screenlock
I've been thinking, the way that Seth did Screenlocks in the original game is quite... stupid. It requires you to have special-monster scripts just so you can lock the screen, and unlock it when Dink kills all the monsters. And that's just a waste of space.
My idea (which may have been done before, but I don't recall) is to just place a sprite with a script on the screen, and tada, instant screenlock. And if you decide later that you don't want a screenlock, its a lot easier to delete the sprite rather than to change every monster's script.
This is how it would work: create a screenlock image. It doesn't have to be big (the one I'm using is 50x50 pixels), but it should stand-out so you can see which screens are screenlocked. Then just attach the following script to it, and you're ready to go.
//Screenlock The screen
void main(void)
{
sp_nodraw(&current_sprite,1);
screenlock(1);
loop:
if (get_sprite_with_this_brain(9, &current_sprite) == 0)
{
if (get_sprite_with_this_brain(10, &current_sprite) == 0)
{
screenlock(0);
playsound(43, 22050,0,0,0);
kill_this_task();
}
}
wait(250);
goto loop;
}
The nodraw line allows you to see your little screenlock graphic in WDE or DE, but the player won't see it at all from within Dink. The rest is pretty self-explanatory.
My idea (which may have been done before, but I don't recall) is to just place a sprite with a script on the screen, and tada, instant screenlock. And if you decide later that you don't want a screenlock, its a lot easier to delete the sprite rather than to change every monster's script.
This is how it would work: create a screenlock image. It doesn't have to be big (the one I'm using is 50x50 pixels), but it should stand-out so you can see which screens are screenlocked. Then just attach the following script to it, and you're ready to go.
//Screenlock The screen
void main(void)
{
sp_nodraw(&current_sprite,1);
screenlock(1);
loop:
if (get_sprite_with_this_brain(9, &current_sprite) == 0)
{
if (get_sprite_with_this_brain(10, &current_sprite) == 0)
{
screenlock(0);
playsound(43, 22050,0,0,0);
kill_this_task();
}
}
wait(250);
goto loop;
}
The nodraw line allows you to see your little screenlock graphic in WDE or DE, but the player won't see it at all from within Dink. The rest is pretty self-explanatory.
Gary Hertel used this meathod in Prophecy of the Ancients. I later borrowed the idea for my own mod. I'm not sure how many others have used this. I'm guessing that at least Simon has though.
lol, what about non-hostile brain 9/10 monsters in the room, TADA Screenlock
Um... you'd have the same problem with the normal screenlock. If you place a screenlocked-pillbug and some brain 9 people in the same screen...
Actually no... I'm pretty slow... I never have used this script... mind you it doesn't allow for followers who may be brain 9 or 10, but that can be easily fixed.
If you had the nodraw command in the script, would it not draw it from the start, or would it draw it until the scripts initiated? Sorry that makes little sense... but basically, during the screen scroll, no scripts are going, so you'd see it while the screen is scrolling, then it would disapear. I think. If that's the case, using a large one would be rather annoying. Could you set it to no_draw or brain 0 or something in the editor?
Nope, it doesn't appear during a screen scroll. I know, it seems like it should... but it doesn't. If it is on the 1-pixel border of the screen, then it is slightly visible during the screen scroll along that 1 pixel area, but only if you're looking closely.
And if you set no_draw or size 1 or whatever in the editor, then you're unable to see it in the editor, which would suck
And if you set no_draw or size 1 or whatever in the editor, then you're unable to see it in the editor, which would suck
