Standalone [1.3] tModLoader - A Modding API

Okay I want to import my characters into the modded game but I don't know how and the methods I looked up are either outdated (I tried coping the contents of the respective folders, and when that failed I move the character files and...wait.)

By any chance does the API not have compatibility with cloud saves?
 
And the error is....?

Go to the Mod directory and either delete .tmod files or edit .enabled files to read false: My Games\Terraria\ModLoader\Mods

Delete that line.


Who are you talking to? If you are having trouble with broken mods, delete them: My Games\Terraria\ModLoader\Mods

I'm not sure what you mean by "it's not returning any female values"
[doublepost=1481838496,1481838449][/doublepost]
The old tModLoader downloads work for me.
---------------------------
Terraria: Error
---------------------------
System.MissingFieldException: Field not found: 'Terraria.Main.rand'.

at FastStart.FastStartPlayer.SetupStartInventory(IList`1 items)

at Terraria.ModLoader.PlayerHooks.SetupStartInventory(Player player)

at Terraria.Player..ctor(Boolean startupInventory)

at Terraria.Player.LoadPlayer(String playerPath, Boolean cloudSave)

at Terraria.Player.GetFileData(String file, Boolean cloudSave)

at Terraria.Main.LoadPlayers()

at Terraria.GameContent.UI.States.UICharacterSelect.OnActivate()

at Terraria.UI.UIElement.Activate()

at Terraria.UI.UserInterface.SetState(UIState state)

at Terraria.Main.DrawMenu(GameTime gameTime)

at Terraria.Main.do_Draw(GameTime gameTime)

at Terraria.Main.DoDraw(GameTime gameTime)

at Terraria.Main.Draw(GameTime gameTime)

at Microsoft.Xna.Framework.Game.DrawFrame()

at Microsoft.Xna.Framework.Game.Tick()

at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)

at Microsoft.Xna.Framework.GameHost.OnIdle()

at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()

at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)

at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)

at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

at System.Windows.Forms.Application.Run(Form mainForm)

at Microsoft.Xna.Framework.WindowsGameHost.Run()

at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)

at Terraria.Program.LaunchGame(String[] args)
---------------------------
OK
---------------------------
 
at FastStart.FastStartPlayer.SetupStartInventory(IList`1 items)
Delete this mod: My Games\Terraria\ModLoader\Mods
Every time I launch terraria with the latest tmodloader it keeps giving me an error. It begins with System.MissingFieldException: Field: not found: 'Terraria.Main.rand'.
Delete outdated .tmod mods:My Games\Terraria\ModLoader\Mods

Okay I want to import my characters into the modded game but I don't know how and the methods I looked up are either outdated (I tried coping the contents of the respective folders, and when that failed I move the character files and...wait.)

By any chance does the API not have compatibility with cloud saves?
I'm pretty sure they are stored on a different folder on the cloud, so you'll need to take them off, then copy them from the vanilla save folder to the tmodloader save folder.
 
I'm pretty sure they are stored on a different folder on the cloud, so you'll need to take them off, then copy them from the vanilla save folder to the tmodloader save folder.

I figured as much, which is why I went back to the vanilla launcher and took both characters off the cloud. Thanks
 
I am currently getting this error when trying to launch the game


15/12/2016 20:47:36
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: c. Path '', line 1, position 1.
ved Newtonsoft.Json.JsonTextReader.ParseValue()
ved Newtonsoft.Json.JsonTextReader.ReadInternal()
ved Newtonsoft.Json.JsonTextReader.Read()
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
ved Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
ved Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
ved Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
ved Terraria.IO.FavoritesFile.Load()
ved Terraria.Main.Initialize()
ved Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
ved Terraria.Program.LaunchGame(String[] args)


as i know nothing fo coding, any help would be great.
 
Hey, I've found a bug with candelabras, in which when placing one, it places another one as well? Here is the order it seems to go in when placing the living wood one from left to right:
Capture 2016-12-15 16_29_50.png
It stops at the mushroom one.
 
Literally, the first post I have ever made on this forum. But, "The Mod Browser server is under heavy load. Try again later"? Any ideas? An issue on my end or?
 
hello, if you guys see this comment, is there something wrong with my tmodloader install? or is this normal, when i try to install a mod with the mod browser it says something like cant download heavy load, i was curious if something was wrong or not :p
 
I am currently getting this error when trying to launch the game


15/12/2016 20:47:36
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: c. Path '', line 1, position 1.
ved Newtonsoft.Json.JsonTextReader.ParseValue()
ved Newtonsoft.Json.JsonTextReader.ReadInternal()
ved Newtonsoft.Json.JsonTextReader.Read()
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
ved Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
ved Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
ved Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
ved Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
ved Terraria.IO.FavoritesFile.Load()
ved Terraria.Main.Initialize()
ved Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
ved Terraria.Program.LaunchGame(String[] args)


