PlayerPlaysTERR
Steampunker
are you kiddin me
i have using Microsoft.Xna.Framework.Graphics
but forget using Microsoft.Xna.Framework
i have using Microsoft.Xna.Framework.Graphics
but forget using Microsoft.Xna.Framework
To fix the slow-to-a-stop problem, move the line 'projectile.velocity *= 0.95f;' inside the 'if (nearest != null)' condition, or get rid of it entirely if you don't want any drag. That's all that line did.less of a problem now
all it does now is go out a small distance and the stops and then homes when there is something to home on.
but it still is stopping when there is nothing to home on.
Code:public NPC FindNearest(Vector2 pos) { NPC nearest = null; float oldDist = 1001; float newDist = 1000; for (int i = 0; i < Terraria.Main.npc.Length - 1; i++) { if (!Collision.CanHit(pos, 1, 1, Main.npc[i].position, Main.npc[i].width, Main.npc[i].height)) continue; if (!Terraria.Main.npc[i].CanBeChasedBy(projectile)) continue; if (nearest == null) nearest = Terraria.Main.npc[i]; else { oldDist = Vector2.Distance(pos, nearest.position); newDist = Vector2.Distance(pos, Terraria.Main.npc[i].position); if (newDist < oldDist) nearest = Terraria.Main.npc[i]; } } return nearest; } int maxSpeed = 10; public override void AI() { NPC nearest = this.FindNearest(projectile.Center); Vector2 acceleration; if (nearest != null) // extremely important { acceleration = (nearest.position - projectile.position); } else { acceleration = Vector2.Zero; // maintain speed -- or whatever else you want to do here } projectile.velocity += acceleration * 1.5f; projectile.velocity *= 0.95f; if (projectile.velocity.Length() > maxSpeed) { projectile.velocity.Normalize(); projectile.velocity *= maxSpeed; } projectile.rotation = projectile.velocity.ToRotation(); }
also, since this homing is almost complete, how might I make an arkhalis type weapon. I have tried, but the projectile for the blade doesn't even show up!
WeaponCodedefaults:
Code:public override void SetDefaults() { item.name = "Solarius"; item.damage = 75; item.melee = true; item.width = 48; item.height = 48; item.useTime = 1; item.useAnimation = 1; item.useStyle = 1; item.noMelee = true; item.knockBack = 2; item.noUseGraphic = true; item.channel = true; item.value = 100000; item.rare = 9; item.useSound = 1; item.autoReuse = true; item.shoot = mod.ProjectileType("SolarisP"); item.shootSpeed = 20; }
ProjectileCodedefaults:
the class is shown so you know why the weapon is refering to that name for the projectile.Code:public class SolarisP : ModProjectile { public override void SetDefaults() { projectile.name = "Solarius"; projectile.width = 36; projectile.height = 20; projectile.friendly = true; projectile.penetrate = -1; projectile.aiStyle = 20; projectile.melee = true; projectile.tileCollide = false; projectile.light = 2f; }
pls help me
I am so lost
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace ZeldaMod.Items.Weapons
{
public class HerosBow : ModItem
{
public override void SetDefaults()
{
item.name = "Hero's Bow";
item.damage = 20;
item.ranged = true;
item.noMelee = true;
item.width = 14;
item.height = 42;
item.toolTip = "The tresaure of Gorons.";
item.useTime = 27;
item.useAnimation = 27;
item.useStyle = 5;
item.knockBack = 2;
item.value = 10000;
item.rare = 2;
item.shoot = mod.ProjectileType("LightArrow");
item.useAmmo = 1;
item.useSound = 1;
item.shootSpeed = 9;
item.autoReuse = true;
}
public override bool AltFunctionUse(Player player) //Enable right click
{
return true;
}
public override bool UseItem(Player player)
{
return base.UseItem(player);
}
public override bool CanUseItem(Player player)
{
return true;
}
public override bool ConsumeAmmo(Player player) //So that when right clicking it change the projectile but doesn't shoot anything
{
if (player.altFunctionUse == 2)
return false;
else
return 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)
{
ZMPlayer mp = player.GetModPlayer<ZMPlayer>(mod);
if (player.altFunctionUse == 2) // if right click sswitch projectile that will be shooted
{
if (mp.switchArrow == 3) //Variable in ZMPlayer (ModPlayer)
mp.switchArrow = 0;
else
mp.switchArrow++;
return false;
}
if (mp.switchArrow == 0) // If there is no special projectile type, we just want to shoot the bow.
return true;
// If there is, however, we want to set the projectile type we want to shoot to the specialProjetileType of the player.
if (mp.switchArrow == 3)
{
if (player.statMana >= 50)
{
player.statMana -= 50;
type = mod.ProjectileType("LightArrow");
damage = 150;
}
else
{
type = ProjectileID.WoodenArrowFriendly;
damage = 20;
}
}
else if (mp.switchArrow == 1)
{
if (player.statMana >= 25)
{
player.statMana -= 25;
type = ProjectileID.FireArrow;
damage = 50;
}
else
{
type = ProjectileID.WoodenArrowFriendly;
damage = 20;
}
}
else if (mp.switchArrow == 2)
if (player.statMana >= 25)
{
player.statMana -= 25;
type = ProjectileID.FrostburnArrow;
damage = 40;
}
else
{
type = ProjectileID.WoodenArrowFriendly;
}
return true;
}
}
}
To fix the slow-to-a-stop problem, move the line 'projectile.velocity *= 0.95f;' inside the 'if (nearest != null)' condition, or get rid of it entirely if you don't want any drag. That's all that line did.
As for the arkhalis type weapon, the vanilla projectile has the type of 595 and uses the ai style of 75, so you'll need to set projectile.type and .aiStyle to those two numbers. Also, it would be a good idea for you to try decompiling tModLoader's source so that you can have a look at vanilla code for yourself. ILSpy and DotPeek are two good decompilers.
Hi I'm new here and i just tried to download the tmod loader only my virusscan began to shout that there was a virus in the zip file i clicked it away but i really want this mod so did i do something wrong or is the virusscanner oversensitive? i hope you can help me?
you have a few errors
your virusscan is a bad one, i got mine virus free, as there is no virus, its just the .jar that the computer doesnt like, get something different, ok?
there is no virus in there, ok? just turn off or get a different anti-virus, then download again, make sure its an actuall popular one that isnt in the corners of the web.
[/QUOTE]I had the tmodloader downloaded a few days ago and my computer didn't scan any virus , but when I started up Terraria today, my computer scanned there is Trojan virus in the Terraria.exe.bak file. Also my virusscan is Windows Defender so I think it shouldn't be wrong. Pls help.
I had the tmodloader downloaded a few days ago and my computer didn't scan any virus , but when I started up Terraria today, my computer scanned there is Trojan virus in the Terraria.exe.bak file. Also my virusscan is Windows Defender so I think it shouldn't be wrong. Pls help.
I get something like that, except its constantly pinging at me for it and apparently Windows Defender wont shut up, and i cant even get it to DOWNLOAD.
I'm starting to become convinced that Windows Defender is pretty terrible. Unfortunately, the best thing I can recommend is to get another antivirus first, then disable Windows Defender.Anytime I download this from the media fire link given for windows I get a trojan virus disabling me to use tmodloader.
Question, with this installed, i cannot seem to be able to access multiplayer, why is that?
Yeah it does.Currently tModLoader doesn't fully support multiplayer
What and how are you trying to launch, and what OS? Also, is stream already running?I repeat, When I try launching it it says "This app can't run on your PC." Can someone help me?
I restarted my PC, and it didn't work. I followed the instructions exactly and I'm trying to run the Terraria.exe file (The modded one) on Win 8.What and how are you trying to launch, and what OS? Also, is stream already running?