Recreating the ENDGAME script of DOOM2 in a ZDOOM map?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- Tormentor667
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
Recreating the ENDGAME script of DOOM2 in a ZDOOM map?
Well, I need to know how I can recreate the ENDGAME script (the one in front of the BOSSBACK, where all your enemies are once more displayed and you kill them by hitting a key) of DOOM2 in a ZDOOM map, that is capable of even displaying and killing DECORATE monsters?
Well, I have a certain idea how this could (?) work but I am not sure so I need professional help. I think it'd be not that hard to spawn monsters in a 3D environment (a map), displaying them with a CAMERA thing and killing them with a ACS script, if "USE" is being hit.
The problem itself is the spawning script for the monsters. Is someone capable of writing me something like that? I think it should be possible to write that with some sort of STRINGS, that you give all of the monsters a number (1,2,3,4,etc) and spawn them via "spawnspot" so you are able to even spawn DECORATE objects quite easily. Each of the monsters has at first a TID of 1 when spawned, if they die, they get a TID of 2, spawn a new TID 1-monster and after the next TID 1 monster is killed, the same thing happens and all the TID 2 things were removed (dead bodies) and so on in a loop.
As far as I know, Cyb did something like that in MM2...
Well, I have a certain idea how this could (?) work but I am not sure so I need professional help. I think it'd be not that hard to spawn monsters in a 3D environment (a map), displaying them with a CAMERA thing and killing them with a ACS script, if "USE" is being hit.
The problem itself is the spawning script for the monsters. Is someone capable of writing me something like that? I think it should be possible to write that with some sort of STRINGS, that you give all of the monsters a number (1,2,3,4,etc) and spawn them via "spawnspot" so you are able to even spawn DECORATE objects quite easily. Each of the monsters has at first a TID of 1 when spawned, if they die, they get a TID of 2, spawn a new TID 1-monster and after the next TID 1 monster is killed, the same thing happens and all the TID 2 things were removed (dead bodies) and so on in a loop.
As far as I know, Cyb did something like that in MM2...
- AgentSpork
- Posts: 106
- Joined: Fri Aug 22, 2003 7:38 pm
That's the easiest way I could think of to do it. As far as having it trigger when the player presses a key, I don't know. I'm no scripting expert 
EDIT: Actually, I've figured out a way.. removed the old code.
Simply have your camera set up, and put the player in a small box where all the linedefs are set to trigger Script 51 when the player presses use, and voila! I've tested it and it seems to work just fine. 

EDIT: Actually, I've figured out a way.. removed the old code.
Code: Select all
int monsterSpawnList[16] = { //Monster SpawnID for Thing_SpawnFacing Command
T_ZOMBIE,
T_SHOTGUY,
T_CHAINGUY,
T_IMP,
T_DEMON,
T_SPECTRE,
T_LOSTSOUL,
T_CACODEMON,
T_HELLKNIGHT,
T_BARON,
T_REVENANT,
T_VILE,
T_ARACHNOTRON,
T_MANCUBUS,
T_SPIDERMASTERMIND,
T_CYBERDEMON };
str monsterNameList[16] = { //Monster names for Print/HudMessage Command
"Zombieman",
"Shotgun Guy",
"Heavy Weapons Dude",
"Imp",
"Demon",
"Spectre",
"Lost Soul",
"Cacodemon",
"Hell Knight",
"Baron of Hell",
"Revenant",
"Arch Vile",
"Arachnotron",
"Mancubus",
"Spider Mastermind",
"Cyberdemon" };
Script 50 (void) //Monster Credit Thingy
{
For(int x = 1; x <= 16; x += 1) //Goes through list of monsters starting at the Zombieman
{
Print(s: monsterNameList[x - 1] ); //Prints the monster's name (Hudmessage would work fine as well)
Thing_SpawnFacing(50,monsterSpawnList[x - 1], 0,51); //Spawns the monster
Delay(35 * 5);
Thing_Destroy(51,0); //Kills the currently active monster
Delay(35);
} //Loops, moving on to the next monster until it reaches the end of the list
}
Script 51 (void) //Kills monster when player presses use (or whatever)
{
ACS_Suspend(50,0); //Suspend the monster credit script
Thing_Destroy(51,0); //Kill currently alive monster
Delay(35);
}

- Tormentor667
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
Thx alot for that script
This works pretty well, there is just a single problem I have with the scrpt: First, the "press use" key to kill a monster doesn't work and second all the dead bodies stay... and some of them hide smaller monsters then when it gets to much on the floor. Is there any way how to remove them?

