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.

Randomspawner Flag/TID Transfer

Postby StroggVorbis » Thu Jan 04, 2018 3:40 pm

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 allExpand view
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 allExpand view
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
StroggVorbis
Donut eat me pls!
 
Joined: 08 Nov 2017
Location: Germany
Discord: StroggVorbis#2466
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Randomspawner Flag/TID Transfer

Postby ramon.dexter » Fri Jan 05, 2018 4:15 am

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
ramon.dexter
rudebwoy
 
Joined: 20 Oct 2015
Location: Kozolupy, Bohemia
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Randomspawner Flag/TID Transfer

Postby StroggVorbis » Fri Jan 05, 2018 4:59 am

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
StroggVorbis
Donut eat me pls!
 
Joined: 08 Nov 2017
Location: Germany
Discord: StroggVorbis#2466
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Randomspawner Flag/TID Transfer

Postby Apeirogon » Fri Jan 05, 2018 6:53 am

What map?
User avatar
Apeirogon
I have a strange sense of humour
 
Joined: 12 Jun 2017

Re: Randomspawner Flag/TID Transfer

Postby Gez » Fri Jan 05, 2018 9:04 am

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.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Randomspawner Flag/TID Transfer

Postby StroggVorbis » Sat Jan 06, 2018 1:05 am

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 :)
User avatar
StroggVorbis
Donut eat me pls!
 
Joined: 08 Nov 2017
Location: Germany
Discord: StroggVorbis#2466
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Randomspawner Flag/TID Transfer

Postby Blue Shadow » Sat Jan 06, 2018 7:33 am

User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests