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

Announcements and Commands - revamped #46

Open
slipcor opened this issue Aug 3, 2021 · 2 comments
Open

Announcements and Commands - revamped #46

slipcor opened this issue Aug 3, 2021 · 2 comments

Comments

@slipcor
Copy link
Owner

slipcor commented Aug 3, 2021

Since no-one is complaining about this, I have to. The current way of setting up announcements and commands is very strict and narrow mineded, to a degree where it only makes sense for a fringe minority.

There needs to be a dedicated block for both - that supports the following options:

  • triggers to react to
    • current streak
    • max streak
    • death
    • kill
    • streak ending
  • definition whether the trigger is
    • on value X reached
    • every X triggers
  • restrictions on the trigger based on
    • minimal value
    • maximal value

As this becomes more and more complicated, we might want to look into setting this up with commands, and relying on one YML file per setting that can be combined. However, that is up to the server owner to decide, really.

commands:
  deaths:
    interval:
      '10': 'tellraw %player% You have died %total% times already!'
  kills:
    amount:
      '100': 'tellraw %player% Congratz on your 100th kill!'
announcements:
  streak:
    interval:
      '5': '%player% is on a hunt!'
    amount:
      '100': '%player% is on a streak of 100 - better stop them now!'

Some examples here, I think this makes the most sense in a way that we can suppot the old way and the new way. This can be expanded to be multiline just like before, and I prefer this over a more verbose setup like

announcements:
  [some node indicator]:
    trigger: streak
    interval: 5
    message: '%player% is on a hunt!'
  [next node indicator]:
    trigger: streak
    amount: 100
    message: '%player% killed 100 players in a row!'

I am not sure. I really prefer the numbers being used here instead of stringified integers as keys.

Thoughts, anyone? I am up for totally different solutions :)

@ffaen
Copy link
Contributor

ffaen commented Aug 3, 2021

The last option can be used but with no keys, so in practice it becomes an array of objects:

announcements:
  - trigger: streak
    interval: 5
    message: '%player% is on a hunt!'
  - trigger: streak
    amount: 100
    message: '%player% killed 100 players in a row!'

Parses as:

{
  "announcements": [
    {
      "message": "%player% is on a hunt!", 
      "trigger": "streak", 
      "interval": 5
    }, 
    {
      "amount": 100, 
      "trigger": "streak", 
      "message": "%player% killed 100 players in a row!"
    }
  ]
}

Since we're now managing intervals, we'll probably have to loop over all options at runtime anyway to figure out which ones should trigger...

@slipcor
Copy link
Owner Author

slipcor commented Oct 5, 2022

Updated requirements based on new features. After reflecting after forgetting we had this issue and this discussion... I am not sure I like the way of setting up these nodes to split up announcements and commands so early. I think there might be a reason to keep them closer together, maybe:

actions:
  - trigger: streak
    amount: 10
    command:
      # can be server or player ; maybe server: true / false
      scope: server
      lines:
      - give %player% diamond 1
      - permission give %player% hat.dominator
    message:
      # can be global or player; maybe global: true / false
      scope: global
      lines:
      - %players% is on a rampage!
      - There is a new dominator! Welcome %player%

Writing this up I came up with something a bit more flexible but of course more complicated 🥇

actions:
  - trigger: streak
    amount: 10
    commands: 
      server:
      - give %player% diamond 1
      - permission give %player% hat.dominator
      # run a command as the player
      player:
      - pvpstats show
    messages:
      global:
      - %players% is on a rampage!
      - There is a new dominator! Welcome %player%
      player:
      - You are now a wearing a bounty hat!

All above things apply like further configurable options like "interval or absolute" and "minimal or maximal" and I need to think about whether we always have all values in there as examples or if we can omit values to have less spam

Edit:
By grouping it like this we can allow setting of these map values and have only one value for each integer, right?

Command ideas:

/pvpstats action 10 add command player "me is the best"
/pvpstats action 10 set type interval
/pvpstats action 10 set minimum 50

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