Standalone [1.3] tModLoader - A Modding API

How do I start invasion using item?
UPD: Solved
Hmmm... the code looks correct, but invasion doesn't start on use.
Code:
namespace Randomod.Items.Consumables
{
    class MSBlueprint : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Martian Saucer Blueprint";
            item.width = 30;
            item.height = 26;
            AddTooltip("Summons Martian Madness");
            item.value = 00005000;
            item.rare = 4;
            item.consumable = true;
            item.useStyle = 4;
            item.useTime = 30;
            item.useAnimation = 30;
            item.useSound = 0;
            item.maxStack = 20;
            item.summon = true;
        }

        public override bool UseItem(Player player)
        {
            Main.StartInvasion(InvasionID.MartianMadness);
            Main.PlaySound(15, player.position, 0);
            return true;
        }
    }
}

I'm sure that should work.
 
how do I make a homing projectile?
I tried
Code:
ProjectileID.Sets.Homing[projectile.type] = true;
in defaults, but It didn't do anything at all. no errors or anything.
help please

also

THANK YOU IT WORKS :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :)
You're welcome.

As for a homing projectile, either you'll need to use the aiType and aiStyle of a projectile that already behaves the way you want, or if none do, write your own homing AI.

Can someone help me here please? :(

Is there something wrong with the sprite? The code? Both?
Also, you'll want to set penetrate to -1 so that it won't disappear after just one hit.
 
hi
[doublepost=1466168045,1466168000][/doublepost]Why isnt this tmodloader thing not working with Terraria 1.3.1.1 pls halp and recognize me :(
what isnt working?
[doublepost=1466168174][/doublepost]
We can't work with 'not working', could you give us some specifics?
hey Iriazul, i quoted you in my mods home page
forums.terraria.org/index.php?threads/bozocorp-mod-making.44923/
 
(This is a loading error, not a compile error)
Items/Weapons/CM330
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

(The code)
using Terraria.ID;
using Terraria.ModLoader;

namespace CakeMod.Items.Weapons
{
public class CM330 : ModItem
{
public override void SetDefaults()
{
item.name = "CM 330";
item.damage = 15;
item.ranged = true;
item.width = 36;
item.height = 25;
item.toolTip = "";
item.useTime = 6;
item.useAnimation = 6;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 2;
item.value = 1000;
item.rare = 2;
item.useSound = 11;
item.autoReuse = true;
item.shoot = 10;
item.shootSpeed = 16f;
item.useAmmo = ProjectileID.Bullet;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.CobaltBar, 20);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();

recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.PalladiumBar, 20);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
(This is a loading error, not a compile error)
Items/Weapons/CM330
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

(The code)
using Terraria.ID;
using Terraria.ModLoader;

namespace CakeMod.Items.Weapons
{
public class CM330 : ModItem
{
public override void SetDefaults()
{
item.name = "CM 330";
item.damage = 15;
item.ranged = true;
item.width = 36;
item.height = 25;
item.toolTip = "";
item.useTime = 6;
item.useAnimation = 6;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 2;
item.value = 1000;
item.rare = 2;
item.useSound = 11;
item.autoReuse = true;
item.shoot = 10;
item.shootSpeed = 16f;
item.useAmmo = ProjectileID.Bullet;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.CobaltBar, 20);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();

recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.PalladiumBar, 20);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
do you have a texture of the same name in that folder?
 
Hi, i really need help my terraria crashed when i tried to install the mod tmod so i can use other mods. (I made a back up file btw) I installed it and used it for terraria but now i can't play on my worlds and characters are not there. So i tried to uninstall the mod and that worked (i think) but now when im using the terraria shortcut on my desktop it just says a bunch of error stuff. please help me i've came really far in the game. If you wan't to know more in detail just leave comment i will look at it. And if you have the solution i hope you tell me it.
 
Hi, i really need help my terraria crashed when i tried to install the mod tmod so i can use other mods. (I made a back up file btw) I installed it and used it for terraria but now i can't play on my worlds and characters are not there. So i tried to uninstall the mod and that worked (i think) but now when im using the terraria shortcut on my desktop it just says a bunch of error stuff. please help me i've came really far in the game. If you wan't to know more in detail just leave comment i will look at it. And if you have the solution i hope you tell me it.
so, if you go in your documents, there will be a MyGames folder, in there are your terraria saves, under their respective folders, if you want to use worlds in modded, just copy them into the tmodloader version of the player and worlds folder, they are separate so you dont accidentally corrupt yor world, but you can copy them over, as for when you uninstall, can you post the error message
 
so, if you go in your documents, there will be a MyGames folder, in there are your terraria saves, under their respective folders, if you want to use worlds in modded, just copy them into the tmodloader version of the player and worlds folder, they are separate so you dont accidentally corrupt yor world, but you can copy them over, as for when you uninstall, can you post the error message
But the thing is that now i cant start terraria at all
 
Missing mod: MadCrafter/Items/Dreams
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

I get this error with everything I do, no one tells me how to fix it.
 
Missing mod: MadCrafter/Items/Dreams
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

I get this error with everything I do, no one tells me how to fix it.
ive only seen this error when i dont have a sprite of the same name as the file, make sure of caps
 
public class Dreams : ModItem
{

public override void SetDefaults()
{
item.name = "Your D.R.E.A.M.S Book";

Does it take from the lower or upper file?
 
Back
Top Bottom