You can explain me with an example?
// Help, my gun isn't being held at the handle! Adjust these 2 numbers until it looks right.
public override Vector2? HoldoutOffset()
{
return new Vector2(10, 0);
}
From ExampleMod's ExampleGun
Code:// Help, my gun isn't being held at the handle! Adjust these 2 numbers until it looks right. public override Vector2? HoldoutOffset() { return new Vector2(10, 0); }
oh, I just read your original question.Thanks, I'll try this method.
Thanks for the quickly reply, I will try this useful tips.oh, I just read your original question.
item.width and height should match the actual dimensions of the moditem texture, since they define the hitbox, not how large it will be drawn.
holdoutoffset only affects guns, if your swung weapon is wrong, you need to fix the texture.
You can mess with item.scale (= 0.7f or something), but I'd suggest fixing the texture first.
Hi, I'm having a technical issue when playing with tModLoader 0.9.1 installed - every time that a menu or other type of UI is up on the screen (such as the Item/NPC browsers from the Cheat Sheet mod) Terraria's FPS drops to 15-20 from 45 and the game becomes incredibly laggy. The lag goes away once the menus/UI are closed and not being drawn on the screen anymore.
I can confirm that it works fine on my laptop; my desktop is the one with this issue. Desktop specs: Core i5 processor, 16 GB RAM, and Radeon 6900 2 GB video card.
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace EpicnessModRemastered.Projectiles
{
public class PoisonRing : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "Poison Ring";
projectile.width = 57;
projectile.height = 50;
projectile.friendly = true;
projectile.hostile = false;
projectile.ranged = false;
projectile.melee = false;
projectile.magic = true;
projectile.penetrate = -1;
projectile.timeLeft = 600;
projectile.light = 0.5f;
projectile.tileCollide = false;
}
}
}
You can always override an AI method and set the velocity to zero manually:How do I get a projectile to stay still? When I shoot it it moves down.
Here is the projectile's code:
Code:using System; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace EpicnessModRemastered.Projectiles { public class PoisonRing : ModProjectile { public override void SetDefaults() { projectile.name = "Poison Ring"; projectile.width = 57; projectile.height = 50; projectile.friendly = true; projectile.hostile = false; projectile.ranged = false; projectile.melee = false; projectile.magic = true; projectile.penetrate = -1; projectile.timeLeft = 600; projectile.light = 0.5f; projectile.tileCollide = false; } } }
public override bool PreAI()
{
projectile.velocity = Vector2.Zero;
return false;
}
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace PupusyaviysMod.Items.Weapons
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
item.name = "Dirt Sword";
item.damage = 1;
item.melee = true;
item.width = 40;
item.height = 40;
item.toolTip = "It's a dirt sword, what do you think?";
item.useTime = 70;
item.useAnimation = 70;
item.useStyle = 1; ,
item.knockBack = 2;
item.value = 1;
item.rare = 1;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
}
public override void AddRecipes()
{
ModRecipie recipe = new ModRecipie(mod);
recipe.AddIngredient(ItemID.DirtBlock, 10);
recipe.AddTiles(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipie();
}
}
}
Terraria\ModLoader\Mod Sources\PupusyaviysMod\Items\Weapons\DirtSword.cs(30,4) : error CS0246: The type or namespace name 'ModRecipie' could not be found (are you missing a using directive or an assembly reference?)
Terraria\ModLoader\Mod Sources\PupusyaviysMod\Items\Weapons\DirtSword.cs(30,28) : error CS0246: The type or namespace name 'ModRecipie' could not be found (are you missing a using directive or an assembly reference?)
/Users/account/Library/Application Support/TerrariaI have a question. is there a way to remove a specific mod from tmod without logging in terraria on mac.Or is there a way to access the mod folder on mac?
thanks!! now i can play modded terraria again!/Users/account/Library/Application Support/Terraria