Advanced visibility-filtering
Posted: Sun Dec 11, 2011 5:10 pm
The features for filtering by class and team are not always enough for what we/I/somebody want to do. Sometimes it would be useful to apply a different filter. With this patch, that is possible. This visibility is purely a rendering matter, and does not affect game logic. (The actor is not considered invisible when this feature prevents it from rendering for any given player)
Decorate property: int VisibleFilter
Decorate flag: FILTERHIDES
The filter uses AAPTR_ values to identify actors (players) that may render this actor.
If the filter is 0 no filtering occurs.
If FILTERHIDES is set, the filter identifies actors (players) that may not render the actor.
I have not set up string parsing for the VisibleProperty (yet). That means that the property in decorate syntax is next to useless. I might add that later, or try to make the decorate parser expression-aware (so that you can use named constants directly. This would change Actvation and other properties, which must now use string constants to identify individual flags. An expression aware parser would accept any constant decorate expression.)
However, you can change the flag and filter at runtime from ACS or decorate.
ACS-property identifiers:
APROP_VisibleFilter
APROP_FilterHides
Decorate declarations:
int VisibleFilter -- setting 0 will disable filtering (default)
flag FILTERHIDES -- only applies when VisibleFilter is non-0.
Decorate modifiers:
A_FilterVisibility(int filter)
A_ChangeFlag("FILTERHIDES", true|false)
For those who want to filter one actor so that only master sees it, and one so that only master does not see it, who also happen already to have this particular actor as an activator at some point in an acs script:
Decorate property: int VisibleFilter
Decorate flag: FILTERHIDES
The filter uses AAPTR_ values to identify actors (players) that may render this actor.
If the filter is 0 no filtering occurs.
If FILTERHIDES is set, the filter identifies actors (players) that may not render the actor.
I have not set up string parsing for the VisibleProperty (yet). That means that the property in decorate syntax is next to useless. I might add that later, or try to make the decorate parser expression-aware (so that you can use named constants directly. This would change Actvation and other properties, which must now use string constants to identify individual flags. An expression aware parser would accept any constant decorate expression.)
However, you can change the flag and filter at runtime from ACS or decorate.
ACS-property identifiers:
APROP_VisibleFilter
APROP_FilterHides
Decorate declarations:
int VisibleFilter -- setting 0 will disable filtering (default)
flag FILTERHIDES -- only applies when VisibleFilter is non-0.
Decorate modifiers:
A_FilterVisibility(int filter)
A_ChangeFlag("FILTERHIDES", true|false)
For those who want to filter one actor so that only master sees it, and one so that only master does not see it, who also happen already to have this particular actor as an activator at some point in an acs script:
Code: Select all
SetActorProperty(0, APROP_VisibleFilter, AAPTR_MASTER);
Code: Select all
SetActorProperty(0, APROP_VisibleFilter, AAPTR_MASTER);
SetActorProperty(0, APROP_FilterHides, true);
Spoiler: Technical notes
Spoiler: About the demo