Standalone [1.3] tModLoader - A Modding API

Wonder where the updated version of this is?
It's not on the front page, so if I can't download to update I can't play Terraria modded due to outdated mods that requires the update.
You can get the most up to date version off the tModLoader Discord server in the #announcements channel, but apparently it may still have some bugs which is why they haven't updated the main page just yet.
 
hmmm can't go to mods list or mod browser as it either crashes or freezes.....any solutions? (crashes when going into mod browser, and crashes when going into my mods list.
 
Ok, so. I want to make a projectile with an effect, which I thought would be a fairly common thing. But I haven't been able to find anything. At all. There's nothing on how to make projectiles that give buffs or debuffs. At least, not that I can see. So, anyone got a solution? Just a quick warning, I'm not all that good with C#
So I figured out how to add a debuff to a projectile, but now I've run into a different issue. I'm wanting to, instead of a debuff, heal the player for a third of the damage. But I don't know how to heal the player with a projectile. I've figured out that I want "ModPlayer", but I don't know what the current health property is. The healing code as it is will follow.

Code:
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
      int lifeSteal = damage / 3;
      ModPlayer.statLife += lifeSteal;
      ModPlayer.HealEffect(lifeSteal);
}
Any advice?
 
So I figured out how to add a debuff to a projectile, but now I've run into a different issue. I'm wanting to, instead of a debuff, heal the player for a third of the damage. But I don't know how to heal the player with a projectile. I've figured out that I want "ModPlayer", but I don't know what the current health property is. The healing code as it is will follow.

Code:
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
      int lifeSteal = damage / 3;
      ModPlayer.statLife += lifeSteal;
      ModPlayer.HealEffect(lifeSteal);
}
Any advice?

Hm, a better way would be to find the player in the player array. Try something more like the following.
Main.player[projectile.whoAmI].HealEffect(lifeSteal);
One problem is that 'int damage' is the damage before your targets defence is taken into account (I think), and I don't know how to find the final damage value.
 
Hm, a better way would be to find the player in the player array. Try something more like the following.
Main.player[projectile.whoAmI].HealEffect(lifeSteal);
One problem is that 'int damage' is the damage before your targets defence is taken into account (I think), and I don't know how to find the final damage value.
You, my dear sir, are one of my favourite people, as of now. Thanks to you, it compiled without errors, but it didn't heal me. However, with a slight modification -
C#:
Main.player[projectile.owner].HealEffect(lifeSteal);
- I was able to get it fully working. My sincerest thanks
Untitled.png
 
Last edited:
You, my dear sir, are one of my favourite people, as of now. Thanks to you, it compiled without errors, but it didn't heal me. However, with a slight modification -
C#:
Main.player[projectile.owner].HealEffect(lifeSteal);
- I was able to get it fully working. My sincerest thanks

I apologize, I was mistaken. While you are still a great person, I was wrong that it was working. It was simply providing the HealEffect, which is the green number. I wasn't actually being healed at all. Still, it's a step in the right direction. Any more advice?
 
I apologize, I was mistaken. While you are still a great person, I was wrong that it was working. It was simply providing the HealEffect, which is the green number. I wasn't actually being healed at all. Still, it's a step in the right direction. Any more advice?
Glad to be of help, though that was a mistake on my part having .whoAmI instead of .owner.

It's been a while since I dealt with healing players, and I'd forgotten that the heal effect and actual healing is seperate. Like you had earlier, you need to add lifeSteal to the player's health, but add it to Main.player[projectile.owner].statLife instead.
 
I apologize, I was mistaken. While you are still a great person, I was wrong that it was working. It was simply providing the HealEffect, which is the green number. I wasn't actually being healed at all. Still, it's a step in the right direction. Any more advice?
Glad to be of help, though that was a mistake on my part having .whoAmI instead of .owner.

It's been a while since I dealt with healing players, and I'd forgotten that the heal effect and actual healing is seperate. Like you had earlier, you need to add lifeSteal to the player's health, but add it to Main.player[projectile.owner].statLife instead.
I am no longer mistaken. I owe you. Thanks
 
