The Dink Network

Little help please

January 15th 2011, 03:30 PM
goblinh.gif
thor
Peasant He/Him United Kingdom
whos afraid of the big bad duck 
Can i use the IF statement on a door warp to change where im warped to? EG I go to a house and warp to one room then when the story value changes i warp to a different room from the same door. Any help would be greatly appreciated and an example script would be fantastic.
Thanks guys.
January 15th 2011, 03:41 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
void main(void)
{
    //first we make sprite touchable
    sp_touch_damage(&current_sprite, -1);
}
void touch(void)
{
     if(&story == 1)
     {
          freeze(1);
          //fade down the screen after freezeing dink
          fade_down(); 
          script_attach(1000); 
          //&player map is the screen number
          &player_map = 120; 
          //loads map
          load_screen(); 
          //draws map
          draw_screen(); 
         //we have to freeze dink again after wrap
         freeze(1);
         //where should dink appear?
         sp_x(1, 180); 
         sp_y(1, 250); 
        //let's fade up screen
        fade_up();
        unfreeze(1);
    }
    else
    {
         //on the other condition do the same thing but     
        //change loacation and screen number
    }
}


I haven't tested the script so there may be typos

EDIT: Oh and you have to remove the wrap from editor...and the sprite must be hard
January 15th 2011, 04:03 PM
slimeg.gif
metatarasal
Bard He/Him Netherlands
I object 
You forgot to kill the script. You always need to kill the script manually after you've done a script_attach(1000)! Just put this line after unfreeze(1);

kill_this_task();

Also, it might be a good idea to disable touch damage when warping, just to make sure the script isn't run multiple times. Here is the edited version:

void main(void)
{
    //first we make sprite touchable
    sp_touch_damage(&current_sprite, -1);
}
void touch(void)
{
     if(&story == 1)
     {
          sp_touch_damage(&current_sprite, 0);
          freeze(1);
          //fade down the screen after freezeing dink
          fade_down(); 
          script_attach(1000); 
          //&player map is the screen number
          &player_map = 120; 
          //loads map
          load_screen(); 
          //draws map
          draw_screen(); 
         //we have to freeze dink again after wrap
         freeze(1);
         //where should dink appear?
         sp_x(1, 180); 
         sp_y(1, 250); 
        //let's fade up screen
        fade_up();
        unfreeze(1);
        kill_this_task();
    }
    else
    {
         //on the other condition do the same thing but     
        //change loacation and screen number
    }
}


And I don't see any reason why it would need to be hard. Sure Dink can walk straight through the door when it isn't hard, but there would not be any fundamental reason why it wouldn't work...
January 15th 2011, 04:26 PM
custom_iplaydink.gif
iplaydink
Peasant He/Him Sweden
Hmm.. 
YE I'm sorry I haven't scripted dinkC for a long time, I was thinking about normal wrapping, not touch damage

January 15th 2011, 05:36 PM
goblinh.gif
thor
Peasant He/Him United Kingdom
whos afraid of the big bad duck 
Thanks guys. Ive been struggling with this one for a couple of days!