Standalone [1.3] tModLoader - A Modding API

For some reason, enemies aren't dropping money. I'm currently using:


Thorium Mod
Calamity Mod
Zoaklen Mod
Reduced Grinding Mod
RPG classes mod
Dushy's Upgrade mod

It's really frustrating how I always have like no money.
 
Every single weapon that Summons an entity on screen doesn't work, like the flare gun, slime staff, and it applies to modded weps too. Can someone plz help(I'm sorry for bothering everyone again
 
when i make a sword, i can change item width and height, but i do not notice any effect of changing it, as hitbox of my sword seem to stay just as big as my sprite size which stay the same size as well. So what are those for?
 
View attachment 152072
hey, sorry for silly questions, still how do i fix ?
See the yellow triangle next to 'Terraria' in references? that means that Visual Studio can't find the file anymore. Remove the reference and add it again. Also, make sure you are referencing tModLoader's .exe not vanilla .exe, if you have a side-by-side installation.

when i make a sword, i can change item width and height, but i do not notice any effect of changing it, as hitbox of my sword seem to stay just as big as my sprite size which stay the same size as well. So what are those for?
I think that width and height change the item's appearance when dropped in the world. I think that item.scale is what you want to change. But I could be wrong.
 
Hi guys, I don't see a bug or feature request thing in the OP and the former programmer in me has been tickled.

In short, when trying to build a mod without the "build.txt" file existing in the mod's source folder, everything *appears* to work properly but it fails miserably. If you use tModReader to extract the result, essentially all the input files are missing. Any chance of adding a simple check for the existence of the "build.txt" file during the build phase?
 
EDIT: Nevermind. I removed and reequiped all my equipment and things seem to have fixed themselves and I can't cause it to happen again. So.. I guess.. move along, nothing to see here.

EDIT 2: Thanks to another member posting about this same issue, it turns out that putting a dye in the head slot is what caused it: https://forums.terraria.org/index.p...der-a-modding-api.23726/page-733#post-1156016

I'm working on getting the TML GOG patches working and I've come across some unusual behavior. Before I make a github issue, I want to see if any of you steam users can reproduce this, because there is every possibility that it could just be an issue on the GOG patching side.

Basically, the Balloon Animal and Bundled Party Balloons vanity accessories display below the character's feet instead of above their head. The left image shows the problem in patched GOG Terraria and the right image from vanilla Terraria shows what it should look like.
View attachment 151690
Steam user here, and I have the exact same problem. I first noticed it with "Bundle of Balloons", and it indeed happens with all others I've tried -- all of them appear just like in your picture, roughly half of it depicted underneath the character. This is the only significant problem I've encountered so far using the latest tMod.



Apologies in case this has since been addressed.
 
Hi guys another question. The answer is likely no but is there a way to directly access player data? Specifically, I'd like to be able to access the player's equipment array and increase the size of array that holds accessories. It seems to be hard coded to 7.
 
When im trying to use ranged type weapon nothing happens. if im facing right every weapon is in daedalus bow position and if im facing left every weapon aims into the ground. They don't shoot anything and don't consume ammo.

Edit1: also my game crashes every 10 mins.
 
Last edited:
one question: ive found the tmodloader migration file an had migrated most of the stuff, but now tmodloader says something llike "no override accepts 2-arguments for the "hurt"-method" (sorry i had to translate that error it might not be perfect) and ive found nothing about it on this migration file so could someone please help me? :confused:
 
TML GOG Patcher for 1.3.4.4
Is out and up and running (contrary to the current opening post in this topic - due to a short timeframe since release and this post).
Refer to the link provided in this topic to 'GOG Installer' for an up-to-date download link and information.

Thanks to Jeckel for continuing work on this.
 
one question: ive found the tmodloader migration file an had migrated most of the stuff, but now tmodloader says something llike "no override accepts 2-arguments for the "hurt"-method" (sorry i had to translate that error it might not be perfect) and ive found nothing about it on this migration file so could someone please help me? :confused:
Hurt in ModPlayer looks like this: public override void Hurt(bool pvp, bool quiet, double damage, int hitDirection, bool crit). You'll have to show the exact error if this doesn't help
 
