I need help to fix my first boss

Status
Not open for further replies.

GLide KS

Sometimes I sprite "things"
I have a problem with my first boss object, when i hit him (in this case, the boss its me), the boss cant stop flashing or, stop the boss pain effect, here´s the code (WARNING: Large MAINCFG).

Code:
#Carlos Boss Made by CarlosGamer72

Freeslot
MT_CARLOS_BOSS
S_CARLOSBOSS_STND
S_CARLOSBOSS_WALK1
S_CARLOSBOSS_WALK2
S_CARLOSBOSS_WALK3
S_CARLOSBOSS_WALK4
S_CARLOSBOSS_WALK5
S_CARLOSBOSS_WALK6
S_CARLOSBOSS_WALK7
S_CARLOSBOSS_WALK8
S_CARLOSBOSS_WALK9
S_CARLOSBOSS_WALK10
S_CARLOSBOSS_WALK11
S_CARLOSBOSS_WALK12
S_CARLOSBOSS_WALK13
S_CARLOSBOSS_WALK14
S_CARLOSBOSS_WALK15
S_CARLOSBOSS_WALK16
S_CARLOSBOSS_PAIN1
S_CARLOSBOSS_PAIN2
S_CARLOSBOSS_PAIN3
S_CARLOSBOSS_PAIN4
S_CARLOSBOSS_DEAD
S_CARLOSBOSS_SPINATK0
S_CARLOSBOSS_SPINATK1
S_CARLOSBOSS_SPINATK2
S_CARLOSBOSS_SPINATK3
S_CARLOSBOSS_SPINATK4
S_CARLOSBOSS_SPINATK5
S_CARLOSBOSS_SPINATK6
S_CARLOSBOSS_SPINATK7
S_CARLOSBOSS_SPINATK8
S_CARLOSBOSS_SWORDATK
S_CARLOSBOSS_JUMP0
S_CARLOSBOSS_JUMP1
S_CARLOSBOSS_JUMP2
S_CARLOSBOSS_FALL
S_CARLOSBOSS_STOPJUMPING
S_CARLOSBOSS_ROLLING0
S_CARLOSBOSS_ROLLING1
S_CARLOSBOSS_ROLLING2
S_CARLOSBOSS_ROLLING3
S_CARLOSBOSS_ROLLING4
S_CARLOSBOSS_ROLLING5
S_CARLOSBOSS_ROLLING6
S_CARLOSBOSS_ROLLING7
S_CARLOSBOSS_ROLLING8
S_CARLOSBOSS_STOP
S_CARLOSBOSS_SWORDATK0
SPR_BSPN
SPR_BATK
SPR_CRBS
sfx_BSJUMP
sfx_BSROLL

Object MT_CARLOS_BOSS
MapThingNum = 3012
SpawnState = S_CARLOSBOSS_STND
SpawnHealth = 12
SeeState = S_CARLOSBOSS_WALK1
SeeSound = sfx_None
ReactionTime = 32
AttackSound = sfx_None
PainState = S_CARLOSBOSS_PAIN1
PainChance = 200
PainSound = sfx_None
MeleeState = S_CARLOSBOSS_SWORDATK
MissileState = S_NULL
DeathState = S_CARLOSBOSS_DEAD
XDeathState = S_CARLOSBOSS_DEAD
DeathSound = sfx_pop
Speed = 13
Radius = 24*FRACUNIT
Height = 32*FRACUNIT
DispOffset = 0
Mass = 100
Damage = 0
ActiveSound = sfx_None
Flags = MF_BOSS|MF_SHOOTABLE|MF_SPECIAL|MF_BOUNCE|MF_ENEMY
RaiseState = S_NULL

#Initial State

State S_CARLOSBOSS_STND
SpriteName = CRBS
SpriteFrame = A
Duration = 1
Next = S_CARLOSBOSS_WALK1
Var1 = 0
Var2 = 0

#Walk to target

