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

rewards system issue... #20

Open
homerek111 opened this issue Apr 15, 2024 · 58 comments
Open

rewards system issue... #20

homerek111 opened this issue Apr 15, 2024 · 58 comments
Labels
enhancement New feature or request

Comments

@homerek111
Copy link

I don't know if it's a bug but for me this rewards system does not work at all...

I don't understand when win/lose commands should be executed because the kotl game never ends...
-> there isn't any settings in config to make it check the current king after X minutes or getting rewarded after X minutes of being the King (basically the game never ends - and that's good for me - but idk when the King should be rewarded...)

So... when does it check it and execute reward commands...?

It would be nice to make it possible to reward current king after every X minutes (configurable) of being a king or maybe make a global countdown for the arenas and reward current all current kings from all arenas at the same time...

My rewards config:
Rewards-Enabled: true
Reward-Interval: 5
Rewards:
Win:
- broadcast test123 after win
- chance(10):eco give %player% 8
- p:say I won the game!
Lose:
- broadcast test123 after lose
- chance(99):eco give %player% 1
- p:say Hmm, I think lost the game!

Join: []
Leave: []

@Despical
Copy link
Owner

I don't understand when win/lose commands should be executed because the kotl game never ends...

  • Rewards under Win section works when someone becomes king, and it executes for only the king.
  • Rewards under Lose section works when someone becomes king, but this time for all players in the arena except the king.

It would be nice to make it possible to reward current king after every X minutes (configurable) of being a king or maybe make a global countdown for the arenas and reward current all current kings from all arenas at the same time...

It does not really sound good so it seems like I won't add it. It may be possible if I add support for a Javascript Engine.

@homerek111
Copy link
Author

  • Rewards under Win section works when someone becomes king, and it executes for only the king.
  • Rewards under Lose section works when someone becomes king, but this time for all players in the arena except the king.

Okay… so I think this feature does not work on my server… I have some example reward commands (my rewards.yml is sent above) and it never executed :/ becoming a king does not execute these commands for me…
-> are there any other conditions that must be done to execute commands or it might be some bug?

@homerek111
Copy link
Author

I double checked it and im sure that reward commands are never executed on my server :/ changing kings does not make plugin to execute them...

@Despical
Copy link
Owner

Did you enable the rewards?

@homerek111
Copy link
Author

Did you enable the rewards?

yes

@homerek111
Copy link
Author

Did you enable the rewards?

maybe this rewards issue is connected with my multi arena issue from another report #19

@Despical
Copy link
Owner

@homerek111 Can you check out the new update, and let me know if the issue still continue.

@homerek111
Copy link
Author

@homerek111 Can you check out the new update, and let me know if the issue still continue.

@Despical it seems to be broken... Still rewards are not given :/

@homerek111
Copy link
Author

  1. Multi-arena glitch is fixed

  2. extra parameters to disable seem to be working fine as well :)

  3. but still reward commands are not being executed

@homerek111
Copy link
Author

oh wait,,, i found something new - let me test it one more time

@homerek111
Copy link
Author

@Despical i made some more tests and rewards are working now

BUT

As i see reward can be given only when there are at least 2 players in arena - so it won't be given if there is only 1 player in arena
-> when there is 1 player in arena region he is becoming a king but is not being rewarded

Could you possibly add config option to allow rewarding the king if he is the only 1 player in arena???
It could be an option in rewards.yml:

#minimum amount of players in arena region to execute reward commands
min-arena-players: 1

To be honest i believe there is some bug with this rewards because sometimes it allows me to claim it when there is only 1 player in arena - but most of the times it does not... Idk why sometimes it works fine with only 1 player

I have also 2 suggestions to improve the plugin:

  1. add cooldown from taking a king's position again (because now when 2 players are standing on pressure plate it spamming so hard that this 2 players are replacing king's slot all the time)
    -> if there was an option to make a cooldown player would need to wait for example 30 seconds to be able to again become king on some arena
    obraz
  2. make fireworks not harming players - idk if it is possible to do but now when fireworks are exploding it damages players nearby

@homerek111
Copy link
Author

1. add cooldown from taking a king's position again (because now when 2 players are standing on pressure plate it spamming so hard that this 2 players are replacing king's slot all the time)
   -> if there was an option to make a cooldown player would need to wait for example 30 seconds to be able to again become king on some arena

