night and day
darkgoddessnight
16 Oct 2006, 23:17
Thanks in advance,
Shadow

Elexxorine
17 Oct 2006, 11:31 define variable <sec1disp>
type numeric
scope global
value <0>
display <Time: %hourdisp%:%sec2disp%%sec1disp%.>
onchange {
if ( %sec1disp% = 10 ) then {
set numeric <sec1disp; 0>
inc <sec2disp>
}
if ( %hourdisp% > 6 ) and ( %hourdisp% < 19 ) then flag on <day> else flag off <day>
}
end define
define variable <sec2disp>
type numeric
scope global
value <0>
onchange {
if ( %sec2disp% = 6 ) then {
set numeric <sec2disp; 0>
inc <hourdisp; 1>
}
}
end define
define variable <hourdisp>
type numeric
scope global
value <7>
onchange if ( %hourdisp% = 24 ) then set numeric <hourdisp; 0>
end define
Put that one in the 'define game' block, this other one goes at the ned of your ocde:define timer <secadd>
interval <0>
action inc <sec1disp; 2>
enabled
end define
I have two second values so it will show '9:03' instead of '9:3', and looks better that way.GameBoy
17 Oct 2006, 12:30You could use arrays, as that is probably the best way.
Elexxorine
17 Oct 2006, 12:36Also a crude way to do seasons is to have each month set to one, eg: winter=dec, jan, feb, spring=march, april, may, summer=june, july, aug, autumn=sept, oct, nov. And each season has a set number of 'daylight hours' or each month could.
There you go...
Shadowalker
25 Oct 2006, 02:43
' "Time"
' Created with QDK 3.53 - UNREGISTERED VERSION
define game <Time>
asl-version <350>
gametype singleplayer
start <Room>
game info <Created with QDK 3.53 - UNREGISTERED EVALUATION VERSION.>
command <change time;change the time;time;change;change times;change clock;clock;change the clock> {
msg <What would you like to set the hours to?>
enter <change>
if ( #change# >= 0 ) and ( #change# <= 24 ) then set numeric <hourdisp; #change#> else msg <I'm sorry, that is either an unavailable number or you have entered an incorrect format. Please re-enter the code 'change time' to restart this process.>
} define variable <sec1disp>
type numeric
value <0>
display <Time: %hourdisp%:%sec2disp%%sec1disp%.>
onchange {
if ( %sec1disp% = 10 ) then {
set numeric <sec1disp; 0>
inc <sec2disp>
}
if ( %hourdisp% > 6 ) and ( %hourdisp% < 19 ) then flag on <day> else flag off <day>
}
end define
define variable <sec2disp>
type numeric
value <0>
onchange {
if ( %sec2disp% = 6 ) then {
set numeric <sec2disp; 0>
inc <hourdisp; 1>
}
}
end define
define variable <hourdisp>
type numeric
value <7>
onchange if ( %hourdisp% = 24 ) then set numeric <hourdisp; 0>
end define
end define
define synonyms
end define
define room <Room>
end define
define timer <secadd>
interval <0>
action inc <sec1disp; 1>
enabled
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end define
Shadowalker
25 Oct 2006, 06:54command <change time;change the time;time;change;change times;change clock;clock;change the clock> {
msg <What would you like to set the hours to?>
enter <change>
if ( #change# = 0 ) or ( #change# = 2 ) or ( #change# = 3 ) or ( #change# = 4 ) or ( #change# = 5 ) or ( #change# = 6 ) or ( #change# = 7 ) or ( #change# = 8 ) or ( #change# = 9 ) or ( #change# = 10 ) or ( #change# = 11 ) or ( #change# = 12 ) or ( #change# = 13 ) or ( #change# = 14 ) or ( #change# = 15 ) or ( #change# = 16 ) or ( #change# = 17 ) or ( #change# = 18 ) or ( #change# = 19 ) or ( #change# = 20 ) or ( #change# = 21 ) or ( #change# = 22 ) or ( #change# = 23 ) or ( #change# = 24 ) then set numeric <hourdisp; #change#> else msg <I'm sorry, that is either an unavailable number or you have entered an incorrect format. Please re-enter the code 'change time' to restart this process.>
}
The only thing is, you need to enter each number in individually. Is there an easier way?