Hurt in ModPlayer looks like this: public override void Hurt(bool pvp, bool quiet, double damage, int hitDirection, bool crit). You'll have to show the exact error if this doesn't help
in fact ive put that in my weapon...
and the specific code of this is:
Code:
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
        {
               int spike = (int)Math.Floor((double)(damage / 10));
                 player.Hurt(spike, target.direction);
            base.OnHitNPC(player, target, damage, knockBack, crit);
        }
or do I have to do it in ModPlayer?
 
in fact ive put that in my weapon...
and the specific code of this is:
Code:
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
        {
               int spike = (int)Math.Floor((double)(damage / 10));
                 player.Hurt(spike, target.direction);
            base.OnHitNPC(player, target, damage, knockBack, crit);
        }
or do I have to do it in ModPlayer?
Oh. You are talking about a vanilla method. I am in bed, hopefully someone can tell you the new parameters.
 
Who wants to be an awesome person, and help me figure out my error when trying to publish my Tech Mod, it is small, so size is not the error. I believe the error could be the custom music I added in before attempting to publish. Here's the error:

The operation has timed out
at System.Net.HttpWebRequest.GetResponse()
at Terraria.ModLoader.IO.UploadFile.UploadFiles(String address, IEnumerable`1 files, NameValueCollection values)
at Terraria.ModLoader.UI.UIModSourceItem.Publish(UIMouseEvent evt, UIElement listeningElement)

See it? Last line down, listeningElement, must be sound. But, I don't think I coded wrong.

ButterKnifeMod is the file name for my mod.
Here's my code:

using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using ButterKnifeMod.Items;

namespace ButterKnifeMod
{
public class ButterKnifeMod : Mod
{
public ButterKnifeMod()
{
Properties = new ModProperties()
{
Autoload = true,
AutoloadGores = true,
AutoloadSounds = true
};
}
public override void UpdateMusic(ref int music)
{
if (Main.myPlayer != -1 && !Main.gameMenu)
{
if (Main.player[Main.myPlayer].active && Main.player[Main.myPlayer].GetModPlayer<MyPlayer>(this).ZoneCustomBiome) Biome
{
music = this.GetSoundSlot(SoundType.Music, "Sounds/Music/CustomMusic");
}
}
}
}
}

Of course, with all the usual spaces, but could someone please help me?!
 
Is there a way to see if a sound (specifically music) finished playing? As in - to catch the moment in which it starts playing again from the beginning? In order to, for example, change track.
 
I'm trying to make a case that is right clicked and drops swords to make the nights edge, but when I right click it in-game it drops nothing.

using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace OxysMod.Items.Cases
{
public class NightsEdgeCase : ModItem
{
public override void SetDefaults()
{
item.name = "Night's Edge Case";
item.maxStack = 1;
item.consumable = true;
item.width = 24;
item.height = 24;
item.toolTip = "'Open to find a material for the Night's Edge'";
item.toolTip2 = "'Has a 1/6 chance to drop some junk'";
item.rare = 3;
}
public override bool CanRightClick()
{
return true;
}

public override void OpenBossBag(Player player)
{
int choice = Main.rand.Next(6);
if (choice == 0)
{
player.QuickSpawnItem(ItemID.OldShoe);
}
if (choice == 1)
{
player.QuickSpawnItem(ItemID.Muramasa);
}
if (choice == 2)
{
player.QuickSpawnItem(ItemID.LightsBane);
}
if (choice == 3)
{
player.QuickSpawnItem(ItemID.BladeofGrass);
}
if (choice == 4)
{
player.QuickSpawnItem(ItemID.BloodButcherer);
}
if (choice == 5)
{
player.QuickSpawnItem(ItemID.FieryGreatsword);
}
}
}
}

Nobody responded so I'm just reposting it again :\
 
Back
Top Bottom