Allow Level Compatibility to remove COUNTKILLS/COUNTITEMS

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Allow Level Compatibility to remove COUNTKILLS/COUNTITEMS

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

by 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.

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

by 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.

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

by 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.

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

by 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.

Re: Allow Level Compatibility to remove COUNTKILLS/COUNTITEM

by _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.

Allow Level Compatibility to remove COUNTKILLS/COUNTITEMS

by 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).

Top