We're aware of the frequent outages of the Discord server. We're in contact with Discord staff and they're looking for a fix.
 
v0.11.6.2:
Fixes
-Fix imgur/mod icon related issues
-Fix issue with high speed yoyos
-Fix issue with multiple texture packs
-Fix issue with hidden files in the texture packs folder
-Fix rare issue with auto migration of Players and Worlds
API
-Internal loops in .ogg files now supported
-PDB files are available as a separate download for troubleshooting scenarios. If you are seeing exceptions in tModLoader code, placing the pdb file in the install directory and renaming it to the .exe filename should make the exception stack traces have line numbers for tModLoader methods.
Patreon Thanks
-Added POCKETS patreon set

v0.11.6.1 (Unstable):
QOL
-Mod Extract now opens the destination folder automatically
-ModConfig boolean item now shows text as well
Fixes
-Fix MonoMod issue where old code was running when mod re-built or updated.
-Fix issue with mod load cancelling
-Fix join invite issue
-Fix ValueTuple issues, as seen with recent releases of ThoriumMod and CheatSheet
-Exceptions will now be thrown for reading too few bytes in HandlePacket (check logs)
-Fix "Failed to unload" messages not working
-Fix mod compile error line numbers being one off
-Fix ServerHangWatchdog on mono
-More info for ReflectionTypeLoadException
-Fix ModConfig Dictionary<string,T> issue
-Fix Shaders being unable to update without a restart
-Fix OutOfMemory handling behavior
API
-GlobalItem/ModItem.PrefixChance and AllowPrefix -- More control over prefix assignment
-ModMountData: JumpHeight and JumpSpeed have new parameters. SetMount, Dismount, and Draw hooks allow greater mount customization.
-GlobalItem/ModItem.CanBurnInLava hook, allows for enabling lava burning of specific items. Thanks @GoodPro712
-MonoMod updated to v19.12.19.01. Thanks @0x0ade
-.lang file entries are no longer Trimmed.
ExampleMod
-ExampleSimpleMinion, an easy to follow minion example, Thanks @direwolf420
-ExclusiveAccessory, Thanks @direwolf420
-AllowPrefix and PrefixChance examples, Thanks @direwolf420
-Hurt sound replacement example, Thanks @KryptonIon
-Car now has example of _mountSpecificData usage, as well as SetMount and Draw
-Hot Potato/ExampleCustomData example, shows saving and syncing custom ModItem data via ModItem.Save/Load/NetSend/NetRecieve
-ToFromStringConverter example for ExampleConfig, Thanks @direwolf420
 
Hi again. So, I want to make a projectile. This projectile needs to have a hitbox that damages enemies, and another, slightly smaller hitbox to deal with tile collision. How do I do this?
 
but can you play mod in pirated version?
As was mentioned earlier, this is an official Terraria website, and discussion of piracy is forbidden. To answer the question, if I'm not mistaken no, tModLoader does not work on pirated copies of Terraria, and for a good reason
Discussion of pirated copies of Terraria is not permitted on this forum. Do not continue this topic or there will be further consequences.
 
Dudes, sorry to drop out of the blue, but i'm having a rather serious issue that i believe quite a few users will get soon.
My GF upgraded to a new MAC running Catalina OS and as it doesnt support 32 bit and JAR files I literally can't install Tmodloader, when copying the 32 bit EXE doesnt work.
I can't go back to playing vanilla terraria with her, we just reached the wall of flesh with Terraria Overhaul XD Any tips or suggestions how to get TmodLoader working with the new MAC ?!
?
 
Last edited:
I need some help. For some reason, when i load Tmoadloader, my mouse cursor is slowly moving up the screen on its own. I tried running normal Terraria and this problem doesnt happen. It only happens when in tmoadloader.

EDIT: Scratch that, it does it with normal Terraria as well. It seems that tmodloader causes this even without tmodloader running. When i verify integrity of game files, the problem stops. But then tmodloader is uninstalled it seems.

EDIT: I figured out the problem, my controller was plugged in and was messing with the mouse movements. Sorry for wasting time.
 
Last edited:
Back
Top Bottom