rescue NPCs

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.

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!)
Post Reply
User avatar
CBM
Posts: 373
Joined: Wed Oct 09, 2019 3:39 am
Graphics Processor: nVidia with Vulkan support
Location: The Shores of Hell

rescue NPCs

Post by CBM »

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
User avatar
Tartlman
Posts: 226
Joined: Thu Oct 11, 2018 5:24 am
Location: meme hell
Contact:

Re: rescue NPCs

Post by Tartlman »

nope, i don't think that you can change the exit screen.
User avatar
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

Post by wildweasel »

I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
User avatar
Tartlman
Posts: 226
Joined: Thu Oct 11, 2018 5:24 am
Location: meme hell
Contact:

Re: rescue NPCs

Post by Tartlman »

wildweasel wrote:I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
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.
User avatar
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

Post by phantombeta »

Tartlman wrote:
wildweasel wrote:I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
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.
It's very much a thing and has been for a while.
User avatar
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

Post by CBM »

phantombeta wrote:
Tartlman wrote:
wildweasel wrote:I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
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.
It's very much a thing and has been for a while.
COOL!

Any code examples of how it works? preferably using decorate? or am I forced to learn ZScript? :D
User avatar
Tartlman
Posts: 226
Joined: Thu Oct 11, 2018 5:24 am
Location: meme hell
Contact:

Re: rescue NPCs

Post by Tartlman »

CBM wrote:
phantombeta wrote:
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.
It's very much a thing and has been for a while.
COOL!

Any code examples of how it works? preferably using decorate? or am I forced to learn ZScript? :D
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.
User avatar
Gutawer
Posts: 469
Joined: Sat Apr 16, 2016 6:01 am
Preferred Pronouns: She/Her

Re: rescue NPCs

Post by Gutawer »

Tartlman wrote:
wildweasel wrote:I believe the intermission screens can be modified using ZScript. I do not know exactly how, though.
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.
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.
User avatar
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

Post by CBM »

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.
That is good advice.
But the reason I ask a lot of questions is also that I am experimenting and trying to learn :)
User avatar
Enjay
 
 
Posts: 27135
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: rescue NPCs

Post by Enjay »

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).
User avatar
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

Post by CBM »

Enjay 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).
I might take a look when I am Ready for zscripts :)

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

Return to “Scripting”