fade-in fade-out
fade-in fade-out
Does anyone know of a way to fade the Grimrock 1 game screen in or out?
- Zo Kath Ra
- Posts: 931
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: fade-in fade-out
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
viewtopic.php?f=14&t=4261
maybe you can adapt them to your needs
Re: fade-in fade-out
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...).
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.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: fade-in fade-out
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.
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.
- Zo Kath Ra
- Posts: 931
- Joined: Sat Apr 21, 2012 9:57 am
- Location: Germany
Re: fade-in fade-out
The "onDrawGui" hook must be added to the Party class, like this: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.
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
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