tModLoader Official tModLoader Help Thread

D: This error is preventing me from making my mod, how do I select the name and the tooltip of my accesory?

When I build it gives me this error : 'Terraria.Item' does not contain a definition for 'name' and no extension method 'name' accepting a first argument of type 'Terraria.Item' could be found (are you missing a using directive or an assembly reference?)

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

namespace GoliatMod.Items
{
public class SummonerTalisman : ModItem
{
public override void SetDefaults()
{
item.name = "Goliat Talisman";
item.width = 10;
item.height = 14;
item.value = 0;
item.rare = 2;
item.accessory = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod, "DivineTalisman");
recipe.SetResult(this);
recipe.AddRecipe();
}

public override void UpdateAccessory(Player player, bool hideVisual)
{

player.maxMinions += 1;
player.minionDamage += 0.10f;
}
}
}
I found a little fix for when i get this, i delete the default item.name and item.tooltip and use this
public override void SetStaticDefaults()
{
DisplayName.SetDefault("ItemNameHere");
Tooltip.SetDefault("TooltipHere");
}
put it right after the
public class ItemName: ModItem
{
it works for me, i tested it
 
D: This error is preventing me from making my mod, how do I select the name and the tooltip of my accesory?

When I build it gives me this error : 'Terraria.Item' does not contain a definition for 'name' and no extension method 'name' accepting a first argument of type 'Terraria.Item' could be found (are you missing a using directive or an assembly reference?)

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

namespace GoliatMod.Items
{
public class SummonerTalisman : ModItem
{
public override void SetDefaults()
{
item.name = "Goliat Talisman";
item.width = 10;
item.height = 14;
item.value = 0;
item.rare = 2;
item.accessory = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(mod, "DivineTalisman");
recipe.SetResult(this);
recipe.AddRecipe();
}

public override void UpdateAccessory(Player player, bool hideVisual)
{

player.maxMinions += 1;
player.minionDamage += 0.10f;
}
}
}

Geez thanks ! :D

Did you found a way to make a second tooltip line, "tooltip2" ?
 
using Terraria.ID;
using Terraria.ModLoader;


namespace norngforrng
{
class norngforrng : Mod
{
public norngforrng()
{
Properties = new ModProperties()
{
Autoload = true,
AutoloadGores = true,
AutoloadSounds = true
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(this);
recipe.AddIngredient(ItemID.GoldBar, 10);
recipe.AddIngredient(ItemID.GlassWall, 10);
recipe.AddIngredient(ItemID.Torch, 2);
recipe.AddTile(TileID.Anvils);
recipe.AddTile(TileID.CrystalBall);
recipe.needLava = true;
recipe.SetResult(ItemID.MagicLantern);
recipe.AddRecipe();
}
}
}
You are missing these 2:

LhdFWGD.png
 
Hello. I just downloaded the mod skeleton and put the extracted file in my Mod sources folder. Before and after installing the latest XNA Framework I still get this error: "The referenced component 'Terraria' could not be found." I have not touched anything I shouldn't and Terraria is installed in a safe and correct directory with the latest TModloader installed. Any ideas?

Pic:
 

Attachments

  • ErrorTerraria.PNG
    ErrorTerraria.PNG
    101 KB · Views: 133
Hello. I just downloaded the mod skeleton and put the extracted file in my Mod sources folder. Before and after installing the latest XNA Framework I still get this error: "The referenced component 'Terraria' could not be found." I have not touched anything I shouldn't and Terraria is installed in a safe and correct directory with the latest TModloader installed. Any ideas?

Pic:
Remove the reference then add it again. It thinks the exe is somewhere it is not on your computer
 
  • Like
Reactions: PHG
Anyone know how to make it where the item can be made with lead or iron, aka Any Iron Bar?

Also how do I make a recipe make a vanilla item? I'm wanting to make a Rocket I Recipe.
 
Would anyone be able to help me with a way to test if a projectile was shot by an NPC or a player? I am trying to make an accessory that makes bullets fired by players set NPCs on fire, but it causes all bullets fired by anyone to set NPCs on fire. :\
 
Hello, could somebody explain to me how I would add a glowmask to an item like a sword? For example the way the solar pickaxe has a luminous quality to it.

See the attached images for what I'd be wanting to make glow.
 

Attachments

