Standalone [1.3] tModLoader - A Modding API

when i try to host a server for me and my friends it starts loading liquids and at around 50% it says load failed no backup found
 
c:\Users\Amir\Documents\My Games\Terraria\ModLoader\Mod Sources\NicksMod\Npcs\NpcDrops.cs(23,14) : error CS1513: } expected
anyone know why i got 3 of these exact same errors?
the code is here but i dont see any errors
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace NicksMod.NPCs
{
    public class NpcDrops : GlobalNPC
    {
        public override void NPCLoot(NPC npc)
        {


          

            if (npc.type == NPCID.Zombie)
            {
                if (Main.rand.Next(4) == 0)
                {
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ZombieFlesh"), 1);
                    }
                }
            }
 
c:\Users\Amir\Documents\My Games\Terraria\ModLoader\Mod Sources\NicksMod\Npcs\NpcDrops.cs(23,14) : error CS1513: } expected
anyone know why i got 3 of these exact same errors?
the code is here but i dont see any errors
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace NicksMod.NPCs
{
    public class NpcDrops : GlobalNPC
    {
        public override void NPCLoot(NPC npc)
        {


         

            if (npc.type == NPCID.Zombie)
            {
                if (Main.rand.Next(4) == 0)
                {
                    {
                        Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("ZombieFlesh"), 1);
                    }
                }
            }
oDfE6d6.png
 
I've been trying to create a mod, and I keep getting this error message:

error CS1704: An assembly with the same simple name 'Steamworks.NET, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.


I tried deleting the file, since I have seen it as a fix, but I get a second message saying:

error CS0006: Metadata file 'C:\Program Files (x86)\Steam\SteamApps\common\Terraria\Steamworks.NET.dll' could not be found


Anyone know a way to fix this?
 
Can someone help me with this?
Mods aren't a problem. Everytime I place blocks or I craft something I can't use my inventory.

There's a hotfix for this in even more modifiers thread https://forums.terraria.org/index.php?threads/even-more-modifiers.45790/page-11#post-1254427
[doublepost=1489890488,1489890239][/doublepost]
I've been trying to create a mod, and I keep getting this error message:

error CS1704: An assembly with the same simple name 'Steamworks.NET, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null has already been imported. Try removing one of the references or sign them to enable side-by-side.


I tried deleting the file, since I have seen it as a fix, but I get a second message saying:

error CS0006: Metadata file 'C:\Program Files (x86)\Steam\SteamApps\common\Terraria\Steamworks.NET.dll' could not be found


Anyone know a way to fix this?

I'm going to assume that you're using visual studio 2015. IF you look in the solution explorer there's a references section. Expand that and it should look something like this

upload_2017-3-19_13-19-13.png



From the error message it looks like something is in there twice, get rid of the duplicate.

Did you generate your project using the mod skeleton generator (link in OP)? It makes this process a lot easier.
 
There's a hotfix for this in even more modifiers thread https://forums.terraria.org/index.php?threads/even-more-modifiers.45790/page-11#post-1254427
[doublepost=1489890488,1489890239][/doublepost]

I'm going to assume that you're using visual studio 2015. IF you look in the solution explorer there's a references section. Expand that and it should look something like this

View attachment 163140


From the error message it looks like something is in there twice, get rid of the duplicate.

Did you generate your project using the mod skeleton generator (link in OP)? It makes this process a lot easier.
I am just using notepad to edit the code, and I even tried to use the example mod to test it, yet it still gives me the same error message.
 
I am just using notepad to edit the code, and I even tried to use the example mod to test it, yet it still gives me the same error message.

For example mod are you getting CS0006 or the original CS1704 message? I suspect you'll continue to get CS0006 until you restore your steamworks.DLL as it's part of the game. You can probably do this by running "verify integrity of game files" on terraria (as per https://support.steampowered.com/kb_article.php?ref=2037-QEUH-3335)
 
For example mod are you getting CS0006 or the original CS1704 message? I suspect you'll continue to get CS0006 until you restore your steamworks.DLL as it's part of the game. You can probably do this by running "verify integrity of game files" on terraria (as per https://support.steampowered.com/kb_article.php?ref=2037-QEUH-3335)
I'm still getting CS1704, since I re-installed the steamworks thing. I have absolutely no idea what's wrong. Probably something simple that I missed, since I'm VERY new to modding :p
 
I'm still getting CS1704, since I re-installed the steamworks thing. I have absolutely no idea what's wrong. Probably something simple that I missed, since I'm VERY new to modding :p
Ah. I'm at the limit of my expertise on the matter. All I know is I used the instructions from https://forums.terraria.org/index.php?threads/how-to-set-up-your-mod-using-visual-studio-mvs.26476/ ("THIS IS THE FASTEST WAY" section) and it seemed to work for me. Obviously if you're not using VS then you can skip the "open the .csproj file in visual studio" step.
 
My terraira tmodloader wont let me drink a potion,as when i use it, it thinks i still have it and i cant change items, but in normal terraria it works, does anyone have a solution?
[doublepost=1489931131,1489931014][/doublepost]
My terraira tmodloader wont let me drink a potion,as when i use it, it thinks i still have it and i cant change items, but in normal terraria it works, does anyone have a solution?
BTW I have tmodloader 0.9.2.1
 
So, i tried making my first mod, but i get an error about my item (an accessory).
I have never modded before so i watched a video guide and this is my code:

using Terraria.ID;
using Terraria.ModLoader;

namespace MyMod.Items
{
public class Powercrystal : ModItem
{
public override void SetDefaults()
{
item.name = "Powercrystal";
item.width = 10;
item.height = 14;
item.toolTip = "dmg accessory";
item.value = 1;
item.rare = 2;
item.accessory = true;
}

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

public override void UpdateAccessory(Player player, bool hideVisual)
{

player.meleeDamage += 0.50f;
player.rangedDamage += 0.50f;
player.minionDamage += 0.50f;
player.magicDamage += 1.50f;
}
}
}

When trying to build the mod, i get an error like this : "error CS0246 The type or namespacename "Player" could not be found. (Is there a "Using-directive or Assemblyreference missing?)"

NOTE: I got the error in german, so i had to do some translating - in case the error sounds a little weird.

Can anyone tell me what to change about my code for it to work?
 
So, i tried making my first mod, but i get an error about my item (an accessory).
I have never modded before so i watched a video guide and this is my code:

using Terraria.ID;
using Terraria.ModLoader;

namespace MyMod.Items
{
public class Powercrystal : ModItem
{
public override void SetDefaults()
{
item.name = "Powercrystal";
item.width = 10;
item.height = 14;
item.toolTip = "dmg accessory";
item.value = 1;
item.rare = 2;
item.accessory = true;
}

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

public override void UpdateAccessory(Player player, bool hideVisual)
{

player.meleeDamage += 0.50f;
player.rangedDamage += 0.50f;
player.minionDamage += 0.50f;
player.magicDamage += 1.50f;
}
}
}

When trying to build the mod, i get an error like this : "error CS0246 The type or namespacename "Player" could not be found. (Is there a "Using-directive or Assemblyreference missing?)"

NOTE: I got the error in german, so i had to do some translating - in case the error sounds a little weird.

Can anyone tell me what to change about my code for it to work?
you need to have:
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
before everything else
 
try notepad +++ if you like using notepad software , it´s way better than normal notepad especially with things like this
I don't know if it is problem with my notepad version, since it doesn't work if I try and use the example mod. I think it is either a problem with MY tModLoader installation or with my Terraria installation or version or something, but I have no idea how to fix either.
 
Sorry to bother again, but i have another error problem. This time i wanted to make a modded bar.

Code for the Block
using Terraria;
using Terraria.ID;
using Terraria.DataStructures;
using Terraria.ModLoader;

namespace MyMod.Items.Placeable
{
public class Custombar : ModItem
{
public override void SetDefaults()
{
item.name = "Custombar";
item.width = 12;
item.height = 12;
item.maxStack = 999;
AddTooltip("A custom Bar");
item.useTurn = true;
item.autoReuse = true;
item.useAnimation = 15;
item.useTime = 10;
item.useStyle = 1;
item.consumable = true;
item.createTile = mod.TileType("Custombartile");
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Wood, 10);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}

Code for the Tile
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;

namespace MyMod.Tiles
{
public class Custombartile : ModTile
{
public override void SetDefaults()
{
Main.tileSolid[Type] = true;
Main.tileMergeDirt[Type] = true;
Main.tileBlockLight[Type] = true;
Main.tileLighted[Type] = true;
drop = mod.ItemType("Custombar");
AddMapEntry(new Color(200, 200, 200));
}

public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
{
r = 0.5f;
g = 0.5f;
b = 0.5f;
}
}
}

Error:

Items/Placeable/Custombar
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)

I tripple checked that the PNG and CS files have the same name.
This is always a namespace vs folder structure error, read: http://forums.terraria.org/index.ph...der-a-modding-api.23726/page-679#post-1122935
 
so it says in the error

at Terraria.ModLoader.Mod
and
at Terraria.ModLoader.ModLoader

so are those files that should be in the ModLoader file in the Terraria one or no?

If not, can you make the instructions clearer?
 
so it says in the error

at Terraria.ModLoader.Mod
and
at Terraria.ModLoader.ModLoader

so are those files that should be in the ModLoader file in the Terraria one or no?

If not, can you make the instructions clearer?
You'll have to post the error, you've removed the most important part.

Also, when do your see that error?
 
Back
Top Bottom