State S_CARLOSBOSS_WALK1
SpriteName = CRBS
SpriteFrame = B
Duration = 2
Next = S_CARLOSBOSS_WALK2
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK2
SpriteName = CRBS
SpriteFrame = C
Duration = 2
Next = S_CARLOSBOSS_WALK3
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK3
SpriteName = CRBS
SpriteFrame = D
Duration = 2
Next = S_CARLOSBOSS_WALK4
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK4
SpriteName = CRBS
SpriteFrame = E
Duration = 2
Next = S_CARLOSBOSS_WALK5
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK5
SpriteName = CRBS
SpriteFrame = F
Duration = 2
Next = S_CARLOSBOSS_WALK6
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK6
SpriteName = CRBS
SpriteFrame = G
Duration = 2
Next = S_CARLOSBOSS_WALK7
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK7
SpriteName = CRBS
SpriteFrame = H
Duration = 2
Next = S_CARLOSBOSS_WALK8
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK8
SpriteName = CRBS
SpriteFrame = I
Duration = 2
Next = S_CARLOSBOSS_WALK9
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK9
SpriteName = CRBS
SpriteFrame = B
Duration = 2
Next = S_CARLOSBOSS_WALK10
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK10
SpriteName = CRBS
SpriteFrame = C
Duration = 2
Next = S_CARLOSBOSS_WALK11
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK11
SpriteName = CRBS
SpriteFrame = D
Duration = 2
Next = S_CARLOSBOSS_WALK12
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK12
SpriteName = CRBS
SpriteFrame = E
Duration = 2
Next = S_CARLOSBOSS_WALK13
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK13
SpriteName = CRBS
SpriteFrame = F
Duration = 2
Next = S_CARLOSBOSS_WALK14
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK14
SpriteName = CRBS
SpriteFrame = G
Duration = 2
Next = S_CARLOSBOSS_WALK15
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK15
SpriteName = CRBS
SpriteFrame = H
Duration = 2
Next = S_CARLOSBOSS_WALK16
Action = A_Chase
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_WALK16
SpriteName = CRBS
SpriteFrame = I
Duration = 2
Next = S_CARLOSBOSS_JUMP1
Action = A_Chase
Var1 = 0
Var2 = 0

#Dodge (Jump)

State S_CARLOSBOSS_JUMP0
SpriteName = CRBS
SpriteFrame = J
Duration = 1
Next = S_CARLOSBOSS_JUMP1
Action = A_PlaySound
Var1 = sfx_BSJUMP
Var2 = 0

State S_CARLOSBOSS_JUMP1
SpriteName = CRBS
SpriteFrame = J
Duration = 1
Next = S_CARLOSBOSS_JUMP2
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_JUMP2
SpriteName = CRBS
SpriteFrame = J
Duration = 8
Next = S_CARLOSBOSS_FALL
Action = A_BunnyHop
Var1 = 14
Var2 = 6

#Fall

State S_CARLOSBOSS_FALL
SpriteName = CRBS
SpriteFrame = K
Duration = 46
Next = S_CARLOSBOSS_STOPJUMPING
Var1 = 0
Var2 = 0

#Stop Jumping

State S_CARLOSBOSS_STOPJUMPING
SpriteName = CRBS
SpriteFrame = A
Action = A_FaceTarget
Duration = 30
Next = S_CARLOSBOSS_SPINATK1
Var1 = 0
Var2 = 0

#Spin Attack Charging

State S_CARLOSBOSS_SPINATK1
SpriteName = BSPN
SpriteFrame = A
Duration = 2
Next = S_CARLOSBOSS_SPINATK2
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_SPINATK2
SpriteName = BSPN
SpriteFrame = B
Duration = 2
Next = S_CARLOSBOSS_SPINATK3
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_SPINATK3
SpriteName = BSPN
SpriteFrame = C
Duration = 2
Next = S_CARLOSBOSS_SPINATK4
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_SPINATK4
SpriteName = BSPN
SpriteFrame = D
Duration = 2
Next = S_CARLOSBOSS_SPINATK5
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_SPINATK5
SpriteName = BSPN
SpriteFrame = A
Duration = 1
Next = S_CARLOSBOSS_SPINATK6
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_SPINATK6
SpriteName = BSPN
SpriteFrame = B
Duration = 1
Next = S_CARLOSBOSS_SPINATK7
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_SPINATK7
SpriteName = BSPN
SpriteFrame = C
Duration = 1
Next = S_CARLOSBOSS_SPINATK8
Action = A_FaceTarget
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_SPINATK8
SpriteName = BSPN
SpriteFrame = D
Duration = 1
Next = S_CARLOSBOSS_ROLLING1
Action = A_FaceTarget
Var1 = 0
Var2 = 0

#Spin Attack GO!