- Tormentor667
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
Monster blocking lines? Deactivate them?
I'd also think dropped items would start to pile up too. Making Decorate versions of the monsters specifically for the endgame seems like a good plan. (Graf suggested it over at DRD.) You could even make a single monster that cycles through the whole thing if you didn't need the player to instigate the deaths.
I'd also think dropped items would start to pile up too. Making Decorate versions of the monsters specifically for the endgame seems like a good plan. (Graf suggested it over at DRD.) You could even make a single monster that cycles through the whole thing if you didn't need the player to instigate the deaths.
- Tormentor667
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
Deactivating them would make them stay still, and that's not what I plan! The problem with the monsterblocking line is that the monster doesn't get spawned if a monster blocking line is in its way!
And the DECORATE thing is a bit complicated and too hard to do for myself and beyond not flexible enough concerning new DECORATE monsters.
And the DECORATE thing is a bit complicated and too hard to do for myself and beyond not flexible enough concerning new DECORATE monsters.
The DECORATE thing would be quite long and a bit tedious to set up, but not overly complex. I'd also think it would be better for new DECORATE monsters because you could dictate exactly what you want them to do rather than relying on the jumps and other random features of the original (unless you wanted that of course). A single decorate item using sprites from all the monsters you want to show would be pretty straight forward (if long-winded).
[pseudo code]
Spawn:
monter1 walk sprite 1 play see sound
monter1 walk sprite 23412341234
monter1 attack sprite 123 (with attack sound/pointer as required)
monter1 walk sprite 1234
monster1 death sprite 123456 (with death sound)
monster2 walk sprite 1 play see sound
monter2 walk sprite 23412341234
monter2 attack sprite 123 (with attack sound/pointer as required)
etc
etc
etc
loop
[/pseudocode]
[pseudo code]
Spawn:
monter1 walk sprite 1 play see sound
monter1 walk sprite 23412341234
monter1 attack sprite 123 (with attack sound/pointer as required)
monter1 walk sprite 1234
monster1 death sprite 123456 (with death sound)
monster2 walk sprite 1 play see sound
monter2 walk sprite 23412341234
monter2 attack sprite 123 (with attack sound/pointer as required)
etc
etc
etc
loop
[/pseudocode]
- Tormentor667
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
- AgentSpork
- Posts: 106
- Joined: Fri Aug 22, 2003 7:38 pm
Well, it seems quite simple to me. Sure, it'll add a bit of extra stuff to your DECORATE lump, but if that's what you're wanting to do, then it should be more than worth it. Hell, probably more than half of the stuff in the DECORATE lump in my megawad is solely for stuff you only see in the two secret levels. Otherwise there'd only be two enemy definitions and two boss definitions. Currently there's about 6-7 enemy definitions and there will be 4 boss definitions in the end.
My way of doing it would probably be a bit different than Enjay's however. I'd have separate definitions for each monster, like so:
I really can't think of any better way to perfectly emulate the Doom 2 ending without adding a lot of bulk onto the DECORATE lump. But as I said, if it's something you're willing to do, then it should not be too big of an issue.
My way of doing it would probably be a bit different than Enjay's however. I'd have separate definitions for each monster, like so:
Code: Select all
ACTOR EndZombie //End Credits Zombieman
{
SpawnID 211 //SpawnID, for Thing_SpawnFacing
Speed 0
SeeSound "grunt/sight"
AttackSound "grunt/attack"
DeathSound "grunt/death"
States
{
Spawn:
POSS A 0
Goto See
See:
POSS AABBCCDDAABBCCDD 5 //Looping See state.. walks around for a bit and then "shoots"
POSS E 5
POSS F 5 A_PlaySound("grunt/attack")
Loop //Loop!
Death:
POSS H 5 //Death state for enemy when the script kills it
POSS I 5 A_Scream
POSS J 5 A_Fall
POSS K 5
POSS L -1
Stop
}
}
- Tormentor667
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
Well, I don't care about the size of the DECORATE lump at all, because it's already huge. The question is, if you are willing to do it ... or explain to me how to do it (DECORATE n00b) for all the DECORATE monsters, that should be drawn in the end?!
You can actually inherit most of the stuff from the original monsters, can't you? All the sounds and stuff, that makes it easier later?!
...for sure this seems to be the best idea but obviously also the most "hardcoded" and time consuming of all, and I am not sure if the effort is worth for just my "Ultimare TNT Endscreen"... I'd be more happy, if this is useful for any later mod with different monsters, that might be interested in using this. Though I'd still be happy to have it in UTNT
You can actually inherit most of the stuff from the original monsters, can't you? All the sounds and stuff, that makes it easier later?!
...for sure this seems to be the best idea but obviously also the most "hardcoded" and time consuming of all, and I am not sure if the effort is worth for just my "Ultimare TNT Endscreen"... I'd be more happy, if this is useful for any later mod with different monsters, that might be interested in using this. Though I'd still be happy to have it in UTNT
- AgentSpork
- Posts: 106
- Joined: Fri Aug 22, 2003 7:38 pm
Well I've thrown together a little example wad in a few minutes that gives a basic example as to how things could possibly be done. It's nothing special, but it works. It loops through 4 different monsters (because that's about all I got up to before I got bored
)
Here's the example WAD.
Here's the script:

Here's the example WAD.
Here's the script:
Spoiler:And here's the DECORATE:
Spoiler:Both of which can of course be found in the WAD as well.
- Tormentor667
- Posts: 13554
- Joined: Wed Jul 16, 2003 3:52 am
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia (Modern GZDoom)
- Location: Germany
- Contact:
- AgentSpork
- Posts: 106
- Joined: Fri Aug 22, 2003 7:38 pm