tModLoader Official tModLoader Help Thread

ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ID.3467,99);
recipe.AddTile(mod, "Workbench");
recipe.SetResult(this);
recipe.AddRecipe();
This is wrong. For Vanilla items and tiles, you would use:
Code:
recipe.AddIngredient(3467, 99);
//or
recipe.AddIngredient(ItemID.LunarBar, 99);
and for the tile:
Code:
recipe.AddTile(TileID.WorkBenches);
//or
recipe.AddTile(18);
 
Is there any way I can prevent tmodloader from disabling my mods for being made for a different modloader version? Whenever I launch the modloader, rarely it's fine, most of the time it disables one or more mods for being a different TML version.
Vanilla hair dye, capitalism, shaderlib, build planner, imksushidatapacks, DAlib, goregalore, instant respawn, and boss checklist have all been disabled at one point or another for being a different mod loader version. I can't seem to find a configuration for ignoring version inconsistencies, please help.

Load order:
https://pastebin.com/sEKGrB5F
 
Last edited:
How do i make a weapon Fire like starwrath most like Blizzard Staff because im making a magic weapon
From this guide I made:
Code:
int numberProjectiles = 6; // shoots 6 projectiles
            for (int index = 0; index < numberProjectiles; ++index)
            {
                Vector2 vector2_1 = new Vector2((float)((double)player.position.X + (double)player.width * 0.5 + (double)(Main.rand.Next(201) * -player.direction) + ((double)Main.mouseX + (double)Main.screenPosition.X - (double)player.position.X)), (float)((double)player.position.Y + (double)player.height * 0.5 - 600.0));   //this defines the projectile width, direction and position
                vector2_1.X = (float)(((double)vector2_1.X + (double)player.Center.X) / 2.0) + (float)Main.rand.Next(-200, 201); //change the Main.rand.Next here to, for example, (-10, 11) to reduce the spread. Change this to 0 to remove it altogether
                vector2_1.Y -= (float)(100 * index);
                float num12 = (float)Main.mouseX + Main.screenPosition.X - vector2_1.X;
                float num13 = (float)Main.mouseY + Main.screenPosition.Y - vector2_1.Y;
                if ((double)num13 < 0.0) num13 *= -1f;
                if ((double)num13 < 20.0) num13 = 20f;
                float num14 = (float)Math.Sqrt((double)num12 * (double)num12 + (double)num13 * (double)num13);
                float num15 = item.shootSpeed / num14;
                float num16 = num12 * num15;
                float num17 = num13 * num15;
                float SpeedX = num16 + (float)Main.rand.Next(-40, 41) * 0.02f; //change the Main.rand.Next here to, for example, (-10, 11) to reduce the spread. Change this to 0 to remove it altogether
                float SpeedY = num17 + (float)Main.rand.Next(-40, 41) * 0.02f; 
                Projectile.NewProjectile(vector2_1.X, vector2_1.Y, SpeedX, SpeedY, type, damage, knockBack, Main.myPlayer, 0.0f, (float)Main.rand.Next(5));
            }
            return false;
If you need any more help, let me know.
 
I found the answer to my old question but unfortunately I have new one. Basically I was creating a debuff for my mod and when I tried to compile it, it gave me this error.

error:
c:\Users\acer\Documents\My Games\Terraria\ModLoader\Mod Sources\something\NPCs\NPCsINFO.cs(5,29) : error CS0246: The type or namespace name 'NPCInfo' could not be found (are you missing a using directive or an assembly reference?)

code:
using Terraria.ModLoader;

namespace something.NPCs
{
public class NPCsINFO : NPCInfo
{
public bool customdebuff = false;
}
}


Please help and thanks in advance.
Use GlobalNPC instead of NPCInfo.
You would also need to add (inside of the class):
Code:
public override void ResetEffects(NPC npc)
        {
                       customdebuff = false;
                }
 
Tmod is giving me an unknown error when I try to download mods. I check the logs and... Nothing. Does anyone know why this is happening?
 
How do you make it so that an custom enemy that you create spawns only in the forest/purity biome? because i already tried ZonePurity but that wouldnt work
help would be appreciated
 
Back
Top Bottom