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

Implement simpler !tnt controls #19

Merged
merged 3 commits into from
Feb 24, 2025

Conversation

kevinrpb
Copy link
Contributor

Notes

I'd been wanting to do this for a while, and today felt like a good day to do it.

This implements a new system of parameters for the !tnt command. This does not replace the previous system, but rather is a simpler alternative. The best way I can summarize how this work is with this "guide" I made:

Guide

Guide

(Feel free to add this to the guide doc.)

Basically, the parameters are the same. What changes is:

  • Only yaw is required in the command. Everything else has a default value if not specified.
  • The parameters have simpler values:
    • yaw can be specified with:
      • Relative directions (top/right/bottom/left) and shorthands (t/r/b/l).
      • Cardinal directions (e.g. north, southwest) and shorthands (e.g. n, sw).
    • pitch with up/down (and u/d).
    • power with close/far/veryfar (c/f/v).
    • ttl with quick/slow (q/o).
  • The parameters can be specified in any order (since the words and shorthands are all different, we don't care in which order they appear; if there are multiple for the same parameter, we'll only take the first one).

Overall this makes the command easier to use, and it makes it harder to write it in an invalid way.


Besides this change, I also updated the required TPS for the game to start. It seems like the /tps command only updates once per minute, so it can take up to that much for the game to start even if the server is already performing well. Based on some quick testing, 18.5 seems to be a good value for this.

Demo

Recorded a demo with some examples:

ARSimpleDemo.mp4

TPS can take up to a minute to stabilize. 18.5 seems to be enough for
the server to be performing well.
Added the option to specified predefined values for yaw, pitch, ttl and
power/distance. The values come from words that are easier to understand
for players (e.g. "north" for yaw, "up" for pitch, etc.).

Shorthands for the words are also supported (e.g. "q" for "quick").

Default values are provided for pitch, distance and ttl. Yaw is always
required.

Finally, the words do not need to be in a given sequence. Since all of
them are different, we can parse them in any order.
@AdamLearns AdamLearns mentioned this pull request Feb 24, 2025
@AdamLearns
Copy link
Owner

Thank you very much for doing this. 🙏

@AdamLearns AdamLearns merged commit bf33ab2 into AdamLearns:master Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants