Lame screen lock
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.
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.
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?)
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?)
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
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.
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.
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(¤t_sprite);
say("&temp",1);
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(¤t_sprite);
say("&temp",1);