as i know nothing fo coding, any help would be great.
Looks like "Documents\My Games\Terraria\ModLoader\favorites.json" is messed up, not sure why, but you can delete it.
[doublepost=1481848728,1481848571][/doublepost]
It's not using female armour. The male armour is showing on my female character
It's gotta be some misspelling somewhere. ExampleMod's armor works, so it should work if you follow the example.
 
Does anyone know how to fix how my character magic damage percentage is in the negatives? i cant use most magic damaging items and it really bothers me, here a list of all the mods i use,
"AlchamistNPC","BetterPotions","BlousterMod","BonusSwordsMod","BossHealthBars",
"BouncyCoins","CakeMod","CalamityMod","CraftableUncraftablesMod",
"CrystiliumMod","DBZMOD","DogeMod","ElementalWeaponEnhancements",
"EndlessPouchesPlus","EnemyMods","Fargowiltas","GmodTowerWeps","GoldensMisc",
"Greatswords","HeartCrystal","Itemtronics","JMRjMelee","Loot","Malisterria",
"MaxStackPlus","ModularWeaponry","MoreGear","MoreGunsMod","MoreMountsMod",
"NormalGelForMolotov","OmegaMod","OmniSwing","PillarItemsPlus",
"PokemonVanity","PotionMOD","Pumpking","RapidMod","RecipeBrowser",
"ReducedGrinding","RespawnMod","Rockos ARPG","RupeeCoinSound","SacredTools",
"Schwifty","Shrooms","SimpleAutoChests","SniperLongbows","SuperScythesMod",
"TArmory","TerraCompilation","Terralands","TerraWingsMod","TheLuggage",
"the_ancient_mod","ThoriumMod","TrueEater","UniverseOfSwordsMod","Varion",
"WingSlot","WMITF"
 
Hey guys, I made a modded bullet but for some reason when I shoot it from my modded gun, it does not appear and does not deal any damage. Yet it still consumes ammo. This is my projectile code:
Code:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace TheDankMod.Projectiles
{
    public class TheLazerShot : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.name = "The Lazor Shot";
            projectile.width = 8;
            projectile.height = 8;
            projectile.aiStyle = 1;
            projectile.friendly = true;
            projectile.ranged = true;
            projectile.penetrate = 1;
            projectile.timeLeft = 600;
            projectile.alpha = 255;
            projectile.light = 0.5f;
            projectile.extraUpdates = 1;
            ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
            ProjectileID.Sets.TrailingMode[projectile.type] = 0;
            projectile.aiStyle = 75;
            projectile.hide = true;

        }

        public override bool OnTileCollide(Vector2 oldVelocity)
        {
            projectile.penetrate--;
            if (projectile.penetrate <= 0)
            {
                projectile.Kill();
            }
            else
            {
                if (projectile.velocity.X != oldVelocity.X)
                {
                    projectile.velocity.X = -oldVelocity.X;
                }
                if (projectile.velocity.Y != oldVelocity.Y)
                {
                    projectile.velocity.Y = -oldVelocity.Y;
                }
                Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
            }
            return false;
        }

        public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            Vector2 drawOrigin = new Vector2(Main.projectileTexture[projectile.type].Width * 0.5f, projectile.height * 0.5f);
            for (int k = 0; k < projectile.oldPos.Length; k++)
            {
                Vector2 drawPos = projectile.oldPos[k] - Main.screenPosition + drawOrigin + new Vector2(0f, projectile.gfxOffY);
                Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - k) / (float)projectile.oldPos.Length);
                spriteBatch.Draw(Main.projectileTexture[projectile.type], drawPos, null, color, projectile.rotation, drawOrigin, projectile.scale, SpriteEffects.None, 0f);
            }
            return true;
        }
    }
}

