Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Mewdoom

zdoom - how to FadeIn a monster ?

Recommended Posts

Hello guys,

I try to make a doomimp fadein when he spawn, but I want him to start his A_Look and being shootable just when he reach alpha 1, here is my script below. I read on wiki that fadeIn just work in a loop ? With that script below the Imp start attacking before finishing appear completely and he his keep his alpha below 1 ..

ACTOR NDoomImp
{
Health 60
Radius 20
Height 56
Mass 100
Speed 8
PainChance 200
Alpha 0
RENDERSTYLE add
Monster
+FLOORCLIP
SeeSound "imp/sight"
PainSound "imp/pain"
DeathSound "imp/death"
ActiveSound "imp/active"
HitObituary "$OB_IMPHIT"
Obituary "$OB_IMP"
States
{
Spawn:
TROO A 5 A_Look
TROO B 5 A_FadeIn(0.2)
Loop
See:
TROO AABBCCDD 3 A_Chase
Loop
Melee:
Missile:
TROO EF 8 A_FaceTarget
TROO G 6 A_TroopAttack
Goto See
Pain:
TROO H 2
TROO H 2 A_Pain
Goto See
Death:
TROO I 8
TROO J 8 A_Scream
TROO K 6
TROO L 6 A_NoBlocking
TROO M -1
Stop
XDeath:
TROO A 0 A_FadeIn(0.2, FTF_CLAMP)
TROO N 5
TROO O 5 A_XScream
TROO P 5
TROO Q 5 A_NoBlocking
TROO RST 5
TROO U -1
Stop
Raise:
TROO MLKJI 8
Goto See
}
}

Share this post


Link to post

Unset his SHOOTABLE flag and give him a spawn animation like this:

Spawn:
TROO A 0
TROO AAAAA 5 A_FadeIn(0.2)
TROO A 0 A_ChangeFlag("SHOOTABLE",1)
Idle:
TROO AB 10 A_Look
Loop
In the code above, 5 calls of A_FadeIn(0.2) will set his alpha exactly to 1.0, then he becomes shootable. Be sure to call the secondary spawn state "Idle", which will make the Imp enter it automatically when losing its target, so that he won't "fade in" again if this happens.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×