Possible resurrection kill count exception
Moderator: GZDoom Developers
-
- Posts: 226
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
- Contact:
Possible resurrection kill count exception
So… would it be possible in a future update to add something to the base "actor" class so that enemies resurrected by arch-viles don’t count towards the kill score?
- Zhs2
- Posts: 1300
- Joined: Fri Nov 07, 2008 3:29 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Maryland, USA, but probably also in someone's mod somewhere
- Contact:
Re: Possible resurrection kill count exception
Haven't tested this myself, but maybe this can be easily DIY'd if you set bCOUNTKILL to false on e.thing in a WorldThingRevived event?
-
- Posts: 226
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
- Contact:
Re: Possible resurrection kill count exception
is that like an event handler thing for MAPINFO?
- Xeotroid
- Posts: 446
- Joined: Sat Jun 23, 2012 7:44 am
- Graphics Processor: nVidia with Vulkan support
- Location: Czech Rep.
Re: Possible resurrection kill count exception
That doesn't work - the resurrected monster still increases the total monster count, but it then doesn't get counted as a kill when it is killed, making 100% kills impossible. The flag is unset probably after the Revive function is called, which increases the total monster count if bCountKill is set. I've tried using WorldThingDestroyed() instead, but that doesn't seem to do anything at all - monster count increases upon resurrection, and kill count increases upon re-killing.
Edit: LevelLocals.Total_Monsters is editable, so a DIY is actually very simple:
Code: Select all
override void WorldThingRevived(WorldEvent e) {
e.Thing.bCountKill = false;
Level.Total_Monsters -= 1;
}
- Zhs2
- Posts: 1300
- Joined: Fri Nov 07, 2008 3:29 pm
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Location: Maryland, USA, but probably also in someone's mod somewhere
- Contact:
Re: Possible resurrection kill count exception
Ah, I figured as much. But I can also think of no better way to intercept this aside from the CanResurrect virtual, which would involve rolling your own monsters in the first place.
-
- Posts: 226
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
- Contact:
Re: Possible resurrection kill count exception
I tested it, & it works like a charm! Now if only we can get this to work with EVERYTHING that screws up the kill counter, like respawns & summons
- Xeotroid
- Posts: 446
- Joined: Sat Jun 23, 2012 7:44 am
- Graphics Processor: nVidia with Vulkan support
- Location: Czech Rep.
Re: Possible resurrection kill count exception
I don't know what else you mean by respawns except possibly for directly setting a dead monster's state to Spawn or something (sounds very rare and probably not worth considering for cases where this kill count reverting is desired, like UV-maxing a map), but this should work for any kind of summons including those from the Icon of Sin and from the summon command. The map time check is there to not prevent pre-defined spawns from adding to the kill counter. I don't think there is another way to check if an actor is placed in the map file or spawned during playtime.
Code: Select all
class KillCountHandler : EventHandler {
override void WorldThingSpawned(WorldEvent e) {
if (Level.MapTime > 0) {
RevertCounter(e);
}
}
override void WorldThingRevived(WorldEvent e) {
RevertCounter(e);
}
private void RevertCounter(WorldEvent e) {
if (e.Thing.bCountKill) {
e.Thing.bCountKill = false;
Level.Total_Monsters -= 1;
}
}
}
-
- Posts: 226
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
- Contact:
Re: Possible resurrection kill count exception
With respawns, I was referring to things like Nightmare difficulty. As to summons, the Icon isn’t too much of a problem since you can just set its death to kill all its spawns. I’m more concerned with things like Pain Elementals. Basically, anything that’d cause the kill counter to go above 100% in the original DOS executable but doesn’t really have a proper built-in way of accounting for that in GZDoom is my main concern as far as what I’m trying to make the kill count ignore here. Also,with this setup, will enemies that teleport in still count as kills?
- Xeotroid
- Posts: 446
- Joined: Sat Jun 23, 2012 7:44 am
- Graphics Processor: nVidia with Vulkan support
- Location: Czech Rep.
Re: Possible resurrection kill count exception
You can just test it in two minutes on your own, you know. Yes, it prevents Pain Elementals' Lost Souls and Nightmare respawns from increasing the kill counter. I haven't checked ACS-spawned monsters, but I see no reason why they wouldn't be affected by the handler. Enemies that teleport in vanilla-style are already in the map at the start.
-
- Posts: 226
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
- Contact:
Re: Possible resurrection kill count exception
I’ll test it when I’m at my computer. & when you mention ACS-spawned monsters, are you referring to the Hexen monster spawning system? & I didn’t know enemies that teleport in are already in the map. Are there dummy sectors that hold the monsters in prep for teleporting?
- Xeotroid
- Posts: 446
- Joined: Sat Jun 23, 2012 7:44 am
- Graphics Processor: nVidia with Vulkan support
- Location: Czech Rep.
Re: Possible resurrection kill count exception
Yeah, monsters in Hexen respawn through a simple repeating OPEN script with a delay and a chance to spawn a given monster at a given spot. The same spawning functionality can be used for spawning enemies into the map via scripts from triggers for regular progression, traps etc. I never liked mappers using this too much, as the kill count at the start of a map means pretty much nothing and easily balloons up.Ultimate Freedoomer wrote: ↑Wed Dec 13, 2023 9:52 pm are you referring to the Hexen monster spawning system?
The ACS spawn functions are affected by the handler, so monsters spawned this way don't add to the kill count.
Vanilla, Boom, MBF etc. maps can't spawn in a monster that's not already present in the map somewhere, so dummy sectors are used. Usually the dummy sector is merged with a sector inside the playable area (or a small physical connection is made, like in E1M9 or MAP16) for sound to propagate to wake the monsters and have them walk over a teleporting linedef.Ultimate Freedoomer wrote: ↑Wed Dec 13, 2023 9:52 pm Are there dummy sectors that hold the monsters in prep for teleporting?
The monsters are there at the start of the map, so they count for the kill count, and them teleporting in is them just being moved around the map.
-
- Posts: 226
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
- Contact:
Re: Possible resurrection kill count exception
Hopefully this won’t screw with things like Doom 64's teleport ambush or — assuming UDMF can — cases where it DOES spawn a monster that isn’t already present in such situations. Anyway, I’ll test it tomorrow
-
- Posts: 226
- Joined: Fri Jan 30, 2015 10:32 pm
- Location: Pittman Center
- Contact:
Re: Possible resurrection kill count exception
Regarding this: the main thing I’m concerned about are things like respawns (Hexen's scripted monster spawning system, Nightmare difficulty), resurrects (enemy's raise states being invoked), & summons (Icon of Sin, Pain Elemental lost souls). Stuff like a monster that isn’t already on the map somewhere being spawned in WITHOUT such being on an endless loop I still want to count towards the kills, though.