Ambush Flag gone(A_SpawnitemEx+randomspawner)

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Plynthus » Sat Jun 29, 2019 5:18 pm

Hey,

I don't know if this is considered a bug. Or if there is a reason why it works this way.

But when I spawn a "RandomSpawner" through a "A_SpawnitemEx", the ambush flag from the replaced ACTOR is gone. Even if I use "SXF_TRANSFERAMBUSHFLAG".
Both work separately.
When I used only RandomSpawner everything was fine. Or if I spawn the ACTOR of the enemy through A_SpawnitemEx using SXF_TRANSFERAMBUSHFLAG, that works too.

Here's an example what I'm trying to do with it(from a DECORATE):

Spoiler:


Yes, I'm asking because I really would love to get it to work this way on my project.
But also if that could be fixed(again... if it is a bug, and there's no intended reason why it works that way.), it would make doing these kind of options for different spawning settings(especially random) so much simpler for everyone.

Here's a video of the spawning working as I intended, and the problem with the Ambush FLAG:



Here's the .pk3 just in case the information above wasn't enough. https://www.mediafire.com/file/hmhc7hvd7u4f7ca/Vanilla_Doom_Plus_-_example.pk3/file
DECORATE/Zombieman.txt

Either way... Thank you for everything you've done for GZDOOM over the years. It is the best!

EDIT:

+BossDeath doesn't seem to transfer either. (using the same type of A_SpawnItemEx + RandomSpawner combination)
If I've understood correctly that is the one needed for things like E1M8. Kill the barons to trigger tag 666.




Or maybe the +BossDeath transfers fine. But GZDOOM doesn't count them as Barons anymore. Because "replaces Baronofhell" is not in the randomspawners themselves?
Here's an example of the DECORATE I'm using:

Spoiler:
Last edited by Plynthus on Thu Jul 04, 2019 12:15 pm, edited 3 times in total.
Plynthus
 
Joined: 27 Jun 2019

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby _mental_ » Sun Jun 30, 2019 3:00 am

SXF_TRANSFERAMBUSHFLAG doesn't transfer spawn flag, only actor's one. Probably, it's a bug because initial ambush state is lost indeed.

This can be fixed by copying bAmbush here, or by setting corresponding bit in SpawnFlags here.
I need someone else opinion as I cannot decide which one is better.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Plynthus » Sun Jun 30, 2019 3:40 am

Thanks for the info _mental_!

Also I wanted to add that you can even spawn a RandomSpawner through another RandomSpawner, and even that works just fine.
But when you combine A_SpawnitemEx with RandomSpawner. That's when it breaks.
Plynthus
 
Joined: 27 Jun 2019

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Plynthus » Sun Jun 30, 2019 7:46 am

And for my own mod I could define RandomSpawner2 using this code?
I'm very unfamiliar with zscript. I tried couple things, but couldn't get it to work.
Last edited by Plynthus on Mon Jul 01, 2019 3:05 pm, edited 2 times in total.
Plynthus
 
Joined: 27 Jun 2019

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby _mental_ » Sun Jun 30, 2019 7:55 am

Instead of incorporating some workarounds, I would wait for Graf's reply on this topic.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Plynthus » Sun Jun 30, 2019 7:57 am

Ok, thank you! I'm new here.
And I'm just really hoping to get the options settings to work in my mod.
Plynthus
 
Joined: 27 Jun 2019

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Plynthus » Wed Jul 03, 2019 2:05 pm

(I added this to the original post)

Spoiler:
Last edited by Plynthus on Thu Jul 04, 2019 12:15 pm, edited 1 time in total.
Plynthus
 
Joined: 27 Jun 2019

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby drfrag » Thu Jul 04, 2019 6:38 am

This looks like it could be an important bug. I wonder when it was introduced, in the last round of scriptifications?
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Graf Zahl » Thu Jul 04, 2019 6:56 am

The problem here is very simple: The RandomSpawner was designed for replacing map placed items, it contains code to handle the flags from there. This will always overwrite those map-settable flags in the spawner actor itself, which is where the SXF_TRANSFERAMBUSHFLAG writes into. And since a runtime-spawned actor has no corresponding mapthing, these flags will not be set.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Plynthus » Thu Jul 04, 2019 8:57 am

Thanks for the answer!
So to make sure I understood correctly. It is like that on purpose and it's not a bug?
Plynthus
 
Joined: 27 Jun 2019

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Graf Zahl » Thu Jul 04, 2019 10:27 am

It's not a bug but it still should be investigated if this can be worked around.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Plynthus » Thu Jul 04, 2019 12:12 pm

Thanks, great to know!

Also the BossDeath thing might be even bigger.
I tried spawning the ACTOR directly using the SpawnItemEx, and not through a RandomSpawner as well. And their special actions("BaronSpecial", "CyberdemonSpecial" etc.) gets triggered as soon as you start the map.
And if I spawned RandomSpawner throgh SpawnItemEx. Those "specials" wouldn't trigger at all(shown in the second video).

I assume this isn't a bug either. Just thought I'd point it out, because I just noticed it.
Plynthus
 
Joined: 27 Jun 2019

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby _mental_ » Sat Jul 06, 2019 3:16 am

Graf Zahl wrote:It's not a bug but it still should be investigated if this can be worked around.

For ambush flag I proposed two possible solutions here.

As for boss death thing, most likely all replacement monsters need to be made "boss".
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Ambush Flag gone(A_SpawnitemEx+randomspawner)

Postby Plynthus » Sat Jul 06, 2019 4:17 am

I have tried that for the boss death thing. With no success so far.

It happens even when you spawn the original monster(well, a copy of it at least) that way.

I made 2 example wads where the problem happens in different ways:
(there's only DECORATE lump in there so file size is very small)

Example 1 https://www.mediafire.com/file/4pf01uga5ac3jma/BossExample1-E2M8.wad/file
-If you go to E2M8 the level ends as soon as you start the map.
Spoiler:


Example 2 https://www.mediafire.com/file/hcrxzz0v2rvfzft/BossExample2-E2M8.wad/file
-If you go to E2M8 and kill the Cyberdemon, nothing happens. I lowered it's health down to 15 for test purpose.
-Maybe the randomspawner had nothing to do with this after all, because it happens even when doing it like this:
Spoiler:


And for the ambush flag. I know your reply wasn't for me, but I thought I should mention this.
I can confirm that I got it working with the first way you proposed. I added
"newmobj.bAmbush = bAmbush;"
to the "// copy everything relevant" section starting from line 187.
Haven't noticed it causing any side effects or any other problems so far.
Plynthus
 
Joined: 27 Jun 2019


Return to Bugs

Who is online

Users browsing this forum: No registered users and 6 guests