• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Question about VJASS time of day events

Status
Not open for further replies.
Level 4
Joined
Apr 19, 2013
Messages
86
Hello,

I used to believe in myself enough to use vjass here and there, but since then I've lost a lot of confidence so now I just use it as little as possible.

Every once in a while though I come across an excellent vjass system that I can't turn down, in this case it's a scrolling text system. It's just perfect.

The problem is I only want to display my text when the time of day = 8.

here is what i tried:

JASS:
function GetTimeOfDay takes nothing returns 8

but that didn't work and threw all kinds of errors at me.

Can someone point me in the right direction?
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
JASS:
if GetTimeOfDay()==8.00 then
    // actions
endif

// or

if GetFloatGameState(GAME_STATE_TIME_OF_DAY)==8.00 then
    // actions
endif
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Or maybe you want to display it when time of day becomes 8?
JASS:
library something initializer init

private function itIsThatTime takes nothing returns nothing
    // Do your thing
endfunction

private function init takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterGameStateEvent(t, GAME_STATE_TIME_OF_DAY, EQUAL, 8.00)
    call TriggerAddAction(t, function itIsThatTime)
endfunction

endlibrary
 
Status
Not open for further replies.
Top