Standalone [1.3] tModLoader - A Modding API

So I am trying to get a "Throwing style melee weapon" to work...

What I want the weapon to do is throw a random amount of projectiles in a similar way to vampire knives.

Here's the projectile CS

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

namespace TerraCompilation.Projectiles
{
   public class CopperSS : ModProjectile
  {
  public override void SetDefaults()
  {
  projectile.name = "Thrown Copper Shortsword";
  projectile.width = 10;
  projectile.height = 44;
  projectile.timeLeft = 120;
  projectile.penetrate = 0;
  projectile.friendly = true;
  projectile.hostile = false;
  projectile.tileCollide = true;
  projectile.ignoreWater = true;
  projectile.ranged = true;
  projectile.aiStyle = 0;
  }
  }
}

And this is the item CS itself
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using TerraCompilation.Items;

namespace TerraCompilation.Items.Weapons
{
   public class Copperhand : ModItem
   {
     public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
   {
     texture = "TerraCompilation/Items/Weapons/Copperhand";
     return true;
   }
     public override void SetDefaults()
     {
       item.name = "Copperhand";
       item.damage = 85;
       item.melee = true;
       item.noUseGraphic = true;
       item.width = 2;
       item.height = 2;
       item.toolTip = "Throw copper shortswords at your foes!";
       item.toolTip2 = "It's about time the copper shortsword got its revenge!";
       item.useTime = 10;
       item.useAnimation = 10;
       item.useStyle = 1;
       item.noMelee = true;
       item.knockBack = 2;
       item.value = 263000;
       item.rare = 4;
       item.UseSound = SoundID.Item1;
       item.autoReuse = true;
       item.shoot = mod.ProjectileType("CopperSS");
       item.shootSpeed = 10f;
       item.expert = true;
     }
  
     public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
     {
       int numberProjectiles = 2 + Main.rand.Next(8);
       for (int i = 0; i < numberProjectiles; i++)
       {
         Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedByRandom(MathHelper.ToRadians(10));
         Projectile.NewProjectile(position.X, position.Y, perturbedSpeed.X, perturbedSpeed.Y, type, damage, knockBack, player.whoAmI);
       }
       return false;
     }
  
     public override void AddRecipes()
     {
       ModRecipe recipe = new ModRecipe(mod);
       recipe.AddIngredient(ItemID.LunarBar, 30);
       recipe.AddIngredient(null, "Unknownparts", 1);
       recipe.AddTile(TileID.LunarCraftingStation);
       recipe.SetResult(this);
       recipe.AddRecipe();
     }
   }
}

Yet whatever I do, I can't get it to fire the projectiles, it does its animations but never shoots.
I'm sure theres an error in there that my newbie brain can't see, so if an expert can tell me where I screwed up I'd be mighty thankful. :)


EDIT: Turns out having penetration set to 0 on the projectile was the culprit in this issue, it's been resolved!
 
Last edited:
So after downloading the new Terraria update and doing the manual install for tModLoader as I usually do, I boot up the game and it (Somehow?) recognizes old mods that wouldn't even conceivably be in my Terraria; I say this because twice now I've deleted all my Terraria files, re-downloaded them, re-downloaded tModLoader, then did the manual install, only for it to somehow detect the mods again. The reason I bring this up is because I can no longer load a modded Terraria client, it's almost finished with initializing 1.3.3 mods, then crashes. Any potential way of how I could go about fixing this? I'm really hyped for another wave of mods, along with the 1.3.4 content patch.
If you're on windows, go to My Documents>My Games>Terraria>ModLoader>Mods. If there are still mods there, that's your problem. If not, try to do a search on your computer for the name of one of the mods (if you can remember it) and if it shows up, try to find where said mods are and delete them all if you wont use another version of tModLoader


Edit: (Unrelated) I'm having some trouble still, can anyone please explain (to someone not super tech savvy such as myself) how to move the locations that tModloader looks for mods in per version? I loved my setup for the previous update and wanted a way to have multiple tModLoader versions working at once without having to grab all my mods and put them in a folder every time I play the new or old version(s) of terraria. Thanks :D
[doublepost=1483029021,1483028491][/doublepost]
If I have mods downloaded and in the file for tmodloader but were not updated to that version of tmodloader yet have now been updated, do I need to redownload the mod or would updating it in tmodloader in terraria work? It's a bit wordy sorry if you need more clearification
If the mods have a version for the current tModLoader update then you can just update them in game or redownload them. If not, then those mods (possibly) might not be usable in the newer version of tModLoader/Terraria
 
How can I make armor set bonus that are like the Vortex and stardust ones, where the player double-taps down to change stats or direct a unique minion?


Also, what about one like the Orichalcum armor, where it creates a projectile after hitting an enemy?
 
Last edited:
What is the code for the vortex beater's grenades and guns in general? For a more machine guns mod I wanted to make I was gonna make a vortex gatling gun which is crafted with 1 chain gun 1 vortex beater 1 illegal gun parts 5 of each of the souls of fright,might,and sight and 18 vortex fragments at an ancient manipulator. The gun would turn any suitable ammo into the grenades fired by the vortex beater while having these stats:
2bb34589a4d249bd9c1cf68adf5bad38.png
that's the sprite I made with gimp.
40 damage
3 (weak knockback)
4% critical strike chance
6 use time
25 velocity
'58% chance to not consume ammo'
'Turns any suitable ammo into vortex homing explosives'
 
I'm terribly sorry if this has been asked, but I can't find any info. If you're running a dedicated server (Renting from a provider) is there anywhere else you can put the mods to load on the server instead of in documents and still have the folder read since we do not have access to that folder.
 
