MantisBT - Zandronum
View Issue Details
0000678Zandronum[All Projects] Bugpublic2012-02-17 13:102012-02-21 12:31
ZzZombo 
 
normalminoralways
closedno change required 
98d 
 
0000678: A_CustomMissile doesn't work in monsters if they haven't something to attack.
I tried to create a monster which location is shown with a small green arrow which is attached via call to A_VileTarget. To make it work, I've created new projectile which upon spawning constantly calls A_VileTarget until the monster dies so the arrow is following the monster. I made a call to A_CustomMissile in monster Spawn state but nothing happens. I tried to guess what is wrong and noticed that monsters of this class which sees a player at level start appear to have the arrow but others don't.
Use this DECORATE code and run Skulltag:
actor Pointer:ArchvileFire
{
    RenderStyle Translucent
    Alpha 0.05
    PROJECTILE// to allow it pass through walls
    +NOCLIP// to allow it pass through walls
    +NOINTERACTION// to allow it pass through walls
    +NOTIMEFREEZE
    States
    {
        Spawn:
        Death:
        ACCU A 17 BRIGHT
        ACCU A 10
        stop
    }
}

actor PointerSpawner
{
    PROJECTILE
    +NOTIMEFREEZE
    +SEEKERMISSILE
    +SERVERSIDEONLY
    States
    {
        Death:
        Spawn:
        TNT1 A 0 A_JumpIfInTargetInventory("killed",1,"XDeath")
        TNT1 A 1 A_VileTarget("BarrelPointer")
        loop
        XDeath:
        TNT1 A 35
        stop
    }
}

actor Killed:Inventory {Inventory.maxamount 1}

ACTOR AMonster:DoomImp
{
    Mass 100
    +PUSHABLE
    States
    {
        Spawn:
        TNT1 A 0 A_Jump(255,"Idle")
        TNT1 A 1 Thing_ChangeTID(0,632)
        TNT1 A 0 Thing_Hate(0,632,4)
        TNT1 A 0 A_LookEx(0,0,0,0,0,"See2")
        See2:
        TNT1 A 0 A_CustomMissile("PointerSpawner")
        Idle:
        goto Super::Spawn
    }
}
Spawning AMonster during gameplay via "summon AMonster" sometimes spawns monsters
98d, A_CustomMissile, decorate
? skulltag_bug_example2.pk3 (1,390) 2012-02-18 15:10
/tracker/file_download.php?file_id=461&type=bug
Issue History
2012-02-17 13:10ZzZomboNew Issue
2012-02-18 13:28Torr SamahoNote Added: 0002630
2012-02-18 13:28Torr SamahoStatusnew => feedback
2012-02-18 15:10ZzZomboFile Added: skulltag_bug_example2.pk3
2012-02-18 15:12ZzZomboNote Added: 0002635
2012-02-18 15:12ZzZomboStatusfeedback => new
2012-02-18 15:15ZzZomboNote Edited: 0002635bug_revision_view_page.php?bugnote_id=2635#r1331
2012-02-18 15:28Torr SamahoNote Added: 0002636
2012-02-18 15:28Torr SamahoNote Edited: 0002636bug_revision_view_page.php?bugnote_id=2636#r1333
2012-02-18 15:47Edward-sanNote Added: 0002637
2012-02-18 18:42MinigunnerNote Added: 0002640
2012-02-19 00:11ZzZomboNote Added: 0002641
2012-02-19 00:18ZzZomboNote Edited: 0002641bug_revision_view_page.php?bugnote_id=2641#r1335
2012-02-19 00:21ZzZomboNote Edited: 0002641bug_revision_view_page.php?bugnote_id=2641#r1336
2012-02-19 01:43Torr SamahoNote Added: 0002643
2012-02-19 01:43Torr SamahoStatusnew => feedback
2012-02-20 13:55ZzZomboNote Added: 0002658
2012-02-20 13:55ZzZomboStatusfeedback => new
2012-02-21 12:31Torr SamahoStatusnew => closed
2012-02-21 12:31Torr SamahoResolutionopen => no change required
2012-06-09 13:22Torr SamahoCategoryGeneral => Bug

Notes
(0002630)
Torr Samaho   
2012-02-18 13:28   
Does it work in ZDoom?
(0002635)
ZzZombo   
2012-02-18 15:12   
(edited on: 2012-02-18 15:15)
Looks like ZDoom has same behavior, no projectile is spawned if a monster has no target. Also, if you are lazy, I've attached an example WAD. Monsters which spawned at level load time have the pointer but others including summoned later not. Just run MAP01 and see that all replaced zombiemans are hate each other and though have valid target and A_CustomMissile fires PointerSpawner but all replaced DoomImps have not target at A_CustomMissile call time and looks like it doesn't fire any projectiles. Maybe, it's ZDoom odd treatment of CMF_CHECKTARGETDEAD which is checked any time this code pointer is called from a monster regardless of it actual value?

(0002636)
Torr Samaho   
2012-02-18 15:28   
> Looks like ZDoom has same behavior

In that case you should report the issue at the ZDoom forums. It could even be possible that ZDoom's behavior is intended (I didn't look at your code in detail). With all the information you already supplied here, it should be easy to create a bug report over at ZDoom.

(0002637)
Edward-san   
2012-02-18 15:47   
Since this problem is related to editing features, I'd like to suggest you to create a new thread in the editing forum:'http://forum.zdoom.org/viewforum.php?f=3 [^]'
(0002640)
Minigunner   
2012-02-18 18:42   
I work around the issue by calling A_LookEx(LOF_NOSEESOUND,0,0,0,0,<Actual Attack state>). If the target no longer exists, the actor will look for a new one. If one can't be found, use A_SpawnItemEx as an emergency maneuver.
(0002641)
ZzZombo   
2012-02-19 00:11   
(edited on: 2012-02-19 00:21)
'http://forum.zdoom.org/viewtopic.php?f=2&t=32019 [^]' -- it's here.

A_SpawnItemEx doesn't transfer calling actor in target field of spawning actor, while A_VileTarget requires the target field to point to actor which you want to be affected. So I have to make my monsters fire a projectile which upon spawning will have tracer pointed to its owner (as described is DECORATE docs) and that allow A_VileTarget to attach hte marker in desired way.

A_LookEx introduces odd behavior described as (in my first tries, without call to Thing_Hate) "monsters which sees a player upon level start have the pointer but others not".

(0002643)
Torr Samaho   
2012-02-19 01:43   
Thanks! Please report back here when the issue was resolved at ZDoom.
(0002658)
ZzZombo   
2012-02-20 13:55   
I had to supply CMF_AIMDIRECTION in code pointer call in flags to make my WAD work. Please, close this issue. Thanks FDARI on ZDoom forums who pointed me to my mistake.