tModLoader Official tModLoader Help Thread

it does the same with terraria and thats it
Then the problem is with Terraria, not tModLoader. The first thing that you should try is to verify Terraria's cache.
(Right click on game > properties > Local Files > Verify integrity of game files...)
 
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.
 
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???
 
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.
 
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.
 
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> ()
 
Back
Top Bottom