Russ
11-27-2007, 11:46 AM
I just made (with some help) my first script! It allows you to have a day and night system! Here is the script:
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 (http://www.mediafire.com/download.php?1n3lth8oikw).
Thanks DarkDragon, Joe123, and Gleeok for helping me make the script!
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 (http://www.mediafire.com/download.php?1n3lth8oikw).
Thanks DarkDragon, Joe123, and Gleeok for helping me make the script!