Ghost And Sword

Ghost And Sword

Enter in dark dungeons where the monsters rule are thirsty to kill you, collect items and artifacts, learn skills and fight with giant bossies, buy on earn gold new equipment and trade with lost souls.

Find the game on Gamejolt.

Crafts.xml How to add new crafts

How to add new crafts and new tabs of crafting.

Posted by on


About

Crafts.xml is markup file that contains all data about all crafts in game. But on mod side crafts.xml is just addition file for main crafts.xml inside of game files, this means if the mod folder has crafts.xml when the mod is loaded the main game's crafts.xml WILL NOT BE REPLACED with crafts.xml from mod, but all content from crafts.xml will be exported to main file and all original content and all content from all loaded mods will work together.

Usage

Open your mod folder and create file "crafts.xml" open it with your text editor. If you used XML before not hurry to add XML version line.

<?xml version="1.0" encoding="UTF-8"?>

This not need! Because all xml files on mods side is not standalone xml files, they only contains addition content for main xml files in game files. You NOT NEED TO ADD IT, else game won't can read your xml file.

In crafts.xml you can add new crafts for tabs that already exist in game or for tabs that you will create your self. What is tabs? Tabs is category of crafts game already have few is Alchemy, Weapons, Armor and Other, but you can make new ones.

How to add craft

First lets look how to add new craft to already existing tab:

<craft>
       <result>Bread</result>
       <craftanim>Mix</craftanim>
       <tab>Other</tab>
       <ing>
             <name>Gel</name>				   
	     <count>3</count>
       </ing>
       <ing>
	     <name>Cake</name>				   
	     <count>1</count>
       </ing>
       <ing>
	     <name>Raw potato</name>				   
	     <count>1</count>
       </ing>
</craft>

Everything easy here:

Every time when you need to add craft you need add

<craft>

</craft>

And next put all content inside of it.

  • result - Is item that you will got when done craft.
  • craftanim - is optional element is animation of crating, is can be Mix, Combinate or NewItem.
  • tab - is name of tab where you want to add craft.

Next going ingredients. Can't be more then 3 Ingredients, is limit. To add ingredient add

       <ing>

       </ing>

inside of "craft" element. Then inside of "ing" element you can set name of needed item and how many are required.

       <ing>
             <name>Gel</name>				   
	     <count>3</count>
       </ing>

This will means to craft this item will need 3 Gel. If you need more then one ingredient to craft it add one more "ing" element below past one.

       <ing>
             <name>Gel</name>				   
	     <count>3</count>
       </ing>
       <ing>
	     <name>Cake</name>				   
	     <count>1</count>
       </ing>

This will means need 3 Gel and 1 Cake to craft this item and etc. I think you got understand how this work now.

How to add tab

Now lets look how to add own tab.

<addtab>
	    <name>AbbyModTab</name>
	    <string>Abbies</string>
	    <icon>abbycraft_icon</icon>
	    <modname>MyNewMod</modname>
</addtab>
  • name - is id of tab, this id will be used to adding crafts intro this tab.
  • string - visible name of tab when hover mouse on it.
  • icon - png spriter from "Spriters" folder in mod.
  • modname - True mod name. True mod name is folder name of mod, not name from modinfo.json.

To add craft to tab just in "tab" element of craft put id of tab. Whole code will be looks like a that:

<addtab>
	    <name>AbbyModTab</name>
	    <string>Abbies</string>
	    <icon>abbycraft_icon</icon>
	    <modname>MyNewMod</modname>
</addtab>
<craft>
       <result>Bread</result>
       <craftanim>Mix</craftanim>
       <tab>AbbyModTab</tab>
       <ing>
             <name>Gel</name>				   
	     <count>3</count>
       </ing>
       <ing>
	     <name>Cake</name>				   
	     <count>1</count>
       </ing>
       <ing>
	     <name>Raw potato</name>				   
	     <count>1</count>
       </ing>
</craft>

If you everything did correct you will see such:

Your new tab will be last.

Comments

Join the community or sign in with your gaming account to join the conversation: