Standalone [1.3] tModLoader - A Modding API

GetItem("color1").item.name
This seems to be the problem. Just change it to "Color 1" if you'd like (Just a string). I'm actually not sure the items have been loaded at this point, or maybe a ModItem class with that name doesn't actually exist. (spelling?)
 
What should I do to make gun use ammo in inventory that have texture1 for example and the projectile texture2
[DOUBLEPOST=1450543164,1450543110][/DOUBLEPOST]Because in vanila you have bullet texture and the texture in inventory same.
 
What should I do to make gun use ammo in inventory that have texture1 for example and the projectile texture2
[DOUBLEPOST=1450543164,1450543110][/DOUBLEPOST]Because in vanila you have bullet texture and the texture in inventory same.

there are as u say 2 textures one as item one as projectile
 
Yes because you have musket ball for example so there is only one item in inventory and the projectile that will be shoot have the same textures but i want to have diferent textures in inventory and the shooten one
[DOUBLEPOST=1450543671,1450543633][/DOUBLEPOST]Sorry if that language is bad because i only learn english :/
 
this is how it knows what projectile to shot from this one bullet


public override void SetDefaults()
{
item.name = "Example Bullet";
item.damage = 12;
item.ranged = true;
item.width = 8;
item.height = 8;
item.maxStack = 999;
item.toolTip = "This is a modded bullet ammo.";
item.consumable = true;
item.knockBack = 1.5f;
item.value = 10;
item.rare = 2;
item.shoot = mod.ProjectileType("ExampleBullet");
item.shootSpeed = 16f;
item.ammo = ProjectileID.Bullet;
}
 
Holy sh*t I am idiot the answer is there !
item.shot = ..... (what the projectile looks like)
item.ammo = ..... (what item it consume)

so it should looks like this :

item.shot = mod.ProjectileType("Laser")
item.ammo = mod.AmmoType("LaserCartrige")

i think
 
Holy sh*t I am idiot the answer is there !
item.shot = ..... (what the projectile looks like)
item.ammo = ..... (what item it consume)

the item.ammo is just the group this ammo is in (bullet)

what item it consumes is the item this file is made for (ExampleBullet)
 
I canot create recipe for item when i try to build this mod it write this :
no suitable method found to override
pls help
 
d:\Documents\My Games\Terraria\ModLoader\Mod Sources\ExampleMod\Items\Weapons\OrbitalFriend:red:Cannon.cs(41,38) : error CS0161: 'ExampleMod.Items.Weapons.OrbitalFriend:red:Cannon.Shoot(Terraria.Player, ref Microsoft.Xna.Framework.Vector2, ref float, ref float, ref int, ref int, ref float)': not all code paths return a value
What else do i need to type in so it works? Code:
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items.Weapons
{
    public class OrbitalFriend:red:Cannon : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Orbital Friend:red: Cannon";
            item.damage = 100;
            item.melee = true;
            item.width = 21;
            item.height = 32;
            item.toolTip = "The Orbital Friend:red: Cannon - Free hugs!";
            item.useTime = 1;
            item.useAnimation = 13;
            item.useStyle = 1;
            item.knockBack = 1;
                        item.noMelee = true;
            item.value = 666666;
            item.rare = 11;
            item.useSound = 1;
            item.autoReuse = true;
            item.shoot = mod.ProjectileType("Friend:red:");
            item.shootSpeed = 16f;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }

                public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
                {
                position.Y -= 110;
                }

        public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            target.AddBuff(BuffID.OnFire, 60);
            target.AddBuff(BuffID.Cursed, 60);
            target.AddBuff(BuffID.Confused, 60);
        }
    }
}
 
thats not what the error is about but thanks for noticing
2. can you provide the recipe code of the item/item's your using
 
public override void AddRecipes()
{
ModRecipe recippe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBench);
recipe.SetResault(this);
recipe.AddRecipe();
}


Try this
 
Code:
Your code(incorrect):
recipe.SetResault(this);

Correct code:
recipe.SetResult(this);

Code:
Your code:
recipe.AddIngredient(Terraria.ID.ItemID.DirtBlock, 1);

Correct code:
recipe.AddIngredient(ItemID.DirtBlock);
// for more
recipe.AddIngredient(ItemID.DirtBlock, 2);
 
I use Terraria.ID.ItemID.....
and it work
[DOUBLEPOST=1450546653,1450546399][/DOUBLEPOST]And can anyone help me with that error ?
 
how can i make a mount or wings that can let me hover in the same place? id like to make a mod that allows you to make maps easier. i just need to hover.
 
Back
Top Bottom