Standalone [1.3] tModLoader - A Modding API

There must be something wrong there somewhere. I'll have to see all of your projectile's code to really see what's happening. If someone else spots the problem before I do, feel free to jump in with a solution.

Code:
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;

namespace Pack.Projectiles
{
    public class PossessedTempliteHammerP : ModProjectile
    {
        public override void SetDefaults()
        {
            projectile.name = "Possessed Templite Hammer";
            projectile.width = 52;
            projectile.height = 52;
            projectile.friendly = true;
            projectile.penetrate = -1;
            projectile.aiStyle = 3;
            projectile.melee = true;
            projectile.tileCollide = false;
            projectile.timeLeft = 60000;
            projectile.light = 1f;
        }
        public override void OnHitNPC(NPC n, int damage, float knockback, bool crit)
        {
            Player player = Main.player[projectile.owner];
            player.statLife += 10; //Heals by 10; Can be changed of course
            player.HealEffect(10); //Shows a green 10 above your head to show you've been healed; Can be changed of course
            if (projectile.ai[1] > 0)
                projectile.ai[0] = 0;
            if (projectile.ai[0] == 0f)
            {
                projectile.velocity *= -1;
            }
            projectile.netUpdate = true;
        }
        public override void PostAI()
        {
            Main.NewText("ai[0]: " + projectile.ai[0] + ", ai[1]: " + projectile.ai[1]);
            if (projectile.ai[0] == 1)
            {
                projectile.velocity *= 2;
            }

        }
    }
}
 
My computer says "This app cant run on your PC" for the GOG version, please help!
 
Anybody know the Terraria.ID.ProjectileID for Rockets?
 
Anybody know the Terraria.ID.ProjectileID for Rockets?

There are four, corresponding with their items: RocketI (134), RocketII (137), RocketIII (140) and Rocket IV (143).

Doesn't destroy tilesDestroys tiles
Small radiusRocket IRocket II
Large radiusRocket IIIIRocket IV
 
Last edited:
Anybody know the Terraria.ID.ProjectileID for Rockets?
I assume you're trying to make endless Rocket ammunition items for your Infinity mod, so I'll try to save you some headache (I've been trying to figure it out for a while in my own mod):
In the ammunition ModItem, you'll want to make item.ammo = 771; and item.shoot = 0, 3, 6, or 9 for Rockets I, II, III, and IV respectively. I tried it before using the projectile IDs for each of the rockets and ended up with a RL that shot Eye Springs .-.
However, I still can't figure out how to get the Snowman Cannon to properly fire the rockets, it doesn't fire a projectile when I use my endless Rocket item.
 
Hello!
I have a weapon that should be an "arm cannon", is there a way to do that when this item is selected it shows its sprite on player's arm witouth clicking (much like nebula blaze and nebula arcanum do)
Thanks for help!
 
Hmmm, I made glasses but they are appearing on player like copper helmet.
 
What the code should be for this?
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;

namespace Randomod.Items.Equipables.Accessories
{
    class SpelunkerGlasses : ModItem
    {
        public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
        {
            equips.Add(EquipType.Face);
            return true;
        }

        public override void SetDefaults()
        {
            item.name = "Spelunker Glasses";
            item.height = 14;
            item.width = 8;
            item.material = true;
            item.maxStack = 1;
            item.rare = 3;
            item.headSlot = 1;
        }

        public override void UpdateEquip(Player player)
        {
            player.AddBuff(BuffID.Spelunker, 1);
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "SpelunkerLens", 1);
            recipe.AddIngredient(ItemID.Wood, 5);
            recipe.AddTile(TileID.TinkerersWorkbench);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
 
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;

namespace Randomod.Items.Equipables.Accessories
{
    class SpelunkerGlasses : ModItem
    {
        public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
        {
            equips.Add(EquipType.Face);
            return true;
        }

        public override void SetDefaults()
        {
            item.name = "Spelunker Glasses";
            item.height = 14;
            item.width = 8;
            item.material = true;
            item.maxStack = 1;
            item.rare = 3;
            item.headSlot = 1;
        }

        public override void UpdateEquip(Player player)
        {
            player.AddBuff(BuffID.Spelunker, 1);
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "SpelunkerLens", 1);
            recipe.AddIngredient(ItemID.Wood, 5);
            recipe.AddTile(TileID.TinkerersWorkbench);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
Could you try removing this line from your SetDefaults function:
Code:
item.headSlot = 1;
 
Could you try removing this line from your SetDefaults function:
Code:
item.headSlot = 1;
But now I'm unable to wear the item.
 
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;

namespace Randomod.Items.Equipables.Accessories
{
    class SpelunkerGlasses : ModItem
    {
        public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
        {
            equips.Add(EquipType.Face);
            return true;
        }

        public override void SetDefaults()
        {
            item.name = "Spelunker Glasses";
            item.height = 14;
            item.width = 8;
            item.material = true;
            item.maxStack = 1;
            item.rare = 3;
            item.headSlot = 1;
        }

        public override void UpdateEquip(Player player)
        {
            player.AddBuff(BuffID.Spelunker, 1);
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(null, "SpelunkerLens", 1);
            recipe.AddIngredient(ItemID.Wood, 5);
            recipe.AddTile(TileID.TinkerersWorkbench);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}

Do you want to use this as a vanity or to equip it on the helmet slot?
EDIT: nvm
EDIT 2: In wich slot do you want to equip this? In head slot or into accessories?
 
Do you want to use this as a vanity or to equip it on the helmet slot?
Second one. But I think I will make it work in vanity slot. But now let's concentrate on second variant.
 
Second one. But I think I will make it work in vanity slot. But now let's concentrate on second variant.

Then I think it should be:
Code:
equips.Add(EquipType.Head);
 
Then I think it should be:
Code:
equips.Add(EquipType.Head);
No, it must be equips.Add(EquipType.Face); or it will hide the hair.
 
Can you post your sprites?
IS THAT JUST FOR SPOILERS?!
13024156.png
13024173.png
 
No, it must be equips.Add(EquipType.Face); or it will hide the hair.
I haven't experienced so much with equipTypes, but isn't EquipTypes.Face for accessories?
You could do them like equipable accessory instead of armor...
IS THAT JUST FOR SPOILERS?!
13024156.png
13024173.png
Idk why I asked, but I can think better with the images (lol). Btw nice glasses.
 
I haven't experienced so much with equipTypes, but isn't EquipTypes.Face for accessories?
You could do them like equipable accessory instead of armor...

Idk why I asked, but I can think better with the images (lol). Btw nice glasses.
They are not nice. :D That's just recolored version.
 
How can I change player's tile reach?
 
Back
Top Bottom