Difference between revisions of "ModTweaker:Botania Support:Lexica Botania"

From MineTweaker 3
Jump to: navigation, search
Line 41: Line 41:
 
  mods.botania.Lexicon.addCategory("botania.category.rainbow");
 
  mods.botania.Lexicon.addCategory("botania.category.rainbow");
 
  game.setLocalization("en_US", "botania.category.rainbow", "Rainbow");
 
  game.setLocalization("en_US", "botania.category.rainbow", "Rainbow");
  //CategoryKey, Domain, ResourcePath
+
  //CategoryKey, Domain + ResourcePath
 
  mods.botania.Lexicon.setCategoryIcon("botania.category.rainbow", "botania:textures/items/rainbowRod.png");
 
  mods.botania.Lexicon.setCategoryIcon("botania.category.rainbow", "botania:textures/items/rainbowRod.png");
 +
//CategoryKey, Priority
 +
mods.botania.Lexicon.setCategoryPriority("botania.category.rainbow", 6);
  
 
== Creating Entries ==
 
== Creating Entries ==

Revision as of 16:43, 22 January 2015

The Basics

Botania's Lexica Botania is seperated into three different steps. The first and big one are categories, something that shows up directly when you open your Lexica. They each have an icon dedicated to them as well as their entries. Entries are the next step, basically they are the text deposits of the Lexica. Once you open one of them they will show up pages of text or crafting recipes or pictures. These pages are the third and last step of the Lexica. Each category/entry/page is identified by a unique string called its Key.

If you want to alter an existing category/entry/page, you'll need to know its key. When adding a new Botania recipe, you'll need to supply the pages with the recipe manually as it will not detect the recipe itself.

You can get a list of category/entry/page keys by using the in-game command /minetweaker lexiconCategories/Entries/Pages to output all category/entry/page keys to the MineTweaker log. If you want a more precise dump of entries and pages, you can define the category/entry, for example /minetweaker lexiconEntries [CATEGORY]or /minetweaker lexiconPages [ENTRY].

Removing Categories/Entries/Pages

Categories/Entries/Pages can be removed with the removeCategory/Entry/Page() method. However, removing a Cagetory is only visual. The entries that were inside of it can still be found in the Index so if you want to remove a Category completly you have to track down all of the entries inside of a category and then remove them.

Example:

//Category/Entry/PageKey 
mods.botania.Lexicon.removeCategory("botania.category.basics");
mods.botania.Lexicon.removeEntry("botania.entry.mIntro");
mods.botania.Lexicon.removePage("botania.entry.fIntro", 0);

Categories

Each category is also identified with its own unique string. These are important to know if you want to remove a category or place a new entry in one.

Known Tab Keys:

* botania.category.basics (Basics and Mechanics)
* botania.category.mana (Mana Manipulation)
* botania.category.generationFlowers (Generating Flora)
* botania.category.functionalFlowers (Functionial Flora)
* botania.category.devices (Natural Apparatus)
* botania.category.tools (Mystical Items)
* botania.category.baubles (Baubles and Acessoires)
* botania.category.alfhomancy (Alfhomancy)
* botania.category.misc (Miscellaneous)

Creating Categories

Creating a category requires a texture to supply for the category icon. You'll need the domain and file path for the texture. You'll also need to create a localization for the tab name either through a resource pack or by using ModTweaker's localization changer. The localization key will always be "botania.category." followed by the category key.

For example, if you wanted a category with the Rod of the Bifrost texture from Botania:

//CategoryKey, Name
mods.botania.Lexicon.addCategory("botania.category.rainbow");
game.setLocalization("en_US", "botania.category.rainbow", "Rainbow");
//CategoryKey, Domain + ResourcePath
mods.botania.Lexicon.setCategoryIcon("botania.category.rainbow", "botania:textures/items/rainbowRod.png");
//CategoryKey, Priority
mods.botania.Lexicon.setCategoryPriority("botania.category.rainbow", 6);

Creating Entries

Entries are created with a unique Key, a category key and optionally a knowledge type. Like with creating a category, creating a new entry requires a new localization.

If an entry is added through ModTweaker, its name is localized as "botania.entry.[name]" followed by the localized name of it.

