simulating voyage GameMode.fadeOut

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

simulating voyage GameMode.fadeOut

Post by bongobeat »

Hey all,

please can someone help with this script? (to be sure nothing can goes wrong)
it is used to simulate a voyage. The screen get black, the player get blocked into a forcefield, and after a time he is teleported on an island.
SpoilerShow

Code: Select all

				GameMode.fadeOut(0,0,0,1,5)
--				GameMode.advanceTime(7200)

				playSound("discover_spell")
		                GameMode.fadeIn(0,0,0,1,1)
I use the fadeOut, but I don't really know if this is the correct way. I tried the rgb 0 0 0 1 to use black color. 5 is the time that the screen stay black.
Can someone tells more about how to use GameMode.fadeOut(0,0,0,1,5) ?
It suddenly goes black, can it be set to something more slow? Same thing for the GameMode.fadeIn, it suddenly remove the black screen.

How to advance time while the voyage? I tried GameMode.advanceTime(amount), with 7200 in value like 7200 seconds, but that don't do anything.
is it possible to see the screen effect, that the timepiece trigger when you rest?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: simulating voyage GameMode.fadeOut

Post by minmay »

See the scripting reference. GameMode.fadeOut() takes two arguments, not five. Calling GameMode.fadeOut(0,0,0,1,5) should be the same as calling GameMode.fadeOut(0,0). The color is specified in a single R8G8B8 number, not 3 different arguments. So for example, GameMode.fadeOut(0x0,1) to fade to black over 1 second, or GameMode.fadeOut(0xffffff,2) to fade to white over 2 seconds.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: simulating voyage GameMode.fadeOut

Post by bongobeat »

thanks for reply.
better fading now :D

what is the type of value that has to be used in the GameMode.advanceTime(amount) ?
is it seconds? minutes?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: simulating voyage GameMode.fadeOut

Post by minmay »

If I recall correctly, it's the same units used by GameMode.setTimeOfDay(). 0 is sunrise, 1 is dusk, when it reaches 2 it wraps around. Since 7200 is divisible by 2, it will have no effect whatsoever. 7200 seconds would be 7200/43200 of these units, exactly 1/6.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: simulating voyage GameMode.fadeOut

Post by bongobeat »

I have just test some lower values:

for 1 in value, the time advance by 12 hours
0.5 --> 6 hours
0.25 --> 3 hours
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Post Reply