Fade

Post » Fri May 27, 2011 8:24 am

Can anyone give me an example of how fade works?
User avatar
Quick Draw III
 
Posts: 3372
Joined: Sat Oct 20, 2007 6:27 am

Post » Fri May 27, 2011 4:30 pm

It works best incased in a series of state variables like this:

Begin YourFadeOutScriptShort stateFloat timer ;timers always need to be a float variable because seconds are counted in decimal pointsIf ( state == 0 )	FadeOut 2 ;the number is the seconds it takes to fade the screen completely to black	Set state to 1Elseif ( state == 1 )	Set timer to ( timer + GetSecondsPassed ) ;to make it stay black for as long as you need before fading back in. Make sure this is longer than the seconds it takes to fade out.	If ( timer > 4 ) ;adjust for however many seconds you need		FadeIn 2		Set state to 3	EndifEndifEnd


I usually have something trigger the FadeOut, so it's usually in the state == 1 block, not the state == 0 block, or else it will just happen instantly. Also, if you want to use it again, make sure to trigger something to reset it and set the timer back to 0.

Have you downloaded a copy of Morrowind Scripting for Dummies yet (linked in the tutorial sticky)? I highly recommend it. It's taught me most of what I know about scripting. The rest is learned through trial and error, and lots of help from forum members. ;)
User avatar
liz barnes
 
Posts: 3387
Joined: Tue Oct 31, 2006 4:10 am

Post » Fri May 27, 2011 1:07 pm

Ditto on downloading Scripting for Dummies - you'll find it very helpful - it has a good section on how to use fade and fadeto

Fadeto allows you to set a percentage of darkness for a length of time

I use it in Dialogue when I want to simulate time passing - sort of like a cinematic wipe which signals the story is moving on

In the results box I use

Fadeto 100 2.0Fadeto 0 3.0 


This is a quick fade to complete black - 100 for 2 seconds then a Fadeto no black - 0 for 3 seconds in other words it's fading out then fading in
User avatar
Solina971
 
Posts: 3421
Joined: Thu Mar 29, 2007 6:40 am


Return to III - Morrowind