This means the png isn't found where it expects it. Mod Sources/modname/Items/Weapons/HammerSword.png
Doesn't seem to work :/
This means the png isn't found where it expects it. Mod Sources/modname/Items/Weapons/HammerSword.png
I also got this error.Turns out the the public class name wasn't the same as the one on the corresponding .png image.Have you checked if the public class name is also HammerSword?Doesn't seem to work :/
I also got this error.Turns out the the public class name wasn't the same as the one on the corresponding .png image.Have you checked if the public class name is also HammerSword?
PS: Sorry if I sound dumb.I'm fairly new to this coding business.
How do I make custom weapons drop from bosses or enemies?Ah, I see, and things without a direction like fall damage or lava have a hitDirection of 0. Thanks
Cheers, that helped point me in the right direction The tricky bit is that it looks like it splits no-npc and no-projectile damage into Fall Damage, Drowning, Lava Damage, {???}, {misc. like hammering Demon Altar}, {death while petrified?}, so we'd have to figure out how to distinguish between those.
Looks like I could maybe duplicate the functionality if I recreate "else if (((this.gravDir == 1f && {fall_dist} > {max_fall_dist}) || (this.gravDir == -1f && {fall_dist} < -{max_fall_dist})) && !this.noFallDmg && !{has_wings})".
I could possibly skim off of the fall-damage death messages, but it'd cause the problem of not working with a translation that I don't include (e.g. a fan-translation or an update that has bounce messages besides " fell to their death."," didn't bounce."," stuerzte in den Tod."," ist nicht gesprungen."," sente la sua morte."," non poteva rimbalzare."," a cassé sa pipe."," ne bouge plus."," le ha llegado la hora."," no saltó a tiempo.")
I'll figure something out. Thanks
You can use the NPCLoot in globalNPCHow do I make custom weapons drop from bosses or enemies?
You inserted the method without creating the classI don`t understand what`s wrong, trying to make start custom items.
http://hastebin.com/ozaqabeveq.avrasm
View attachment 138009
I don't know what you're saying...You can use the NPCLoot in globalNPC
You inserted the method without creating the class
Have a look at the exampleMod GlobalNPC class it is always useful to check the examplesI don't know what you're saying...
The correct code would be:I don`t understand, can you put me an example?
using Terraria.ID;
using Terraria.ModLoader;
namespace XtrafaMod.Items
{
public class MyPlayer : ModPlayer
{
public override void SetupStartInventory(IList<Item> items)
{
Item item5 = new Item();
item5.SetDefaults(mod.ItemType("TerraEsence")); //this is an example of how to add your moded item
item5.stack = 15; //this is the stack of the item
items.Add(item5);
Item item6 = new Item();
item6.SetDefaults(ItemID.Wood); //this is an example of how to add a vanilla terraria item
item6.stack = 50; //and the stack of the item
items.Add(item6);
}
}
Have a look at the exampleMod GlobalNPC class it is always useful to check the examples
[doublepost=1473110210,1473110051][/doublepost]
The correct code would be:
Code:using Terraria.ID; using Terraria.ModLoader; namespace XtrafaMod.Items { public class MyPlayer : ModPlayer { public override void SetupStartInventory(IList<Item> items) { Item item5 = new Item(); item5.SetDefaults(mod.ItemType("TerraEsence")); //this is an example of how to add your moded item item5.stack = 15; //this is the stack of the item items.Add(item5); Item item6 = new Item(); item6.SetDefaults(ItemID.Wood); //this is an example of how to add a vanilla terraria item item6.stack = 50; //and the stack of the item items.Add(item6); } }
Can I have a code example for making a custom sword drop from a boss (Skeletron Prime)Have a look at the exampleMod GlobalNPC class it is always useful to check the examples
[doublepost=1473110210,1473110051][/doublepost]
The correct code would be:
Code:using Terraria.ID; using Terraria.ModLoader; namespace XtrafaMod.Items { public class MyPlayer : ModPlayer { public override void SetupStartInventory(IList<Item> items) { Item item5 = new Item(); item5.SetDefaults(mod.ItemType("TerraEsence")); //this is an example of how to add your moded item item5.stack = 15; //this is the stack of the item items.Add(item5); Item item6 = new Item(); item6.SetDefaults(ItemID.Wood); //this is an example of how to add a vanilla terraria item item6.stack = 50; //and the stack of the item items.Add(item6); } }
When starting with modding I higly suggest to use an IDE as Visual Studio to prevent errors of this kind
https://github.com/bluemagic123/tModLoader/blob/master/ExampleMod/NPCs/ExampleGlobalNPC.cs#L68Can I have a code example for making a custom sword drop from a boss (Skeletron Prime)
Can I have a code example for making a custom sword drop from a boss (Skeletron Prime)
Can I have a code example for making a custom sword drop from a boss (Skeletron Prime)
Does it work for normal mode skeletron prime?
Yes, of course it does. The !Main.expertMode states that the item will be dropped only in normal mode since in expert it drops the boss bag where you'll have to add the item to the bagDoes it work for normal mode skeletron prime?
Also 1 more thing how do I change the drop chance of the item?Yes, of course it does. The !Main.expertMode states that the item will be dropped only in normal mode since in expert it drops the boss bag where you'll have to add the item to the bag
Ok thanks!
[doublepost=1473111684,1473111652][/doublepost]
Also 1 more thing how do I change the drop chance of the item?
?you can insert in the "if" a Main.rand.Next(int MinValue, int MaxValue) and check the value of that to add drop chance