If you want the entry to be a bit more advanced, let's say on Elven knowledge level, you have to define it that way. You do not have to add the Knowledge Level if you want the entry to be unlocked alongside of the others when you first get your Lexica, thus it is "basic".

Known Knowledge Type Keys:

* minecraft (Basic Knowledge)
* alfheim (Elven Knowledge)

Example:

//EntryKey, CategoryKey
mods.botania.Lexicon.addEntry("botania.entry.colour","botania.category.rainbow");
game.setLocalization("en_US", "botania.entry.colour", "Colour");
//EntryKey, KnowledgeTypeKey
mods.botania.Lexicon.SetEntryKnowledgeType("botania.entry.colour", "alfheim");

Adding Pages to Entries

Just creating the base entry isn't enough. The base entry starts out without pages and crashes the game if you try to open it. Once an entry has been created, you can use add[Type]Page() to add new pages to the entry. There are several types of page types, going from text, to image, to crafting and even to lore pages. Do note though, that the crafting pages (Regular Crafting, Runic Altar, Petal Apothecary, Alfheim Portal, etc) do not use an OutputStack as an item for it to define the recipe like Thaumcraft 4 Research Modtweaking does. Thus, you have to "re"-create the recipe in the page creation. That means that they are only visual and that an appropriate script would be necessary.

Example:

== Text & Image Pages ==
//PageKey, EntryKey, PageNumber //Adds a Text Page
mods.botania.Lexicon.addTextPage("botania.page.colourText","botania.entry.colour",0);
game.setLocalization("en_US", "botania.page.colourText", "&oThe first and (...)"); 

//PageKey, EntryKey, PageNumber, Domain + ResourcePath //Adds an Image Page
mods.botania.Lexicon.addImagePage("botania.page.colourImage","botania.entry.colour",1, "botania:textures/gui/entries/elvenGarde.png");
game.setLocalization("en_US", "botania.page.colourImage", "Guide for Modtweaker"); 

 == Crafting Pages ==
//PageKey, EntryKey, PageNumber, OutputStack, InputArray //Adds a Crafting Page, Out/InputStack are just visual
mods.botania.Lexicon.addCraftingPage("botania.page.colourCrafting","botania.entry.colour",2,[<minecraft:diamond_block>], [[[<minecraft:diamond>, <minecraft:diamond>, <minecraft:diamond>], [<minecraft:diamond>, <minecraft:diamond>, <minecraft:diamond>], [<minecraft:diamond>, <minecraft:diamond>, <minecraft:diamond>]]]);
game.setLocalization("en_US", "botania.page.colourCrafting", "Crafting the &1Diamond Block&0."); 

//PageKey, EntryKey, PageNumber, OutputStack, InputArray //Adds a Petal Page, Out/InputStack are just visual. The appropriate script for the page would be "mods.botania.Apothecary.addRecipe(<minecraft:melon>, [<Botania:petal:5>, <Botania:petal:14>, <Botania:petal:14>]);"
mods.botania.Lexicon.addPetalPage("botania.page.colourPetal","botania.entry.colour",3,[<minecraft:melon>],[[<Botania:petal:5>, <Botania:petal:14>, <Botania:petal:14>]]);
game.setLocalization("en_US", "botania.page.colourPetal", "&oWhy didn't the melons get married? Because they cantaloupe!&r."); 

//PageKey, EntryKey, PageNumber, OutputStack, InputArray, ManaCost //Adds an Infusion Page, Out/InputStack are just visual. The appropriate script for the page would be "mods.botania.ManaInfusion.addInfusion(<minecraft:golden_apple:1>, <minecraft:golden_apple>, 50000);" 
mods.botania.Lexicon.addInfusionPage("botania.page.colourInfusion","botania.entry.colour",4,[<minecraft:golden_apple:1>],[<minecraft:golden_apple>],[50000]);
game.setLocalization("en_US", "botania.page.colourInfusion", "Infusing &1Golden Apple&0.");  

//PageKey, EntryKey, PageNumber, OutputStack, InputArray, ManaCost //Adds an Alchemy Page, Out/InputStack are just visual. The appropriate script for the page would be "mods.botania.ManaInfusion.addAlchemy(<minecraft:sand> * 4, <minecraft:sandstone:*>, 10);" 
mods.botania.Lexicon.addAlchemyPage("botania.page.colourAlchemy","botania.entry.colour",5,[<minecraft:sand> * 4],[<minecraft:sandstone:*>],[10]);
game.setLocalization("en_US", "botania.page.colourAlchemy", "Breaking down &1Sandstone&0");  

