Standalone [1.3] tModLoader - A Modding API

I can't see any mods in the mod browser, i know it's beta but everyone else seems to be able to. I'm using the latest version of terraria and the latest version of tModLoader (V0.8.0.0). Any idea how i can do something about it to fix it?
Did u try reloading the page cause i tryed reloading it it the mod apeared through my eyes..
 
actually no, the { wasn't actually the problem it seems. this is why you post your code with your question lol, i gave the wrong answer

what is happening is actually that you have spaces in your namespace

{ namespace The Well Mod.Items.Weapons
is wrong

namespace TheWellMod.Items.Weapons
is right

you can't have spaces in the namespace like that. you will need to go through each of your CS files and correct this, im sure more errors will pop up the same

also go to INSERT and then select CODE when your posting, it looks much better than just straight posting it like that
THANKS MAN!! AND I LIKE YOUR MOD TOO u have a mod link in it?? cause it has really cool sprites!
[doublepost=1463578680,1463578529][/doublepost]
I tried every combination of filters and reloaded the pages every time, still nothing.
that's a shame.. SORRY i don't have ideas..
 
THANKS MAN!! AND I LIKE YOUR MOD TOO u have a mod link in it?? cause it has really cool sprites!
nah its just sprites, my mod is one of those permanently WIP things. i may complete it sometime in the future, but i promised to first help a friend out with their's, once theirs is done i'll finish my own

I can't see any mods in the mod browser, i know it's beta but everyone else seems to be able to. I'm using the latest version of terraria and the latest version of tModLoader (V0.8.0.0). Any idea how i can do something about it to fix it?
u on a mac?
 
nah its just sprites, my mod is one of those permanently WIP things. i may complete it sometime in the future, but i promised to first help a friend out with their's, once theirs is done i'll finish my own
what is the name of ur mod the WIP thingyss..
[doublepost=1463578859,1463578795][/doublepost]and..

i have a question??
how to be like you??
i mean the word under your picture (Pixel Pirate)??
 
nah its just sprites, my mod is one of those permanently WIP things. i may complete it sometime in the future, but i promised to first help a friend out with their's, once theirs is done i'll finish my own


u on a mac?
I saw that post before, no i use windows 10.
[doublepost=1463579098,1463579019][/doublepost]
what is the name of ur mod the WIP thingyss..
[doublepost=1463578859,1463578795][/doublepost]and..

i have a question??
how to be like you??
i mean the word under your picture (Pixel Pirate)??
You need to link your account to steam and have the pixel piracy game on your account, then you can pick wether you want to be pixel pirate or terrarian.
 
ok!!

NOW I HAVE ANOTHER PROBLEM!!

Missing mod: YourModName/Items/Armor/BreastplateName_Body
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.AddEquipTexture(EquipTexture equipTexture, ModItem item, EquipType type, String name, String texture, String armTexture, String femaleTexture)
at Terraria.ModLoader.Mod.AddEquipTexture(ModItem item, EquipType type, String name, String texture, String armTexture, String femaleTexture)
at Terraria.ModLoader.Mod.AutoloadItem(Type type)
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
 
Can you place player variables within your item/buff tooltips...? Like say I made a custom stat within ModPlayer, If I had equipment that increased that stat, could I have a weapons tooltip reflect that on the fly?

Maybe something like, AddTooltip("This item will heal ally life by " 4 + variable); is what I would be looking for?
Hello DIVERMANSAM!! can u add this on ur thorium mod??
[doublepost=1463596730,1463596685][/doublepost]
Can you place player variables within your item/buff tooltips...? Like say I made a custom stat within ModPlayer, If I had equipment that increased that stat, could I have a weapons tooltip reflect that on the fly?

Maybe something like, AddTooltip("This item will heal ally life by " 4 + variable); is what I would be looking for?
Hello DIVERMANSAM!! can u add this on ur thorium mod??
 

Attachments

  • Chroma's Spear (1).png
    Chroma's Spear (1).png
    4.4 KB · Views: 422
  • True Gungnir.png
    True Gungnir.png
    1.6 KB · Views: 187
Can somone help me with making a throwing weapon like a throwing knife or shuriken.
Let me throw you a hand bud. Here's a weapon that functions like the throwing knives.
Item
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ModName.Items
{
    public class ItemName : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Item Name";
            item.damage = 18;
            item.thrown = true; //Sets damage to throwing
            item.width = 40;
            item.height = 40;
            item.useTime = 18;
            item.useAnimation = 18;
            item.maxStack = 999;
            item.consumable = true;
            item.useStyle = 1;
            item.noMelee = true;
            item.noUseGraphic = true;
            item.autoReuse = true;
            item.knockBack = 3;
            item.value = 500;
            item.rare = 2;
            item.useSound = 5;
            item.shoot = mod.ProjectileType("ProjName"); //Projectile Name
            item.shootSpeed = 12f; //How far the projectile will go / how fast it will go
        }
     
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this, 75);
            recipe.AddRecipe();
        }
    }
}

Projectile
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using ModName.Projectiles;

namespace ModName.Projectiles
{
    public class ProjName : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.name = "Projectile Name";
            projectile.width = 10;
            projectile.height = 10;
            projectile.aiStyle = 2;
            projectile.alpha = 100;
            projectile.friendly = true;
            projectile.thrown = true;
            projectile.penetrate = 2;
            projectile.timeLeft = 600;
            aiType = ProjectileID.ThrowingKnife;
        }

// The following code allows the thrown item to have a 1/3 chance to be retrievable

        public override bool OnTileCollide(Vector2 oldVelocity)
        {
            if (Main.rand.Next(3) == 0)
            {
                int itemID = Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("ItemName"), 1, false, 0, false, false);
            }
            projectile.Kill();
            Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
         
            return false;
        }
    }
}
 
