Search the Community
Showing results for tags 'fade in'.
-
Hello :smile: This is a combination of code derived from two scripts from Nexus posts: Script Author: LogicalD Fade To Black ISM Works! But Fade-In not working? Script Author: tewlons Improved cutscenes with cinematic camera, fades, and more The final code here has been heavily tested, and works great - (not ENB tested but should be compatible thanks to tewlons code). The usage is pretty simple, and relies on CrossFade so that things are 'seamless' and should be reliable under low fps conditions. Function Code: ;IMS Property ;object under ImageSpaceModifier FadeToBlackHoldImod ImageSpaceModifier Property FadeToBlackHold auto ;***************************************** ;Fade Functions Function DoFadeOut (Float Time) FadeToBlackHold.ApplyCrossFade (Time) Utility.Wait (Time) Game.FadeOutGame (False,True,50,1) EndFunction Function DoFadeIn (Float Time) Game.FadeOutGame (False,True,0.1,0.1) ImageSpaceModifier.RemoveCrossFade (Time) EndFunction ;**************************************** You can add the IMS property and function code to any "full" Papyrus script -Not a fragment- and then call the functions directly from the same script - this includes a custom made quest script. You can add the IMS property and function code to the main quest script generated by the game and then be able to call the functions from quest stage fragments. Script Example: ;Uncomment the SoundCategory property and MasterSound usage to access usage of the Mute function to remove game sound during the black time **Only use Mute if really needed** ;Uncomment the Game.DisablePlayerControls/Game.EnablePlayerControls to allow the player to be locked in place during the fade sequence ;Object under SoundCategory property _AudioCategoryMaster ;SoundCategory Property MasterSound Auto ;Game.DisablePlayerControls(true, true, true, false, true, true, true, false) Utility.Wait(1.0) DoFadeOut (4) Utility.Wait(4.0) ;MasterSound.Mute () ;Do stuff during the black screen ;Move actors, move things, change time, etc ;wait for things to be finished before allowing the fade in Utility.Wait(7.0) DoFadeIn(4) ;MasterSound.UnMute () ;Game.EnablePlayerControls() The Mute option in script added is just in case during the black screen there might be sounds of footsteps or something else undesirable. The option to use Mute in the example code should only be ran during the absolute black screen time, where the FadeOutGame function is running, which prevents the player from escaping during the Mute time. Through numerous tests I have not been able to break the Mute usage, but due to posts from others cautioning about the use of the command, I would at least suggest using it only if needed. The extra code was put into the functions from tewlons script which attempts to compensate for issues with ENB and the IMS property. With ENB enabled, the final result may vary depending on ENB settings, and could range from being fairly smooth fade transitions, to just an instant black screen and then after the duration instant end to black screen. Off-note: If desiring to use a default main quest script yet it does not exist - A main quest script is seemingly not generated by the game until code is compiled into a quest stage fragment, even just a ; (semicolon) added and then compiled will do it.