Standalone [1.3] tModLoader - A Modding API

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?
 
You do not really read? All is explain....or like i have already say: Read iriazul message, he explain all.

You can change without problem, this is write.... just when you change, you need change other thing.

He have write that: How you have cannot read that? x)
Just so you know, that can be done easier:
Code:
item.useTime = 5;
item.useAnimation = 20;
// So 20 / 5 = 4 = will shoot 4 times in 20 ticks.
item.reuseDelay = 20; // Will take 20 ticks after the animation has ended to be reused.
 
You do not really read? All is explain....or like i have already say: Read iriazul message, he explain all.

You can change without problem, this is write.... just when you change, you need change other thing.

He have write that: How you have cannot read that? x)

My bad! I've been such an idiot with all this advice but I've finally got it working thanks!
 
Im having trouble uploading some mods and when i run them through Terraria i get this error in the log for both of them

error CS1703: An assembly with the same identity 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' has already been imported. Try removing one of the duplicate references.

error CS1704: An assembly with the same simple name 'MP3Sharp, Version=1.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 don't understand what they mean by duplicate references, the only two references I used for both of them are Microsoft.XNA.Framework and Terraria.exe and they're both separate projects.

One of the mods I tried to re-upload worked perfectly on the previous version of TmodLoader, plz halp
[doublepost=1467490249,1467489945][/doublepost]And in MVS this is one of the warnings i get:

Severity Code Description Project File Line Suppression State
Warning There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

There are three more of these the only difference is that two of them are about Terraria.exe
 
Im having trouble uploading some mods and when i run them through Terraria i get this error in the log for both of them

error CS1703: An assembly with the same identity 'Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' has already been imported. Try removing one of the duplicate references.

error CS1704: An assembly with the same simple name 'MP3Sharp, Version=1.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 don't understand what they mean by duplicate references, the only two references I used for both of them are Microsoft.XNA.Framework and Terraria.exe and they're both separate projects.

One of the mods I tried to re-upload worked perfectly on the previous version of TmodLoader, plz halp
[doublepost=1467490249,1467489945][/doublepost]And in MVS this is one of the warnings i get:

Severity Code Description Project File Line Suppression State
Warning There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

There are three more of these the only difference is that two of them are about Terraria.exe
In your Terraria's Steam folder, there should be two files corresponding to those errors (Newtonsoft.Json.dll and MP3Sharp.dll, or something similar). Delete those two files.

The mismatch error you can ignore, but if you want to fix it, follow these steps:
  1. Click the drop down box under Tools (I assume it says x64) and click on Configuration Manager.
  2. Click the Active Solution Platform drop down menu and click New.
  3. Change Any CPU to x86 (or x64 if the drop down box originally said x86) and press OK.
  4. Then change the Platform of your project to x86 (or whatever the new one was).
Might have gotten this the wrong way round, but this should fix it.
 
can u plz hurry and update it to v1.3.1.1
[doublepost=1467491852,1467491635][/doublepost]i already got the files and then it was the wrong version so it was a waste so hurry up plz
 
In your Terraria's Steam folder, there should be two files corresponding to those errors (Newtonsoft.Json.dll and MP3Sharp.dll, or something similar). Delete those two files.

The mismatch error you can ignore, but if you want to fix it, follow these steps:
  1. Click the drop down box under Tools (I assume it says x64) and click on Configuration Manager.
  2. Click the Active Solution Platform drop down menu and click New.
  3. Change Any CPU to x86 (or x64 if the drop down box originally said x86) and press OK.
  4. Then change the Platform of your project to x86 (or whatever the new one was).
Might have gotten this the wrong way round, but this should fix it.
Thank you, it works now
 
I know this is completely off topic but I recently got the title "Skeletron Prime" but I don' know to apply it so everyone can see it. Does anyone know I can enable that?
 
Does this work on linux servers yet? Running one and would love to play it with my friends. Searching the thread gives mix results.
 
Can you show us your folder structure?
2.jpg


Edit: Probably missing something right?
(Also inside of the Items folder is the item file and it's image)
 
Im having a problem.. ( Mac User) I did everthing to install Tmodloader but when i load up terraria, its the same...

EDIT: I think i found out why...
EDIT 2: YES!!!! IT WORKS!!!
 
Last edited:
Back
Top Bottom