-
Notifications
You must be signed in to change notification settings - Fork 61
Configuration Tutorial
Do you want to know how to configure the configuration files? It's not that hard!
If you're running version 4 or higher, please refer to this document instead.
If you have everything setup correctly, you should have 5 files:
- An advancedconfig.yml
- A data.yml
- A simpleconfig.yml
- A lang.yml
- A playerdata.yml
You do not have to touch the data.yml and playerdata.yml because it will automatically be changed everytime a player ranks up or makes progress. Detailed information about the other three '.yml's are below.
Most servers only need this specific file. It allows for simple ranking when a player has played for a certain amount of time.
When a player first joins your server, you can set a default group with your permissions plugin. I use PEX as my Permissions plugin and I've set the group 'guest' as the default group. (Do note that Autorank won't default a player to a rank) When a player would join your server and would be put in the guest group, after 1 hour they would be ranked up to member. After 5 days of playtime, they would be VIP if they are still in the member group. If a moderator would play for 5 days, it will not put your moderator as a VIP. You get the point.
This file is to be used only for servers that require more configuration options, such as: command performing, sending messages, rewarding money, etc.
Example configuration file here.
In this case, whenever a player is in the guests group and has played for 10 hours or over, he or she will be promoted to the members group and will get a message containing "Congratulations, you are now a member.". Also, the commands 'say &p just got a promotion' and 'broadcast &p has just been promoted to Member!' will be performed. Note that &p will change to the player's name.
Once a player has become a member,
- played for 5 days or more,
- has 10 exp,
- is in 'world_nether',
- is in gamemode 0 (survival),
- and has an item with data value 50 (torch),
it will be ranked up to VIP, will get a message ('Congratulations, you are now a vip.') and the following commands would be performed: 'say &p has just been promoted to VIP!', 'give &p 1 100' and 'tell &p You have just earned 100 stone!'.
That's all there is to it. It's not super complicated but it offers you, as an admin, a lot of new ways to rank players. If you want to go even further ( yes, it's possible ), you should check out the 'super-advanced' section.
Oh boy, you are a pro with .ymls aren't you? The super advanced config allows you to push Autorank to its limits.
You can use new 'optional' and 'auto complete' options and have results for requirements.
Click this to see the example file.
This has 2 groups. Guest and Member. Whenever you join my test server, you'll automatically be assigned to the Guest group. When you have played for more than 1 hour, it will rank you to the 'Member' group. It will also tell all other players on the server: "Welcome our new member, playernamehere" Lastly, it will send a message to the player: 'Congratulations, you are now a Member.'
Let's move on to the Member group. The Member group has 6 requirements:
- A time requirement
- An exp requirement
- A world requirement
- Another world requirement
- A gamemode requirement
- A 'has item' requirement
The first thing that is noticeable is that there are 2 world requirements. This wasn't possible until Beta 2.6. If you want to use multiple requirements, you just have to add a number to it. 'world 2' would work, as well as 'world_2'. As long as it contains the word of the requirement. (Which is 'world' in this case).
Another strange thing you might have noticed is that there are results for seperate requirements. This was a new feature of Beta 2.6. It allows you to specify results that happen when a player meets them. The progress of a requirement is saved. If a player were to go to the 'world_nether' and do /ar check, it would complete the 'world' requirement and it would get a custom message. In this case: "You visited the nether for the first time!". After a player has met this requirement, it will not trigger it again. Autorank keeps track of the progress of requirements. All progress is cleared when a player changes groups. If a player were to be ranked up, (s)he could trigger the requirement again because all progress was deleted after group switching.
About the optional and auto complete options: When auto complete is true, Autorank will automatically mark the requirement completed when a player meets the requirement. If auto complete was false, Autorank would nothing until a player does /ar complete #.
The optional option allows you to define whether a requirement is optional or not. Optional requirements will not count towards progress of the group. If you look at the Member example, you'll see that the exp requirement is optional. When all other requirements are met, but not the exp requirement, Autorank will still do the 'global results' that are listed at the end of the group. In this case it would rank a player to a Veteran rank and give him some stone.
The optional option and auto complete option do not have to be defined. Autorank has an algorithm that will check what the status of optional and auto complete is:
Algorithm:
- Is optional option defined?
- Yes -> go to 2
- No -> go to 3
- Is auto complete option defined?
- Yes -> go to 4
- No -> go to 5
- Is auto complete option defined?
- Yes -> go to 6
- No -> go to 7
-
Use user defined values for both options.
-
Use user defined value for 'optional' option. Auto complete = true if optional is true. False otherwise.
-
Use user defined value for 'auto complete' option. Optional = false.
-
Auto completion = true, optional option = false.
This is how Autorank functions for its options. As you can see, when the 'optional' option is left out, it will always be false.
The last requirement is a 'blocks broken' requirement. You're pretty familiar with it already, but it uses some weird syntax. I would call it 'OR logic'. Programmers probably already know what I mean by this, but if you don't understand it just yet, that's no biggie. OR logic allows you to implement a requirement that can have multiple required elements, but only one of them has to be passed to pass the complete requirement. If we take the example given in the SuperAdvancedConfig, you can see that there are two blocks closed off with parentheses, the '(' and ')' symbols. One block of these represents a single requirement. Blocks get seperated by a comma. If we examine the example given, we can see that there are two blocks. The first one is telling us to break 100 sandstone (of damage value 2) and the last one is telling us to break 100 web blocks (also with damage value 2).
Autorank will interpret this as 'the player should break either 100 sandstone blocks OR 100 web blocks'. Only one of them has to be true for the player to pass the requirement.
Now to summarise:
A player that is in the member group needs to:
- have played for at least 5 days
- have been in world_nether at least once.
- have been in world_the_end at least once.
- be in gamemode 0. (survival)
- have at least 1 torch. (item id 50)
- break at least 100 sandstone blocks OR 100 web blocks
If he meets this requirements, he will be ranked up to Veteran and he'll get a few messages.
Note that the exp requirement is optional and thus doesn't have to be completed to perform the global results.
Do you still have questions or problems? Feel free to go visit our Bukkit page and leave a comment/ticket!