User Tag List

Results 1 to 4 of 4

Thread: Day and Night script.

  1. #1
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,939
    Level
    28
    vBActivity - Bars
    Lv. Percent
    43.4%

    Day and Night script.

    I just made (with some help) my first script! It allows you to have a day and night system! Here is the script:

    Code:
    global script daynight {
      void run() {
        int frames=0;
        int daydmap1=;
        int daydmap2=;
        int twilightdmap1=;
        int twilightdmap2=;
        int nightdmap1=;
        int nightdmap2=;
        int morningdmap1=;
        int morningdmap2=;  
        int screen;
    
        while(Game->GetCurDMap() == daydmap1){
        if(frames == 7200) {
                 screen = Game->GetCurScreen();
                        Link->PitWarp(twilightdmap1, screen);
                        frames = 0;
                 }
                 Waitframe(); frames++;
    }
    
    
        while(Game->GetCurDMap() == twilightdmap1){
        if(frames == 1200) {
                 screen = Game->GetCurScreen();
                        Link->PitWarp(nightdmap1, screen);
                        frames = 0;
                 }
                 Waitframe(); frames++;
    }
    
    
        while(Game->GetCurDMap() == nightdmap1){
        if(frames == 7200) {
                 screen = Game->GetCurScreen();
                        Link->PitWarp(morningdmap1, screen);
                        frames = 0;
                 }
                 Waitframe(); frames++;
    }
    
    
        while(Game->GetCurDMap() == morningdmap1){
        if(frames == 1200) {
                 screen = Game->GetCurScreen();
                        Link->PitWarp(daydmap1, screen);
                        frames = 0;
                 }
                 Waitframe(); frames++;
    }
    
    
        while(Game->GetCurDMap() == daydmap2){
        if(frames == 7200) {
                 screen = Game->GetCurScreen();
                        Link->PitWarp(twilightdmap2, screen);
                        frames = 0;
                 }
                 Waitframe(); frames++;
    }
    
    
        while(Game->GetCurDMap() == twilightdmap2){
        if(frames == 1200) {
                 screen = Game->GetCurScreen();
                        Link->PitWarp(nightdmap2, screen);
                        frames = 0;
                 }
                 Waitframe(); frames++;
    }
    
    
        while(Game->GetCurDMap() == nightdmap2){
        if(frames == 7200) {
                 screen = Game->GetCurScreen();
                        Link->PitWarp(morningdmap2, screen);
                        frames = 0;
                 }
                 Waitframe(); frames++;
    }
    
    
        while(Game->GetCurDMap() == morningdmap2){
        if(frames == 1200) {
                 screen = Game->GetCurScreen();
                        Link->PitWarp(daydmap2, screen);
                        frames = 0;
                 }
                 Waitframe(); frames++;
    }
    }
    }
    Some setup is required. First, you have to make four dmaps. Allof them must be on the same map. One for day, one for evening, one for night, and one for morning. Then, input their number into the script here:

    int daydmap1= ;
    int daydmap2= ;
    int twilightdmap1= ;
    int twilightdmap2= ;
    int nightdmap1= ;
    int nightdmap2= ;
    int morningdmap1= ;
    int morningdmap2= ;

    Yes, the script allows you to have two maps that cycle from day to night. After you input the dmap number, that's all you have to do. The script will keep you in the day for two minutes, then make it evening for 17 seconds, then night for two minutes, then morning for 17 seconds. Here is a test quest I made. Uses build 679: http://www.mediafire.com/download.php?1n3lth8oikw.

    Thanks DarkDragon, Joe123, and Gleeok for helping me make the script!
    Quote Originally Posted by rock_nog View Post
    Well of course eveything's closed for Easter - don't you know of the great Easter tradition of people barricading themselves up to protect themselves from the return of Zombie Christ?


  2. #2
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,615
    Level
    25
    vBActivity - Bars
    Lv. Percent
    0.41%

    Re: Day and Night script.

    How does the script handle:

    1. Warps on the DMAP? Does time pass while you're indoors?
    2. Slashables like bushes that might be slashed before a change in time?

  3. #3
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,939
    Level
    28
    vBActivity - Bars
    Lv. Percent
    43.4%

    Re: Day and Night script.

    Quote Originally Posted by C-Dawg View Post
    How does the script handle:

    1. Warps on the DMAP? Does time pass while you're indoors?
    2. Slashables like bushes that might be slashed before a change in time?
    Unfortuntly, currently it dosn't handle those. This is my first script, after all. It resets when you go to another dmap. If anyone knows how to make it keep track of time on another dmap, please tell me.
    Quote Originally Posted by rock_nog View Post
    Well of course eveything's closed for Easter - don't you know of the great Easter tradition of people barricading themselves up to protect themselves from the return of Zombie Christ?


  4. #4
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,307
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.22%

    Re: Day and Night script.

    * Fixed a deficiency with warps by adding an overlay flag to tile, side, and whistle warp types. When this is set, any combo on the new screen that is 0 will be replaced with whatever combo is in that position on the old screen. This allows combos to carry over (slashed bushes, for example)
    perhaps?

    I was more worried about how it'd work with items left in the areas personally.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social