Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag-tracking compass functionality #1286

Closed
wants to merge 1 commit into from

Conversation

OhPointFive
Copy link
Contributor

Firstly, sorry for just making this without discussing the design first. Turns out I needed to get this done much sooner than I expected. Luckily it's a pretty easy implementation so if it gets thrown away & replaced by something better it's not much work lost.

This PR adds the ability to have compasses that track flags. Specifically, it uses this XML syntax:

<flag compass-filter="always">

or

<flag compass-filter="red-team">
<flag compass-filter="blue-team">

Can you have multiple different compasses?
I'm pretty sure a player cannot have multiple compasses with different targets in a vanilla client.

Why put this on flags instead of compass items?
Putting the filter on the flags, instead of on compass items, will make it clear to map makers they can't treat different compasses differently. It also makes the filter simpler if other kinds of targets are added — hills or cores could also have compass filters, and the filters will always filter players, and not some weird mishmash of objectives and locations.

What happens if multiple filters match the player?
Right now it would probably visually just track one, while sending updates for both. Practically I'm not really sure what could be done here. This is one of the major drawbacks of this design.

What about tracking players?
I'm not sure how this design could be extended for player tracking, which is the other major drawback of this design. Perhaps there's a clean way that I'm missing at 3 am, or perhaps we'll need to rethink this entirely. See #1114 for discussion on this.

What about tracking multiple things & clicking the compass?
This could easily be added — increment a variable when the player clicks the compass and filter on variables. I don't think right click actions are currently available, but they are planned so that's an easy future extension of this.


My other concern with this PR is how it filters all the players every tick. Some quick testing seems to indicate that this isn't an issue, and in my mind I'd be surprised if it was an issue expect with pathological filters, but I'm not familiar enough with PGM to be confident.

Signed-off-by: OhPointFive <[email protected]>
@Pablete1234 Pablete1234 marked this pull request as draft December 19, 2023 21:54
@Pablete1234
Copy link
Member

Having this param filter be part of the flags is pretty weird, and even if a single compass is allowed at once i think it makes more sense for this to be defined in the compass item given in the kit itself, or in a separate module that defines the compass pointing rules

@Pablete1234
Copy link
Member

Closing in favor of a more generic approach in #1308

@Pablete1234 Pablete1234 closed this Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants