rescue NPCs
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!)
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!)
- CBM
- Posts: 373
- Joined: Wed Oct 09, 2019 3:39 am
- Graphics Processor: nVidia with Vulkan support
- Location: The Shores of Hell
rescue NPCs
So I have some NPCs (NPC/Civilian/Hostage) that can be rescued (they inherit from powerupgiver)
And I made dead decoration versions of them to replace them if they die before they are rescued and it works very well
my questions are these:
can I somehow count how many hostages/civilians are spawned (they spawn from a randomspawner that replaces explosivebarrel and that also spawns other stuff like different types of cubes) ?
can I somehow count how many hostages/civilians that gets rescued and then show something on the level ending screen.. like 90% civilians were rescued ?
I already have 3 player classes that fit the theme: Cop, FBI Agent, Soldier
I guess I could use ThingCount and assign an ID to a civilian spawner and then call the civilian spawner from the barrel spawner
I could also use score item and perhaps count the amount, but can I display it when a level ends?
I really want to be able to display the amount of hostages that were killed (killed and therefore could not be picked up), rescued (picked up) and abandoned (not pickd up) when the level ends
I looked at gzscoredoom, but it counts points and it is based on an old gzdoom version
And I made dead decoration versions of them to replace them if they die before they are rescued and it works very well
my questions are these:
can I somehow count how many hostages/civilians are spawned (they spawn from a randomspawner that replaces explosivebarrel and that also spawns other stuff like different types of cubes) ?
can I somehow count how many hostages/civilians that gets rescued and then show something on the level ending screen.. like 90% civilians were rescued ?
I already have 3 player classes that fit the theme: Cop, FBI Agent, Soldier
I guess I could use ThingCount and assign an ID to a civilian spawner and then call the civilian spawner from the barrel spawner
I could also use score item and perhaps count the amount, but can I display it when a level ends?
I really want to be able to display the amount of hostages that were killed (killed and therefore could not be picked up), rescued (picked up) and abandoned (not pickd up) when the level ends
I looked at gzscoredoom, but it counts points and it is based on an old gzdoom version
Re: rescue NPCs
nope, i don't think that you can change the exit screen.
- wildweasel
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
- Contact:
Re: rescue NPCs
I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
Re: rescue NPCs
I seriously doubt that's a feature, considering that i have never seen anybody do it before or any posts about it. It would also probably be a headache to make, if it was a thing.wildweasel wrote:I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
- phantombeta
- Posts: 2181
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: rescue NPCs
It's very much a thing and has been for a while.Tartlman wrote:I seriously doubt that's a feature, considering that i have never seen anybody do it before or any posts about it. It would also probably be a headache to make, if it was a thing.wildweasel wrote:I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
- CBM
- Posts: 373
- Joined: Wed Oct 09, 2019 3:39 am
- Graphics Processor: nVidia with Vulkan support
- Location: The Shores of Hell
Re: rescue NPCs
COOL!phantombeta wrote:It's very much a thing and has been for a while.Tartlman wrote:I seriously doubt that's a feature, considering that i have never seen anybody do it before or any posts about it. It would also probably be a headache to make, if it was a thing.wildweasel wrote:I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
Any code examples of how it works? preferably using decorate? or am I forced to learn ZScript?

Re: rescue NPCs
You'd be forced to learn zscript.CBM wrote:COOL!phantombeta wrote:It's very much a thing and has been for a while.Tartlman wrote:
I seriously doubt that's a feature, considering that i have never seen anybody do it before or any posts about it. It would also probably be a headache to make, if it was a thing.
Any code examples of how it works? preferably using decorate? or am I forced to learn ZScript?
Considering that you're asking a lot of questions, i'd say you should start small and stick with DECORATE for now. It's easy to get overwhelmed by ZScript due to the language not being fully documented, and the fact that it doesn't have many code examples on the zdoom wiki.
Re: rescue NPCs
I used it both in the 20 Heretics Community Project (for printing author names (that's a built-in feature now, but wasn't then), and for story text scrolling (which was coded by Marisa Kirisame, IIRC)) and in the newest version of ABAHB for 3D-Sonic-style performance grading at the end of each level. It's not exactly a great idea to base this sort of opinion on perceived usage, especially with ZScript - a lot of ZScript features just aren't used by that many people but that doesn't mean they don't exist.Tartlman wrote:I seriously doubt that's a feature, considering that i have never seen anybody do it before or any posts about it. It would also probably be a headache to make, if it was a thing.wildweasel wrote:I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
- CBM
- Posts: 373
- Joined: Wed Oct 09, 2019 3:39 am
- Graphics Processor: nVidia with Vulkan support
- Location: The Shores of Hell
Re: rescue NPCs
That is good advice.Tartlman wrote: You'd be forced to learn zscript.
Considering that you're asking a lot of questions, i'd say you should start small and stick with DECORATE for now. It's easy to get overwhelmed by ZScript due to the language not being fully documented, and the fact that it doesn't have many code examples on the zdoom wiki.
But the reason I ask a lot of questions is also that I am experimenting and trying to learn

Re: rescue NPCs
For what it's worth, it has been possible to create a fake tally screen using ACS for years. Both my Heretic Thief mod did this (counted loot as well as the kills, items secrets) and my Burghead mod (counted prisoners that escaped and items of additional intelligence that were gathered along the way - as well as kills, items and secrets of course).
- CBM
- Posts: 373
- Joined: Wed Oct 09, 2019 3:39 am
- Graphics Processor: nVidia with Vulkan support
- Location: The Shores of Hell
Re: rescue NPCs
I might take a look when I am Ready for zscriptsEnjay wrote:For what it's worth, it has been possible to create a fake tally screen using ACS for years. Both my Heretic Thief mod did this (counted loot as well as the kills, items secrets) and my Burghead mod (counted prisoners that escaped and items of additional intelligence that were gathered along the way - as well as kills, items and secrets of course).

For now they are ammo and ære counted when using the fist weapon (with ammo umage being 0 and Max is 999)