I do have thorium. Has that issue known to be caused by thorium?
yes it has
[doublepost=1483042565,1483042537][/doublepost]
How can I make armor set bonus that are like the Vortex and stardust ones, where the player double-taps down to change stats or direct a unique minion?


Also, what about one like the Orichalcum armor, where it creates a projectile after hitting an enemy?
are the hooks for such things all ready in the game ?
 
I'm terribly sorry if this has been asked, but I can't find any info. If you're running a dedicated server (Renting from a provider) is there anywhere else you can put the mods to load on the server instead of in documents and still have the folder read since we do not have access to that folder.
can anyone please explain (to someone not super tech savvy such as myself) how to move the locations that tModloader looks for mods in per version? I loved my setup for the previous update and wanted a way to have multiple tModLoader versions working at once without having to grab all my mods and put them in a folder every time I play the new or old version(s) of terraria. Thanks
Either in a bat file or a shortcut files, set the saveDirectory flag:

tModLoader.exe -savedirectory "D:\Documents\My Games\tmodbeta"
 
Everyone I'm facing a problem when I'm playing with Tmodloader. So whenever I'm using the hotbar if I use an item that isn't in the 9th slot it doesn't do anything except for selecting the 9th slot, so I'm limited to one hotbar slot. I've tried disabling ALL the mods I have downloaded(except tmodloader) but it doesn't solve the problem. So is this a bug with tmodloader or is it with vanilla terraria?
 
Everyone I'm facing a problem when I'm playing with Tmodloader. So whenever I'm using the hotbar if I use an item that isn't in the 9th slot it doesn't do anything except for selecting the 9th slot, so I'm limited to one hotbar slot. I've tried disabling ALL the mods I have downloaded(except tmodloader) but it doesn't solve the problem. So is this a bug with tmodloader or is it with vanilla terraria?
none of the above delete your mod cache or try verifyinh steam files and reinstalling tmodloader
 
Everyone I'm facing a problem when I'm playing with Tmodloader. So whenever I'm using the hotbar if I use an item that isn't in the 9th slot it doesn't do anything except for selecting the 9th slot, so I'm limited to one hotbar slot. I've tried disabling ALL the mods I have downloaded(except tmodloader) but it doesn't solve the problem. So is this a bug with tmodloader or is it with vanilla terraria?
It's probably just an accidental case of quickbar 9 being set as left mouse click.
[doublepost=1483051041,1483050978][/doublepost]
Is it true that 1.3.3.3 of Tmodloader have more available mods then 0.9.1?
If so i might use 1.3.3.3...
More, yes, but they are all abandoned mods.
 
Hey some one help me
Capture.PNG
Capture1.PNG

[doublepost=1483059471,1483059356][/doublepost]
Hey some one help me
Capture.PNG
Capture1.PNG
if you need to see the code here
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items.Armor
{
public class WolfWings : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Wings);
return true;
}
public override void SetDefaults()
{
item.name = "Wolf's Wings";
item.width = 22;
item.height = 20;
item.value = 10;
item.rare = 2;
item.accessory = true;
}
public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 1.10f;
maxCanAscendMultiplier = 10f;
maxAscentMultiplier = 3f;
constantAscend = 1f;
}
public override void HorizontalWingSpeeds(ref float speed, ref float acceleration)
{
speed = 10f;
acceleration *= 2.5f;
}
}
}

-------------------------------------
Frame sizes for "./WolfsWings_Wings.png" are 22 x 20 px

I looked through all of my code at least 17 times trying to find inconsistencies but everything looks fine to me Whats causing this?
 
Last edited:
Hey some one help meView attachment 153261 View attachment 153262
[doublepost=1483059471,1483059356][/doublepost]
if you need to see the code here
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace ExampleMod.Items.Armor
{
public class WolfWings : ModItem
{
public override bool Autoload(ref string name, ref string texture, IList<EquipType> equips)
{
equips.Add(EquipType.Wings);
return true;
}
public override void SetDefaults()
{
item.name = "Wolf's Wings";
item.width = 22;
item.height = 20;
item.value = 10;
item.rare = 2;
item.accessory = true;
}
public override void VerticalWingSpeeds(ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
{
ascentWhenFalling = 0.85f;
ascentWhenRising = 1.10f;
maxCanAscendMultiplier = 10f;
maxAscentMultiplier = 3f;
constantAscend = 1f;
}
public override void HorizontalWingSpeeds(ref float speed, ref float acceleration)
{
speed = 10f;
acceleration *= 2.5f;
}
}
}

-------------------------------------
Frame sizes for "./WolfsWings_Wings.png" are 22 x 20 px

I looked through all of my code at least 17 times trying to find inconsistencies but everything looks fine to me Whats causing this?
Your mod name in the code is wrong it shouldn't be ExampleMod but 551
 
It's probably just an accidental case of quickbar 9 being set as left mouse click.
[doublepost=1483051041,1483050978][/doublepost]
More, yes, but they are all abandoned mods.

I think they just need to update their mods,and fix the bugs that are around until 0.9.1 though,im waiting for pumpking's mod,its taking a while but hopefully he does update the mod(i really want some mods updated...like boss health bars and npc nick show or something like that i already forgot)
 
Hi,
Are there any tModloader mod to change the autosave frequency?
I could only find one and it works under tAPI.
Or perhaps the frequency can be changed without a mod?
 
the "virus total" file reports that the 0.9.1 file has a virus called Win.Trojan.Toa

can you fix it as soon as possible?
 
Back
Top Bottom