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

Suggestion: remember user flight intent #86

Open
MilesBHuff opened this issue Jul 13, 2024 · 6 comments
Open

Suggestion: remember user flight intent #86

MilesBHuff opened this issue Jul 13, 2024 · 6 comments

Comments

@MilesBHuff
Copy link

MilesBHuff commented Jul 13, 2024

A common pain point for users is that town flight, after disabling due to the user leaving a flight area, does not automatically re-enable upon the user's return to that area. This makes working along the edges of a town very tedious.
However, the simple "solution" of having flight always re-enable upon entering a flight zone can cause problems too.

Thankfully, I have an idea that should get the best of all worlds: make it so that /tfly also changes the player's flight intent. If the player's flight intent is "on", then anytime they enter a flight zone, their fly should be enabled. If the player's flight intent is "off", then things will work as now.

Basically: In addition to changing whether fly is currently enabled, /tfly will also change a new boolean that determines which flight should auto-enable when possible. Here is a list of possible scenarios:

  • If the user runs /tfly while their flight is enabled, then their flight should disable (as now) and their autoflight should also disable.
  • If the user runs /tfly while their flight is disabled and they are in a flight zone, then their flight should enable (as now) and their autoflight should also enable.
  • If the user runs /tfly while their flight is disabled and they are NOT in a flight zone, then an error should be printed and nothing should be changed.

Possible additions to this base feature could be the addition of the following two subcommands for /tfly:

  • /tfly auto, which toggles autoflight on/off
  • /tfly temp, which toggles flight on/off without also toggling autoflight

Additionally, it might be beneficial to add a new setting to control whether autoflight is on or off by default for players with /tfly permission that have yet to run the /tfly command.

@LlmDl
Copy link
Member

LlmDl commented Jul 13, 2024

Can I see your townyflight config?

@MilesBHuff
Copy link
Author

MilesBHuff commented Jul 13, 2024

Oh. Huh. There's an auto_Enable_Flight setting, and ours is set to 'true'. Let me re-test this with a player, and get back to you. If this turns out to be a mis-report, then I apologize for the trouble. Though, I guess the idea laid-out in this ticket is still a new feature relative to the current implementation, which is a server-wide default instead of a per-user default.

Anyways, here's the config file, as requested:

options:
  
  # If set to true, players entering their town will have flight auto-enabled.
  # When set to true, the plugin will use slightly more resources due to the EnterTown listener.
  auto_Enable_Flight: 'true'
  
  # If set to true, players entering their town will have flight auto-enabled without being notified in chat.
  auto_Enable_Silent: 'false'
  
  # If set to false, players can still fly in their town while war is active.
  disable_During_Wartime: 'true'
  
  # If set to false, TownyFlight will not prevent combat of flying people.
  disable_Combat_Prevention: 'false'
  
  # The list of areas which allow tempflight, allowed words: owntown, nationtowns, alliedtowns, alltowns, trustedtowns, wilderness
  tempflight_allowed_areas: owntown,nationtowns,trustedtowns
  
  # If set to false, the language.noPermission message will not display the permission node.
  show_Permission_After_No_Permission_Message: 'false'
  
  # Number of seconds after leaving an allowed flight area before flight is taken away.
  # Set to 0 to take flight away immediately.
  flight_Disable_Timer: '3'

It seems there's also a disable_Combat_Prevention setting. Apparently, I should have though to look back over the config file before filing these tickets. Erm, sorry.
I've closed TownyAdvanced/Towny#7504, but I did have a question about how disable_Combat_Prevention works; I left this question in the closing comment of that ticket.

@LlmDl
Copy link
Member

LlmDl commented Jul 13, 2024

auto_Enable_Flight: 'true' should be re-enabling their flight automatically already, but you say that it is not?

If the pain comes from them moving in/out of the same town rapidly, increasing the flight_Disable_Timer time would be a good idea.

@LlmDl LlmDl transferred this issue from TownyAdvanced/Towny Jul 13, 2024
@MilesBHuff
Copy link
Author

MilesBHuff commented Jul 16, 2024

I tested this briefly with one player and it worked correctly; but I didn't control for length of time outside of town. I will test again, this time testing both the case where they are outside of town long-enough to fully lose flight, as well as the case where they re-enter before the cooldown is over. It's possible that things lie in this difference. I will also ask them to confirm whether they have flight enabled when they log in while in a town.
If all of these work, then I'm not sure why some players were having issues; it may well be that they were just misunderstanding how TownyFlight works, and were reporting it in a way that I understood to be something other than what was actually happening.

@MilesBHuff
Copy link
Author

MilesBHuff commented Aug 8, 2024

I tested again with some players. Entering/leaving town always works as intended; what doesn't is going through portals. So going into the Nether via a portal from a town to an outpost there removes flight.

@LlmDl
Copy link
Member

LlmDl commented Aug 8, 2024

Yes I could never get this to hold on to their flight when they cross worlds. Something automatically removes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants