Page 1 of 1

fade-in fade-out

Posted: Sat Jan 23, 2016 11:01 pm
by RayB
Does anyone know of a way to fade the Grimrock 1 game screen in or out?

Re: fade-in fade-out

Posted: Sun Jan 24, 2016 12:21 am
by Zo Kath Ra
this thread has some ideas for fading the screen to white:
viewtopic.php?f=14&t=4261
maybe you can adapt them to your needs

Re: fade-in fade-out

Posted: Sun Jan 24, 2016 12:24 am
by minmay
Use party.onDrawGui to fill the screen with a rectangle of your preferred colour, with steadily increasing alpha. You can get the delta time since the last frame by using getStatistic("play_time") every frame and using the difference of the play_time and the previous frame's play_time.

That 2012 thread is from before onDrawGui was added to Grimrock 1. You can still use the screen effect method but it's a lot less flexible (consider that only one screen effect can be played at a time, depth issues...).

Re: fade-in fade-out

Posted: Mon Jan 25, 2016 6:53 pm
by RayB
Once again I am probably in over my head and my ignorance requires me to say "I have no idea what you mean". As the 'onDrawGui' hook is mentioned in the 'Asset Definition Reference' I am assuming I will have to define something in the mod_assets scripts folder but what and where? Also I can not find the 'getStatistic()' statement anywhere.

I realize all this might be very difficult to explain and will understand if you don't reply to this post. I am just trying to set up a fade to black then fade back for my Grim 1 rope routine, like in Grim 2.

Please note that my Grim 2 rope routine seems to be working fine so thanks again for all your help.

Re: fade-in fade-out

Posted: Mon Jan 25, 2016 9:57 pm
by Zo Kath Ra
RayB wrote:Once again I am probably in over my head and my ignorance requires me to say "I have no idea what you mean". As the 'onDrawGui' hook is mentioned in the 'Asset Definition Reference' I am assuming I will have to define something in the mod_assets scripts folder but what and where? Also I can not find the 'getStatistic()' statement anywhere.

I realize all this might be very difficult to explain and will understand if you don't reply to this post. I am just trying to set up a fade to black then fade back for my Grim 1 rope routine, like in Grim 2.

Please note that my Grim 2 rope routine seems to be working fine so thanks again for all your help.
The "onDrawGui" hook must be added to the Party class, like this:
viewtopic.php?f=14&t=5485&start=10#p60155

Here's a simpler example for adding hooks to the Party class:
http://www.grimrock.net/modding_log1/scripting-hooks/

Information about "getStatistic()" can be found in the scripting reference:
http://www.grimrock.net/modding_log1/sc ... reference/
getStatistic(stat)
Returns the value of a built-in statistic. Possible statistics are: “play_time”, “monsters_killed”, “items_found”, “secrets_found”, “treasures_found”, “toorum_notes_found”, “skulls_found”, “grimrock_doors_opened”, “tiles_moved”, “pit_falls”, “melee_attacks”, “ranged_attacks”, “unarmed_attacks”, “rocks_thrown”, “spells_cast” and “potions_mixed”.

Re: fade-in fade-out

Posted: Tue Jan 26, 2016 9:13 pm
by Komag
I did a nice fade-to-white in two parts of Master Quest - after the cube fight, and at the very very end. I can't remember how I did it, but my source files are available at Nexus mods