Jump to content

Photo

Day and Night Script


  • Please log in to reply
15 replies to this topic

#1 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 27 November 2007 - 10:42 AM

I just made (with some help) a script that 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...php?1n3lth8oikw.

Edit: Forgot to say, thanks DarkDragon (at AGN), Joe123, and Gleeok for helping me make the script.

Edited by russadwan, 27 November 2007 - 10:43 AM.


#2 nicklegends

nicklegends

    Trofessional Pransposer

  • Contributors
  • Real Name:Ed
  • Pronouns:He / Him

Posted 29 November 2007 - 01:16 PM

I tried the test quest and it's a really neat effect. But I ask, what is the effect of entering and exiting houses, and do enemies on a screen carry over map changes?

#3 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 29 November 2007 - 08:27 PM

QUOTE(nicklegends @ Nov 29 2007, 10:16 AM) View Post

I tried the test quest and it's a really neat effect. But I ask, what is the effect of entering and exiting houses, and do enemies on a screen carry over map changes?

Just set all the dmaps to the same map and you don;t have to waorry about map changes. As for walking in and out of houses, I am working on how to get around that. If I find a way, I'll post an updated script.

Edited by russadwan, 29 November 2007 - 08:28 PM.


#4 Dinnick the 3rd

Dinnick the 3rd

    Doyen(ne)

  • Members
  • Real Name:Alessandro Dinnick

Posted 01 March 2008 - 02:56 PM

when i try to compile the script appears a error message icon_unsettled.gif (im using ZC 704 windows)

what can i do?

#5 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 01 March 2008 - 03:17 PM

QUOTE(SM anime f @ Mar 1 2008, 11:56 AM) View Post

when i try to compile the script appears a error message icon_unsettled.gif (im using ZC 704 windows)

what can i do?

Wait. I am currently working on a much better one that allows for you to go inside houses and things like that without it reseting.

However, I think your problem is that you didn't follow the instruction. At the beginning of the script, you have to put in numbers that correspond with the dmaps you are using.

#6 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 01 March 2008 - 03:51 PM

QUOTE(russadwan @ Mar 1 2008, 02:17 PM) View Post

Wait. I am currently working on a much better one that allows for you to go inside houses and things like that without it reseting.

However, I think your problem is that you didn't follow the instruction. At the beginning of the script, you have to put in numbers that correspond with the dmaps you are using.


Are you going to release the new one? I could use that. icon_naughty.gif

#7 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 01 March 2008 - 04:13 PM

QUOTE(ZebraStallion @ Mar 1 2008, 12:51 PM) View Post

Are you going to release the new one? I could use that. icon_naughty.gif

Well, maybe. LostInHyru1e thought of the day and night idea, I started scripting it, and I was really hoping our quest would be the first to feature it. But I might release it. But I am not giving a definite answer right now.

#8 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 01 March 2008 - 04:20 PM

... If I were to use it, I'd give your quest the credit.

Anyway, will it be kind of like the add-on request I posted before? And does it only work for houses? Could it work for villages?

#9 Dinnick the 3rd

Dinnick the 3rd

    Doyen(ne)

  • Members
  • Real Name:Alessandro Dinnick

Posted 01 March 2008 - 08:30 PM

ok, i will wait the new one.


#10 TetriTek

TetriTek

    Wizard

  • Members
  • Real Name:Joshua Johnson
  • Location:Clinton

Posted 02 March 2008 - 12:37 AM

Just make sure not to do what Simons quest did icon_razz.gif anyways, nice idea, that sounds awesome, i havent tried it yet, but i never would have thought of something like that!

#11 jman2050

jman2050

    Illustrious

  • Members

Posted 02 March 2008 - 01:43 AM

This would be a lot easier with palette scripting commands. Hopefully those can get implemented soon.

#12 Dinnick the 3rd

Dinnick the 3rd

    Doyen(ne)

  • Members
  • Real Name:Alessandro Dinnick

Posted 02 March 2008 - 05:57 PM

ok and now its work, i only need to put the dmap number and thats all? the script gives the cset of the morning, twilight and the night?

#13 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 02 March 2008 - 06:02 PM

QUOTE(SM anime f @ Mar 2 2008, 02:57 PM) View Post

ok and now its work, i only need to put the dmap number and thats all? the script gives the cset of the morning, twilight and the night?

Not really. Basically, this script (which isn't very good) just warps Link between different dmaps. So if you make the dmaps, set up the palettes, and input them at the begining of the script, it will warp you between them.

QUOTE
And does it only work for houses? Could it work for villages?

The way I am setting it up, you input which dmaps are effected. In all other ones, time "freezes", like it does in villages in OoT. But when you walk out, time will start again.

QUOTE
This would be a lot easier with palette scripting commands. Hopefully those can get implemented soon.


Palette scripting commands? icon_drool.gif If you implant these, then you will be revered as the Zscript god!

#14 ZebraStallion

ZebraStallion

    Follower of Destiny

  • Members

Posted 02 March 2008 - 06:37 PM

Okay, good. I am looking forward to the release of this script. (If there is one.)

#15 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 02 March 2008 - 06:46 PM

QUOTE(ZebraStallion @ Mar 2 2008, 03:37 PM) View Post

Okay, good. I am looking forward to the release of this script. (If there is one.)

Even if I don't release it publicly, I might send it to you so you can use it in PoS.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users