Hi guys,
I'm getting these errors:
c:\Users\Warsmith\Documents\My Games\Terraria\ModLoader\Mod Sources\Terravalice\Items\KnightSwords\Save the Queen.cs(9,20) : error CS1514: { expected
c:\Users\Warsmith\Documents\My Games\Terraria\ModLoader\Mod Sources\Terravalice\Items\KnightSwords\Save the Queen.cs(9,30) : error CS1002: ; expected
c:\Users\Warsmith\Documents\My Games\Terraria\ModLoader\Mod Sources\Terravalice\Items\KnightSwords\Save the Queen.cs(10,2) : error CS1519: Invalid token '{' in class, struct, or interface member declaration
With this code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Terravalice.Items.KnightSwords
{
public class Save the Queen : ModItem
{
public override void SetDefaults()
{
item.name = "Save the Queen";
item.melee = true;
item.damage = 36;
item.knockBack = 5;
item.width = 30;
item.height = 30;
item.useStyle = 1;
item.useAnimation = 20;
item.useTime = 20;
item.useSound = 1;
item.value = 30000;
item.rare = 2;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.Wood, 1);
recipe.SetResult(this);
recipe.AddRecipe();
}
// Ironskin effect (protect)
public void DamageNPC (Player myPlayer, NPC npc, ref int damage, ref float knockback)
{
// Add the buff
myPlayer.AddBuff (5, 600);
}
}
}
I feel like I'm missing something obvious, but it looks ok to me...
Can anyone explain to me how public virtual bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
in modProjectile works?
I'm trying to make a projectile have a damaging trail
[DOUBLEPOST=1457660346,1457660300][/DOUBLEPOST]
Hi guys,
I'm getting these errors:
c:\Users\Warsmith\Documents\My Games\Terraria\ModLoader\Mod Sources\Terravalice\Items\KnightSwords\Save the Queen.cs(9,20) : error CS1514: { expected
c:\Users\Warsmith\Documents\My Games\Terraria\ModLoader\Mod Sources\Terravalice\Items\KnightSwords\Save the Queen.cs(9,30) : error CS1002: ; expected
c:\Users\Warsmith\Documents\My Games\Terraria\ModLoader\Mod Sources\Terravalice\Items\KnightSwords\Save the Queen.cs(10,2) : error CS1519: Invalid token '{' in class, struct, or interface member declaration
With this code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Terravalice.Items.KnightSwords
{
public class Save the Queen : ModItem
{
public override void SetDefaults()
{
item.name = "Save the Queen";
item.melee = true;
item.damage = 36;
item.knockBack = 5;
item.width = 30;
item.height = 30;
item.useStyle = 1;
item.useAnimation = 20;
item.useTime = 20;
item.useSound = 1;
item.value = 30000;
item.rare = 2;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(Terraria.ID.ItemID.Wood, 1);
recipe.SetResult(this);
recipe.AddRecipe();
}
// Ironskin effect (protect)
public void DamageNPC (Player myPlayer, NPC npc, ref int damage, ref float knockback)
{
// Add the buff
myPlayer.AddBuff (5, 600);
}
}
}
I feel like I'm missing something obvious, but it looks ok to me...
Can anyone explain to me how public virtual bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
in modProjectile works?
I'm trying to make a projectile have a damaging trail
Two rectangles are passed in, you decide if they "intersect".
Vanilla code just checks Rectangle.Intersects(Ractangle).
The projHitbox is based on projectile.width, projectile.height, projectile.position. Similar for the targetHitbox (but for an npc maybe).
Sometimes rectangles aren't perfect for what you want, such as MoonLords beam or Last Prism laser. If you made a bounding box around a laser, it would intersect with a lot of things the visuals don't show it actually hitting.
Use Collision.CheckAABBvLineCollision if you want :
public static bool CheckAABBvLineCollision(Vector2 objectPosition, Vector2 objectDimensions, Vector2 lineStart, Vector2 lineEnd, float lineWidth, ref float collisionPoint)
Two rectangles are passed in, you decide if they "intersect".
Vanilla code just checks Rectangle.Intersects(Ractangle).
The projHitbox is based on projectile.width, projectile.height, projectile.position. Similar for the targetHitbox (but for an npc maybe).
Sometimes rectangles aren't perfect for what you want, such as MoonLords beam or Last Prism laser. If you made a bounding box around a laser, it would intersect with a lot of things the visuals don't show it actually hitting.
Use Collision.CheckAABBvLineCollision if you want :
public static bool CheckAABBvLineCollision(Vector2 objectPosition, Vector2 objectDimensions, Vector2 lineStart, Vector2 lineEnd, float lineWidth, ref float collisionPoint)
Hello, i was wondering how you would go about updating the tModLoader, if you dont need to or if there is an explanation in the description please do tell me, Thanks!
Is there a way to change how the player animates when an item is used, kind of like HoldItemFrame, only called at the same time as UseStyle? I tried changing the player's frame in UseStyle, but it had no effect. Thanks.
Is there a way to change how the player animates when an item is used, kind of like HoldItemFrame, only called at the same time as UseStyle? I tried changing the player's frame in UseStyle, but it had no effect. Thanks.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.