Scripted spawner (Discontinued)

Post your example zscripts/ACS scripts/etc here.
Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
Post Reply
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Scripted spawner (Discontinued)

Post by Blue Shadow »

(See this post for why this has been discontinued)

This is an actor class which is based on the [wiki=Classes:RandomSpawner]RandomSpawner[/wiki] 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 all

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 193 times
User avatar
Doctrine Gamer
Posts: 393
Joined: Wed Jan 30, 2013 1:22 pm

Re: [Code] Scripted spawner

Post by Doctrine Gamer »

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
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [Code] Scripted spawner

Post by Rachael »

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.
Gez
 
 
Posts: 17833
Joined: Fri Jul 06, 2007 3:22 pm

Re: [Code] Scripted spawner

Post by Gez »

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.
User avatar
Doctrine Gamer
Posts: 393
Joined: Wed Jan 30, 2013 1:22 pm

Re: [Code] Scripted spawner

Post by Doctrine Gamer »

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
Posts: 393
Joined: Wed Jan 30, 2013 1:22 pm

Re: [Code] Scripted spawner

Post by Doctrine Gamer »

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
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: [Code] Scripted spawner

Post by Rachael »

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
Doctrine Gamer
Posts: 393
Joined: Wed Jan 30, 2013 1:22 pm

Re: [Code] Scripted spawner

Post by Doctrine Gamer »

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:
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: [Code] Scripted spawner

Post by Blue Shadow »

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: *
Post Reply

Return to “Script Library”