tModLoader Military Advances Mod (MAM)

Hey Guys!, This isn't in release at all so don't expect a download quite yet because I'm still trying to add content that'll actually be worth downloading. HOWEVER! I have ran into a few problems which i shall address here:

1. I'm don't really know how to code alot of things but AlOne (Youtuber) made tutorials on how to make certain things so I've used his videos to make stuff

2. When you shoot a gun (For example the M4) the character holds the gun by the stock as shown here:
TKOSWN4.png

and this it's code:
using Terraria.ID;
using Terraria.ModLoader;

namespace MGM.Items.Weapons
{
public class M4A1 : ModItem
{
public override void SetDefaults()
{
item.name = "M4A1"; //Gun name
item.damage = 20; //gun damage
item.ranged = true; //its a gun so set this to true
item.width = 38; //gun image width
item.height = 18; //gun image height
item.toolTip = "Carbine Rifle."; //gun description
item.useTime = 15; //how fast
item.useAnimation = 20;
item.useStyle = 5; //
item.noMelee = true; //so the item's animation doesn't do damage
item.knockBack = 4;
item.value = 10000;
item.rare = 2;;
item.autoReuse = true;
item.shoot = 10; //idk why but all the guns in the vanilla source have this
item.shootSpeed = 16f;
item.useAmmo = ItemID.MusketBall;
}

public override void AddRecipes() //How to craft this gun
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.DirtBlock, 1); //you need 1 DirtBlock
recipe.AddTile(TileID.WorkBenches); //at work bench
recipe.SetResult(this);
recipe.AddRecipe();

}
}
}

(The structure of the code isn't exact but instead I'm just showing what it's got. And yes yes I know the crafting recipe is a dirt block but that's so it's easier to get and test out but it will change)
Now at first I assumed it had something to deal with the item width and height but when i made changes to the size, Nothing happened. So if someone can help me on how to make the stock of the rifle go into the arm, that would be apprechiated.

3. I haven't got a clue on how to add sound to the damned thing. So i would be thankful if someone told me how.

Once these Issues have been helped, The mod will then have a proper start and can hope to please you all.

The idea of the mod is to add more modern day realistic guns to Terraria with also mounts like Jeeps and Planes and possible a Mech. Also thinking about adding bosses into the game to then help with a tier system for the guns and mounts.

Thank you so much for reading and have a great day!
 
Back
Top Bottom