tModLoader Official tModLoader Help Thread

What means TutorialSword.cs (32,44)?
TutorialSword.cs is the script in which the error is located. The first number (32) indicates in what line the error is (line 32, in your case), and the second number (44) is the column number, or in other words, the character at which line the error is (you can usually ignore that).

So in other words, you're missing a closing bracket at line 32 (or at least around there) in your TutorialSword script.
 
Okay. This is a strange one. Getting this error every time on opening terraria. It goes in the following for a bandaid fix-- Failed to load calamity, thorium, spirit. Enable all 3 reload, failed to load only calamity. Enable, reload and play. I'd love to play without the added 20 seconds to pre-game time.

Here is the log for the first error. (same for all 3 really.)
Object reference not set to an instance of an object.
at EnemyMods.NPCs.gNPC.SetDefaults(NPC npc) in C:\Users\Kenneth\Documents\My Games\Terraria/ModLoader\Mod Sources\EnemyMods\NPCs\gNPC.cs:line 70
at Terraria.ModLoader.NPCLoader.SetDefaults(NPC npc, Boolean createModNPC)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

I don't know how to fix this. Why is it looking in an area that does not exist? The location is saved to C:\Users\gojlu\OneDrive\Documents\My Games\Terraria\M...
 
Last edited:
Does anybody know how to add vanilla blocks to the Spelunker effect? Like for example, if I wanted it highlight dirt, how would I do that? I tried searching and I can't find any code to do with the spelunker effect.
 
When one of the mods loads it keep disabling some mods, please help
20170717111441_1.jpg
 
PLEEEEAAAAAASE HELP ME IF U SEE THIS!!! WHEN I OPEN MY INVENTORY ON A MODDED CHARACTER THIS POPS UP, AND THEN I CAN'T PLAY ANYMORE
 

Attachments

  • Skärmbild (1).png
    Skärmbild (1).png
    240.6 KB · Views: 189
Does anybody know how to add vanilla blocks to the Spelunker effect? Like for example, if I wanted it highlight dirt, how would I do that? I tried searching and I can't find any code to do with the spelunker effect.

I found out how to do this. Turns out, it's simple. Just added a file into my mod with these contents:

Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace MyExampleMod.Tiles
{
    public class MyExample : GlobalTile
    {
        public override void SetDefaults()
        {
           
            Main.tileSpelunker[0] = true;
           
        }
    }
}

Seems to be permanent, to undo this you'd have to change it to "false" and rebuild the mod. This probably isn't the proper way to do this, but hey, whatever works. I'm keeping this here just in case somebody googles this in 20 years.
 
For some reason the Goblin Battle Standard does nothing when used (not even consumed) while playing with TmodLoader.

Please help. I can provide a list of my mods, but the same problem persists even with all mods deactivated. Goblin Invasion is simply not spawning either. I think the issue is with TmodLoader?
 
Hello there,

I've got a question concerning tModLoader. Today I wanted to reinstall it and it first worked out, I browsed and installed a bunch of mods (more like 9).
I enabled them all and restarted my game. When I restarted my game the mods where initializingand the following message popped up:
When I pressed "continue" it started to initialize the mods again, which lead to the message popping up again. When I pressed "open log" this (the second picture) window opened itself.
Translation: Feld nicht gefunden - field(?) not found
bei - at
Thanks for your help and I apologize for my poor English
lightasder
Screenshot (11).png
Screenshot (12).png
 
I get an occasional error that crashes the game the only mods i have enabled are cheat sheet/hotkeys extension for it, calamity, tremor, and thorium
upload_2017-7-18_18-31-17.png
 
this code of a custom sentry doesnt work in 1.3.5 , anyone knows why?

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


namespace TutorialMOD.Items ///We need this to basically indicate the folder where it is to be read from, so you the texture will load correctly
{
public class CustomSentryItem : ModItem
{

public override void SetDefaults()
{
item.name = "Custom Sentry"; //the name displayed when hovering over the Weapon ingame.
item.damage = 60; //The damage stat for the Weapon.
item.mana = 20; //this defines how many mana this weapon use
item.width = 56; //The size of the width of the hitbox in pixels.
item.height = 56; //The size of the height of the hitbox in pixels.
item.useTime = 25; //How fast the Weapon is used.
item.useAnimation = 25; //How long the Weapon is used for.
item.useStyle = 1; //The way your Weapon will be used, 1 is the regular sword swing for example
AddTooltip("Summons a custom sentry"); //The description of the Weapon shown when hovering over the Weapon ingame.
item.noMelee = true; //so the item's animation doesn't do damage
item.knockBack = 2.5f; //The knockback stat of your Weapon.
item.value = Item.buyPrice(0, 10, 0, 0); // How much the item is worth, in copper coins, when you sell it to a merchant. It costs 1/5th of this to buy it back from them. An easy way to remember the value is platinum, gold, silver, copper or PPGGSSCC (so this item price is 10gold)
item.rare = 8; //The color the title of your Weapon when hovering over it ingame
item.UseSound = SoundID.Item44; //The sound played when using your Weapon
item.autoReuse = true; //Weather your Weapon will be used again after use while holding down, if false you will need to click again after use to use it again.
item.shoot = mod.ProjectileType("CustomSentryProj"); //This defines what type of projectile this weapon will shot
item.summon = true; //This defines if it does Summon damage and if its effected by Summon increasing Armor/Accessories.
item.sentry = true; //tells the game that this is a sentry
}

public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); //this make so the projectile will spawn at the mouse cursor position
position = SPos;
for (int l = 0; l < Main.projectile.Length; l++)
{ //this make so you can only spawn one of this projectile at the time,
Projectile proj = Main.projectile[l];
if (proj.active && proj.type == item.shoot && proj.owner == player.whoAmI)
{
proj.active = false;
}
}
return true;
}
}
}this code of a custom sentry doesnt work in 1.3.5 , anyone knows why?

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


namespace TutorialMOD.Items ///We need this to basically indicate the folder where it is to be read from, so you the texture will load correctly
{
public class CustomSentryItem : ModItem
{

public override void SetDefaults()
{
item.name = "Custom Sentry"; //the name displayed when hovering over the Weapon ingame.
item.damage = 60; //The damage stat for the Weapon.
item.mana = 20; //this defines how many mana this weapon use
item.width = 56; //The size of the width of the hitbox in pixels.
item.height = 56; //The size of the height of the hitbox in pixels.
item.useTime = 25; //How fast the Weapon is used.
item.useAnimation = 25; //How long the Weapon is used for.
item.useStyle = 1; //The way your Weapon will be used, 1 is the regular sword swing for example
AddTooltip("Summons a custom sentry"); //The description of the Weapon shown when hovering over the Weapon ingame.
item.noMelee = true; //so the item's animation doesn't do damage
item.knockBack = 2.5f; //The knockback stat of your Weapon.
item.value = Item.buyPrice(0, 10, 0, 0); // How much the item is worth, in copper coins, when you sell it to a merchant. It costs 1/5th of this to buy it back from them. An easy way to remember the value is platinum, gold, silver, copper or PPGGSSCC (so this item price is 10gold)
item.rare = 8; //The color the title of your Weapon when hovering over it ingame
item.UseSound = SoundID.Item44; //The sound played when using your Weapon
item.autoReuse = true; //Weather your Weapon will be used again after use while holding down, if false you will need to click again after use to use it again.
item.shoot = mod.ProjectileType("CustomSentryProj"); //This defines what type of projectile this weapon will shot
item.summon = true; //This defines if it does Summon damage and if its effected by Summon increasing Armor/Accessories.
item.sentry = true; //tells the game that this is a sentry
}

public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); //this make so the projectile will spawn at the mouse cursor position
position = SPos;
for (int l = 0; l < Main.projectile.Length; l++)
{ //this make so you can only spawn one of this projectile at the time,
Projectile proj = Main.projectile[l];
if (proj.active && proj.type == item.shoot && proj.owner == player.whoAmI)
{
proj.active = false;
}
}
return true;
}
}
}
 
this code of a custom sentry doesnt work in 1.3.5 , anyone knows why?

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


namespace TutorialMOD.Items ///We need this to basically indicate the folder where it is to be read from, so you the texture will load correctly
{
public class CustomSentryItem : ModItem
{

public override void SetDefaults()
{
item.name = "Custom Sentry"; //the name displayed when hovering over the Weapon ingame.
item.damage = 60; //The damage stat for the Weapon.
item.mana = 20; //this defines how many mana this weapon use
item.width = 56; //The size of the width of the hitbox in pixels.
item.height = 56; //The size of the height of the hitbox in pixels.
item.useTime = 25; //How fast the Weapon is used.
item.useAnimation = 25; //How long the Weapon is used for.
item.useStyle = 1; //The way your Weapon will be used, 1 is the regular sword swing for example
AddTooltip("Summons a custom sentry"); //The description of the Weapon shown when hovering over the Weapon ingame.
item.noMelee = true; //so the item's animation doesn't do damage
item.knockBack = 2.5f; //The knockback stat of your Weapon.
item.value = Item.buyPrice(0, 10, 0, 0); // How much the item is worth, in copper coins, when you sell it to a merchant. It costs 1/5th of this to buy it back from them. An easy way to remember the value is platinum, gold, silver, copper or PPGGSSCC (so this item price is 10gold)
item.rare = 8; //The color the title of your Weapon when hovering over it ingame
item.UseSound = SoundID.Item44; //The sound played when using your Weapon
item.autoReuse = true; //Weather your Weapon will be used again after use while holding down, if false you will need to click again after use to use it again.
item.shoot = mod.ProjectileType("CustomSentryProj"); //This defines what type of projectile this weapon will shot
item.summon = true; //This defines if it does Summon damage and if its effected by Summon increasing Armor/Accessories.
item.sentry = true; //tells the game that this is a sentry
}

public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); //this make so the projectile will spawn at the mouse cursor position
position = SPos;
for (int l = 0; l < Main.projectile.Length; l++)
{ //this make so you can only spawn one of this projectile at the time,
Projectile proj = Main.projectile[l];
if (proj.active && proj.type == item.shoot && proj.owner == player.whoAmI)
{
proj.active = false;
}
}
return true;
}
}
}this code of a custom sentry doesnt work in 1.3.5 , anyone knows why?

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


namespace TutorialMOD.Items ///We need this to basically indicate the folder where it is to be read from, so you the texture will load correctly
{
public class CustomSentryItem : ModItem
{

public override void SetDefaults()
{
item.name = "Custom Sentry"; //the name displayed when hovering over the Weapon ingame.
item.damage = 60; //The damage stat for the Weapon.
item.mana = 20; //this defines how many mana this weapon use
item.width = 56; //The size of the width of the hitbox in pixels.
item.height = 56; //The size of the height of the hitbox in pixels.
item.useTime = 25; //How fast the Weapon is used.
item.useAnimation = 25; //How long the Weapon is used for.
item.useStyle = 1; //The way your Weapon will be used, 1 is the regular sword swing for example
AddTooltip("Summons a custom sentry"); //The description of the Weapon shown when hovering over the Weapon ingame.
item.noMelee = true; //so the item's animation doesn't do damage
item.knockBack = 2.5f; //The knockback stat of your Weapon.
item.value = Item.buyPrice(0, 10, 0, 0); // How much the item is worth, in copper coins, when you sell it to a merchant. It costs 1/5th of this to buy it back from them. An easy way to remember the value is platinum, gold, silver, copper or PPGGSSCC (so this item price is 10gold)
item.rare = 8; //The color the title of your Weapon when hovering over it ingame
item.UseSound = SoundID.Item44; //The sound played when using your Weapon
item.autoReuse = true; //Weather your Weapon will be used again after use while holding down, if false you will need to click again after use to use it again.
item.shoot = mod.ProjectileType("CustomSentryProj"); //This defines what type of projectile this weapon will shot
item.summon = true; //This defines if it does Summon damage and if its effected by Summon increasing Armor/Accessories.
item.sentry = true; //tells the game that this is a sentry
}

public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
Vector2 SPos = Main.screenPosition + new Vector2((float)Main.mouseX, (float)Main.mouseY); //this make so the projectile will spawn at the mouse cursor position
position = SPos;
for (int l = 0; l < Main.projectile.Length; l++)
{ //this make so you can only spawn one of this projectile at the time,
Projectile proj = Main.projectile[l];
if (proj.active && proj.type == item.shoot && proj.owner == player.whoAmI)
{
proj.active = false;
}
}
return true;
}
}
}

What's the error name?
 
So I'm trying to compile a mod I've made. It's supposed to be a bullet that does no damage, but heals the player and inflicts quite a few debuffs. Every time I try to compile it, I get this:

c:\Users\[CLASSIFIED]\Documents\My Games\Terraria\ModLoader\Mod Sources\VampiricAmmo\Projectiles\Bullet.cs(36,17) : error CS1518: Expected class, delegate, enum, interface, or struct

Here's my code:

using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using Terraria;
using Terraria.ModLoader;

namespace VampiricAmmo.Projectiles //We need this to basically indicate the folder where it is to be read from, so you the texture will load correctly
{
public class VampiricAmmo : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "Vampiric Bullet"; //Name of the projectile, only shows this if you get killed by it
projectile.width = 36; //Set the hitbox width
projectile.height = 36; //Set the hitbox height
projectile.timeLeft = 60; //The amount of time the projectile is alive for
projectile.penetrate = 100; //Tells the game how many enemies it can hit before being destroyed
projectile.friendly = true; //Tells the game whether it is friendly to players/friendly npcs or not
projectile.hostile = false; //Tells the game whether it is hostile to players or not
projectile.tileCollide = false; //Tells the game whether or not it can collide with a tile
projectile.ignoreWater = true; //Tells the game whether or not projectile will be affected by water
projectile.ranged = true; //Tells the game whether it is a ranged projectile or not
projectile.aiStyle = 1; //How the projectile works, this is no AI, it just goes a straight path
projectile.aiType = ProjectileID.ChlorophyteBullet
}

public override void AI()
{
Player owner = Main.player[projectile.owner]; //Makes a player variable of owner set as the player using the projectile
projectile.light = 0.9f; //Lights up the whole room
projectile.alpha = 128; //Semi Transparent

}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(mod.BuffType("Bleeding"), 180);
target.AddBuff(mod.BuffType("Poisoned"), 180);
target.AddBuff(mod.BuffType("On Fire!"), 180);
target.AddBuff(mod.BuffType("Venom"), 180);
target.AddBuff(mod.BuffType("Cursed"), 180);
target.AddBuff(mod.BuffType("Cursed Inferno"), 180);
target.AddBuff(mod.BuffType("Burning"), 180);
target.AddBuff(mod.BuffType("Frostburn"), 180);
target.AddBuff(mod.BuffType("Electrified"), 180);
owner.statLife += 15;
owner.healEffect(15, true);
}

}
 
Hello there,

I've got a question concerning tModLoader. Today I wanted to reinstall it and it first worked out, I browsed and installed a bunch of mods (more like 9).
I enabled them all and restarted my game. When I restarted my game the mods where initializingand the following message popped up:
When I pressed "continue" it started to initialize the mods again, which lead to the message popping up again. When I pressed "open log" this (the second picture) window opened itself.
Translation: Feld nicht gefunden - field(?) not found
bei - at
Thanks for your help and I apologize for my poor English
lightasderView attachment 176704 View attachment 176706
That looks like a problem with CrystiliumMod. Try disabling just that mod.
 
How do I disable the mod when I cant get into the game?
Hi! i was having the same issue ,first,you should go to the tmodloader mods folder in your documents directory, look for the files who end in .enabled extension,delete those files, then start your modded terraria, go to the mod menu, enable the mods you want , and dont press "reload mods", just clic "back" and then exit the game normally, and just open the client again , if none of these works , try installing .net framework 4.6.2 or 4.7

Sorry ,but english isn't my native language ><
 
Back
Top Bottom