• Journey's End on PC - Find info here and here. Please report bugs and issues for PC 1.4 and 1.4.1 to Re-Logic here.
  • Journey's End on Mobile - Find info here. Report bugs for Mobile 1.4 to DR Studios at this link and give as much detail as possible.
  • 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.
  • Console and Switch - The latest news can be found here. To report a bug, please use this link.

tModLoader Official tModLoader Help Thread

Butterspewn

Terrarian
For NPC selling, do this:
C#:
        public override void SetupShop(Chest shop, ref int nextSlot) {
            if (downedBoss2 == true)
            {
                shop.item[nextSlot].SetDefaults(ItemID);
                nextSlot++;
            }
        }
Replace ItemID with and Item by it's ID.
For normal and unprepared if statements, do this:
C#:
     if (downedBoss2 == true)
     {
     }
do you know what namespace i need to use since it says that "downedBoss" does not exist in the current context. The namespaces im currently using are Terraria, Terraria.ID and Terraria.Modloader.
 
Last edited:
I'm tryna make a daedalus stormbow-like-bow in V.C.S. but idk how to make it shoot projectiles from the sky nor how to make it shoot a lot of those projectiles(and if you want tell me how to shoot 2 projectiles(an arrow and a star) ).

CODE:
 

shoelid

Terrarian
I'd like to have my sword swing fast with a delay between each swing. My assumption was that I could have useTime be longer than useAnimation to achieve this effect, but that doesn't seem to be the case. I've also tinkered around with reuseDelay to no avail. Any suggestions?
 

NameTaken

Skeletron
You don't need anything special to do this.
In your UpdateArmorSet:
Code:
player.setBonus = Language.GetTextValue("ArmorSetBonus.Palladium");
player.onHitRegen = true;
it works, except for the "player.setBonus = Language.GetTextValue("ArmorSetBonus.Palladium");"
part but not that it matters because i can just type "Greatly increases life regeneration after striking an enemy"
 

NameTaken

Skeletron
how do i make an accessory that makes you immune to a buff? im trying to make something interesting and i want it to make you immune to distorted.
 
Last edited:

Piercepotato

Terrarian
is there some way to modify player knockback through an accessory? I found something called .GetWeaponKnockback but I can’t figure out how to set it up properly or even if it would do what i want anyway.
 

shoelid

Terrarian
is there some way to modify player knockback through an accessory? I found something called .GetWeaponKnockback but I can’t figure out how to set it up properly or even if it would do what i want anyway.
You would probably do this in a ModPlayer class. You should carefully read over what ExampleMod tells you in its SimpleModPlayer file, but what you basically do is this:
Create a public variable in the ModPlayer class that your accessory changes. Say you make it a bool titled knockbackAccessory: public bool knockbackAccessory;

Then in the ResetEffects method in your ModPlayer class, set it to false. This is essentially where you place the default value of your knockbackAccessory variable.
To have your accessory update this, you want to put this line in its UpdateAccessory:player.GetModPlayer<your ModPlayer file name here>().your variable here = true;

Now to make it increase knockback.
In the ModPlayer class, you can use the GetWeaponKnockback to increase the knockback value of your attack only if knockbackAccessory is true:
C#:
public override void GetWeaponKnockback(Item item, ref float knockback)
        {
            if (knockbackAccessory) { knockback *= 999; }
        }
I've only started modding recently, but it seems all the fun stuff happens in the ModPlayer class. I'd recommend getting really comfortable with it.
Good luck! :)
 

shoelid

Terrarian
I'd like to have my sword swing fast with a delay between each swing. My assumption was that I could have useTime be longer than useAnimation to achieve this effect, but that doesn't seem to be the case. I've also tinkered around with reuseDelay to no avail. Any suggestions?
I have another question on top of this: How do i completely turn off pitch variance for a custom sound? I've tried .WithPitchVariance(0f), which doesn't seem to work.
 
Top Bottom