Adding a threat system

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
Darklord328
Posts: 74
Joined: Mon Sep 17, 2012 6:11 pm
Preferred Pronouns: He/Him

Adding a threat system

Post by Darklord328 »

So, it came across to my mind, that i would like to add in a threat system, using the Ifs and elses command, however, i would like to point out, that if a player has a pistol, lower tier monsters get spawned in, player with a ShotGun, and a SuperShotGun, medium tier monsters gets spawned in, like the shotgunguy/chaingunguy/doomimp and so on.

though if this is going to be used in every other weapon, for a tier, i would like to add in a threat point, like say for instance, shotgun is like 2 or 3 points, whereas a supershotgun is like 6 to 7 points and so on. i would like to keep this simple. yet very affective. cause, i do not have the knowledge of having advanced scripting. i can do decorate coding, if anyone can lend me a few pointers or like an EX: wad file that'll be great! :D

Thank you in advanced!
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Adding a threat system

Post by Sir Robin »

I think you're talking about some kind of adaptive difficulty system. Does this happen just at map load or throughout game play?

You could create an event handler (or some other global object) that would be responisble for assessing the threat level based on the player(s). Then you replace each monster on the map with a monster spawner. That spawner queries the threat level from the assessor and spawns the appropriate monster.

Could do a similar thing for powerups - for example health pickups could be upgraded or downgraded on the chain according to a chance based on player current health and difficulty level
Darklord328
Posts: 74
Joined: Mon Sep 17, 2012 6:11 pm
Preferred Pronouns: He/Him

Re: Adding a threat system

Post by Darklord328 »

so, the way the game works, there could be no monsters or could be there monsters, so, i would like to add in a tier, OR a threat system. i have sliders of what monsters get spawned in, and lots of options. hopefully this makes sense.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Adding a threat system

Post by Sir Robin »

So you have slider and options, in the menu system? And those are storing their info in cvars?

So, same as I said before, you put monster spawners in your map instead of real monsters, then those spawners check the cvars to know what to spawn.
Darklord328
Posts: 74
Joined: Mon Sep 17, 2012 6:11 pm
Preferred Pronouns: He/Him

Re: Adding a threat system

Post by Darklord328 »

i also forgot to add, that when the slider is at the maximum, the monsters get spawned in, however if its 0? monsters don't get spawned in. as for the tier/threat system, i would like to know if this is possible, and i use doom2 for testing, not for maps that i have created, so adding in a tier/threat system, like in slade, not in ultimate doom builder, for the threat system. as for points, like say if one gets a megasphere, it adds in a couple of points 5 points maximum, and stronger tierd enemies spawns in. like the revenant and an archvile. bfg9000 adds in 10 to 20 points of the threat system, meaning cyberdemons and spidermasterminds spawns in.
hopefully this makes sense. :D
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Adding a threat system

Post by Sir Robin »

So you're not making your own maps, and you want this to work for existing maps?

So write your spawners to check your cvars and whatnot and get get all that working. Then create an event handler that waits for a map to load, then iterates the actors replacing the monsters and items with the appropriate spawners.
Darklord328
Posts: 74
Joined: Mon Sep 17, 2012 6:11 pm
Preferred Pronouns: He/Him

Re: Adding a threat system

Post by Darklord328 »

im using zandronum, event handler isn't supported for zandronum. what im creating needs skulltag_contentv4.0. and im using decorate coding for the monsters that im doing. otherwise i would be doing gzdoom. i believe this could be achieved by doing the scripting and coding in slade.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: Adding a threat system

Post by Sir Robin »

Ah, ok. Yeah I only really know GZDoom and ZScript. Hope someone else can help you with that.

I think the concept would be the same, create the spawners in decorate and have an ACS entry script to replace all monsters and pickups with the appropriate spawners. But I don't exactly how to implement that.
Darklord328
Posts: 74
Joined: Mon Sep 17, 2012 6:11 pm
Preferred Pronouns: He/Him

Re: Adding a threat system

Post by Darklord328 »

hoping so as well.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Adding a threat system

Post by ramon.dexter »

Darklord328 wrote: Mon Oct 23, 2023 7:54 am im using zandronum, event handler isn't supported for zandronum. what im creating needs skulltag_contentv4.0. and im using decorate coding for the monsters that im doing. otherwise i would be doing gzdoom. i believe this could be achieved by doing the scripting and coding in slade.
Sorry, but I think is too complex so it is out of scope of decorate, which is pretty limited.
Post Reply

Return to “Scripting”