This feature can be added to Reward-Interval: 5 - because now it only blocks spamming with reward but still allows spamming with becoming a king

@Despical
Copy link
Owner

As i see reward can be given only when there are at least 2 players in arena - so it won't be given if there is only 1 player in arena -> when there is 1 player in arena region he is becoming a king but is not being rewarded

Could you possibly add config option to allow rewarding the king if he is the only 1 player in arena??? It could be an option in rewards.yml:

#minimum amount of players in arena region to execute reward commands min-arena-players: 1

To be honest i believe there is some bug with this rewards because sometimes it allows me to claim it when there is only 1 player in arena - but most of the times it does not... Idk why sometimes it works fine with only 1 player

This is not a bug but a feature. It prevents players to be a king in a row. You can enable it from the config by setting Become-King-In-A-Row option to true.

  1. make fireworks not harming players - idk if it is possible to do but now when fireworks are exploding it damages players nearby

I am going to fix it in the next update.

add cooldown from taking a king's position again (because now when 2 players are standing on pressure plate it spamming so hard that this 2 players are replacing king's slot all the time)
-> if there was an option to make a cooldown player would need to wait for example 30 seconds to be able to again become king on some arena

Delay is not a really good option in this case but I'll think something else to prevent this situation. Thank you for your contribution.

@Despical Despical added the enhancement New feature or request label Apr 15, 2024
@homerek111
Copy link
Author

homerek111 commented Apr 15, 2024

This is not a bug but a feature. It prevents players to be a king in a row. You can enable it from the config by setting Become-King-In-A-Row option to true.

Ah... i think you misunderstood - I am not talking about becoming king all over again. I am talking about being rewarded after becoming a king
Players are not getting reward if there is only 1 player in arena
-> right now (as i tested) there must be at least 2 players in arena to execute reward commands after becoming a king

I am asking about adding an option to allow getting rewarded EVEN IF there is only 1 player in arena

@Despical
Copy link
Owner

If there is only one player in the arena and if that player becomes king then they'll rewarded for once, there is no need to be at least 2 players in an arena to execute rewards.

@homerek111
Copy link
Author

homerek111 commented Apr 15, 2024

If there is only one player in the arena and if that player becomes king then they'll rewarded for once, there is no need to be at least 2 players in an arena to execute rewards.

hmmm... If you are right then it must be a bug - because i am not getting rewarded unless there at least 2 players on arena region

I am claiming king position properly but reward is not given if the king is the only player in arena's region

@homerek111
Copy link
Author

Delay is not a really good option in this case but I'll think something else to prevent this situation. Thank you for your contribution.

In my opinion delay of becoming king again would be a good feature to add (if someone wants he can disable/enable it - i find it really usefull)

@homerek111
Copy link
Author

homerek111 commented Apr 16, 2024

If there is only one player in the arena and if that player becomes king then they'll rewarded for once, there is no need to be at least 2 players in an arena to execute rewards.

hmmm... If you are right then it must be a bug - because i am not getting rewarded unless there at least 2 players on arena region

I am claiming king position properly but reward is not given if the king is the only player in arena's region

I'm not sure if it is about the amount of players in the arena region but for sure there must be some issue (with giving rewards) because sometimes it works and sometimes it does not... (i have 10 arenas created - maybe that makes some difference...)

@Despical
Copy link
Owner

If there is only 1 player in an arena and if that player becomes king, they'll rewarded for only ONE time unless someone enters the arena because they can not be king more than one time if there is only 1 player.

@homerek111
Copy link
Author

If there is only 1 player in an arena and if that player becomes king, they'll rewarded for only ONE time unless someone enters the arena because they can not be king more than one time if there is only 1 player.

I agree that it SHOULD work as you described... But on my server it does not :/ Sometimes it triggers giving reward / sometimes it does not... I sent you my server's version in #21

I believe there must be something wrong using conditions from my server. I send you all my config files:
config.yml: https://pastebin.com/EdYsvZ9X
arenas.yml: https://pastebin.com/yJVkPZBa
rewardl.yml: https://pastebin.com/adrvETGP
kits.yml: kits-enabled: false
messages.yml: https://pastebin.com/5Dka4fvG

@homerek111
Copy link
Author

If you want i can provide you more informations / show the issue in-game... My discord name: _homerek

@homerek111
Copy link
Author

Pressure plates glitch from #21 is only a visual thing but this rewards bug is important to solve :/

