tModLoader Official tModLoader Help Thread

so I recently updated my tModloader to 1.3.5, made a mod, and this error message comes up:
Microsoft.Xna.Framework.Content.ContentLoadException: Error loading "Fonts\Item_Stack". Cannot find ContentTypeReader
(The rest is possibly unneeded error message stuff)
So can anyone help me with this?
 
so I recently updated my tModloader to 1.3.5, made a mod, and this error message comes up:
Microsoft.Xna.Framework.Content.ContentLoadException: Error loading "Fonts\Item_Stack". Cannot find ContentTypeReader
(The rest is possibly unneeded error message stuff)
So can anyone help me with this?
So nobody is going to help me with this?
 
Alright, so my previous problem has been resolved, but apparently, my GlobalNpcs thing needs another bracket. Here's what's in right now:
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace SomeExtraStuff.NPCs
{
public class ModGlobalNPC : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (type == NPCID.EyeofCthulhu)
{
if (Main.rand.Next(33) == 0) //item rarity
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Myopia Glass"), Main.rand.Next(52, 62));
{
}
}
}
}
 
Alright, so my previous problem has been resolved, but apparently, my GlobalNpcs thing needs another bracket. Here's what's in right now:
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace SomeExtraStuff.NPCs
{
public class ModGlobalNPC : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (type == NPCID.EyeofCthulhu)
{
if (Main.rand.Next(33) == 0) //item rarity
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("Myopia Glass"), Main.rand.Next(52, 62));
{
}
}
}
}
The bracket after the 'Item.NewItem' line has to be a closed one.
I'd recommend a program like Visual Studio that helps you with stuff like that.
 
I'd recommend a program like Visual Studio that helps you with stuff like that.
The ironic thing was that I WAS using Visual Studio for the programming. I guess I'm importance blind or something.
[doublepost=1495416129,1495415724][/doublepost]Alright, now it says "The type or namespace name 'ExamplePlayer' could not be found (are you missing a using directive or an assembly reference?)". What does this mean?
 
Its because I saw a video to help me, but the guy dont update his windows. He use windowns 6 or 7
[doublepost=1495402497,1495402473][/doublepost]Help with make mods
Äh okay the mod making is not different on an other windows versions

If my english is bad sorry im German
 
How to make an alternative modded helmet for vanilla armor and how to make it have a different set bonus
 
I've recently created a weapon whose position can be set to a player's aimPos variable (in a modPlayer class) via a right click, and shoots a laser pointing from that position to the mouse's position with a left click. This works like a charm for single player, and in multiplayer, the lasers still start in the correct position and hurt enemies correctly, but for some reason, the lasers won't appear on another person's screen. For example, if I used the weapon, it would appear on my screen, but not on the other person's screen, even though enemies still appear to be hurt to the other person. I used the laser from the ExampleMod as a base. How can this be?
 
The ironic thing was that I WAS using Visual Studio for the programming. I guess I'm importance blind or something.
[doublepost=1495416129,1495415724][/doublepost]Alright, now it says "The type or namespace name 'ExamplePlayer' could not be found (are you missing a using directive or an assembly reference?)". What does this mean?
Is no one going to help me with this?
 
I've recently created a weapon whose position can be set to a player's aimPos variable (in a modPlayer class) via a right click, and shoots a laser pointing from that position to the mouse's position with a left click. This works like a charm for single player, and in multiplayer, the lasers still start in the correct position and hurt enemies correctly, but for some reason, the lasers won't appear on another person's screen. For example, if I used the weapon, it would appear on my screen, but not on the other person's screen, even though enemies still appear to be hurt to the other person. I used the laser from the ExampleMod as a base. How can this be?
You must be using a hook that is only called on the client of the person who uses the item. You can find out which one that is by adding something like 'Main.NewText("nameOfHook was called"); to the beginning of a hook to see when it is being called.

want to know how to make 2 different versions of terraria. 1 vanilla and 1 modded
Simple, start with a vanilla install of Terraria. Make a copy of it's install directory and apply tModLoader to that copy. Create a shortcut to the moded version and you are good to go.
If you already have an install that is moded, it would be easier to rename it's install directory, then validate your games cache to get the vanilla version back. Don't forget to create a shortcut to the renamed version for convenience.
 
hey, does anyone know how to get a custom block have a custom drop?
Use this hook in your mod tile

Code:
public override bool Drop(int i, int j)

i and j are the coordinates of the tile depending on the tile position, so all you would need to do for spawning an item is using the i and j as your x and y coordinates and multiply them by 16 to get their actual coordinates to load into Item.NewItem().
 
Hello, I am attempting to make a very weak pickaxe with limited range. I've got it mostly working but still have a few stumbling blocks...

1. I want this tool to only reach one or two blocks away. I see no property to directly set this so I assumed it is based on the item.width and height forming a hitbox. Several of the vanilla picks have modified range so I know it is possible. :) What am I missing?

2. I want the tool to animate like a spear (it is a sharp stick after all) but when I set it up to "shoot" I lose the pick functionality all together. Any suggestions?

Code:
Code:
public class SharpStick : ModItem
{
    public override void SetDefaults()
    {
        item.name = "Sharp Stick";
        item.width = 8;
        item.height = 8;
        item.maxStack = 1;
        item.rare = 5;
        item.toolTip = "This sharp stick is really useful.";
        item.toolTip2 = "You can dig in the dirt with it and poke stuff.";
        item.useStyle = 1;
        item.useTime = 24;
        item.useAnimation = item.useTime + 4;
        item.pick = 4; // good for dirt and not much else :D Too low, even dirt won't budge.
        item.damage = 2;
        item.melee = true;
        item.knockBack = 2;
        item.autoReuse = false;
        item.scale = 1f;
        item.useTurn = true;           
    }
}
 
Back
Top Bottom