Page 1 of 1

[297 +/-] SpawnItemEx Bug - Different cause

Posted: Sun Feb 08, 2009 15:19
by Tormentor667
Okay, I obviously didn't get the problem last time, so it wasn't the GZDoom revision, it is obviously an older bug - for me it seems to be bug because the behaviour is very odd.

This is my actor:

Code: Select all

actor AntBoss 12345
{
  obituary "%o was killed by a giant ant."
  health 200
  radius 32
  height 32
  mass 1000
  speed 12
  painchance 96
  maxtargetrange 128
  meleerange 32
  seesound "ant/active"
  attacksound "ant/attack"
  painsound "ant/pain"
  deathsound "ant/death"
  activesound "ant/active"
  dropitem "0" 256
  MONSTER
  +FLOORCLIP
  states
  {
  Spawn:
    POSS A 50 A_Look
    POSS ABCDEFGHIJKLMNOPQRSTU 2 A_Look
    SPOS ABCDEFGHIJKLMNOPQRSTU 2 A_Look
    BOS2 ABCDEFGHI 2 A_Look
    loop
  See:
    BOSS EF 8 A_Chase
    BOSS G 0 A_PlaySound("ant/step")
    BOSS GH 8 A_Chase
    BOSS E 0 A_PlaySound("ant/step")
    loop
  Melee:
    TROO ABCD 4 A_FaceTarget
    TNT1 A 0 A_SpawnItemEx("FreezeDummy",32,0,0,0,0,0,0,32)
    TROO EFGH 4 
    TNT1 A 0 A_CustomMeleeAttack(10,"ant/bite",0,0,1) 
    TROO IJKLMNOPQRSTU 3
    goto See
  Missile:
    TROO ABCDEF 2 A_FaceTarget
    TNT0 A 0 A_CustomMissile("AntFire",32,0, random(10,-10), 0, random(170,190))
    TROO GH 2 A_FaceTarget
    TNT0 A 0 A_CustomMissile("AntFire",32,0, random(10,-10), 0, random(170,190))
    TROO IJ 2 A_FaceTarget
    TNT0 A 0 A_CustomMissile("AntFire",32,0, random(10,-10), 0, random(170,190))
    TROO KL 2 A_FaceTarget
    TNT0 A 0 A_CustomMissile("AntFire",32,0, random(10,-10), 0, random(170,190))
    TROO MNO 3
    goto See
  Pain:
    TROO A 0 A_Pain
    TROO BCDEDCBA 2
    goto See
  Death:
    TNT1 A 0 A_Scream
    TNT1 A 0 A_NoBlocking
    TNT1 A 0 A_Jump(160,5)
    TNT1 AAAA 0 A_SpawnItemEx("AntSmall", random(-128,128), random(-128,128), 0, 0, 0, 0, random(0,359), 0)    <-- -----------------
    SKEL ABCDE 8
    SKEL F 8 A_Playsound("ant/fall")
    SKEL GH 8 
    SKEL I -1    
    stop
  }
}
The important line is in its death state: After the ant dies, it should spawn several little ants. For some reason, if the player looks as it is now, nothing gets spawned at all, absolutely nothing. It doesn't even make a difference if I change the code pointer to force the spawn (flag 32) or if I enlarge the random positions even more.

The only difference that makes the actor spawn the ants is when I inherit the AntBoss from the Zombieman (and most likely from other actors as well). I already double checked if the AntBoss is missing something, but everything that is present in the Zombieman decorate is also in my AntBoss decorate. Bug?

*EDIT*
I found out that the ISMONSTER flag makes the difference. If I deactivate it for the object being spawned, it always works. If it is activated, it never works (as long as I don't inherit from the Zombieman, as this works always but is no solution in my eyes)

Posted: Sun Feb 08, 2009 15:48
by Rachael
I'm thinking this may actually be intended behavior. Monsters aren't supposed to clip each other, otherwise it will create issues, and both victims (or in this case, all) in the clip will be unable to move or otherwise interact with anything unless they come within melee range because they are stuck.

Are the little ants solid? If they're not, then it might work. I think it's possible to make them shootable but unsolid.

If you've ever "summoned" two monsters on too close to each other you'll see what I mean.

Posted: Sun Feb 08, 2009 15:48
by Enjay
Back to your thread on Zdoom... ;)

http://forum.zdoom.org/viewtopic.php?f=3&t=20825

I'm not getting the problem. The spawning happens for me.
Enjay wrote:Are you sure you haven't just been unlucky with your A_Jumps jumping past the spawning when you have tested it? I commented out that line and got spawning to happen every time. Here's some proof. I made the AntSmall actor by simply inheriting from the DoomImp. I summoned an AntBoss and killed it with MDK bound to a button. As you can see, the boss died and was immediately surrounded by imps.

http://www.rowand.myzen.co.uk/antboss.wmv

[edit] I haven't changed any flags so I think your "ismonster" theory is wrong. If you look at my vid, you can see the monster count go up when the antboss spawns and when the imps are spawned.[/edit]

Posted: Sun Feb 08, 2009 16:02
by Tormentor667
I got the problem - finally :P Don't know if it is a bug though.
Let's take a look at the Death ani:

Code: Select all

Death:
    TNT1 A 0 A_Scream
    TNT1 A 0 A_NoBlocking
    TNT1 A 0 A_Jump(160,5)
    TNT1 AAAA 0 A_SpawnItemEx("AntSmall", random(-128,128), random(-128,128), 0, 0, 0, 0, random(0,359), 0)    <-------------------
    SKEL ABCDE 8
    SKEL F 8 A_Playsound("ant/fall")
    SKEL GH 8
    SKEL I -1   
    stop
  }
}
If I kill the monsters with a weapon, every other monster being spawned in the A_SpawnItemEx gets spawned. If I kill the monsters with the console command "kill monsters", nothing gets spawned at all.

Bug?

Posted: Sun Feb 08, 2009 16:07
by Enjay
Gah! cross posting. ;)

As I metioned in the other thread, no bug. It's intentional behaviour.

Posted: Sun Feb 08, 2009 22:03
by Rachael
Tormentor667 wrote: If I kill the monsters with a weapon, every other monster being spawned in the A_SpawnItemEx gets spawned. If I kill the monsters with the console command "kill monsters", nothing gets spawned at all.
Intentional. Pain Elemental, for example. If you spawn this dude, and "kill monsters" him (or her?), you will not get lost souls.

I am not sure, but I think D'Sparil is supposed to be the exception to that. When you kill the parent monster (Sorcerer1 I think), it spawns Sorcerer2 no matter how it's killed.

Posted: Sun Feb 08, 2009 22:41
by Graf Zahl
SoulPriestess wrote: I am not sure, but I think D'Sparil is supposed to be the exception to that. When you kill the parent monster (Sorcerer1 I think), it spawns Sorcerer2 no matter how it's killed.
That's necessary because the second form often has special actions attached.

Posted: Sun Feb 08, 2009 23:44
by Enjay
It was actually a D'Sparil copy that I found this with when I raised the issue. IIRC, I was confused because D'Sparil's second stage would spawn with the original actor, but my fake D'Sparil didn't. Confusing the hell out of me at the time. ;)