fade-in fade-out

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
RayB
Posts: 140
Joined: Fri Mar 06, 2015 3:45 am

fade-in fade-out

Post by RayB »

Does anyone know of a way to fade the Grimrock 1 game screen in or out?
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: fade-in fade-out

Post 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
minmay
Posts: 2768
Joined: Mon Sep 23, 2013 2:24 am

Re: fade-in fade-out

Post 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...).
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.
RayB
Posts: 140
Joined: Fri Mar 06, 2015 3:45 am

Re: fade-in fade-out

Post 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.
User avatar
Zo Kath Ra
Posts: 931
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: fade-in fade-out

Post 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”.
User avatar
Komag
Posts: 3654
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: fade-in fade-out

Post 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
Finished Dungeons - complete mods to play
Post Reply