Standalone [1.3] tModLoader - A Modding API

I think the
Code:
namespace kif's,mod.NPCs
is causing the trouble. Try changing it to kifsmod.NPCs and also you have to rename the folder that's containing your mod.
OH... Yeah i figured that out but must of changed that name in a different mod i was trying to make...
OOPS

*looks for a facepalm symbol
*gives up and uses emojis
 
so my pc says this has a virus can you fix it please
 
Does anyone know the basic code for a bomb, if so could you show me please?
 
If I install this how can I launch the vanilla? I put the actual game file on my desktop but I can't launch it, an error message keeps popping up.
 
so is it just a glitch cause my antivirus [360 total security] says it has the trojan virus
You can call it a glitch, but "false positive" is a good term to learn, since it conveys the idea that the antivirus isn't broken completely, but just overly sensitive in this particular case.

If I install this how can I launch the vanilla? I put the actual game file on my desktop but I can't launch it, an error message keeps popping up.
Do you know what the error says? If you "put it on your desktop", that doesn't tell me much. Sounds like you are either trying to run the installer from within the zip file, trying to install using the installer but don't have java installed, or trying to just run the .exe from the desktop, all of which won't work. Read the readme.txt.

If you install normally, the "Terraria_v1.3.1.1.exe" in the steam directory is Vanilla. You can double click that, or drag a shortcut to the desktop for starting vanilla. OR, you can do it the other way, with Terraria.exe being vanilla still and installing tmodloader as tmodloader.exe or something similar....and the same process still applies...either double click or make a shortcut.

It won't work. :(

The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

I use the GOG version of Terraria if it helps.
Not many GOG users here, unfortunately, but are you certain you patched a plain 1.3.1.1 Terraria?
 
when I start a Tmodloader server start-tModloaderServer. i'm doing fine on the server, but when my friend joins it he can't do anything, he starts teleporting all over the place, by what he told me, he starts doing everything slowly, it's like he's on the moon, after he jumps and starts falling down, he takes twice as long to get down, than me, he mooves twice as slow, and when he hits a monster the monster teleports behind him, but for me as the host everything is fine, he tried hosting the server but the same thing happened to him, on singleplayer he said he's doing fine, so we I tried hosting a regular terraria srver the non modloader one, and it worked fine for both of us, so idk. could there be a lag issue with your modloader server ?
 
Code:
using System;
using Terraria.ID;
using Terraria.ModLoader;

namespace Items_Extended.Items.Weapons
{
    public class Bronze Eye : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Bronze Eye";
            item.damage = 60;
            item.ranged = true;
            item.width = 44;  
            item.height = 14;
            item.toolTip = "Fires Bronze Coins.";
            item.useTime = 30;
            item.useAnimation = 30;
            item.useStyle = 5; 
            item.noMelee = true;
            item.knockBack = 5.25;
            item.value = 100;
            item.rare = 1;
            item.useSound = 11;
            item.autoReuse = true;
            item.shoot = 10;
            item.shootSpeed = 10f;
            item.useAmmo = ProjectileID.BronzeCoin;
        }
     
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Musket, 1);
            recipe.AddIngredient(ItemID.BronzeBar, 30);
            recipe.AddIngredient(ItemID.BronzeCoin, 1000);  
            recipe.AddIngredient(ItemID.IllegalGunParts, 1);          
            recipe.AddTile(TileID.Furnaces);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
     
        public override void onHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            player.AddBuff(BuffID.Spelunker, 30); 
        }
    }
}
I'm quite new to C# and I've already run into an error in my extremely simple code for a gun. I got an error that says 'error cs1514 { expected ', but I don't see anything wrong with it or any missing {. It appears for every ranged weapon I make. Please help! Thanks.
 
Last edited:
Why can I not get on public servers when this is installed?
Thanks! it really helps a lot. I shall have a look and will try to make a good mod. also, if any other fellow terrarians are stuck, they should visit www.youtube.com and search terraria tmodloader how to make a mod and there is a series for modding like a pro if you are a noob
[doublepost=1467464226,1467464099][/doublepost]UPDATE! IT WASNT JSON FILES IT WAS CS FILES!
 
Code:
using System;
using Terraria.ID;
using Terraria.ModLoader;