@Despical Please let me know how I can help u finding the reason of that - i can test it for you :))

@Despical
Copy link
Owner

Pressure plates glitch from #21 is only a visual thing but this rewards bug is important to solve :/

@Despical Please let me know how I can help u finding the reason of that - i can test it for you :))

Use the code below for rewards.yml and disable async option from config file. Let me know if you get the messages.

Rewards-Enabled: true
Reward-Interval: 0

Rewards:
  Win:
    - say won
  
  Lose:
    - say lost
  
  Join:
    - say joined

  Leave:
    - say left

@homerek111
Copy link
Author

@Despical Results of my tests:

  1. async: false + Reward-Interval: 0 = FIX OF MY REWARDS ISSUE

  2. async: true + Reward-Interval: 0 = FIX OF MY REWARDS ISSUE

  3. async: false + Reward-Interval: 1 = SOMETIMES IT WORKS / SOMETIMES IT DOES NOT (the situation like I had while reporting the bug)

  4. async: true + Reward-Interval: 1 = SOMETIMES IT WORKS / SOMETIMES IT DOES NOT (the situation like I had while reporting the bug)

WAY TO BREAK THE PLUGIN:
5. async: true + Join: - say joined and Leave: - say left = makes console ERROR SPAM and BREAKS the plugin
-> https://pastebin.com/Dntd9BGW
-> When these messages are defined the plugin gets broken (with Join: [] and Leave: [] it does not happen)

So basically my rewards bug is fixed after setting: Reward-Interval: 0
-> When the value is more than 0 sometimes while becoming a king it does not trigger reward command (probably it shouldn't be like that...)

@homerek111
Copy link
Author

Suggestion to improve the plugin:

It would be useful to allow setting the value (in seconds) for how long player needs to stand on the plate to become king - maybe with some countdown for him…

For example he needs to stay on plate for 5seconds to become a new king - if he leaves the plate = countdown resets

@homerek111
Copy link
Author

Suggestion to improve the plugin:

It would be useful to allow setting the value (in seconds) for how long player needs to stand on the plate to become king - maybe with some countdown for him…

For example he needs to stay on plate for 5seconds to become a new king - if he leaves the plate = countdown resets

This option would help current king defending his position + avoid spam with changing kings when 2 players are standing on the plate

Despical added a commit that referenced this issue Apr 17, 2024
@Despical
Copy link
Owner

Suggestion to improve the plugin:
It would be useful to allow setting the value (in seconds) for how long player needs to stand on the plate to become king - maybe with some countdown for him…
For example he needs to stay on plate for 5seconds to become a new king - if he leaves the plate = countdown resets

This option would help current king defending his position + avoid spam with changing kings when 2 players are standing on the plate

I'll check tomorrow.

@Despical
Copy link
Owner

Released an update.

@homerek111
Copy link
Author

homerek111 commented Apr 19, 2024

Released an update.

@Despical I tested everything and here are my results:
Remove-Cooldown-On: issue with working like true while it's false does not happen anymore :)
Reset-Cooldowns-On-New-King: false works perfect :)

BUT this feature is a little buggy I think:
Show-Cooldown-If-Rejoin: true
-> when it's enabled (on true) it makes cooldown count ONLY when player is inside arena's region - if he is not inside the arena his cooldown is frozen and it continues counting when he comes back into region (it should count outside the region as well - just with disabled action-bar display)
-> when it's disabled (on false) it counts cooldown time outside the region as well (so it works correct)

1 more thing that might be made on purpose or is a bug:
-> cooldown from one arena works on other arenas - so when player becomes a king on Arena A he has cooldown activated on other arenas as well - he can't become a king on Arena B until his cooldown goes down
I don't know if it should work like that or shouldn't so i just report it

