Fade in Fade out

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
User avatar
Eleven Warrior
Posts: 736
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Fade in Fade out

Post by Eleven Warrior »

I was wondering if anyone knows how i can fade out to black then after say 5 seconds it fades back to the game eg: Quest is completed i want it to fade in to black screen the after 5 second the fade in (back to the game)
User avatar
THOM
Posts: 1266
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Fade in Fade out

Post by THOM »

use
GameMode.fadeIn(color, length)
GameMode.fadeOut(color, length)

e.g.

Code: Select all

function fade()
	GameMode.fadeOut(0,1)
	delayedCall(self.go.id, 5, "fadeBack")
end

function fadeBack()
	GameMode.fadeIn(0,1)
end
You might want to think about disabeling the champions during the five seconds of black?
Then use GameMode.setEnableControls(false) - and of course set it back to true afterwards.
Last edited by THOM on Wed Mar 03, 2021 2:21 pm, edited 1 time in total.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Eleven Warrior
Posts: 736
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Fade in Fade out

Post by Eleven Warrior »

Thom it comes up with the error: attempt to index field 'go' (a functionvalue)
User avatar
THOM
Posts: 1266
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Fade in Fade out

Post by THOM »

Are you using the code in a script-entity or elsewhere?

EDIT: Ah, and the name of the function has to be set in quotes. Corrected my code above.
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
User avatar
Eleven Warrior
Posts: 736
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Fade in Fade out

Post by Eleven Warrior »

Thanks for the help mate :)
Post Reply