Difference between revisions of "Make character disappear"
Jump to navigation
Jump to search
Sharing solution to User problem
imported>Rbt hlpr mnky |
imported>JBurgess (Sharing solution to User problem) |
||
Line 57: | Line 57: | ||
--[[User:Hawkes|Hawkes]] 13:07, 12 April 2006 (EDT) | --[[User:Hawkes|Hawkes]] 13:07, 12 April 2006 (EDT) | ||
==Solution== | |||
I just happened to be doing this exact thing for something I'm working on right now. Here's how I'm handling it. Good Luck. [[User:JBurgess|JBurgess]] 14:45, 13 April 2006 (EDT) | |||
<pre> | |||
scn FadingNPCscript | |||
short onDeathFlag | |||
short Fader | |||
begin onLoad | |||
set Fader to 1 ; initialize our variable here | |||
end | |||
begin onDeath | |||
set FadeFlag to 1 ; activate gameMode loop | |||
sms shaderEffect ; turn off shaders which may conflict with saa | |||
end | |||
begin gameMode | |||
if FadeFlag == 1 ; only passes after death | |||
saa 1 ; set actor alpha to 100% - "just in case" | |||
if Fader > 0 ; because we set it to 1 in onLoad, this will pass | |||
set Fader to (Fader - 0.05) ; Decrement our var by 0.05 | |||
saa Fader ; and use that var for our actor alpha | |||
elseif Fader <= 0 ; When invisible, let's clean up | |||
set FadeFlag to 0 | |||
disable ; disable the dead/invisible NPC | |||
endif | |||
endif | |||
end | |||
</pre> | |||
[[Category:Questions]] | [[Category:Questions]] |