Scripted spawner (Discontinued)

Post your example zscripts/ACS scripts/etc here.

Scripted spawner (Discontinued)

Postby Blue Shadow » Sun Jul 09, 2017 1:26 am

(See this post for why this has been discontinued)

This is an actor class which is based on the RandomSpawner class. It allows you to do scripted spawning instead of the random one you can achieve with RandomSpawner. What's the advantage of using this over those "custom" spawners people create? Well, since it's based on RandomSpawner, it handles things that those spawners usually overlook or can't when replacing existing monsters, like transferring certain properties, and making sure that boss-death events actually trigger.

This of course requires ZScript, and a GZDoom version which supports it. But don't worry, it's not that hard. Here is an example which demonstrates the kind of thing people like to do when creating custom spawners: spawning actor A or actor B depending on the value of a console variable:

Code: Select allExpand view
class SS_DoomImp : DoomImp {} // So the spawner doesn't do recursive spawning since the it replaces DoomImp.

class SS_DoomImpSpawner : SS_ScriptedSpawner replaces DoomImp
{
    override name SS_GetActorToSpawn ()
    {
        if(GetCvar("blah")) // Assuming 'blah' is a boolean console variable.
        {
            // 'blah' is true, spawn a cyberdemon.
            return 'Cyberdemon';
        }

        // 'blah' is false, spawn an imp.
        return 'SS_DoomImp';
    }


nc-scriptedspawner.pk3
(1.71 KiB) Downloaded 117 times
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: [Code] Scripted spawner

Postby Doctrine Gamer » Sun Jul 30, 2017 8:19 am

It did not work, I tested on the Brutal Doom, Quadrillion Shades of Doom but I still continue with A_BossDeath bug, my version of GZDoom is 3.0.1. Did I do something wrong?
User avatar
Doctrine Gamer
Holger Danilchenko
 
Joined: 30 Jan 2013

Re: [Code] Scripted spawner

Postby Rachael » Sun Jul 30, 2017 8:48 am

Doctrine Gamer wrote:my version of GZDoom is 3.0.1. Did I do something wrong?

Well, technically, yes, by not upgrading to the latest GZDoom version, but I don't know if that's the cause of your actual problem.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: [Code] Scripted spawner

Postby Gez » Sun Jul 30, 2017 8:55 am

What exactly did you do?

For stuff like Brutal Doom, you'd need to edit the entire Brutal Doom code to update it to use ScriptedSpawner instead of whatever hodgepodge mess of duct-tape and regrets it's using.
Gez
 
 
 
Joined: 06 Jul 2007

Re: [Code] Scripted spawner

Postby Doctrine Gamer » Sun Jul 30, 2017 3:53 pm

I used that version of Cyanide Quadrillion Shades of Doom and Brutal Doom but even after the monsters die they continued with broken map, changed the loading order of the files but did nothing.
User avatar
Doctrine Gamer
Holger Danilchenko
 
Joined: 30 Jan 2013

Re: [Code] Scripted spawner

Postby Doctrine Gamer » Sun Jul 30, 2017 6:29 pm

Rachael wrote:
Doctrine Gamer wrote:my version of GZDoom is 3.0.1. Did I do something wrong?

Well, technically, yes, by not upgrading to the latest GZDoom version, but I don't know if that's the cause of your actual problem.


Forgiveness I wrote wrong, my version is the last one of the link that you posted 3.1.0
User avatar
Doctrine Gamer
Holger Danilchenko
 
Joined: 30 Jan 2013

Re: [Code] Scripted spawner

Postby Rachael » Sun Jul 30, 2017 6:31 pm

Then you aren't doing anything "wrong" it's just an incompatibility and it will have to be manually corrected by modding it either yourself or with someone's help. >_<
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: [Code] Scripted spawner

Postby Doctrine Gamer » Mon Jul 31, 2017 12:00 pm

Rachael wrote:Then you aren't doing anything "wrong" it's just an incompatibility and it will have to be manually corrected by modding it either yourself or with someone's help. >_<



Maybe someday I'll learn how to make mods. Thanks! :thumb:
User avatar
Doctrine Gamer
Holger Danilchenko
 
Joined: 30 Jan 2013

Re: [Code] Scripted spawner

Postby Blue Shadow » Tue Jul 10, 2018 1:30 am

This is now abandoned and will no longer be supported. The reason being is that the RandomSpawner class will have the same functionality in the next version of GZDoom*. It will also receive a fix for a bug which this still suffers from. So it's recommended to use the RandomSpawner from then on.

Spoiler: *
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)


Return to Script Library

Who is online

Users browsing this forum: No registered users and 1 guest