The Dink Network

Lame screen lock

May 14th 2004, 11:51 AM
pillbug.gif
Ok I have a room that is only exitable from two invisible counter sprites that warp dink outside, however when the screen lock in this room is activated by the boss, the player can still just touch the sprites and leave.

is there any easy way to fix this or do i have to give them their own scripts saying, "dont warp if blaaaaaaaaaaaaah suck it down now!". yeah.
May 14th 2004, 12:10 PM
girl.gif
joshriot
Peasant They/Them United States
keep it real 
now how it should work is you can check if the screen is locked or not like so

int &check = screenlock(-1)

&check = 1 if screen locked
&check = 0 if screen isnt locked

well i tested it and this does not work for screenlock, whereas it will for sprite properties and such, so its pretty lame. but this is what you can do.

make the script that locks the screen (boss script?) create the sprites that warp with create_sprite commands after the screen is unlocked (die procedure?)
May 14th 2004, 01:32 PM
pillbug.gif
hmmm that might work but you see the boss isnt always there, there are several times you could come and go from the room with out the boss showing up. So times when the boss wasn't there would be fukkked
May 14th 2004, 02:50 PM
wizardb.gif
Phoenix
Peasant He/Him Norway
Back from the ashes 
Unless you have a shortage on globals, you can just define a global, like... '&nowarp' for instance, and set it to 1 when you're not allowed to warp (when the screen is locked) and just test against that.
May 14th 2004, 03:15 PM
wizardb.gif
Kyle
Peasant He/Him Belgium
 
Or you can simply use the scripting trick to set the editor_seq of a sprite in the room to the value you like. This will save you a global.
May 15th 2004, 07:36 AM
custom_king.png
redink1
King He/Him United States bloop
A mother ducking wizard 
There are two simple ways to do what you want to do:

1) When you screenlock, create two slightly bigger sprites with hardness so they effectively block the warp exits. You may want to create a loop in your screenlock script to check every 100 ms or so to un-screenlock, so you can easily delete these sprites without having to deal with global variables or whatnot.

2) Make sure there is enough hardness 'behind' the warp sprites so Dink cannot walk out, and take off their hardness when screenlocking, and make them hard when un-screenlocking. Sprites are only warp-able when they have hardness. You would have to get their editor numbers to do this, attach dummy scripts to them one at a time with something like:

int &temp = sp_editor_num(&current_sprite);
say("&temp",1);
May 15th 2004, 10:13 AM
pillbug.gif
well that first option was ROXXOR