- Joined
- Jul 26, 2008
- Messages
- 1,009
Alright so I wanted to put a trigger in my map where night goes slower and day goes faster depending on how easy of the mode you have it in. I might even include something like time stopping or clock slowing as an ability/ult.
However I can't seem to figure out the right function to use. At first I was told to use Game - Set Game Speed (AKA SetGameSpeed).
Then I was told to use SetTimeOfDayScale() But that crashes the game :\ Dunno why, but it just does. Here's an example of the code I'm using:
Dunno why, but it just crashes the game. :\
However I can't seem to figure out the right function to use. At first I was told to use Game - Set Game Speed (AKA SetGameSpeed).
Then I was told to use SetTimeOfDayScale() But that crashes the game :\ Dunno why, but it just does. Here's an example of the code I'm using:
JASS:
function Trig_Skiptime_Actions takes nothing returns nothing
if udg_EasyMode == 1 then
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 7.10)
call SetTimeOfDayScale(1.15)
else
call SetFloatGameState(GAME_STATE_TIME_OF_DAY, 8.10)
call SetTimeOfDayScale(1.45)
endif
endfunction
//===========================================================================
function InitTrig_Skiptime takes nothing returns nothing
set gg_trg_Skiptime = CreateTrigger( )
call TriggerRegisterGameStateEvent(gg_trg_Skiptime, GAME_STATE_TIME_OF_DAY, EQUAL, 6.10)
call TriggerAddAction( gg_trg_Skiptime, function Trig_Skiptime_Actions )
endfunction
Dunno why, but it just crashes the game. :\