• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Begin your search for Journey's End information here and here. Please report bugs and issues for Journey's End here.
  • For issues you find with the Mobile 1.4 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

Standalone [1.3] tModLoader - A Modding API

TheGamerLV

Terrarian
Hello Please help me
Code:
    public override void UpdateEquip(Player player)
     {
       player.moveSpeed += 0.05f;
     }
How do i get to know all of the player. stats like there it is player.moveSpeed
 

blushiemagic

Retinazer
tModLoader
Quick and fast question, is there any way to hide an NPC's health bar? Specifically, I need this to prevent a worm NPC from showing the (usually wrong) hp of its single parts. Vanilla worms seem to use a bool called "dontCountMe", but setting it to true didn't seem to do anything.
Hm, it looks like health bars are terribly hardcoded into the game. I'll have to add a hook for that in the next update.

Hello Please help me
Code:
    public override void UpdateEquip(Player player)
     {
       player.moveSpeed += 0.05f;
     }
How do i get to know all of the player. stats like there it is player.moveSpeed
Unfortunately, the only way is to decompile Terraria then look at Player.cs.
 

NeonDragon5

Official Terrarian
Can anyone help me add more than one craft group. I can't seem to figure out how to add more.

Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod
{
    public class ExampleMod : Mod
    {
        public ExampleMod()
        {
            Properties = new ModProperties()
            {
                Autoload = true,
                AutoloadGores = true,
                AutoloadSounds = true
            };
        }

        public override void AddRecipeGroups()
        {
            RecipeGroup group = new RecipeGroup(() => Lang.misc[37] + " " + GetItem("ExampleItem").item.name, new int[]
            {
                ItemType("ExampleItem"),
                ItemType("EquipMaterial"),
                ItemType("BossItem")
            });
            RecipeGroup.RegisterGroup("ExampleMod:ExampleItem", group);
        }
    }
}
 

jopojelly

Retinazer
tModLoader
What is going on with the tmodloader mod browser? The server has been down for hours and is annoying me.
So My mod browser is under heavy load
what does it means?
does that means youre working on the mod browser?
That means the daily bandwidth limit it has was reached. I'm investigating the cause of the sudden jump in downloads.
oh could you upload Player.cs somewhere on your github?
No, we can't. Not allowed
 
I'm having an issue with some experimental code.
I have a body armor item based off of ExampleMod. What I want it to do is copy the color of the player's skin color.
However, after adding in this code, any accessories worn around the body area stop being drawn.
Code:
public override void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
{
    PlayerDrawInfo info = new PlayerDrawInfo();

    color = info.bodyColor;
}
The armor's color is set correctly, but as said above, all accessories around the body area (shield, balloon, etc) stop drawing. The accessories appear again as soon as I take the armor off.

Additionally, the Shield of Cthulhu does not draw on dash, and neither does the afterimage effect.
 
Last edited:

jopojelly

Retinazer
tModLoader
I'm having an issue with some experimental code.
I have a body armor item based off of ExampleMod. What I want it to do is copy the color of the player's skin color.
However, after adding in this code, any accessories worn around the body area stop being drawn.
Code:
public override void DrawArmorColor(Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
{
    PlayerDrawInfo info = new PlayerDrawInfo();
    PlayerLayer.Body.layer.Invoke(info);

    color = info.bodyColor;
}
The armor's color is set correctly, but as said above, all accessories around the body area (shield, balloon, etc) stop drawing. The accessories appear again as soon as I take the armor off.

Additionally, the Shield of Cthulhu does not draw on dash, and neither does the afterimage effect.
That sounds like an exception is being thrown. Surround with try catch and log the exception.
 
That sounds like an exception is being thrown. Surround with try catch and log the exception.
How do I log the exception? I don't have much experience with try/catch blocks either.
I came up with this:
Code:
try
{
    PlayerDrawInfo info = new PlayerDrawInfo();

    color = info.bodyColor;
}
catch(System.Exception e)
{
    ErrorLogger.Log(e.ToString());
}
Would this work?
(I removed the Invoke line; turns out it wasn't needed. Behavior is still the same)

EDIT: I built the mod with this code, and everything still works as it is. Since the code is clearly still working, I can't possibly imagine there's even one exception occuring.
However, there's a good possibility that the reason this is happening is because of the method itself. In the documentation, it says that it changes the color of accessories around it too (which is bad. I don't want this.)

It's entirely possible that the body color has a very low alpha, making objects not intended to have that color invisible. Not getting the afterimage, though... possibly another side effect of the alpha change?

So I suppose the real question here is: is it possible to change the color of an armor piece without changing the color of nearby accessories? It feels like it should, since the game already seems to do that with dressers.
 
Last edited:

UberCAKE

Spazmatism
For the last 2, just add the correct tile.

The ExampleMod has an example of ice chest items.

The other ones need to be more specific, so I know which part is the part you need help with
Where in the example mod?

For the ore spawning, I have a ore (called Skaedium) that I want to generate like Cobalt or Palladium, (breaking a demon/crimson altar causes them to generate).

Is it possible to change the image of the moon once Hardmode is enabled? (Like how wearing sunglasses causes the sun image to change).

Also what's the tile ID for a Crimson altar?
 

jopojelly

Retinazer
tModLoader
Where in the example mod?

For the ore spawning, I have a ore (called Skaedium) that I want to generate like Cobalt or Palladium, (breaking a demon/crimson altar causes them to generate).

Is it possible to change the image of the moon once Hardmode is enabled? (Like how wearing sunglasses causes the sun image to change).

Also what's the tile ID for a Crimson altar?
Post world gen. Exampleworld.cs

No, that's all hard coded, unless you just want to piggyback off the tile being killed in a globaltile.

No, at least not that I think of.

It's TileID.DemonAltar
 

DoYouEvenCookie

Terrarian
Code:
if (projectile.ai[1] > 0)
projectile.ai[0] = 0;
if (this.ai[0] == 0f)
{
this.velocity *= -1;
}
this.netUpdate = true;
"this" needs to be "projectile"
THANKS

Now that the boomerang goes through, how do I make it return faster. It was mentioned before that this is part of the AI I think, but it should be possible to do since the paladin's hammer uses the same AI as other boomerangs, but returns faster.

sorry if I'm annoying.

pls help
 

jopojelly

Retinazer
tModLoader
THANKS

Now that the boomerang goes through, how do I make it return faster. It was mentioned before that this is part of the AI I think, but it should be possible to do since the paladin's hammer uses the same AI as other boomerangs, but returns faster.

sorry if I'm annoying.

pls help
If I were you, I'd copy the ai code in and edit it directly, but if you want to do this blind, a solution might be changing the aiType to the hammer after collide
 
Everytime i have to download Tmodloader again and again because i can only play it once then when i try to play a second time it says:


System.DllNotFoundException: Unable to load DLL 'CSteamworks': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Steamworks.NativeMethods.SteamAPI_RestartAppIfNecessary(AppId_t unOwnAppID)
at Terraria.Social.Steam.CoreSocialModule.Initialize()
at Terraria.Social.SocialAPI.Initialize(Nullable`1 mode)
at Terraria.Program.LaunchGame(String[] args)



WHAT SHOULD I DO!!!!!!
 
Top Bottom