Let me throw you a hand bud. Here's a weapon that functions like the throwing knives.
Item
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ModName.Items
{
    public class ItemName : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Item Name";
            item.damage = 18;
            item.thrown = true; //Sets damage to throwing
            item.width = 40;
            item.height = 40;
            item.useTime = 18;
            item.useAnimation = 18;
            item.maxStack = 999;
            item.consumable = true;
            item.useStyle = 1;
            item.noMelee = true;
            item.noUseGraphic = true;
            item.autoReuse = true;
            item.knockBack = 3;
            item.value = 500;
            item.rare = 2;
            item.useSound = 5;
            item.shoot = mod.ProjectileType("ProjName"); //Projectile Name
            item.shootSpeed = 12f; //How far the projectile will go / how fast it will go
        }
    
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this, 75);
            recipe.AddRecipe();
        }
    }
}

Projectile
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using ModName.Projectiles;

namespace ModName.Projectiles
{
    public class ProjName : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.name = "Projectile Name";
            projectile.width = 10;
            projectile.height = 10;
            projectile.aiStyle = 2;
            projectile.alpha = 100;
            projectile.friendly = true;
            projectile.thrown = true;
            projectile.penetrate = 2;
            projectile.timeLeft = 600;
            aiType = ProjectileID.ThrowingKnife;
        }

// The following code allows the thrown item to have a 1/3 chance to be retrievable

        public override bool OnTileCollide(Vector2 oldVelocity)
        {
            if (Main.rand.Next(3) == 0)
            {
                int itemID = Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("ItemName"), 1, false, 0, false, false);
            }
            projectile.Kill();
            Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
        
            return false;
        }
    }
}
Thank you very much ! I love your mod btw !
 
Let me throw you a hand bud. Here's a weapon that functions like the throwing knives.
Item
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ModName.Items
{
    public class ItemName : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Item Name";
            item.damage = 18;
            item.thrown = true; //Sets damage to throwing
            item.width = 40;
            item.height = 40;
            item.useTime = 18;
            item.useAnimation = 18;
            item.maxStack = 999;
            item.consumable = true;
            item.useStyle = 1;
            item.noMelee = true;
            item.noUseGraphic = true;
            item.autoReuse = true;
            item.knockBack = 3;
            item.value = 500;
            item.rare = 2;
            item.useSound = 5;
            item.shoot = mod.ProjectileType("ProjName"); //Projectile Name
            item.shootSpeed = 12f; //How far the projectile will go / how fast it will go
        }
    
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this, 75);
            recipe.AddRecipe();
        }
    }
}

Projectile
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using ModName.Projectiles;

namespace ModName.Projectiles
{
    public class ProjName : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.name = "Projectile Name";
            projectile.width = 10;
            projectile.height = 10;
            projectile.aiStyle = 2;
            projectile.alpha = 100;
            projectile.friendly = true;
            projectile.thrown = true;
            projectile.penetrate = 2;
            projectile.timeLeft = 600;
            aiType = ProjectileID.ThrowingKnife;
        }

// The following code allows the thrown item to have a 1/3 chance to be retrievable

        public override bool OnTileCollide(Vector2 oldVelocity)
        {
            if (Main.rand.Next(3) == 0)
            {
                int itemID = Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType("ItemName"), 1, false, 0, false, false);
            }
            projectile.Kill();
            Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
        
            return false;
        }
    }
}


(25,13): error CS0103: The name "aitype" does not exist in the current context.
Any help ?
 
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namesspace TheRandomMod.Items.Weapons
{
public class WoodenCleaver : ModItem
{
item.name = "Wooden Cleaver";
item.damage = 10;
item.melee = true;
item.width = 90;
item.height = 90;
item.toolTip = "Not very sharp,gets most of it's damage from its weight";
item.usetime = 40;
item.useanimation = 20;
item.useStyle = 1;
item.knockBack = 5;
item.value = 20;
item.rare = 1;
item.usesound = 1;
item.autoReuse = false;
item.useTurn = false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.wood, 30);
recipe.AddTile9TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();

}
}
}




So this doesn't work,could you guys help me with this(only have experience with python)
 
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;

namesspace TheRandomMod.Items.Weapons
{
public class WoodenCleaver : ModItem
{
item.name = "Wooden Cleaver";
item.damage = 10;
item.melee = true;
item.width = 90;
item.height = 90;
item.toolTip = "Not very sharp,gets most of it's damage from its weight";
item.usetime = 40;
item.useanimation = 20;
item.useStyle = 1;
item.knockBack = 5;
item.value = 20;
item.rare = 1;
item.usesound = 1;
item.autoReuse = false;
item.useTurn = false;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.wood, 30);
recipe.AddTile9TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();

}
}
}




So this doesn't work,could you guys help me with this(only have experience with python)
"namesspace"
no SetDefaults method
"recipe.AddTile9TileID.WorkBenches);" -- 9?
"recipe.AddIngredient(ItemID.wood, 30);" -- wood doesn't exist, Wood does
"ModRecipe recipe = new ModRecipe(Mod);" -- Mod is the classname, not instance name, check the docs.
"item.usetime = 40;" -- spelled wrong
"item.useanimation = 20;" -- spelled wrong
"item.usesound = 1;" -- spelled wrong
[doublepost=1463602314,1463602176][/doublepost]
Nope! just a misspell on my reply
Well, it does exist. This error happens in game? I can't see why this error would happen, unless you didn't install correctly....
 
Back
Top Bottom