Any Of Category Component

From wiki
Revision as of 00:44, 21 November 2017 by DeamonHunter (Talk | contribs) (Update formatting.)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Category:Component Modding are all optional properties that can be added to any file. Components are useful in extending the original files with even more information, such as the cost of the item or whether the block can be broken by a weapon.

On this page, we go over the Any Of Category component, signified by the following;

"anyOfCategory": {
  =Content=
}

Any Of Category components are one of the components that are related to Achievements. This component is for any achievement that requires one, and only one, of the following;

  • Items that are collected
  • Items that were sold
  • Items that were discarded
  • Items that were planted
  • Items that were ordered
  • Items that were placed
  • Items that were crafted

As such this is the most versatile component, but not the most specific.


When and How to use

Any Of Category components are used whenever you want an Achievement that tracks one of the issues listed above. Note that this does not track specific items, just items with the specific categories.

To start off with first, you should create an Achievement. Once that is done, you can add the following below the last property of the file;

"anyOfCategory" : {
  "type" : "discardItems",
  "orCategories" : [ "license" ],
  "andCategories": [ "farming", "paper" ],
  "displayCategory", "license",
  "quantity" : 1,
  "givenByRestriction" : "Maximilian"
}

First up is the "type" property. This specifies what the achievement should track. The full list is "collectItems", "sellItems", "discardItems", "plantItems", "orderItems", "placeItems", "craftItems". Each of these correspond to one of the bullet points at the start of the page. Next up is "orCategories". For an item to count, one of its categories must be in this list. Not all categories in this list must be met, but at least one does. The next is "andCategories". For an item to count, its categories must be at least match this list. (i.e. It must have all of these categories, but can have more.) "displayCategory" is the category it will show in the achievement UI. "quantity" is how many valid items must be obtained in order to meet the achievement. "givenByRestriction" is the name of the person who gives the item to the player. This is the Villagers name. Leaving this blank will allow the player to get this achievement by any means.

With that this component is done.

Config Options

All config options must be inside the body of;

"anyOfCategory": {
  =Config Here=
}


"andCategories"

Valid options (Listof Strings): A list containing valid strings.

Default Value: If not specified, will not enforce any required categories.


These are all the categories that must be on the item in order to accept it. The item can have more categories, but it at least will need all of the ones specified here.


"displayCategory"

Valid options (String): Any valid string.

Default Value: If not specified, will have no displayed category.


This is the category that will be displayed for the achievement.


"givenByRestriction"

Valid options (String): Any valid string.

Default Value: If not specified, the item can be received from any source.


This is the name of the villager that this achievement will be limited to. Useful for making sure a player completes a quest.


"orCategories"

Valid options (List of Strings): A list containing valid strings.

Default Value: If not specified, will not enforce any required categories.


These are all the categories that can be on the item in order to accept it. The item must have at least one of these categories, but does not need all and can have others not in this list.


"quantity"

Valid options (Integer): A positive integer number.

Default Value: No default value is specified. Always need to provide your own.


This is the number of valid items needed before the achievement will pop. These items must meet the type requirement as well as the category requirements.


"type"

Valid options (String): "collectItems", "sellItems", "discardItems", "plantItems", "orderItems", "placeItems", "craftItems"

Default Value: No default value is specified. Always need to provide your own.


This is the type of collection required. Each type was specified in the bullet points at the start of this page but are fairly self-explanatory.