Tag666 bug with an actor that spawns monsters

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
User avatar
DevilBlackDeath
Posts: 172
Joined: Fri Sep 06, 2013 2:40 am

Tag666 bug with an actor that spawns monsters

Post by DevilBlackDeath »

Hello guys, I'm trying to fix Duke Nukem : War Against the Doomed bug with tag 666 (MAP07 trigger) and since I couldn't find a DECORATE god in that topic, I figured this was probably a much better place to ask that kind of thing. I've pinpointed the actual issue. Fatso is replaced by the actor FatsoReplacer. This FatsoReplacer actor in turn uses an ACS function to determine what type of enemy is spawned and goes to the associated state in which it spawns either a monster or a RandomSpawner using A_SpawnItemEX. The problem is that what the level is expecting to die is FatsoReplacer. But since all states end with a frame with a duration > -1 then stops, the actor is destroyed (at least according to the wiki, correct me if that changed)

Now what I tried to do :
-Adding +BOSSDEATH flag to FatsoReplacer (it will need it if is expected to die and tag 666 needs to check for its death from what I understand)
-Adding a Death state containing

Code: Select all

TNT1 A 0 A_SpawnItem("SuperShotgun")
TNT1 A 0 A_BossDeath
Stop
(the SpawnItem is used for debugging purpose, to see if it is called)
-Adding SXF_SETMASTER to the SpawnItemEx call, so the monster's master is the spawner (although, according to the wiki, that should already be the case right?). For the record, I also tried the other way around with SXF_ISMASTER
-Adding a call to A_KillMaster (A_KillChildren when using SXF_ISMASTER) in the Death and XDeath states of the mod's fatso (then making sure to call Super::Death\XDeath to still get the proper death animation)
Then I tried those solutions :
-Replacing Stop by Goto See and adding a See state containing only

Code: Select all

TNT1 A 1
Loop
I tried replacing the sprite to see if it went into the See state, and it does enter it, but A_KillMaster doesn't make it go into its Death State
-Making all durations of the A_SpawnItemEX frames be -1, so Stop wouldn't delete the actor, but still no good, Death state is never entered into

So in the end what I need to do is make sure the game understands the Fatsos are dead, when it actually checks for the FatsoReplacers state.

Oh I should precise that trying to make Fatso1 (the mod's replacement for Fatsos) replace the Fatso made it work, but then again, that's just a cheap trick that remove features :S

Also, I'm not a pro, but I would assume any other monster using this replacer trick would break any ACS script checking for this monster's death in a map ?

Thanks in advance guys !
User avatar
DevilBlackDeath
Posts: 172
Joined: Fri Sep 06, 2013 2:40 am

Re: Tag666 bug with an actor that spawns monsters

Post by DevilBlackDeath »

Ok I may be on to something. Sadly I'm not at home and will only be able to test this out tonight =/

I'll try using the SXF_TRANSFERSPECIAL flag on A_SpawnItemEX and maybe transferring the tid (although I suspect the tid has nothing to do with tag 666 considering it's something that was added in Hexen format only, so unless G/ZDoom changed the behaviour of the function checking for A_BossDeath it should not do a thing theoretically)

Will update if it works later today ;)

Return to “Scripting”