ooooh!! so one for every hand, kewl,
next two questions:
1:
how to inflict damage on Player and NPC
i want a debuff dealing 8 dmg per sec
2:
how do i make a projectile inflict a debuff on a PLAYER
using Terraria;
using Terraria.ModLoader;
using ExampleMod.NPCs;
namespace ExampleMod.Buffs
{
public class EtherealFlames : ModBuff
{
public override void SetDefaults()
{
Main.buffName[Type] = "Ethereal Flames";
Main.buffTip[Type] = "Losing life";
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
longerExpertDebuff = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.GetModPlayer<ExamplePlayer>(mod).eFlames = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.GetModInfo<ExampleNPCInfo>(mod).eFlames = true;
}
}
}
If it doesn't work, you can manually replace all files. Grant permission to overwrite when asked.View attachment 127104
I extracted the files to my desktop as instructed, and then I got this error when I run the installer.
I think they are planning to do this, it would be nice as some of my friends are running a ol' macbookView attachment 127104
I extracted the files to my desktop as instructed, and then I got this error when I run the installer.
If you type Item with a capital, the code thinks you're referring to the Item class of Terraria. Item should be lowercase in all the lines from SetDefaults, as well as Name and Knockback.I REALLY need help, I am developing my first mod and I have had about 30 errors which have been solved, but this one just does not make any sense what so ever. CSerror0117:
'Terraria.Item' does not contain a definition for 'name'
It says there is a problem with line 15 but I cant solve it.
My Coding is this:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace YourModName.Items.Weapons //where is located
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
Item.Name = "Dirt Sword"; //sword name
Item.damage = 5; //sword damage
Item.melee = true;
Item.width = 50;
item.height = 50;
item.toopTip = "Finaly a starter weapon that isnt complete poop, maybe I can use dirt to make more things...";
item.useTime = 25;
Item.useAnimation = 25;
Item.useStyle = 1;
Item.Knockback = 5;
Item.value = .33;
Item.rare = 10;
Item.usesound = 1;
Item.autoReuse = true;
Item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Please Help me as soon as possible, I have some great ideas I would love to enter into the terraira modding community, Thanks in advance!
Now I get the same error but this time with knockback, and I uncapitalized everything like you said and I got past the name thing. Now Its doing the same for knockback any ideas?If you type Item with a capital, the code thinks you're referring to the Item class of Terraria. Item should be lowercase in all the lines from SetDefaults, as well as Name and Knockback.
No, Modloader is a mod for include mods. So same if you have not active mods, meh, this is not the same thing ^^.If you have no mods installed (or active) can you play with players who don't have tModLoader but have Terraria for Steam? Can they join your world if no mods are installed (or active)?
Now I get the same error but this time with knockback, and I uncapitalized everything like you said and I got past the name thing. Now Its doing the same for knockback any ideas?
My Updated code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace YourModName.Items.Weapons //where is located
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
item.name = "Dirt Sword"; //sword name
item.damage = 5; //sword damage
item.melee = true;
item.width = 50;
item.height = 50;
item.toolTip = "Finaly a starter weapon that isnt complete poop, maybe I can use dirt to make more things...";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockback = 5;
item.value = .33;
item.rare = 10;
item.usesound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
The b in knockback needs to be capitalised (knockBack). That's what's causing the issue.Now I get the same error but this time with knockback, and I uncapitalized everything like you said and I got past the name thing. Now Its doing the same for knockback any ideas?
My Updated code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Graphics.Effects;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
namespace YourModName.Items.Weapons //where is located
{
public class DirtSword : ModItem
{
public override void SetDefaults()
{
item.name = "Dirt Sword"; //sword name
item.damage = 5; //sword damage
item.melee = true;
item.width = 50;
item.height = 50;
item.toolTip = "Finaly a starter weapon that isnt complete poop, maybe I can use dirt to make more things...";
item.useTime = 25;
item.useAnimation = 25;
item.useStyle = 1;
item.knockback = 5;
item.value = .33;
item.rare = 10;
item.usesound = 1;
item.autoReuse = true;
item.useTurn = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(Mod);
recipe.AddIngredient(ItemID.DirtBlock, 1);
recipe.AddTile(TileID.WorkBenches);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Thats what im using, it autocorrected to that but I thought it was wrong, my mistake. thank you so much!The b in knockback needs to be capitalised (knockBack). That's what's causing the issue.
I recommend installing Visual Studio, it has the IntelliSense feature which auto-completes your code, and all in all prevents you from making these mistakes. It'll make everything a lot simpler and faster.