Standalone [1.3] tModLoader - A Modding API

Is there a way to manually uninstall TMODloader mods? WeaponOut is causing a problem that whenever I launch, it starts checking my mods, and then crashes. The error message -if I can fit it fully- is
System.MissingFieldException: Field not found: 'Terraria.Main.rand'.
at WeaponOut.WeaponOut.ModifyTransformMatrix(Matrix Transform)
at Terraria.ModLoader.ModHooks.ModifyTransformMatrix(Matrix Transform)
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)


It'd be truly nice (sorry for the double post) for input on this. :/
I wanna play tmodloader terraria but I cannot.
 
It'd be truly nice (sorry for the double post) for input on this. :/
I wanna play tmodloader terraria but I cannot.

To manually remove a mod, close terraria, go to your equivalent of 'C:\Users\<your user name>\Documents\My Games\Terraria\ModLoader\Mods' and deleted the mod and its .enabled file, and then restart your terraria.
 
ModBrowser seems nice and all, but you should always know how to Install/uninstall Mods Manually.
i thought the Modlist would have a Button that gets you into the Mod Folder.
kinda like Minecraft does with RPs.
 
Hi there, new to Tmodloader, I was trying to make a server and having followed the instructions found online, it told us to go to the TmodloaderServer file and to start a server there, however whenever we tried to create a world it would pause at 38% and stop, and when we tried to use a freshly made one in singleplayer, it had the error 'Failed to Load, no backup'. Would someone mind explaining what I should be doing or is this a bug? I currently have 4 mods installed, Pumpking, Tremor, Thorium & reduced Grinding if that makes a difference.
 
Hi there. Regarding tmodloader - I've been running into a problem mentioned a few times before but never really answered - crafting/inventory fps lag. Vanilla Terraria runs flawless. To quote another user with the exact same issues:

"Ok the odd lag problem I have figured some things out about it. If I open my inventory near a crafting station, then close my inventory when I am still in range of it, it will lag. I can fix this lag by going away from this crafting station then opening my inventory then closing it. This is really weird. It is not the npcs causing this."

I am able to reproduce that problem 100%. If I walk away from my crafting areas, then open and close my inventory, I jump right back to 60fps. Any ideas?
 
Hi there. Regarding tmodloader - I've been running into a problem mentioned a few times before but never really answered - crafting/inventory fps lag. Vanilla Terraria runs flawless. To quote another user with the exact same issues:

"Ok the odd lag problem I have figured some things out about it. If I open my inventory near a crafting station, then close my inventory when I am still in range of it, it will lag. I can fix this lag by going away from this crafting station then opening my inventory then closing it. This is really weird. It is not the npcs causing this."

I am able to reproduce that problem 100%. If I walk away from my crafting areas, then open and close my inventory, I jump right back to 60fps. Any ideas?
Non of the devs have experienced this yet...so either it's a mod people are using or our computers are decent enough that it never affects us.
 
i need help with this code.. im trying to make a biome but i keep getting this irritating Error.
Code:
using System.IO;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.World.Generation;
using Microsoft.Xna.Framework;
using Terraria.GameContent.Generation;
using System.Linq;


namespace Trelamium
{
    public class TrelamiumWorld : ModWorld
    {   public static int TRealm = 0;
        public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
        {
           {//add this under public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
            for (int k = 0; k < 750; k++)                     //750 is the ore spawn rate. the bigger is the number = more ore spawns
            {
                int Xo = X + Main.rand.Next(-240, 240);
                int Yo = Y + Main.rand.Next(-240, 240);
                if (Main.tile[Xo, Yo].type == mod.TileType("TrelamiumOreTile"))   //this is the tile where the ore will spawn
                {

                    {
                        WorldGen.TileRunner(Xo, Yo, (double)WorldGen.genRand.Next(5, 10), WorldGen.genRand.Next(5, 10), mod.TileType("TrelamiumOreTile"), false, 0f, 0f, false, true);  //   5, 10 is how big is the ore veins.    mod.TileType("CustomOreTile") is the custom ore tile,  if u want a vanila ore just do this: TileID.Cobalt, for cobalt spawn
                    }
                }
            }
        }
            int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
            if (ShiniesIndex == -1)
            {
                return;
            }
            tasks.Insert(ShiniesIndex + 1, new PassLegacy("Generating Shrooms", delegate (GenerationProgress progress)
            {
                progress.Message = "Generating Shrooms!";
                                                                                                                                                                                                                                         //Put your custom tile block name
                for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++)                                                                                                                                      //      |
                {                                                                                                                                                                                                                      //       |
                    WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, Main.maxTilesY), (double)WorldGen.genRand.Next(10, 20), WorldGen.genRand.Next(10, 20), mod.TileType("ShroomtoniumOreTile"), false, 0f, 0f, false, true);
                }
            }));
        }
    }
}




