Standalone [1.3] tModLoader - A Modding API

I also fixed it, but now i'm getting another error.
vzVATBf.png

This is my main CS:
7xdET7B.png

What did i do wrong?
 
I also fixed it, but now i'm getting another error.
vzVATBf.png

This is my main CS:
7xdET7B.png

What did i do wrong?
Maybe you should use "recipe.AddTile(...);" where "..." is ID of your tile.
[DOUBLEPOST=1437468843,1437468605][/DOUBLEPOST]Any way of changing player starting items? I want to add a new item that new player gets in his inventory.
 
then how do i remove a vanilla recipe?

I'm not sure how you could remove a vanilla recipe. All my attempts ended in crashes.
I was able to alter the vanilla recipe though. The result does reduce the cost of the celestial sigil.

Code:
public override void AddRecipes()
{
            Main.recipe[1799].requiredItem[0].stack = 4;
            Main.recipe[1799].requiredItem[1].stack = 4;
            Main.recipe[1799].requiredItem[2].stack = 4;
            Main.recipe[1799].requiredItem[3].stack = 4;
}
 
I'm not sure how you could remove a vanilla recipe. All my attempts ended in crashes.
I was able to alter the vanilla recipe though. The result does reduce the cost of the celestial sigil.

Code:
public override void AddRecipes()
{
            Main.recipe[1799].requiredItem[0].stack = 4;
            Main.recipe[1799].requiredItem[1].stack = 4;
            Main.recipe[1799].requiredItem[2].stack = 4;
            Main.recipe[1799].requiredItem[3].stack = 4;
}
mmhm... how did you find the ID of the recipe?
 
Sorry guys, I work out 6 times a week so I'm always gone for a bit.
Working on updating the installer now, should be up soon. After that I'm taking a look at the new updates.
 
mmhm... how did you find the ID of the recipe?

I made a script to look up the recipe that created the right item.
Built the mod and then checked the log file.

Code:
public override void AddRecipes()
{
            int i;
            for(i=0;i<Main.recipe.Length;i++)
            {
                if(Main.recipe[i]!=null&&Main.recipe[i].createItem.type==3601)
                {
                    ErrorLogger.Log(Main.recipe[i].createItem.name);
                    ErrorLogger.Log(""+i);
                }
            }
}

Edit:
You can in fact 'remove' a vanilla recipe by replacing it with another and reducing the recipe count.

Code:
Main.recipe[1799] = Main.recipe[Recipe.numRecipes - 1];
Recipe.numRecipes --;

A word of caution though, Any alterations to vanilla recipes will not revert upon disabling your mod. You will need to restart Terraria in order for the changes to revert.

Also, when using the above method for deleting recipes additional recipes will be deleted each time you reload the mod. (unless additional steps are taken to prevent it.)
 
Last edited:
Checking out new updates now, seems like a ton :D
[DOUBLEPOST=1437479964,1437479461][/DOUBLEPOST]I like how you added in RecipeHelper, it adds a bit of clarity for people :) Also, I see I can now make my own souls, yay
 
Just getting this error:

Code:
The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Terraria.ModLoader.ModLoader.GetTexture(String name)
   at Terraria.ModLoader.Mod.SetupContent()
   at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

How to fix?
Well I always forget that tModLoader doesn't take for example: @"ExampleMod\Items\filename"
It only takes it like this: "ExampleMod/Items/Filename"
[DOUBLEPOST=1437481033,1437480795][/DOUBLEPOST]So I added in a custom soul, and it worked properly right off the bat. Problem is, the lighting of it doesnt seem to work?

QY1ekRC.png


Code:
        public override Color? GetAlpha(Color lightColor)
        {
            return Color.AliceBlue;
        }
 
So I added in a custom soul, and it worked properly right off the bat. Problem is, the lighting of it doesnt seem to work?

QY1ekRC.png


Code:
        public override Color? GetAlpha(Color lightColor)
        {
            return Color.AliceBlue;
        }


You're probably looking for this:
Code:
public override void Update(ref float gravity, ref float maxFallSpeed)
{
        Lighting.AddLight(item.position, Microsoft.Xna.Framework.Color.AliceBlue.ToVector3()); 
}
 
So I actually still managed to crash Terraria.exe @bluemagic123

Code:
AddItem("CyclogenesisLeggings", new CyclogenesisLeggings(), moditems + "Armor/ExampleLeggings");
AddEquipTexture(EquipType.Legs, ExampleLeggings.texture);

Just put in the wrong name there and it crashed my game ;) (instead of disabling the mod)

Edit: well that was not even it, because it still crashed :O without logs
Can't seem to find the issue.. It crashes at "Setting up"
 
Last edited:
Back
Top Bottom