DECORATE: kamikadze monster wont die properly

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
zalewa
Posts: 14
Joined: Sun Dec 03, 2006 5:50 pm

DECORATE: kamikadze monster wont die properly

Post by zalewa »

A guy I've been working on a project with made this.
It attack players with it's missile attack correctly, then blows up when it gets near them and gets removed from the game.

However sometimes actor remains in the game, or rather actor's "ghost". When it happens engine substracts one monster from monster count (which is normal behavior) but the monster is still there - floating and attacking. It cannot perform melee attack anymore and cannot be killed.
I've no idea what causes this since it happens very random and when I've got 50 Suicide Souls alive in single room sometimes none ghosts remain.

Here's the code:

Code: Select all

actor Suicide_Soul 31037
{
  spawnid 199
  obituary "%o was blown up by a Suicide Soul."
  hitobituary "%o was spooked by a Suicide Soul."
  health 250
  radius 16
  height 56
  mass 50
  speed 8
  damage 10
  painchance 256
  attacksound "DSSKLATK"
  painsound "DSDMPAIN"
  deathsound "DSFIRXPL"
  activesound "DSDMACT"
  MONSTER
  +FLOAT
  +NOGRAVITY
  +NOICEDEATH
  +MISSILEMORE
  +DONTFALL
  states
  {
  Spawn:
    LSTS AB 4 bright A_Look
    loop
  See:
    LSTS AB 4 bright A_Chase
    loop
  Melee:
    LSTS C 1 bright A_FaceTarget
    LSTS C 0 A_Die
    goto see
  Missile:
    LSTS C 10 bright A_FaceTarget
    LSTS D 2 bright A_SkullAttack
    LSTS CD 2 bright
    goto see
  Pain:
    LSTS E 3 bright
    LSTS E 3 bright A_Pain
    goto See
  Death:
    LSTS F 4 bright A_Explode
    LSTS G 4 bright A_Scream
    LSTS H 4 bright
    LSTS I 4 bright A_NoBlocking
    LSTS JK 4
    stop
  }
}
There was also another variant of this monster which had goto Missile+2 instead of goto See in it's Missile state but I think it behaves better with goto See.

Missile state must be fault here because I've made similar monster with almost the same Melee and Death states, but no Missile and no weird shit happened (Terminator series).
Also when I commented out Missile state in this Suicide Soul I had no ghosts remaining.
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

The problem is that the actor isn't actually dying, and it still has health left during it's dying sequence. If you shoot it after it's done it's missile state it will enter it's pain state and still be alive.

I *think* this will solve it. Don't quote me on this though:

Code: Select all

  Melee:
    LSTS C 1 bright A_FaceTarget
    LSTS C 0 DamageThing(0)
    goto death 
Give it a try.
zalewa
Posts: 14
Joined: Sun Dec 03, 2006 5:50 pm

Post by zalewa »

Seems to work. Thanks.
One more thing: when this soul explodes and kills player game says that "Player killed himself". Is there any way to replace it with proper obituary?
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

I think it's only meant for projectiles. Here's a way around it:

Make this new actor:

Code: Select all

actor suicideexplosion
{
- SOLID
+NOBLOCKMAP
Speed 0
Damage 0
height 1
radius 1
PROJECTILE
States
{
Spawn:
TNT1 A 0 A_Explode
Stop
}
}
And replace your death state with:

Code: Select all

  Death:
    LSTS F 4 bright A_SpawnItem("suicideexplosion")
    LSTS G 4 bright A_Scream
    LSTS H 4 bright
    LSTS I 4 bright A_NoBlocking
    LSTS JK 4
    stop
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

Cutmanmike wrote:

Code: Select all

- SOLID

The space is no longer needed. That bug has been fixed a long time ago.
User avatar
Cutmanmike
Posts: 11354
Joined: Mon Oct 06, 2003 3:41 pm
Operating System Version (Optional): Windows 10
Location: United Kingdom
Contact:

Post by Cutmanmike »

It was a bug? It'll probably take me a while to get out of the habbit of doing that.
Locked

Return to “Editing (Archive)”