This is my gun's code :
Code:
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace TheDankMod.Items.Weapons
{
    public class TheLazorShot : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "The Lazor Shot";
            item.damage = 20;
            item.ranged = true;
            item.width = 80;
            item.height = 60;
            item.toolTip = "'IMMA FIRIN' MAH LAZAHHHHH'";
            item.useTime = 20;
            item.useAnimation = 20;
            item.useStyle = 5;
            item.noMelee = true; //so the item's animation doesn't do damage
            item.knockBack = 4;
            item.value = 10000;
            item.rare = 2;
            item.UseSound = SoundID.Item11;
            item.autoReuse = true;
            item.shoot = 10; //idk why but all the guns in the vanilla source have this
            item.shootSpeed = 16f;
            item.useAmmo = AmmoID.Bullet;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.DirtBlock, 1);
            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)
        {
            if (type == ProjectileID.Bullet) // or ProjectileID.WoodenArrowFriendly
            {
                type = mod.ProjectileType("The Lazer Shot"); // or ProjectileID.FireArrow;
            }
            return true; // return true to allow tmodloader to call Projectile.NewProjectile as normal
        }

        // What if I wanted this gun to have a 38% chance not to consume ammo?
        /*public override bool ConsumeAmmo(Player player)
        {
            return Main.rand.NextFloat() > .38f;
        }*/

        // What if I wanted it to work like Uzi, replacing regular bullets with High Velocity Bullets?
        // Uzi/Molten Fury style: Replace normal Bullets with Highvelocity
        /*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            if (type == ProjectileID.Bullet) // or ProjectileID.WoodenArrowFriendly
            {
                type = ProjectileID.BulletHighVelocity; // or ProjectileID.FireArrow;
            }
            return true; // return true to allow tmodloader to call Projectile.NewProjectile as normal
        }*/

        // What if I wanted it to shoot like a shotgun?
        // Shotgun style: Multiple Projectiles, Random spread
        /*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            int numberProjectiles = 4 + Main.rand.Next(2); // 4 or 5 shots
            for (int i = 0; i < numberProjectiles; i++)
            {
                Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(30)); // 30 degree spread.
                Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI);
            }
            return false; // return false because we don't want tmodloader to shoot projectile
        }*/

        // What if I wanted an inaccurate gun? (Chain Gun)
        // Inaccurate Gun style: Single Projectile, Random spread
        /*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(30));
            speedX = perturbedSpeed.X;
            speedY = perturbedSpeed.Y;
            return true;
        }*/

        // What if I wanted multiple projectiles in a even spread? (Vampire Knives)
        // Even Arc style: Multiple Projectile, Even Spread
        /*public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            float numberProjectiles = 3 + Main.rand.Next(3); // 3, 4, or 5 shots
            float rotation = MathHelper.ToRadians(45);
            position += Vector2.Normalize(new Vector2(speedX, speedY)) * 45f;
            for (int i = 0; i < numberProjectiles; i++)
            {
                Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numberProjectiles - 1))) * .2f; // Watch out for dividing by 0 if there is only 1 projectile.
                Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI);
            }
            return false;
        }*/

        // Help, my gun isn't being held at the handle! Adjust these 2 numbers until it looks right.
        /*public override Vector2? HoldoutOffset()
        {
            return new Vector2(10, 0);
        }*/
    }
}
 
what does this mean (sorry for asking lots of questions)
error CS0029: Cannot implicitly convert type 'int' to 'Terraria.Audio.LegacySoundStyle'
Heres my code if needed like always
using Terraria;
using System;
using Terraria.ID;
using System.Diagnostics;
using Microsoft.Xna.Framework;
using Terraria.ModLoader;

namespace NicksMod.Items
{
public class RawFossilQuickBow : ModItem
{

public override void SetDefaults()
{
item.name = "Raw Fossil Quick Bow";
item.damage = 16;
item.noMelee = true;
item.ranged = true;
item.width = 30;
item.height = 42;
item.toolTip = "Dont Touch The Mouth At The Front";
item.useTime = 24;
item.useAnimation = 26;
item.useStyle = 5;
item.shoot = 3;
item.useAmmo = 1;
item.knockBack = 1;
item.value = 1000;
item.rare = 7;
item.UseSound = 5;
item.autoReuse = true;
item.shootSpeed = 12f;

}


public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(169, 30);
recipe.AddIngredient(3347, 100);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
 
what does this mean (sorry for asking lots of questions)
error CS0029: Cannot implicitly convert type 'int' to 'Terraria.Audio.LegacySoundStyle'
Heres my code if needed like always
using Terraria;
using System;
using Terraria.ID;
using System.Diagnostics;
using Microsoft.Xna.Framework;
using Terraria.ModLoader;

namespace NicksMod.Items
{
public class RawFossilQuickBow : ModItem
{

public override void SetDefaults()
{
item.name = "Raw Fossil Quick Bow";
item.damage = 16;
item.noMelee = true;
item.ranged = true;
item.width = 30;
item.height = 42;
item.toolTip = "Dont Touch The Mouth At The Front";
item.useTime = 24;
item.useAnimation = 26;
item.useStyle = 5;
item.shoot = 3;
item.useAmmo = 1;
item.knockBack = 1;
item.value = 1000;
item.rare = 7;
item.UseSound = 5;
item.autoReuse = true;
item.shootSpeed = 12f;

}


public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(169, 30);
recipe.AddIngredient(3347, 100);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
It should be, item.UseSound = SoundID.Item11;
 
You could make a new folder and put your outdated mods in it.
but then I would need to re-download them anyway. And since i use so many it takes a long time and would be a hassle, while if i were to just launch tmodloader without mods automatic loading, i could go update them in the mod browser to they're newest version (which would stop the crashing).
 
Back
Top Bottom