Reply to Re: Achievements
If you don't have an account, just leave the password field blank.
So basically, what you want is:
Achievement-message pops up, sticks around for a second or two, then disappears again? And while it's sticking around, you should be able to screenchange without it disappearing.
Eh, tricky one, that. Sprites can't really be set to survive screenchange, so you'd have to detect those yourself in some way, and re-create the pop-up when a screenchange is detected.
Here's some code that I haven't tested, but something like this would be my first attempt:
In this case I'm detecting a screenchange by seeing if there's still a brain-95 sprite on the screen. Another common way is to keep a variable around that stores the last known value of &player_map, and when it's different from &player_map, we know a screenchange has occurred. Either method works.
I also expect the above code to go wrong when two achievements are unlocked at the same time. Because then you'll have multiple brain-95 sprites that need to disappear at different times (and possibly need to appear on different spots). But it's a start.
Threads like this is why I make dev files, btw >_>
Achievement-message pops up, sticks around for a second or two, then disappears again? And while it's sticking around, you should be able to screenchange without it disappearing.
Eh, tricky one, that. Sprites can't really be set to survive screenchange, so you'd have to detect those yourself in some way, and re-create the pop-up when a screenchange is detected.
Here's some code that I haven't tested, but something like this would be my first attempt:
// achievement.c // You'll call this procedure with external("achievement","achieve"); void achieve( void ) { // Somehow fill those missing values in. You could probably pass in &frame as an argument, or something. // Brain of 95 does the same as 0, but we can use it to get back at this sprite without storing its number! create_sprite(&somewhere_x,&somewhere_y,95,&seq,&frame); spawn("achievement"); } // This code is run because of spawn() above. Didn't feel like putting it in its own script. void main( void ) { int &chievo; script_attach(1000); &some_juggle_global = ¤t_script; int &timer = spawn("timer"); checkloop: // Here's that magic brain of 95 again. &chievo = get_sprite_with_this_brain(95,1); if (&chievo < 1) { // No brain-95 sprites while in the checkloop: we've changed screens. &chievo = create_sprite(yadda,yadda,95,yadda,yadda); } wait(50); goto checkloop; } void remove( void ) { &chievo = get_sprite_with_this_brain(95,1); if (&chievo > 0) { // Alternatively, do something fancy. sp_active(&chievo,0); } run_script_by_number(&timer,"kill"); kill_this_task(); } // timer.c void main( void ) { // If only we could spawn() with extra arguments. Oh, well. int &script = &some_juggle_global; // Or wait however long you want the message to appear. wait(2000); run_script_by_number(&script,"remove"); } void kill( void ) { kill_this_task(); }
In this case I'm detecting a screenchange by seeing if there's still a brain-95 sprite on the screen. Another common way is to keep a variable around that stores the last known value of &player_map, and when it's different from &player_map, we know a screenchange has occurred. Either method works.
I also expect the above code to go wrong when two achievements are unlocked at the same time. Because then you'll have multiple brain-95 sprites that need to disappear at different times (and possibly need to appear on different spots). But it's a start.
Threads like this is why I make dev files, btw >_>