Standalone [1.3] tModLoader - A Modding API

I did not ask your opinion
 
I did not ask your opinion
Not an opinion, but a fact. If you continue to ignore the rules and staff direction, you may lose some of your privileges to post.

This is the official site for Terraria, talking about pirating the game here is not permitted.
 
I Am Having some problems.o_O
I Made a sprite for the thing that broke :(
SuspiciousMushroom.png
 
Has there been a thread for this???: I want to make a condition where the weapon will have increased damage so long as it's hp is above 50% but somehow the condition when it gets below 50% doesn't work.

Here's the code:

Code:
        public override void UpdateInventory(Player player)
        {
            if (player.inventory[player.selectedItem] == this.item){
                if (player.statLifeMax <= player.statLifeMax2/2){
                    player.meleeDamage /= 2f;
                    ((RequiemPlayer)player.GetModPlayer(mod, "RequiemPlayer")).critMultiplier = 1.25f;//<- An additional 50% critical hit damage.
                }
                else {
                    player.meleeDamage *= 1.252f;
                    ((RequiemPlayer)player.GetModPlayer(mod, "RequiemPlayer")).critMultiplier = 1.25f;
                }
            }
 
Last edited:
Has there been a thread for this???: I want to make a condition where the weapon will have increased damage so long as it's hp is above 50% but somehow the condition when it gets below 50% doesn't work.

Here's the code:

Code:
        public override void UpdateInventory(Player player)
        {
            if (player.inventory[player.selectedItem] == this.item){
                if (player.statLifeMax <= player.statLifeMax2/2){
                    player.meleeDamage /= 2f;
                    ((RequiemPlayer)player.GetModPlayer(mod, "RequiemPlayer")).critMultiplier = 1.25f;//<- An additional 50% critical hit damage.
                }
                else {
                    player.meleeDamage *= 1.252f;
                    ((RequiemPlayer)player.GetModPlayer(mod, "RequiemPlayer")).critMultiplier = 1.25f;
                }
            }
Looks like a typo to me. Where you have
if (player.statLifeMax <= player.statLifeMax2/2){
you should have
if (player.statLife <= player.statLifeMax2/2){
 
Looks like a typo to me. Where you have
if (player.statLifeMax <= player.statLifeMax2/2){
you should have
if (player.statLife <= player.statLifeMax2/2){

oh, i didn't know there was a call for that; thought it was just player.statLifeMax and .statLifeMax2; guess i need to search better, thanks :3
 
Tmodloader 1.16.1 is here!
 
Dunno if this is the appropriate thread for this, but I haven't played the game in a while and wanted to make a calamity playthrough, but it apparently doesn't read my mod folder anymore. Anyone knows how to fix this?
1577301497656.png
1577301561802.png
 
hello, my game has been crashing for memory shortage after i updated modloader to latest version, im using same mods, could new update be problem, "bug" or something ? i dont think it gives crash log (just out of memory window pops up and closes game)
 
Weird I just installed it and I am 100% sure I did it right, after installation I played with my friends and then I wanted to launch the normal Terraria, but in order to do so I had to uninstall the tModLoader (otherwise it doesn't work for me, really) which I did by uninstalling Terraria, know if you uninstall the game itself, the saves are kept anyways, bbut when I installed it again, POOF, the save files from before installation were all gone (the vanilla saves I played before instaling the tModLoader) I even try loading the cloud saves but nothing and the cloud worked before too. What's happening there? (also I checked the bin and suprisingly there were none of my save files or worlds)
 
The Tmodloader v0.11.6.1 is why not download it on the original page?

And Why this page is instead open up: tModLoader/tModLoader

Sooo This is safe and and good and all happiness?

Edit: Just to make sure Im don't get some bad stuff, not that I don't have trust in it tho...
 
Last edited:
The Tmodloader v0.11.6.1 is why not download it on the original page?

And Why this page is instead open up: tModLoader/tModLoader

Sooo This is safe and and good and all happiness?

Edit: Just to make sure Im don't get some bad stuff, not that I don't have trust in it tho...
You're good dude, 's perfectly legit
 
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#
 
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.
 
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.
 
Is Tml discord down?
 
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.
 
Back
Top Bottom