namespace Items_Extended.Items.Weapons
{
    public class Bronze Eye : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Bronze Eye";
            item.damage = 60;
            item.ranged = true;
            item.width = 44; 
            item.height = 14;
            item.toolTip = "Fires Bronze Coins.";
            item.useTime = 30;
            item.useAnimation = 30;
            item.useStyle = 5;
            item.noMelee = true;
            item.knockBack = 5.25;
            item.value = 100;
            item.rare = 1;
            item.useSound = 11;
            item.autoReuse = true;
            item.shoot = 10;
            item.shootSpeed = 10f;
            item.useAmmo = ProjectileID.BronzeCoin;
        }
    
        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Musket, 1);
            recipe.AddIngredient(ItemID.BronzeBar, 30);
            recipe.AddIngredient(ItemID.BronzeCoin, 1000); 
            recipe.AddIngredient(ItemID.IllegalGunParts, 1);         
            recipe.AddTile(TileID.Furnaces);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    
        public override void onHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            player.AddBuff(BuffID.Spelunker, 30);
        }
    }
}
I'm quite new to C# and I've already run into an error in my extremely simple code for a gun. I got an error that says 'error cs1514 { expected ', but I don't see anything wrong with it or any missing {. It appears for every ranged weapon I make. Please help! Thanks.
You cannot have spaces in class/namespace names. So instead of using Bronze Eye use BronzeEye. :)
 
Is there a way I can get a weapon to fire a set amount of bullets in quick succession and then have a cooldown time between another burst?
 
Last edited:
Im having the same issue I had before. Whenever I build and reload my mod source it comes out with an error that asks me to place a ) in the center of item.CloneDefaults? This is the code I am using

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace DeceasedExpansion.Items.Weapons
{
public class McCaw : ModItem
{
public override void SetDefaults()
{
item.CloneDefaults(ItemID.434);
item.name = "McCaw";
item.damage = 20;
item.ranged = true;
item.width = 48;
item.height = 28;
item.toolTip = "'Justice ain't gonna dispense itself'";
item.useTime = 20;
item.knockBack = 4;
item.value = 1000000;
item.rare = 1;
item.useSound = 11;
item.autoReuse = false;
item.shoot = 10; //idk why but all the guns in the vanilla source have this
item.shootSpeed = 16f;
item.useAmmo = ProjectileID.Bullet;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(2, 10);
recipe.AddTile(18);
recipe.SetResult(this);
recipe.AddRecipe();
}
 
Im having the same issue I had before. Whenever I build and reload my mod source it comes out with an error that asks me to place a ) in the center of item.CloneDefaults? This is the code I am using

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace DeceasedExpansion.Items.Weapons
{
public class McCaw : ModItem
{
public override void SetDefaults()
{
item.CloneDefaults(ItemID.434);
item.name = "McCaw";
item.damage = 20;
item.ranged = true;
item.width = 48;
item.height = 28;
item.toolTip = "'Justice ain't gonna dispense itself'";
item.useTime = 20;
item.knockBack = 4;
item.value = 1000000;
item.rare = 1;
item.useSound = 11;
item.autoReuse = false;
item.shoot = 10; //idk why but all the guns in the vanilla source have this
item.shootSpeed = 16f;
item.useAmmo = ProjectileID.Bullet;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(2, 10);
recipe.AddTile(18);
recipe.SetResult(this);
recipe.AddRecipe();
}

Use VisualStudio for that. Because you put ItemID. then a ID, else you put ItemID.nameoftheitem or just 434. ^^
 
Use VisualStudio for that. Because you put ItemID. then a ID, else you put ItemID.nameoftheitem or just 434. ^^

I changed that and now the game loads and the gun works, but the idea of cloning the clockwork assault rifle was to try and get the gun to fire in a burst, will I have to add other code to do that?
 
You have just read or not the officiel help for modloader or you troll me? Why clone clockwork assault rifle? Sorry if i am aggressive, but, i answer and you do not read, this is very....

edit:
http://forums.terraria.org/index.php?threads/official-tmodloader-help-thread.28901/page-82

Read Iriazul message, please....

I've got it working now using your code thanks, but there's one issue. If I set the usetime and cooldown to anything other than 20 then the multishot doesn't work at all?

EDIT: Now no usetime or cooldown gets the multishot working?
 
Back
Top Bottom