time riddles
time riddles
Hello script masters around. Somebody was already able to crack how to script / make time riddles ? I want make magical bridge visible only in particular time of the day.
- Skuggasveinn
- Posts: 562
- Joined: Wed Sep 26, 2012 5:28 pm
Re: time riddles
I've been flirting with a timemachine
So far I've not uncovered much. But I have this http://www.zorglubb.net/grimrock/dropzo ... achine.mp4
This is what I've found out so far.
The commande GameMode.setTimeOfDay() changes the skybox.
so 0 seems to be dawn, and about 0.5 is high day, then just before 1 we go into dusk and just after 1 we have night that stays until we go back to 0
The lever in the video simply starts a timer that calls this function
I haven't figured out how I can query for time, and if time is this or that then do .... (like I wan't to query for the time after 1 until 0 again, to spawn fireflies only in the night etc)
If anyone has any insight, I'm all ears
Skuggasveinn.

So far I've not uncovered much. But I have this http://www.zorglubb.net/grimrock/dropzo ... achine.mp4
This is what I've found out so far.
The commande GameMode.setTimeOfDay() changes the skybox.
so 0 seems to be dawn, and about 0.5 is high day, then just before 1 we go into dusk and just after 1 we have night that stays until we go back to 0
The lever in the video simply starts a timer that calls this function
Code: Select all
function timemachine()
clock = 0 else
GameMode.setTimeOfDay(clock)
clock = clock + 0.01
hudPrint(""..clock.."")
end
end
If anyone has any insight, I'm all ears

Skuggasveinn.
Re: time riddles
That's cool, how did you find that GameMode-object?
Edit: Just tested and you can query time with command: GameMode.getTimeOfDay()
so you can just use a timer which executes a script where you check if it's time to show the bridge or do something else, should be easy.
Edit: Just tested and you can query time with command: GameMode.getTimeOfDay()
so you can just use a timer which executes a script where you check if it's time to show the bridge or do something else, should be easy.
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450
Re: time riddles
sounds quite esay, still too complicate to meJKos wrote:That's cool, how did you find that GameMode-object?
Edit: Just tested and you can query time with command: GameMode.getTimeOfDay()
so you can just use a timer which executes a script where you check if it's time to show the bridge or do something else, should be easy.

Re: time riddles
Something like this (not tested)
bridge_check script entity
place a timer to the level where your bridge is located and set desired interval for eg. 10 secs. And then add a connector and attach its onActivate-event to bridge_check.script:bridgeShowCheck
bridge_check script entity
Code: Select all
-- show bridge between timeofday 0.5 and 0.7
function brigeShowCheck(timer)
if GameMode.getTimeOfDay() > 0.5 and GameMode.getTimeOfDay() < 0.7 then
--show bridge
end
end
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
- cloneObject viewtopic.php?f=22&t=8450