The Dink Network

Reply to Re: File wanted:day to night

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
July 27th 2009, 07:31 AM
dinkdead.gif
Not much time recently... Ok I'll just copy those scripts exactly and put in comments about changes, not saying it'll work afterwards but at least (hopefully) you'll know the problems! Call it constructive criticism

//blah blah blah

&update_status = 1;
draw_status();

kill_this_task();
//You've just killed the script!  Nothing after this line will run.
//Get rid of kill_this_task()
//In fact, spawning a new script may be better than running the next bit in start.c

//Need semi-colon: script_attach(1000);
script_attach(1000)

//Why did you change my example loop so much?
//If there's a reason, I need to know it in order to know what to suggest here   
loop:
wait(10000);
&time = get_time_real();
//need == not just = in an 'if'.  And see above comment!
if (&time = 480)
{
&don = 2;
}
if (&time = 1200)
{
&don = 1;
}
//This skip: isn't being used, harmless but pointless to leave it here.
skip:
goto loop;
}

void main(void)
{
if (&don == 1)
{
//Must have a script_attach(1000); before the load_screen() somewhere,
//otherwise the script will die when the screen changes!
&don = 2;
fade_down();

//This won't work AFAIK. Better and simpler to do it this way:
//&player_map += 9;
&player_map = &player_map + 9;

load_screen();
draw_screen();
//draw_status not needed unless they are actually changing.
draw_status();
fade_up();
kill_this_task();
}
}

Doing it this way, 2 things will happen that might not be what you wanted. This is because you changed my loop thingy, so maybe you did want this? Not sure...
1, it will only change from day to night (or other way) at exactly 8 o'clock. So if you start playing the game at 9pm it could look like day for example.
2, it will also only change day/night when you move to a different screen.

And my mistake, wait(10000) is actually 10 seconds Use wait(60000).