  • RedLithiumBladeGlow.png
    RedLithiumBladeGlow.png
    528 bytes · Views: 130
  • RedLithiumBlade.png
    RedLithiumBlade.png
    642 bytes · Views: 124
Hello! I need help, i make custom AI for walking NPC and i dont know how to make him overcome obstacles. For example: all vanilla walking NPC(zombies, slimes and etc.) jump on the ledges after the player.
My AI code:
public override void AI()
{
Target();
Move();


}

private void Move()
{
Vector2 targetPosition = Main.player[npc.target].position;

if(targetPosition.X < npc.position.X) npc.velocity.X = -1f;
if(targetPosition.X > npc.position.X) npc.velocity.X = 1f;

if(targetPosition.Y > npc.position.Y)
{

npc.velocity.X += 1f;
npc.velocity.Y += 0.8f;

}
else {
npc.velocity.X -= 1f;
npc.velocity.Y -= 0.8f;
}
}



private void Target()
{
npc.TargetClosest(true);
player = Main.player[npc.target];

}
 
Been trying to do an expert mode modded run with friends. My connection is too slow so I cannot host. That is not the issue but it sort of defeats a fix for it.

My issue is.
Whenever I try to join a server with multiple big mods like Thorium and Calamity for example (which are the two we mainly want to use. They want to run with Tremor too.) I get an error about missing audiofiles. The mods automatically disable and the game crashes. Yet I can hold a singleplayer session just fine.

I believe the problem is caused by the fact that I have a low end PC. More specifically that I only have 2GB RAM. It wasnt uncommon for me to lag to the point of near unplayability during bosses and invasions. They told me to make a post here anyways just in case there is a fix for it.

I tried the fix where you enable all the mods and then close the game and reopen it. I tried running with different combinations of mods. I tried using clean installs. I tried -maxMem=8192 -malloc=system in launch options (though that is a fix for a different game...)

Log File
The texture file at Projectiles/Healer/DragonZoneCore.png failed to load
at Terraria.ModLoader.Mod.Autoload()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Inner Exception:
Insufficient memory to continue the execution of the program.
at Microsoft.Xna.Framework.Helpers.GetExceptionFromResult(UInt32 result)
at Microsoft.Xna.Framework.Graphics.Texture2D..ctor(GraphicsDevice graphicsDevice, Stream stream, Int32 width, Int32 height, XnaImageOperation operation)
at Microsoft.Xna.Framework.Graphics.Texture2D.FromStream(GraphicsDevice graphicsDevice, Stream stream)
at Terraria.ModLoader.Mod.Autoload()



My other problem is that in the Mods menu I can hover over buttons and they even get highlighted but clicking on them does nothing. This makes it impossible for me to enable mods without reinstalling them.


Also an option to allow a mod to continue to run even after it conflicts with something would be nice for troubleshooting .


Any help would be appreciated. Even if you can just tell me what the problem is I would be one step forward.
 
Hey I love Tmod Loader but it makes terraria 1.3.5.2 instead of 1.3.5.3 so I can't play online...Is my Tmod outdated? v0.10.0.2
Steam Terraria and Windows 10.
 
Hey I love Tmod Loader but it makes terraria 1.3.5.2 instead of 1.3.5.3 so I can't play online...Is my Tmod outdated? v0.10.0.2
Steam Terraria and Windows 10.
If you want to play with vanilla servers, you'd need to launch the vanilla client (the installer makes a file called Terraria_v1.3.5.3.exe, that is vanilla). The version of tmodloader has nothing to do with that.
 
I just tried loading mods for the first time. tmodloader worked just fine. I used the mod browser and got Calamity, Thorium, and Spirit. They all encountered the same error when I enabled and reloaded them: an mp3 file couldn't load.

I'll admit, though, my laptop is slow; it can barely run vanilla Terraria at 30fps. Am I doing something wrong or is it my computer?
 
Back
Top Bottom