Standalone [1.3] tModLoader - A Modding API

Anyone know a way to use more mods while loading a world without crashing? I'm only using about 10 right now, but the game keeps crashing when I load up a world.
 
Anyone know a way to use more mods while loading a world without crashing? I'm only using about 10 right now, but the game keeps crashing when I load up a world.
Try turning all settings down to there lowest quality, Games have whats referred to as Max Memory. Going at or over 'Max Memory' causes the game to crash. Turning everything down to its lowest quality releases massive amounts of 'Memory'. 'Max Memory' is also a lag factor, Having to much going on at the same time increases 'Memory' which increases lag and the possibility of a crash. This may not be the case for you but it might work.

Also Terraria uses the openGL shading system, if you have to much things active that are being drawn to your graphics card this could cause you game to crash as well as a shading modifier that could be stored in one of the mods, Check for GLSL or openGL identifiers inside your mods. Something could be going wrong there.
 
Hello! I loved playing modded terraria and I just got back to playing it and this error pops up...

Method not found: 'Int32 Terraria.Player.HasBuff(Int32)'.
at MoonLordNerf.BiteNerf.PostUpdateBuffs()
at Terraria.ModLoader.PlayerHooks.PostUpdateBuffs(Player player)
at Terraria.Player.Update(Int32 i)
at Terraria.WorldGen.do_playWorldCallBack(Object threadContext)
at Terraria.WorldGen.playWorldCallBack(Object threadContext)

Does anyone know what I have to do to take this off so I can play again?
 
Hello! I loved playing modded terraria and I just got back to playing it and this error pops up...

Method not found: 'Int32 Terraria.Player.HasBuff(Int32)'.
at MoonLordNerf.BiteNerf.PostUpdateBuffs()
at Terraria.ModLoader.PlayerHooks.PostUpdateBuffs(Player player)
at Terraria.Player.Update(Int32 i)
at Terraria.WorldGen.do_playWorldCallBack(Object threadContext)
at Terraria.WorldGen.playWorldCallBack(Object threadContext)

Does anyone know what I have to do to take this off so I can play again?

Remove MoonLordNerf/"Bow to the Lord" mod.
 
How do i add lifesteal like the vampire knifes to a weapon?
I have this in something I made, thing it works:
Code:
        public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
        {
            projectile.vampireHeal(damage, target.Center);
        }
 
Try turning all settings down to there lowest quality, Games have whats referred to as Max Memory. Going at or over 'Max Memory' causes the game to crash. Turning everything down to its lowest quality releases massive amounts of 'Memory'. 'Max Memory' is also a lag factor, Having to much going on at the same time increases 'Memory' which increases lag and the possibility of a crash. This may not be the case for you but it might work.

Also Terraria uses the openGL shading system, if you have to much things active that are being drawn to your graphics card this could cause you game to crash as well as a shading modifier that could be stored in one of the mods, Check for GLSL or openGL identifiers inside your mods. Something could be going wrong there.
I put the quality to low but it still doesn't seem to solve the problem.
Terraria Crash.PNG
 
There is a problem with this code for a pickaxe can anyone help me?
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace TheRebirthMod.Items
{
    namespace LightningPickaxe.Items
    {
        public override void SetDefaults()
        {
            item.name = "Lightning Pickaxe";
            item.damage = 10;
            item.melee = true;
            item.width = 60;
            item.height = 56;
            item.toolTip = "Strikes Faster The Lightning";
            item.useTime = 20;
            item.useAnimation = 20;
            item.pick = 49;    //pickaxe power
            item.useStyle = 1;
            item.knockBack = 7;
            item.value = 10;
            item.rare = 2;
            item.UseSound = SoundID.Item1;
            item.autoReuse = true;
        }
        public override void AddRecipes()  //How to craft this item
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Wood, 10);   //you need 10 Wood
            recipe.AddTile(TileID.WorkBenches);   //at work bench
            recipe.SetResult(this); 
            recipe.AddRecipe();
        }
    }
}
 
I have a buff that works but it wont go away. Heres the code, (1st code is in items folder 2nd is in buffs.)
Code:
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tf2.Items
{
    public class Critacola : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Crit A Cola";// in game item name
            item.UseSound = SoundID.Item3;                //this is the sound that plays when you use the item
            item.useStyle = 2;                 //this is how the item is holded when used
            item.useTurn = true;
            item.useAnimation = 17;
            item.useTime = 17;
            item.maxStack = 30;                 //this is where you set the max stack of item
            item.consumable = true;           //this make that the item is consumable when used
            item.width = 20;
            item.height = 28;
            item.toolTip = "Gives increased damage! Very balanced crits!";
            item.value = 100;               
            item.rare = 1;
            item.buffType = mod.BuffType("CritBoosted");    //this is where you put your Buff name
            item.buffTime = 900;         
            return;
        }
    }
}
Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tf2.Buffs
{
    public class CritBoosted : ModBuff
    {
        public override void SetDefaults()
        {
            Main.buffNoTimeDisplay[Type] = false;
            Main.buffName[this.Type] = "Crit Boosted";
            Main.buffTip[this.Type] = "40% more damage, ";
        }
        public override void Update(Player player, ref int buffIndex)
        {
  player.AddBuff(mod.BuffType("CritBoosted"), 1); 
player.rangedDamage += 20;
player.meleeDamage += 20;
player.magicDamage += 20;                                       
          
          
        }
    }
}
[doublepost=1485118719,1485118545][/doublepost]
There is a problem with this code for a pickaxe can anyone help me?
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace TheRebirthMod.Items
{
    namespace LightningPickaxe.Items
    {
        public override void SetDefaults()
        {
            item.name = "Lightning Pickaxe";
            item.damage = 10;
            item.melee = true;
            item.width = 60;
            item.height = 56;
            item.toolTip = "Strikes Faster The Lightning";
            item.useTime = 20;
            item.useAnimation = 20;
            item.pick = 49;    //pickaxe power
            item.useStyle = 1;
            item.knockBack = 7;
            item.value = 10;
            item.rare = 2;
            item.UseSound = SoundID.Item1;
            item.autoReuse = true;
        }
        public override void AddRecipes()  //How to craft this item
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Wood, 10);   //you need 10 Wood
            recipe.AddTile(TileID.WorkBenches);   //at work bench
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
Whats the error you get?
 
I have a buff that works but it wont go away. Heres the code, (1st code is in items folder 2nd is in buffs.)
Code:
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tf2.Items
{
    public class Critacola : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Crit A Cola";// in game item name
            item.UseSound = SoundID.Item3;                //this is the sound that plays when you use the item
            item.useStyle = 2;                 //this is how the item is holded when used
            item.useTurn = true;
            item.useAnimation = 17;
            item.useTime = 17;
            item.maxStack = 30;                 //this is where you set the max stack of item
            item.consumable = true;           //this make that the item is consumable when used
            item.width = 20;
            item.height = 28;
            item.toolTip = "Gives increased damage! Very balanced crits!";
            item.value = 100;              
            item.rare = 1;
            item.buffType = mod.BuffType("CritBoosted");    //this is where you put your Buff name
            item.buffTime = 900;        
            return;
        }
    }
}
Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tf2.Buffs
{
    public class CritBoosted : ModBuff
    {
        public override void SetDefaults()
        {
            Main.buffNoTimeDisplay[Type] = false;
            Main.buffName[this.Type] = "Crit Boosted";
            Main.buffTip[this.Type] = "40% more damage, ";
        }
        public override void Update(Player player, ref int buffIndex)
        {
  player.AddBuff(mod.BuffType("CritBoosted"), 1);
player.rangedDamage += 20;
player.meleeDamage += 20;
player.magicDamage += 20;                                      
         
         
        }
    }
}
[doublepost=1485118719,1485118545][/doublepost]
Whats the error you get?
c:\Users\Dominik\Documents\My Games\Terraria\ModLoader\Mod Sources\TheRebirthMod\Items\LightningPickaxe.cs(28,25) : error CS1518: Expected class, delegate, enum, interface, or struct
 
c:\Users\Dominik\Documents\My Games\Terraria\ModLoader\Mod Sources\TheRebirthMod\Items\LightningPickaxe.cs(28,25) : error CS1518: Expected class, delegate, enum, interface, or struct
"public override void AddRecipes() //How to craft this item" is where the problems at. (28,25) Refers to line and character number of where the error is at.
 
There is a problem with this code for a pickaxe can anyone help me?
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace TheRebirthMod.Items
{
    namespace LightningPickaxe.Items
    {
        public override void SetDefaults()
        {
            item.name = "Lightning Pickaxe";
            item.damage = 10;
            item.melee = true;
            item.width = 60;
            item.height = 56;
            item.toolTip = "Strikes Faster The Lightning";
            item.useTime = 20;
            item.useAnimation = 20;
            item.pick = 49;    //pickaxe power
            item.useStyle = 1;
            item.knockBack = 7;
            item.value = 10;
            item.rare = 2;
            item.UseSound = SoundID.Item1;
            item.autoReuse = true;
        }
        public override void AddRecipes()  //How to craft this item
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Wood, 10);   //you need 10 Wood
            recipe.AddTile(TileID.WorkBenches);   //at work bench
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
You have two namespace declarations. Remove one.
 
when i do that its say c:\Users\Dominik\Documents\My Games\Terraria\ModLoader\Mod Sources\TheRebirthMod\Items\LightningPickaxe.cs(7,1) : error CS0116: A namespace cannot directly contain members such as fields
Add a class declaration after the namespace.
Code:
public class LightningPickaxe : ModItem
 
I have a buff that works but it wont go away. Heres the code, (1st code is in items folder 2nd is in buffs.)
Code:
using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tf2.Items
{
    public class Critacola : ModItem
    {
        public override void SetDefaults()
        {
            item.name = "Crit A Cola";// in game item name
            item.UseSound = SoundID.Item3;                //this is the sound that plays when you use the item
            item.useStyle = 2;                 //this is how the item is holded when used
            item.useTurn = true;
            item.useAnimation = 17;
            item.useTime = 17;
            item.maxStack = 30;                 //this is where you set the max stack of item
            item.consumable = true;           //this make that the item is consumable when used
            item.width = 20;
            item.height = 28;
            item.toolTip = "Gives increased damage! Very balanced crits!";
            item.value = 100;              
            item.rare = 1;
            item.buffType = mod.BuffType("CritBoosted");    //this is where you put your Buff name
            item.buffTime = 900;        
            return;
        }
    }
}
Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace Tf2.Buffs
{
    public class CritBoosted : ModBuff
    {
        public override void SetDefaults()
        {
            Main.buffNoTimeDisplay[Type] = false;
            Main.buffName[this.Type] = "Crit Boosted";
            Main.buffTip[this.Type] = "40% more damage, ";
        }
        public override void Update(Player player, ref int buffIndex)
        {
  player.AddBuff(mod.BuffType("CritBoosted"), 1);
player.rangedDamage += 20;
player.meleeDamage += 20;
player.magicDamage += 20;                                      
         
         
        }
    }
}
[doublepost=1485118719,1485118545][/doublepost]
Whats the error you get?

You have AddBuff in your buff's Update method, meaning the buff will reapply itself every frame. Remove that line, see what happens.
 
Back
Top Bottom