Other things (that weren't included in newest update):
-> Fireworks still damage players
-> (suggestion) add countdown for how long player needs to stay on pressure plate to become a king (if he leaves the plate - countdown restarts)

@Despical
Copy link
Owner

BUT this feature is a little buggy I think:
Show-Cooldown-If-Rejoin: true
-> when it's enabled (on true) it makes cooldown count ONLY when player is inside arena's region - if he is not inside the arena his cooldown is frozen and it continues counting when he comes back into region (it should count outside the region as well - just with disabled action-bar display)
-> when it's disabled (on false) it counts cooldown time outside the region as well (so it works correct)

You can disable if you want it to be count when player is not in an arena.

1 more thing that might be made on purpose or is a bug: -> cooldown from one arena works on other arenas - so when player becomes a king on Arena A he has cooldown activated on other arenas as well - he can't become a king on Arena B until his cooldown goes down I don't know if it should work like that or shouldn't so i just report it

No, it is not a bug. I just didn't handle it that way. I'm going to add an option for that.

-> Fireworks still damage players

Players must be in the arena region to not get damaged by firework. If your arena is 1x1 then they will get damaged.

-> (suggestion) add countdown for how long player needs to stay on pressure plate to become a king (if he leaves the plate - countdown restarts)

Yeah, probably in future updates.

@homerek111
Copy link
Author

homerek111 commented Apr 19, 2024

@Despical I have just found 1 more weired thing - I have Do-Not-Restore: - "hunger" option enabled so it shouldn't max-feed player when he enters the arena (and that works correct). The problem is that it now prevents players from feeding after eating some food inside the arena - it freezes their hunger-bar

Inventory-Manager:
Enabled: false
Do-Not-Restore:
- "health"
- "game-mode"
- "hunger"

@homerek111
Copy link
Author

homerek111 commented Apr 19, 2024

You can disable if you want it to be count when player is not in an arena.

Yeah but in that case it doesn't give any feedback to the player that he has cooldown activated - he would be confused why he can't become a king (making action-bar show up would prevent this confusion - just like it works with Show-Cooldown-If-Rejoin: true but with time counting outside the area as well)

No, it is not a bug. I just didn't handle it that way. I'm going to add an option for that.

Cool :)

Players must be in the arena region to not get damaged by firework. If your arena is 1x1 then they will get damaged.

Oh that makes sense - you are right

Yeah, probably in future updates.

sure :)

Despical added a commit that referenced this issue Apr 19, 2024
@Despical
Copy link
Owner

@Despical I have just found 1 more weired thing - I have Do-Not-Restore: - "hunger" option enabled so it shouldn't max-feed player when he enters the arena (and that works correct). The problem is that it now prevents players from feeding after eating some food inside the arena - it freezes their hunger-bar

Inventory-Manager: Enabled: false Do-Not-Restore: - "health" - "game-mode" - "hunger"

Fixed in the latest commit.

@Despical
Copy link
Owner

Yeah but in that case it doesn't give any feedback to the player that he has cooldown activated - he would be confused why he can't become a king (making action-bar show up would prevent this confusion - just like it works with Show-Cooldown-If-Rejoin: true but with time counting outside the area as well)

Yeah, I'm going to add an option.

@homerek111
Copy link
Author

If you drop release some patch ping me - I can test everything :)

@Despical
Copy link
Owner

Released the update v2.9.3.

@homerek111
Copy link
Author

Released the update v2.9.3.

@Despical Nice! I have just tested the update and all fixed/added things work great :)

There are only last 2 things that we talked about and possibility of customization the plugin will be insane

  • add an option to separate cooldowns for different arenas (so becoming a king on Arena A won’t launch the cooldown on Arena B)
  • king’s retake countdown (stay on plate for X seconds to retake king’s position - leaving the plate = countdown resets)

@Despical
Copy link
Owner

I have mid-terms this week so probably I'll add these by this weekend.

@homerek111
Copy link
Author

I have mid-terms this week so probably I'll add these by this weekend.

My server where I use KOTL starts this Friday - if you find some spare time I would be greatful :)) If not, no problem - I will handle it somehow. Good luck with exams

@homerek111
Copy link
Author

@Despical hello, I started the server and my players found a way to skip cooldown by disconnecting and joining the server back. Maybe some protection from that would be useful to prevent disabling cooldown with a relog

@homerek111
Copy link
Author

@Despical Let me know if there would be something to test :)

@Despical
Copy link
Owner

@Despical Let me know if there would be something to test :)

Thank you but, currently there is nothing to test. Probably tomorrow, I'll release an update for the cooldown issue.

@Despical
Copy link
Owner

@homerek111 I have released a new update. Added an option to separate cooldowns based on different arenas and now cooldowns won't reset if player leaves the server and rejoins.

@homerek111
Copy link
Author

@homerek111 I have released a new update. Added an option to separate cooldowns based on different arenas and now cooldowns won't reset if player leaves the server and rejoins.

