[Added] Allow Level Compatibility to remove COUNTKILLS/COUNTITEMS

Moderator: GZDoom Developers

Allow Level Compatibility to remove COUNTKILLS/COUNTITEMS

Postby 3saster » Tue Apr 21, 2020 9:06 pm

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).
User avatar
3saster
 
Joined: 11 May 2018
Location: Canada

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Postby _mental_ » Wed Apr 22, 2020 1:25 am

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.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Postby Graf Zahl » Wed Apr 22, 2020 1:38 am

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Postby Rachael » Wed Apr 22, 2020 2:26 am

_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
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Postby 3saster » Wed Apr 22, 2020 2:51 am

_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
 
Joined: 11 May 2018
Location: Canada

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

Postby 3saster » Mon Apr 27, 2020 12:49 am

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.
User avatar
3saster
 
Joined: 11 May 2018
Location: Canada


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests