tModLoader Official tModLoader Help Thread

ive already done that and idk what to do
It might be worth having a look through Windows Logs in Event Viewer. There might be some errors there that give some clues.
 
I have an issue. When I try use the menus in tModloader (specifically the Mods menu and Mods Browser) my mouse will teleport whenever I click on anything. The typing still works. Also many of the mods will not load even though the game says that they are loaded. Plus when I try to attack or use items the game moves me right at the same time.
 
Can you add a mobile version pls?😟😟
 
Hey. so my friend is having trouble with a mod. it won't get disabled, and he has tried deleting the mod, but nothing has worked. please help???
 
I need help making an accessory fire a projectile when worn, like the chlorophyte armour buff.
 
It should be enough to do this in your player file:
Code:
if (Your accesory){

Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ProjectileType<Your projectile>();
}
If you want a max projectile cap, you can look into ExampleMods Elemental shield.
 
Thanks so much but I still cant get it to work. It doesnt like the code when I put it in my player file
 
My mistake, the code belongs in the part of the player file where you determine stat changes and similiar, in the 'UpdateBadLifeRegen' part.
If you have done this I recommend looking in Example mod
Edit:If you dont have Example mod i will show you example mods example.
 
Its saying that the Accessory name Doesn't Exist in the current contest?
 
What do you use to refer to the accesory?
A bool or the item name?
Using an item name is the wrong way to refer to a item in the player file.
Instead use a bool to refer to it.
Then put a reference in the accesory file.
I can provide an example for a accesory that uses the player file if you want.
 
using Beskil.Items.Accesories;
using Beskil.Projectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameInput;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;

namespace Beskil
{
public class BeskilPlayer : ModPlayer
{
public override void UpdateBadLifeRegen()
{
if (BrainBand){

Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ProjectileType <CreeperBand> ());
}
}

}
}


using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;

namespace Beskil.Items.Accesories
{
public class BrainBand : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Brain Band");
Tooltip.SetDefault("Shoots little Creepers");
}

public override void SetDefaults()
{
item.width = 28;
item.height = 20;
item.value = 0;
item.rare = -12;
item.accessory = true;
item.defense = 4;
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
player.GetBeskilPlayer().BrainBand = true;
}
}
}

It still says it does not exist in the current context
 
You are still missing a bool in the player file.
Put this in the raw player file: public bool BrainBand;
Now put this in the player file:
Code:
 public override void ResetEffects()
        {
            BrainBand = false
          
      
        }
Note that the way Im doing it here at all will (with a high chance) repeatedly create creepers.
I recommend creating an invisible projectile that only lasts for a short amount of time and will shoot the creepers if an enemy is nearby.
You could also extract the terraria code and look at the code for the volatile gelatin or the phantasm.
 
using Beskil.Items.Accesories;
using Beskil.Projectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameInput;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;

namespace Beskil
{


public class BeskilPlayer : ModPlayer
{

public bool BrainBand;

public override void UpdateBadLifeRegen()
{
if (BrainBand){

Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ProjectileType <CreeperBand> ());
}
}

public override void ResetEffects()
{
BrainBand = false;
}
}
}

using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;

namespace Beskil.Items.Accesories
{
public class BrainBand : ModItem
{

public override void SetStaticDefaults()
{
DisplayName.SetDefault("Brain Band");
Tooltip.SetDefault("Shoots little Creepers");
}

public override void SetDefaults()
{
item.width = 28;
item.height = 20;
item.value = 0;
item.rare = -12;
item.accessory = true;
item.defense = 4;
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
player.GetBeskilPlayer().BrainBand = true;
}
}
}

Projectile Type does not exist in the current context
 
Your file has no reference to the mod projectile.
Use using Beskil.Projectiles; at the top and/or write ModContent.ProjectileType <CreeperBand> ()
 
I did both ways and they never worked. With the mod content it says I cant convert from float to Microsoft.Xna.Framework.Vector2

using Beskil.Items.Accesories;
using Beskil.Projectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Terraria;
using Terraria.DataStructures;
using Terraria.GameInput;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;

namespace Beskil
{


public class BeskilPlayer : ModPlayer
{

public bool BrainBand;

public override void UpdateBadLifeRegen()
{
if (BrainBand){

Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType<CreeperBand>());
}
}

public override void ResetEffects()
{
BrainBand = false;
}
}
}



using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Beskil.Projectiles;
using Beskil;

namespace Beskil.Items.Accesories
{
public class BrainBand : ModItem
{

public override void SetStaticDefaults()
{
DisplayName.SetDefault("Brain Band");
Tooltip.SetDefault("Shoots little Creepers");
}

public override void SetDefaults()
{
item.width = 28;
item.height = 20;
item.value = 0;
item.rare = -12;
item.accessory = true;
item.defense = 4;
}

public override void UpdateAccessory(Player player, bool hideVisual)
{
player.GetBeskilPlayer().BrainBand = true;
}
}
}
 
Then I cant really help you, like I said I havent tested this before and Im not all knowing either
The example mod has a very good example for something like this or you could just look through the terraria code.
If you were to look through the code of terrria i still recommend looking at the code of the volatile gelatin.
Your error isnt the worst error you couldve gotten and I could probably fix it with enough time.
But I dont have the time.
I wish you good luck in future projects and hope that you find a solution.
If you have a question about the extrcation of terraria you can ask me.
 
Is there a way to have an item apply a debuff to all enemies currently on screen? Or is it not possible without using projectiles or something that will touch the mob?
 
Back
Top Bottom