Problem with A_SpawnItemEx
Posted: Sun Feb 08, 2009 8:20 am
I thought this is an GZDoom bug but most likely, it isn't so I just ask here for a solution.
This is my actor:
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 code is able to spawn PROJECTILES but no MONSTERS (DoomImp and Demon doesn't work, but DoomImpBall works for example) if I do not add the inherited Zombieman to the head of the actor.
*EDIT2*'
If I remove the "MONSTER" flag from the AntSmall, it works as well... so to summarize:
Inheriting from Zombieman
Projectiles work
Monsters work
Without Inheriting from Zombieman
Projectiles Work
Monsters do not work
Monsters work if they have no MONSTER flag
*EDIT3*
Ok got it, for some reason the ISMONSTER flag causes the problem... if I remove that from the MONSTER combo, the monsters get spawned... bug? Or did I set up anything wrong?
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 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 code is able to spawn PROJECTILES but no MONSTERS (DoomImp and Demon doesn't work, but DoomImpBall works for example) if I do not add the inherited Zombieman to the head of the actor.
*EDIT2*'
If I remove the "MONSTER" flag from the AntSmall, it works as well... so to summarize:
Inheriting from Zombieman
Projectiles work
Monsters work
Without Inheriting from Zombieman
Projectiles Work
Monsters do not work
Monsters work if they have no MONSTER flag
*EDIT3*
Ok got it, for some reason the ISMONSTER flag causes the problem... if I remove that from the MONSTER combo, the monsters get spawned... bug? Or did I set up anything wrong?