Error.PNG
 
i need help with this code.. im trying to make a biome but i keep getting this irritating Error.
Code:
using System.IO;
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.World.Generation;
using Microsoft.Xna.Framework;
using Terraria.GameContent.Generation;
using System.Linq;


namespace Trelamium
{
    public class TrelamiumWorld : ModWorld
    {   public static int TRealm = 0;
        public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
        {
           {//add this under public override void ModifyWorldGenTasks(List<GenPass> tasks, ref float totalWeight)
            for (int k = 0; k < 750; k++)                     //750 is the ore spawn rate. the bigger is the number = more ore spawns
            {
                int Xo = X + Main.rand.Next(-240, 240);
                int Yo = Y + Main.rand.Next(-240, 240);
                if (Main.tile[Xo, Yo].type == mod.TileType("TrelamiumOreTile"))   //this is the tile where the ore will spawn
                {

                    {
                        WorldGen.TileRunner(Xo, Yo, (double)WorldGen.genRand.Next(5, 10), WorldGen.genRand.Next(5, 10), mod.TileType("TrelamiumOreTile"), false, 0f, 0f, false, true);  //   5, 10 is how big is the ore veins.    mod.TileType("CustomOreTile") is the custom ore tile,  if u want a vanila ore just do this: TileID.Cobalt, for cobalt spawn
                    }
                }
            }
        }
            int ShiniesIndex = tasks.FindIndex(genpass => genpass.Name.Equals("Shinies"));
            if (ShiniesIndex == -1)
            {
                return;
            }
            tasks.Insert(ShiniesIndex + 1, new PassLegacy("Generating Shrooms", delegate (GenerationProgress progress)
            {
                progress.Message = "Generating Shrooms!";
                                                                                                                                                                                                                                         //Put your custom tile block name
                for (int k = 0; k < (int)((double)(Main.maxTilesX * Main.maxTilesY) * 6E-05); k++)                                                                                                                                      //      |
                {                                                                                                                                                                                                                      //       |
                    WorldGen.TileRunner(WorldGen.genRand.Next(0, Main.maxTilesX), WorldGen.genRand.Next((int)WorldGen.worldSurfaceLow, Main.maxTilesY), (double)WorldGen.genRand.Next(10, 20), WorldGen.genRand.Next(10, 20), mod.TileType("ShroomtoniumOreTile"), false, 0f, 0f, false, true);
                }
            }));
        }
    }
}




View attachment 161958
Well, X doesn't exist there:
 

Attachments

  • upload_2017-3-6_19-57-47.png
    upload_2017-3-6_19-57-47.png
    32.8 KB · Views: 204
