Randomspawner Flag/TID Transfer

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!)
Post Reply
User avatar
StroggVorbis
Posts: 866
Joined: Wed Nov 08, 2017 4:23 pm
Graphics Processor: nVidia with Vulkan support
Location: Germany

Randomspawner Flag/TID Transfer

Post by StroggVorbis »

I played a UDMF map that has a rocket launcher which counts as a secret upon pickup. I then played the map again with a mod that replaces the Rocketlauncher with a RandomSpawner. Neither of the mod's dropped/spawned replacements inherit the Rocketlauncher's 'Count as Secret' flag, so I'm unable to finish the map with 100% secrets. The spawner looks like this:

Code: Select all

Actor RocketReplacer : RandomSpawner replaces Rocketlauncher
{
DropItem "Rocketlauncher1" 255 10 //to avoid a recursion
DropItem "STGrenadelauncher" 255 3
}
Is there a way to work around this, or does the RandomSpawner itself have to be replaced with a custom made spawner which uses A_Jump and A_SpawnItemEX in its spawn state?

So it looks like this:

Code: Select all

Actor RocketLauncherSpawner replaces RocketLauncher
{
States
{
Spawn:
TNT1 A 0
TNT1 A 0 A_Jump (255,1,2)
TNT1 A 1 A_SpawnItemEX ("RocketLauncher1", 0, 0, 0, 0, 0, 0, 0, 0, 0, tid)
Goto Death
TNT1 A 1 A_SpawnItemEX ("STGrenadeLauncher", 0, 0, 0, 0, 0, 0, 0, 0, 0, tid)
}
}
Thanks in advance.
User avatar
ramon.dexter
Posts: 1529
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Randomspawner Flag/TID Transfer

Post by ramon.dexter »

Well, you are replacing an actor, that has a flag "+countsercret" with a actor, that doesn't have this flag.

How do you want the engine to transfer one flag, when it is not specified in the new actor? This is just impossible.
User avatar
StroggVorbis
Posts: 866
Joined: Wed Nov 08, 2017 4:23 pm
Graphics Processor: nVidia with Vulkan support
Location: Germany

Re: Randomspawner Flag/TID Transfer

Post by StroggVorbis »

The +countsecret flag is not applied via DECORATE, its done via an UDMF map script. This is done so not every rocket launcher counts as a secret, only a specific one and only in said map. Like I said, as long as the rocket launcher gets replaced directly, it still works. Replacing it with a RandomSpawner however, doesn't. Upon map load, the RandomSpawner destroys itself directly after executing its function, without transfering the +countsecret flag to the weapon it spawns.

Edit: In theory it might work when inheriting from the Rocket Launcher itself. But you can't inherit from both RandomSpawner and something else at the same time.
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: Randomspawner Flag/TID Transfer

Post by Apeirogon »

What map?
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: Randomspawner Flag/TID Transfer

Post by Gez »

RS should transfer everything. Anything missing is an oversight that should be fixed. In fact it might be useful to make a transfer spawn properties function that could be used elsewhere in ZScript.
User avatar
StroggVorbis
Posts: 866
Joined: Wed Nov 08, 2017 4:23 pm
Graphics Processor: nVidia with Vulkan support
Location: Germany

Re: Randomspawner Flag/TID Transfer

Post by StroggVorbis »

Gez wrote:RS should transfer everything. Anything missing is an oversight that should be fixed. In fact it might be useful to make a transfer spawn properties function that could be used elsewhere in ZScript.
That must be it, then. I searched the ZDoom Wiki high and low for a flag or property that I could append to the RS, but didn't find anything. Thanks for the quick response, this case needs to be investigated further :)
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Randomspawner Flag/TID Transfer

Post by Blue Shadow »

Post Reply

Return to “Scripting”