Updating to 0.8.4

johnycilohoklajohnycilohokla Posts: 283 Developer
edited April 2015 in Code
The 0.8.4 update restored the modding support.
You don't need CommonLib anymore (or else it has something of use to your mod).

To get your mod working without CommonLib for the most part you will just have to remove CommonLib.

To get crafting recipes working you will need to add the following code to your ModScriptClass:
function YourModName:Initialize()
	Eternus.CraftingSystem:ParseRecipeFile("Data/Crafting/YourModName_crafting.txt")
end

The format of crafting.txt file has also changed it used to be:
My Crafting Recipe
	{	
		file = "Scripts/Recipes/DefaultRecipe.lua"
		class = "DefaultRecipe"
		#...
	}
Now its:
My Crafting Recipe
	{	
		Script = "Scripts/Recipes/DefaultRecipe.lua"
		#...
	}

The changes are simple just change all:
file = " -> Script = "
and remove the class = "DefaultRecipe"
My Blog
jc.png
  yt.png  t.png  

Comments

  • Red AgliatorRed Agliator Posts: 307 Seed
    Is CommonLib still required to register custom chat commands?
  • johnycilohoklajohnycilohokla Posts: 283 Developer
    Is CommonLib still required to register custom chat commands?

    In the current release version it is.
    My Blog
    jc.png
      yt.png  t.png  
  • Red AgliatorRed Agliator Posts: 307 Seed
    Just in case anyone else runs into this, I found that there's one more change needed for mod crafting to work correctly:

    If the crafted object is custom, make sure you set values for these script arguments in the object.txt file:
    Script
    {
    	arguments
    	{
    		UBPcraft = 7
    		LBPcraft = 7
    		XPcraft = 14
    
    (Those numbers are from the fireball neuria gauntlet file. I haven't poked around yet to see what they do. I'm guessing they are for the future. )

    Before I added those arguments, I got a lua error:
    [Parsing, Error]
    ...TUGGame/Core/Scripts/DataModels/CraftModel.lua:21:attempt to perform arithmetic on a nil value.
    
  • johnycilohoklajohnycilohokla Posts: 283 Developer
    Actually there is 1 more thing, except for the *craft values you will need a dataMetricCategory.
    Script
    {
       arguments
       {
          UBPcraft = 7
          LBPcraft = 7
          XPcraft = 14
          dataMetricCategory = "Data Metric Category Name"
    
    My Blog
    jc.png
      yt.png  t.png  
  • Red AgliatorRed Agliator Posts: 307 Seed
    Does it matter (to a mod author) what the dataMetricCategory value is? When I played around with it in previous versions, I didn't see any effects.

    (And yes, that code won't work by itself. I only showed the new lines, so there's lots of stuff missing.)
Sign In or Register to comment.