//PageKey, EntryKey, PageNumber, OutputStack, InputArray, ManaCost //Adds a Conjuration Page, Out/InputStack are just visual. The appropriate script for the page would be "mods.botania.ManaInfusion.addConjuration(<minecraft:sand:1> * 2, <minecraft:sand:1>, 5);" 
mods.botania.Lexicon.addConjurationPage("botania.page.colourConjuration","botania.entry.colour",6,[<minecraft:sand:1> * 2],[<minecraft:sand:1>],[5]);
game.setLocalization("en_US", "botania.page.colourConjuration", "Conjuring &1Red Sand&0");  

//PageKey, EntryKey, PageNumber, OutputStack, InputArray, ManaCost //Adds a Rune Page, Out/InputStack are just visual. The appropriate script for the page would be "mods.botania.RuneAltar.addRecipe(<minecraft:stonebrick:2>, [<minecraft:stonebrick>, <minecraft:gunpowder>], 5);"
mods.botania.Lexicon.addRunePage("botania.page.colourRune","botania.entry.colour",7,[<minecraft:stonebrick:2>],[[<minecraft:stonebrick>, <minecraft:gunpowder>]],[5]);
game.setLocalization("en_US", "botania.page.colourRune", "The &1Cracked Stone Brick&0.");  
 
//PageKey, EntryKey, PageNumber, OutputStack, InputArray, ManaCost //Adds a Brew Page, Out/InputStack are just visual. The appropriate script for the page would be "[MISSING, WAITING FOR SOUNDLOGIC]" 
mods.botania.Lexicon.addBrewPage("botania.page.colourBrew","botania.entry.colour",8, "invisibility", [<minecraft:nether_wart>, <minecraft:snowball>, <minecraft:glowstone_dust>], "botania.page.colourBrew_bottom.text");
game.setLocalization("en_US", "botania.page.colourBrew", "A simple brew, it mimics a &1Potion of Invisibility&0, when taken, it has a similar effect, giving the individual a &4Invisibility&0 effect.");
game.setLocalization("en_US", "botania.page.colourBrew_bottom.text", "Pretend you have Incursio");

//PageKey, EntryKey, PageNumber, OutputStack, InputStack //Adds an Elven Page, Out/InputStack are just visual. The appropriate script for the page would be "mods.botania.ElvenTrade.addRecipe(<Botania:flower:4>, [<minecraft:yellow_flower>]);"
mods.botania.Lexicon.addElvenPage("botania.page.colourElven","botania.entry.colour",9,[<Botania:flower:4>],[[<minecraft:yellow_flower>]]);
game.setLocalization("en_US", "botania.page.colourElven", "Trading for &1Yellow Mystical Flower&0."); 

 == Miscellaneous Pages ==
//PageKey, EntryKey, EntityName, Size //Adds a Entity Page
mods.botania.Lexicon.addEntityPage("botania.page.colourEntity","botania.entry.colour",10,"Botania.botania:pixie",100);
game.setLocalization("en_US", "botania.page.colourEntity", "The Pixie");

//PageKey, EntryKey //Adds a Lore Page
mods.botania.Lexicon.addLorePage("botania.page.colourLore","botania.entry.colour",11);
game.setLocalization("en_US", "botania.page.colourLore", "(...) &othe final Page!");   

When localizing text for research pages, the following markup can be used:

# Special formatting codes:
# <BR> or <BR/>         Paragraph break (<BR/> is included for people using XML for their localization)
# <LINE> or <LINE/>     Insert a fancy linebreak between sections of text.

Connecting Research

Research has three types of connections, Parents, Hidden Parents, and Siblings.

Parents are the prerequisite researches you need to unlock before you can research a particular research. For example, ROD_silverwood has INFUSION and ROD_greatwood as its parents. You cannot research Silverwood Wand without first researching Infusion and Greatwood Wand. If a research is on the same page as its parents, the Thaumonomicon will draw a line from parent to child to indicate which leads to which.

Hidden Parents are like Parents, except that the Thaumonomicon will not draw a line between them even if they're on the same page. Use this if you're trying to reduce clutter on a research tab.

To add parents or hidden parents to a research:

//ResearchKey, Parent, Hidden?
mods.thaumcraft.Research.addPrereq("WTFPLANTS", "ICHOR", false);

Siblings are researches that are auto-unlocked when a particular research is. For example, DISTILLESSENTIA has JARLABEL as a sibling. When you research Essentia Distillation, you automatically unlock the Jar Label research. When siblings are on the same tab, the Thaumonomicon will draw a line between them.

To add a sibling to a research:

//ResearchKey, Sibling
mods.thaumcraft.Research.addSibling("WTFPLANTS, "ZOMGSAPLINGS");

To change parents or siblings for an existing research, you'll need to use the following commands to clear those values and then add your own.

//ResearchKey
mods.thaumcraft.Research.clearPrereqs("ICHOR");
mods.thaumcraft.Research.clearSiblings("WTFPLANTS");

Modifying Research

There are many tags and extra commands for adding more features to your created research or modifying existing ones.

Some standard research tags are:

  • ROUND - Research has a round icon in the Thaumonomicon. Usually for non-recipe researches or auto-unlocked researches.
  • SPIKY - Research has spikes around its icon. Generally for indicating that a research is important.
  • STUB - Research cannot be researched by the player. Generally for researches that are unlocked other ways such as Siblings or auto-unlock.
  • SECONDARY - Research has an octagonal icon in the Thaumonomicon and is purchased with points instead of researched.
  • VIRTUAL - Research does not really exist and cannot be researched. Used as "parent" research that cannot normally be unlocked.
  • AUTO-UNLOCK - Research starts out already unlocked.
  • CONCEALED - Research does not appear in the Thaumonomicon until its parent researches are completed. Used for most researches by default.

They can be set with the following commands:

//ResearchKey, Value
mods.thaumcraft.Research.setRound("WTFPLANTS", true);
mods.thaumcraft.Research.setSpikey("WTFPLANTS", true);
mods.thaumcraft.Research.setStub("WTFPLANTS", true);
mods.thaumcraft.Research.setSecondary("WTFPLANTS", true);
mods.thaumcraft.Research.setVirtual("WTFPLANTS", true);
mods.thaumcraft.Research.setAutoUnlock("ASPECTS", false);
mods.thaumcraft.Research.setConcealed("WTFPLANTS", true);

You can modify what Aspects an existing research has. Aspects determine what and how many research points you need to purchase a research in EASY research mode or if it is a Secondary research. They also determine what aspects you will need to connect during the research mini-game for non-secondary research or in HARD research mode.

//ResearchKey, Aspects
mods.thaumcraft.Research.setAspects("WTFPLANTS", "lucrum 39, perditio 96, potentia 100");

Complexity is what determines the difficulty level of a research. The higher the Complexity level of a research, the more annoying challenging it will be in the research mini-game.

//ResearchKey, Complexity
mods.thaumcraft.Research.setComplexity("WTFPLANTS", 16);

If you're trying to change pages for an existing research, you'll first need to clear the research of pages with this:

//ResearchKey
mods.thaumcraft.Research.clearPages("WTFPLANTS");

Once you've cleared all the pages, you can manually add pages back in whatever format you want.

Normally, when you change a Thaumcraft recipe, the research page for it will still show the original recipe. You can manually change this by clearing all the pages and adding them back, or you can use this to try and force it to refresh the recipe:

//ResearchKey
mods.thaumcraft.Research.refreshResearchRecipe("WTFPLANTS");

Refreshing the research will only work if the recipe is still the same type (Arcane Worktable, Infusion, etc...) Otherwise, you'll need to clear the research pages and add them back with the new recipe type.

Finally, if you want to move an existing research to a different location and/or different tab, you can use this:

//ResearchKey, DestinationCategory, X, Y
mods.thaumcraft.Research.moveResearch("INFERNALFURNACE", "FORBIDDEN", 1, 0);




ModTweaker Supported Mods

Applied Energistics 2 | Aura Cascade | Botania | Chisel 2 | Ex Nihilo | Extra Utilities | Factorization | Flaxbeard's Steam Power Support | Forestry | Mariculture | Mekanism | Metallurgy 4 | PneumaticCraft | Railcraft | Thaumcraft 4 | Thermal Expansion | Tinker's Construct