RazzyB
Terrarian
Just change these to a smaller numberthank you!!
[doublepost=1514831392,1514830971][/doublepost]
and how would you insert insanely fast speed for a gun like the minishark?
item.useTime = 20;
item.useAnimation = 20;
Just change these to a smaller numberthank you!!
[doublepost=1514831392,1514830971][/doublepost]
and how would you insert insanely fast speed for a gun like the minishark?
If you download Example Mod, it's the uncompiled version, with all the folders, files, images, right there to see and resue freely. For this sort of question, I'd suggest you check out Example Gun. Example Gun has a lot of VERY useful commentary and ideas to explore. Then again, the mod in general does.thank you!!
[doublepost=1514831392,1514830971][/doublepost]
and how would you insert insanely fast speed for a gun like the minishark?
thank you, but within the example mod folder i didnt quite see a section for accessory equipables..If you download Example Mod, it's the uncompiled version, with all the folders, files, images, right there to see and resue freely. For this sort of question, I'd suggest you check out Example Gun. Example Gun has a lot of VERY useful commentary and ideas to explore. Then again, the mod in general does.
Again, I'd suggest having Visual Studio (VS does a lot of neat things that help you figure out problems and understand just what can go where), but, even if you just use something like Notepad++ to look through the mod's files, you'll find a TON of stuff to learn from! And I've put a link to TModLoader Wiki in my signature... it has both useful tools and a BUNCH of current tutorials!
Not all of it is within more detailed folders, some of it is in the parent folder. If you just look in the Items folder, you can see documentation for a shield and some wings, for example.thank you, but within the example mod folder i didnt quite see a section for accessory equipables..
Maybe change the mountData.yOffset?View attachment 190858
Code:using System; using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; namespace MilitaryMod.Mounts { public class Tank : ModMountData { public override void SetDefaults() { mountData.spawnDust = mod.DustType("Smoke"); mountData.buff = mod.BuffType("TankMount"); mountData.heightBoost = 20; mountData.fallDamage = 0f; mountData.runSpeed = 5f; mountData.dashSpeed = 3f; mountData.flightTimeMax = 0; mountData.fatigueMax = 0; mountData.jumpHeight = 5; mountData.acceleration = 0.05f; mountData.jumpSpeed = 4f; mountData.blockExtraJumps = false; mountData.totalFrames = 4; mountData.constantJump = false; int[] array = new int[mountData.totalFrames]; for (int l = 0; l < array.Length; l++) { array[l] = 20; } mountData.playerYOffsets = array; mountData.xOffset = 13; mountData.bodyFrame = 6; mountData.yOffset = -12; mountData.playerHeadOffset = 12; mountData.standingFrameCount = 4; mountData.standingFrameDelay = 12; mountData.standingFrameStart = 0; mountData.runningFrameCount = 4; mountData.runningFrameDelay = 12; mountData.runningFrameStart = 0; mountData.flyingFrameCount = 0; mountData.flyingFrameDelay = 0; mountData.flyingFrameStart = 0; mountData.inAirFrameCount = 1; mountData.inAirFrameDelay = 12; mountData.inAirFrameStart = 0; mountData.idleFrameCount = 4; mountData.idleFrameDelay = 12; mountData.idleFrameStart = 0; mountData.idleFrameLoop = true; mountData.swimFrameCount = mountData.inAirFrameCount; mountData.swimFrameDelay = mountData.inAirFrameDelay; mountData.swimFrameStart = mountData.inAirFrameStart; if (Main.netMode != 2) { mountData.textureWidth = mountData.backTexture.Width + 20; mountData.textureHeight = mountData.backTexture.Height; } } public override void UpdateEffects(Player player) { if (Math.Abs(player.velocity.X) > 4f) { Rectangle rect = player.getRect(); Dust.NewDust(new Vector2(rect.X, rect.Y), rect.Width, rect.Height, mod.DustType("Smoke")); } } } }
how can i change the position of the tank?
sweet thank you now what would be the coding in order to make it shoot a rocket?Maybe change the mountData.yOffset?
No idea. I don’t know anything about mounts. I just knew that a negative y offset means something is lower.sweet thank you now what would be the coding in order to make it shoot a rocket?
First, remove item.name. Secondly, add [ DisplayName.SetDeafault(“Infantry Patch”); ] (minus the brackets) to the SetStaticDefaults code. It should look like this:View attachment 190899
Code:using System; using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace MilitaryMod.Items.Accessory { public class InfantryPatch : ModItem { public override void SetStaticDefaults() { Tooltip.SetDefault("Infantry Mastery Patch"); } public override void SetDefaults() { item.name = "InfantryPatch"; item.width = 10; item.height = 14; item.value = 10; item.rare = 3; item.accessory = true; } public override void AddRecipes() //How to craft this item { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.Wood, 10); //you need 10 Wood recipe.AddTile(TileID.WorkBenches); //at work bench recipe.SetResult(this); recipe.AddRecipe(); } public override void UpdateAccessory(Player player, bool hideVisual) { player.noFallDmg = true; player.canRocket = true; player.rocketTime = 1200; player.rocketBoots = 1; player.rocketTimeMax = 1200; player.aggro += 300; player.meleeCrit += 17; player.meleeDamage += 0.22f; player.meleeSpeed += 0.15f; player.moveSpeed += 2.15f; player.rangedCrit += 7; player.rangedDamage += 0.16f; player.maxMinions++; player.minionDamage += 0.22f; player.statManaMax2 += 60; player.manaCost -= 0.15f; player.magicCrit += 7; player.magicDamage += 1.07f; } } }
any ideas?
[...]
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault(“Infantry Patch”);
Tooltip.SetDefault("Infantry Mastery Patch");
}
[...]
item.useAnimation = 24; //How long the spear appears to be out (even though this is invisible, it still holds out your character's hand)
item.useTime = 24; //How long it takes for the spear to be usable again, regardless of how much time it spent out
item.shootSpeed = 5f; //The velocity of the spear, or how fast it causes its projectile to move
public float movementFactor //Guessing that this is used as a factor to multiply by the velocity I wrote in the spear's .cs file?
{
get { return projectile.ai[0]; }
set { projectile.ai[0] = value; }
}
public override void AI()
{
...
if (!projOwner.frozen)
{
if (movementFactor == 0f)
{
movementFactor = 3f; //??? What would changing this number (and the two below as well) do? My guess is that this is initial velocity (although I thought that was specified in the actual spear's code)?
projectile.netUpdate = true;
}
if (projOwner.itemAnimation < projOwner.itemAnimationMax / 3)
{
movementFactor -= 2.4f; //Velocity while the spear is moving out?
}
else
{
movementFactor += 2.1f; //Velocity while the spear is returning?
}
}
projectile.position += projectile.velocity * movementFactor;
if (projOwner.itemAnimation == 0)
{
projectile.Kill();
}
...
}
Pets are complex, you'll want to find a guide. As for the climbing gear, you'll just need to add player.spikedBoots += 2; to your accessories UpdateEquip hook.Im making an accessory and it combines the Master Ninja Gear and the Ninja Armor. I want it to summon a pet that flies above the player(and does nothing, this is just vanity) while it is equipped. It would be like the Hoardagron pet. How would I do this
Also how do I make wall sliding/jumping possible?