Allow Level Compatibility to remove COUNTKILLS/COUNTITEMS

Moderator: GZDoom Developers

Post Reply
User avatar
3saster
Posts: 199
Joined: Fri May 11, 2018 2:39 pm
Location: Canada

Allow Level Compatibility to remove COUNTKILLS/COUNTITEMS

Post by 3saster »

As far as I know, the level postprocessor does not have any way to remove the COUNTKILL or COUNTITEM from a thing. The use case for removing COUNTKILL is to allow maxkills when monsters are used for "scripting purposes"; for example, Memento Mori 2 MAP25 contains an unkillable imp used to trigger a lift; Hell Revealed MAP26 contains 4 unkillable archviles used to create the ghost monster army at the end. The use case for removing COUNTITEM is for different reasons; maps like 50 Shades of Graytall MAP06 and 50 Monsters MAP29 use unreachable items for decorative purposes; maps likes Speed of Doom MAP14 use item choices (picking one item prevents getting the other one). In both cases (especially the COUNTKILL case), the things cannot be removed without either changing visuals at best, to breaking gameplay at worst. In which case, the best way to allow maxkills/items would be to allow the level postprocessor to remove these flags (or introduce a similar mechanism).
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Post by _mental_ »

Both flags are properties of corresponding classes, it's not something loaded from maps.

A workaround for COUNTKILL can be MTF_FRIENDLY flag set on monsters. There is no such thing for COUNTITEM.
If you really need this, consider to use an event handler that does Actor.ClearCounters() during the first tic instead of postprocessor.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Post by Graf Zahl »

This would surely require two new thing spawn flags to be added, because at the point where compatibility scripts run, no actor has been spawned yet. But that's not an impossibility.
User avatar
Rachael
Posts: 13575
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Post by Rachael »

_mental_ wrote: A workaround for COUNTKILL can be MTF_FRIENDLY flag set on monsters.
This would not work well for the archvile rez traps. The archvile would produce friendly monsters in this case.
User avatar
3saster
Posts: 199
Joined: Fri May 11, 2018 2:39 pm
Location: Canada

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Post by 3saster »

_mental_ wrote: If you really need this, consider to use an event handler that does Actor.ClearCounters() during the first tic instead of postprocessor.
The point of this is for compatibility reasons to do engine-side; If I'm gonna use an event handler anyway for personal use, I might as well just edit the map directly.
Graf Zahl wrote:This would surely require two new thing spawn flags to be added, because at the point where compatibility scripts run, no actor has been spawned yet. But that's not an impossibility.
That's what I figured, but I wasn't sure if there was a better way. Seems there are more than enough bits left in the EMapThingFlags enum, and as far as I can tell, all that really needs to be done is handle the new flags in AActor::HandleSpawnFlags(). In any case, should this functionality be added, I already provided a number of use cases it could be immediately applied to.
User avatar
3saster
Posts: 199
Joined: Fri May 11, 2018 2:39 pm
Location: Canada

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Post by 3saster »

Had a go at it, PR. Thanks to Skepticist from Doomworld, who provided me quite the number of maps that could benefit from this feature.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”