State S_CARLOSBOSS_ROLLING0
SpriteName = CRBS
SpriteFrame = N
Duration = 1
Next = S_CARLOSBOSS_ROLLING1
Action = A_PlaySound
Var1 = sfx_BSROLL
Var2 = 0

State S_CARLOSBOSS_ROLLING1
SpriteName = CRBS
SpriteFrame = N
Duration = 2
Next = S_CARLOSBOSS_ROLLING2
Action = A_BunnyHop
Var1 = 0
Var2 = 49

State S_CARLOSBOSS_ROLLING2
SpriteName = CRBS
SpriteFrame = O
Duration = 2
Next = S_CARLOSBOSS_ROLLING3
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_ROLLING3
SpriteName = CRBS
SpriteFrame = P
Duration = 2
Next = S_CARLOSBOSS_ROLLING4
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_ROLLING4
SpriteName = CRBS
SpriteFrame = Q
Duration = 2
Next = S_CARLOSBOSS_ROLLING5
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_ROLLING5
SpriteName = CRBS
SpriteFrame = N
Duration = 2
Next = S_CARLOSBOSS_ROLLING6
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_ROLLING6
SpriteName = CRBS
SpriteFrame = O
Duration = 2
Next = S_CARLOSBOSS_ROLLING7
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_ROLLING7
SpriteName = CRBS
SpriteFrame = P
Duration = 2
Next = S_CARLOSBOSS_ROLLING8
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_ROLLING8
SpriteName = CRBS
SpriteFrame = Q
Duration = 2
Next = S_CARLOSBOSS_SWORDATK
Var1 = 0
Var2 = 0

#Pain States

State S_CARLOSBOSS_PAIN1
SpriteName = CRBS
SpriteFrame = L
Duration = 1
Next = S_CARLOSBOSS_PAIN2
Action = A_SetObjectFlags
Var1 = MF_SHOOTABLE|MF_BOSS
Var2 = 1

State S_CARLOSBOSS_PAIN2
SpriteName = CRBS
SpriteFrame = L
Duration = 1
Next = S_CARLOSBOSS_PAIN3
Action = A_PlaySound
Var1 = 0
Var2 = 0

State S_CARLOSBOSS_PAIN3
SpriteName = CRBS
SpriteFrame = L
Duration = 17
Next = S_CARLOSBOSS_PAIN4
Action = A_BunnyHop
Var1 = 0
Var2 = -16

State S_CARLOSBOSS_PAIN4
SpriteName = CRBS
SpriteFrame = L
Duration = 1
NEXT = S_CARLOSBOSS_WALK1
Action = A_SetObjectFlags
Var1 = MF_SHOOTABLE|MF_BOSS
Var2 = 2

#Death State

State S_CARLOSBOSS_DEAD
SpriteName = CRBS
SpriteFrame = M
Duration = 1
NEXT = S_CARLOSBOSS_DEAD
Var1 = 0
Var2 = 0

#Carlos Sword ATK

State S_CARLOSBOSS_SWORDATK0
SpriteName = BATK
SpriteFrame = A
Duration = 1
NEXT = S_CARLOSBOSS_SWORDATK
Action = A_PlaySound
Var1 = sfx_ngskid
Var2 = 0

State S_CARLOSBOSS_SWORDATK
SpriteName = BATK
SpriteFrame = A
Duration = 15
NEXT = S_CARLOSBOSS_STOP
Action = A_BunnyHop
Var1 = 0
Var2 = 40

#Carlos Stop Attacking

State S_CARLOSBOSS_STOP
SpriteName = CRBS
SpriteFrame = A
Duration = 80
NEXT = S_CARLOSBOSS_WALK1
Var1 = 0
Var2 = 0

And this is the gif:

giphy.gif
 
Try removing MF2_FRET with A_SetObjectFlags2? That's the flag that causes flashing and pain immunity for bosses. Normally it would auto-turn off when you go back to the spawn state, but it seems you never do so you may as well remove it manually.
 
Try removing MF2_FRET with A_SetObjectFlags2? That's the flag that causes flashing and pain immunity for bosses. Normally it would auto-turn off when you go back to the spawn state, but it seems you never do so you may as well remove it manually.

I think that requires another pain state to do that. :I

---------- Post added at 04:57 PM ---------- Previous post was at 04:51 PM ----------

IT WORKS! Thanks Monster Iestyn.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top