• 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.

Search results

  1. W

    tModLoader Official tModLoader Help Thread

    I'm using git, so I can always revert if things go badly. Thanks though
  2. W

    tModLoader Official tModLoader Help Thread

    I think you need to set projectile.friendly to true
  3. W

    tModLoader Official tModLoader Help Thread

    Hello, I'm trying to make an NPC, and I don't know how I would make the actual hitbox of the NPC smaller than the sprite? I know I can change npc.width and npc.height, but I'm hesitant to in case that breaks the animation. Plus I'm wanting the hitbox offset from (0, 0) on the sprite anyway. Help...
  4. W

    tModLoader Official tModLoader Help Thread

    Set the player.thorns variable to the appropriate value (0 is 0% damage, 1 is 100% damage)
  5. W

    tModLoader Official tModLoader Help Thread

    item.name is not a thing - there is no 'name' variable in Item. Also, there is no AddTooltip method in ModItem. Delete those and do this: public override void SetStaticDefaults() { DisplayName.SetDefault("Tech Plate"); Tooltip.SetDefault("A plate equipped with tech stuff"); }
  6. W

    tModLoader Official tModLoader Help Thread

    Sure: // Override UseItem in ModItem public override bool UseItem(Player player) { player.AddBuff(Terraria.ID.BuffID.Hunter, 360); // Add the Hunter buff to the player for 6 seconds player.AddBuff(Terraria.ID.BuffID.Horrified, 360); // Add the Horrified buff the the player for 6 seconds...
  7. W

    tModLoader Official tModLoader Help Thread

    I don't think you can use the recipe finder for that - If you want to make a recipe for a vanilla item, just create a recipe like you'd usually do, and set the result to that item.
  8. W

    tModLoader Official tModLoader Help Thread

    You'll have to apply the buffs in UseItem with player.AddBuff, instead of setting item.buffType.
  9. W

    tModLoader Official tModLoader Help Thread

    You can probably locate the vanilla sprites in Main (assuming you have access to the source code) and then in your mod, I guess in your mod's Load() method? you can replace those sprites with your own, for example: Main.dukeFishronTexture = ModContent.GetTexture("ModFolder/pathToImage"); That...
  10. W

    tModLoader Official tModLoader Help Thread

    In your magic weapon item's class, you'll need to override the Shoot method like so: public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) { // Check for that 10% chance if(Main.rand.Next(10)...
  11. W

    tModLoader Official tModLoader Help Thread

    I can certainly try to help you with any questions you have, but the best way to learn is to just jump into it. Do have at least a quick look at a C# tutorial (tutorialspoint has a good one I think) as I had no idea how to code when I started modding, and didn't have a look at any tutorials, and...
  12. W

    tModLoader Official tModLoader Help Thread

    You seem to be checking if player.miscEquips is true, but it's an Item[] array, and it can't convert that to a boolean. What exactly is the if(player.miscEquips) meant to be checking? tModLoader doesn't have a decompiler (that I'm aware of), so you're going to have to use something like ilspy...
  13. W

    tModLoader Official tModLoader Help Thread

    Probably be useful to create a Helper class with some commonly used/useful functions in, like hasInInventory and hasEquippedAccessory You can probably change that in GlobalTile, but I wouldn't know how sorry
  14. W

    tModLoader Official tModLoader Help Thread

    You'll need a static global bool like public static bool hasGeneratedOre in one of your classes, and only generate ore when that boss is defeated if hasGeneratedOre is false, and then you'll obviously need to set it to true after that. To keep this variable across each time you enter the world...
  15. W

    tModLoader Official tModLoader Help Thread

    I think for that you're going to have to subclass GlobalNPC and in AI() you'll have to first check the NPC type (if it's the one you want to detect accessories) and loop through Main.player and check each players inventory, maybe only if the player is within a certain distance of the NPC (or...
  16. W

    tModLoader Official tModLoader Help Thread

    Some vanilla accessories will change a variable in player, like player.accFlipper for the flipper accessory, but for all others, I spotted some Item[] in Player called inventory, miscEquips and armor. You'll have to loop through the correct one out of them (there might be others I missed) and...
  17. W

    tModLoader Official tModLoader Help Thread

    You don't need to do that - You can just put item.buffType = BuffID.WellFed; and item.buffTime = 6000; in SetDefaults
  18. W

    tModLoader Official tModLoader Help Thread

    Have a look at Vanilla sprite sheets, and also have a look at how other mods have done it. tModLoader will likely do them the same as Terraria handles it's NPC sprites, so using that should get you what you want. I haven't made an NPC, so I can't help too much here
  19. W

    tModLoader Official tModLoader Help Thread

    Try this: public override bool CanTownNPCSpawn(int numTownNPCs, int money) { for (int k = 0; k < 255; k++) { Player player = Main.player[k]; if (!player.active) { return false...
  20. W

    tModLoader Official tModLoader Help Thread

    My mistake, I thought that your code was in ModItem for some reason :/ Working code: public override void OnHitNPC(Item item, NPC target, int damage, float knockback, bool crit) { if (vampCharm) { int amountToHeal = damage / 10; // Heal tenth of damage if (amountToHeal +...
Top Bottom