tModLoader Official tModLoader Help Thread

I'm preeeetty new to this and I ran into an error after trying to build+reload a mod I made that's swordfish spear that lights things on fire. Anyone that can point me in the right direction? or what this means? Here's the error EDIT: My png with the item is 50x54 and has the same name as the .cs file with it if that is of any significance.

20170401215720_1.jpg
 
I'm preeeetty new to this and I ran into an error after trying to build+reload a mod I made that's swordfish spear that lights things on fire. Anyone that can point me in the right direction? or what this means? Here's the error EDIT: My png with the item is 50x54 and has the same name as the .cs file with it if that is of any significance.

View attachment 164565

that error means TModLoader cant find your png(https://github.com/bluemagic123/tModLoader/wiki/Basic-tModLoader-Modding-FAQ may fix it)
 
Hi, I am trying to make an item version of the enchanted sundial. Here is my code:
Code:
using System;
using System.Collections.Generic;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace timeTokenMod.Items
{
    public class timeToken : ModItem
    {
        bool speed = false;
        public override void SetDefaults()
        {
            item.name = "timeToken";
            item.width = 40;
            item.height = 40;
            item.maxStack = 1;
            item.toolTip = "A time speeding item";
            item.useTime = 20;
            item.useAnimation = 20;
            item.useStyle = 4;
            item.rare = 1;
            item.UseSound = SoundID.Item6;
            item.consumable = false;
        }   
       
        public override bool UseItem(Player player)
        {
            if (speed = false)
            {
                Main.dayRate = 60;
                speed = true;
            }
            if (speed = true)
            {
                Main.dayRate = 1;
                speed = false;
            }
            return true;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

The mod builds and loads alright, but when i try to use the item in-game, nothing happens.
 
I fixed most of the errors for my mod but I get this when I try to build it:

Items/Weapons/KillersEmbrace
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)
 
How do you make a bullet ignore tiles and immunity frame (ps its piercing)
 
Seriously, I at least need to figure out how to display buffs that would normally be on the UI. There's little to no documentation on this, and I couldn't find any open source mods exampling this.
 
Seriously, I at least need to figure out how to display buffs that would normally be on the UI. There's little to no documentation on this, and I couldn't find any open source mods exampling this.
And I doubt there would be, that's extremely specific. For something like this you just need to decompile terraria and search till you find the code you are looking for.
 
And I doubt there would be, that's extremely specific. For something like this you just need to decompile terraria and search till you find the code you are looking for.
It's just a problem that surfaced when hiding the resource bars. It's caused not only the health and mana to be hidden like I wanted, it's also caused the air and buffs to disappear. I figure more people would have crossed this issue.
 
It's just a problem that surfaced when hiding the resource bars. It's caused not only the health and mana to be hidden like I wanted, it's also caused the air and buffs to disappear. I figure more people would have crossed this issue.
Most people don't hide that interface layer. Yeah, looks like they are the same layer, so what I said still stands.
 
Hey guys ! I have a problem. So, i do everything perfect, i even tried codes that worked for other people, every single modded item i try to do gives me this error:

Items/TutorialSword
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Could someone please help me, please ?
 

Attachments

  • Fără titlu.png
    Fără titlu.png
    707.1 KB · Views: 238
Hey guys ! I have a problem. So, i do everything perfect, i even tried codes that worked for other people, every single modded item i try to do gives me this error:

Items/TutorialSword
at Terraria.ModLoader.Mod.GetTexture(String name)
at Terraria.ModLoader.ModLoader.GetTexture(String name)
at Terraria.ModLoader.Mod.SetupContent()
at Terraria.ModLoader.ModLoader.do_Load(Object threadContext)

Could someone please help me, please ?
Read: http://forums.terraria.org/index.ph...der-a-modding-api.23726/page-679#post-1122935
 
Is there a width x height limit to items like swords when making their .png? For instance is a sword that that's 500 width by 750 height possible?
 
Do you know how to access all the vanilla methods?
 
Yes but, where in the source code can i even find the methods?
Really depends on what you are looking for, some things are private methods so you won't be able to use them, however public hooks should work regardless, don't really remember the folder structure on the top of my head, but the one that just says "Terraria" should contain the base game's code.
 
is possible to add a new draw layer to mod player, and if so how?
 
is possible to add a new draw layer to mod player, and if so how?
looks like i was mistaken i want to replace the vanilla head(from ModPlayer), that wasn't what i needed to know sorry. thank you though.
 
Last edited:
Back
Top Bottom