DEVELOPERS HELP ME!!
3/7/2017 12:12:39 PM
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Terraria.ModLoader.ItemLoader.GetItemInfo(Item item, Mod mod, String name)
at Terraria.Item.GetModInfo(Mod mod, String name)
at Terraria.Item.GetModInfo[T](Mod mod)
at starterweapons.starterweaponsGlobalItem.GetAlpha(Item item, Color lightColor)
at Terraria.ModLoader.ItemLoader.GetAlpha(Item item, Color lightColor)
at Terraria.Item.GetAlpha(Color newColor)
at GRealm.MPlayer.GetItemColor(Player drawPlayer, Vector2 position) in c:\Users\Owner\Documents\My Games\Terraria\ModLoader\Mod Sources\GRealm\MPlayer.cs:line 851
at GRealm.MPlayer.<.ctor>b__7(PlayerDrawInfo edi) in c:\Users\Owner\Documents\My Games\Terraria\ModLoader\Mod Sources\GRealm\MPlayer.cs:line 858
at Terraria.ModLoader.DrawLayer`1.Draw(InfoType& drawInfo)
at Terraria.Main.DrawPlayer(Player drawPlayer, Vector2 Position, Single rotation, Vector2 rotationOrigin, Single shadow)
at Terraria.GameContent.UI.Elements.UICharacter.DrawSelf(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.GameContent.UI.Elements.UIList.UIInnerList.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.GameContent.UI.States.UICharacterSelect.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UserInterface.Draw(SpriteBatch spriteBatch, GameTime time)
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)
reply pls
 
Last edited:
is this correct way to make a yoyo projectile Shoot A Vanilla projectile? similar to the terrararian yoyo? if its not can someone tell me what i need to fix?
Code:
        }
        public override void AI()
        {
            if (Main.rand.Next(2) == 0)
            {
                Projectile.NewProjectile(projectile.position + projectile.velocity, projectile.width, projectile.height, ProjectileID.CursedFlameFriendly, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
            }
        }


    }
}
 
is this correct way to make a yoyo projectile Shoot A Vanilla projectile? similar to the terrararian yoyo? if its not can someone tell me what i need to fix?
Code:
        }
        public override void AI()
        {
            if (Main.rand.Next(2) == 0)
            {
                Projectile.NewProjectile(projectile.position + projectile.velocity, projectile.width, projectile.height, ProjectileID.CursedFlameFriendly, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
            }
        }


    }
}
Putting a NewProjectile call in the AI hook should work fine
DEVELOPERS HELP ME!!
3/7/2017 12:12:39 PM
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Terraria.ModLoader.ItemLoader.GetItemInfo(Item item, Mod mod, String name)
at Terraria.Item.GetModInfo(Mod mod, String name)
at Terraria.Item.GetModInfo[T](Mod mod)
at starterweapons.starterweaponsGlobalItem.GetAlpha(Item item, Color lightColor)
at Terraria.ModLoader.ItemLoader.GetAlpha(Item item, Color lightColor)
at Terraria.Item.GetAlpha(Color newColor)
at GRealm.MPlayer.GetItemColor(Player drawPlayer, Vector2 position) in c:\Users\Owner\Documents\My Games\Terraria\ModLoader\Mod Sources\GRealm\MPlayer.cs:line 851
at GRealm.MPlayer.<.ctor>b__7(PlayerDrawInfo edi) in c:\Users\Owner\Documents\My Games\Terraria\ModLoader\Mod Sources\GRealm\MPlayer.cs:line 858
at Terraria.ModLoader.DrawLayer`1.Draw(InfoType& drawInfo)
at Terraria.Main.DrawPlayer(Player drawPlayer, Vector2 Position, Single rotation, Vector2 rotationOrigin, Single shadow)
at Terraria.GameContent.UI.Elements.UICharacter.DrawSelf(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.GameContent.UI.Elements.UIList.UIInnerList.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.DrawChildren(SpriteBatch spriteBatch)
at Terraria.UI.UIElement.Draw(SpriteBatch spriteBatch)
at Terraria.GameContent.UI.States.UICharacterSelect.Draw(SpriteBatch spriteBatch)
at Terraria.UI.UserInterface.Draw(SpriteBatch spriteBatch, GameTime time)
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)
reply pls
I think some mod has corrupted item data stored on an item, try unloading your mods and going back into game
[doublepost=1488911362,1488911248][/doublepost]
To manually remove a mod, close terraria, go to your equivalent of 'C:\Users\<your user name>\Documents\My Games\Terraria\ModLoader\Mods' and deleted the mod and its .enabled file, and then restart your terraria.
FYI, Instead of C:\Users\<your user name>\ you can use %userprofile%\ on Windows. :cool:
[doublepost=1488911622][/doublepost]
Doesn't work, town npc still wears party hat when party.

E1: Well now it works, but instead of "public virtual bool UsesPartyHat()" I had to write "public override bool UsesPartyHat()"
That's because when the hooks are declared in tModLoader, they are declared as virtual methods. Virtual methods can be overridden by mods to have their own implementation, this is what you're supposed to do.
 
So the mod browser is wholly nonfunctional as of 3 days ago, and i'm not really sure why. If anyone could chip in as to why that is, that'd be lovely.
This is because the browser is mostly hosted on dropbox, which limits it to dropbox's bandwith restrictions.
Without our own proper way of hosting or unlimited bandwith, nothing will change. This requires money.
 
This is because the browser is mostly hosted on dropbox, which limits it to dropbox's bandwith restrictions.
Without our own proper way of hosting or unlimited bandwith, nothing will change. This requires money.
So you're saying that dropbox is basically unavailable for the last 72 hours?
 
Back
Top Bottom