@Despical cooldowns are now totally broken... It allows spamming with 2 players + actionbar glitches very much + Separate-Cooldowns: false allows claiming many arenas (it shouldn't cuz it's false - so it should work as before the update)

@Despical
Copy link
Owner

@homerek111 I have released a new update. Added an option to separate cooldowns based on different arenas and now cooldowns won't reset if player leaves the server and rejoins.

@Despical cooldowns are now totally broken... It allows spamming with 2 players + actionbar glitches very much + Separate-Cooldowns: false allows claiming many arenas (it shouldn't cuz it's false - so it should work as before the update)

Yeah, I forgot a few things. Should be fixed in v2.9.6.

@homerek111
Copy link
Author

@homerek111 I have released a new update. Added an option to separate cooldowns based on different arenas and now cooldowns won't reset if player leaves the server and rejoins.

@Despical cooldowns are now totally broken... It allows spamming with 2 players + actionbar glitches very much + Separate-Cooldowns: false allows claiming many arenas (it shouldn't cuz it's false - so it should work as before the update)

Yeah, I forgot a few things. Should be fixed in v2.9.6.

works great now :)

Last thing that might be added is to require standing on plate for X seconds to become a king (countdown - before becoming a king) so it would be a good feature for defending your king's position (so you can kill / knock players from the plate before they become a king)

@homerek111
Copy link
Author

@Despical is there any chance to implement this feature soon? :)

@Despical
Copy link
Owner

Despical commented May 3, 2024

@Despical is there any chance to implement this feature soon? :)

Probably no.

@homerek111
Copy link
Author

@Despical is there any chance to implement this feature soon? :)

Probably no.

@Despical is there any chance to implement this feature soon? :)

Probably no.

Hello :) maybe now you have some free time to implement this countdown feature that we were talking about

@Despical
Copy link
Owner

@Despical is there any chance to implement this feature soon? :)

Probably no.

@Despical is there any chance to implement this feature soon? :)

Probably no.

Hello :) maybe now you have some free time to implement this countdown feature that we were talking about

Hey there, sorry for the late reply. I have my finals next week, I'll try to check it if I have any free time this weekend.

@homerek111
Copy link
Author

@Despical is there any chance to implement this feature soon? :)

Probably no.

@Despical is there any chance to implement this feature soon? :)

Probably no.

Hello :) maybe now you have some free time to implement this countdown feature that we were talking about

Hey there, sorry for the late reply. I have my finals next week, I'll try to check it if I have any free time this weekend.

Hello @Despical - It’s been a while… Maybe now you could find some time to add this 1 feature that we were talking in previous messages :)

@Despical
Copy link
Owner

@Despical is there any chance to implement this feature soon? :)

Probably no.

@Despical is there any chance to implement this feature soon? :)

Probably no.

Hello :) maybe now you have some free time to implement this countdown feature that we were talking about

Hey there, sorry for the late reply. I have my finals next week, I'll try to check it if I have any free time this weekend.

Hello @Despical - It’s been a while… Maybe now you could find some time to add this 1 feature that we were talking in previous messages :)

Hi again, I'll try to check as soon as possible.

@homerek111
Copy link
Author

@Despical is there any chance to implement this feature soon? :)

Probably no.

@Despical is there any chance to implement this feature soon? :)

Probably no.

Hello :) maybe now you have some free time to implement this countdown feature that we were talking about

Hey there, sorry for the late reply. I have my finals next week, I'll try to check it if I have any free time this weekend.

Hello @Despical - It’s been a while… Maybe now you could find some time to add this 1 feature that we were talking in previous messages :)

Hi again, I'll try to check as soon as possible.

@Despical bump :)

@homerek111
Copy link
Author

@Despical is there any chance to implement this feature soon? :)

Probably no.

@Despical is there any chance to implement this feature soon? :)

Probably no.

Hello :) maybe now you have some free time to implement this countdown feature that we were talking about

Hey there, sorry for the late reply. I have my finals next week, I'll try to check it if I have any free time this weekend.

Hello @Despical - It’s been a while… Maybe now you could find some time to add this 1 feature that we were talking in previous messages :)

Hi again, I'll try to check as soon as possible.

@Despical hello maybe now you might find some time to implement that one feature :D
Last thing that might be added is to require standing on plate for X seconds to become a king (countdown - before becoming a king) so it would be a good feature for defending your king's position (so you can kill / knock players from the plate before they become a king)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants