NickWilde992
Terrarian
Thanks a lot!Put player.buffImmune[BuffID.CursedInferno] = true; in your UpdateAccessory method.
Thanks a lot!Put player.buffImmune[BuffID.CursedInferno] = true; in your UpdateAccessory method.
The world I want to use on vanilla Terraria only has 3 files for some reason (.twld, .twld.bak, and wld.bak). The .wld file is missing. All my other worlds made in TModLoader have .wld files.
So, bit of weirdness. Recently updated a few mods on the Mod Browser, and now when I reloaded the mod list, I now have a crash when it reaches the end of the Loading state... Anyone else suffering that error?
Ah, got that in my folder, so that's probably the reason!Yeah, it seems a lot of people are. The problem (for me) came from Nightmares Unleashed. I moved that mod out of my folder and, sure enough, everything works fine now. I'm sure Psychotic will find a solution soon.
If that isn't what is causing it for you, then I don't know...
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace EpicnessModRemastered.Items
{
public class SuperMagicalChest : ModItem
{
public override void SetDefaults()
{
item.name = "Super Magical Chest";
item.maxStack = 1;
item.consumable = true;
item.width = 24;
item.height = 24;
item.useTime = 10;
item.useAnimation = 10;
item.useStyle = 4;
item.toolTip = "Left click to open";
item.rare = 10;
item.useSound = mod.GetSoundSlot(SoundType.Item, "Sounds/Item/Legendaryget");
}
public override bool UseItem(Player player)
{
if (Main.rand.Next(2) == 0)
{
player.QuickSpawnItem(mod.ItemType("SparkyCard"));
}
else if (Main.rand.Next(2) == 1)
{
player.QuickSpawnItem(mod.ItemType("LumberJacksAxe"));
}
else if (Main.rand.Next(2) == 2)
{
player.QuickSpawnItem(mod.ItemType("PrincessesBow"));
}
return true;
}
}
}
public override bool UseItem(Player player)
{
if (Main.rand.Next(2) == 0)
{
player.QuickSpawnItem(mod.ItemType("SparkyCard"));
}
else if (Main.rand.Next(2) == 1)
{
player.QuickSpawnItem(mod.ItemType("LumberJacksAxe"));
}
else if (Main.rand.Next(2) == 2)
{
player.QuickSpawnItem(mod.ItemType("PrincessesBow"));
}
return true;
}
[/CODE]
I'm sorry for asking this but how do I set that up?It is because you are rolling the dice each time you are checking it. The first time will not always be 0, so no SparkyCard, the second time will not always return 1, so no LumberJacksAxe, and the third time will NEVER be 2, because Next() returns 0 to n - 1, ie Next(2) will return 0 or 1.
Call Next(3) once and store it in a variable, ie int result = Main.rand.Next(3);, and then check that variable in your if statements.
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace EpicnessModRemastered.Items
{
public class SuperMagicalChest : ModItem
{
public override void SetDefaults()
{
item.name = "Super Magical Chest";
item.maxStack = 1;
item.consumable = true;
item.width = 24;
item.height = 24;
item.useTime = 10;
item.useAnimation = 10;
item.useStyle = 4;
item.toolTip = "Left click to open";
item.rare = 10;
item.useSound = mod.GetSoundSlot(SoundType.Item, "Sounds/Item/Legendaryget");
}
public override bool UseItem(Player player)
{
(Main.rand.Next(3) == int result Main.rand.Next(3));,
if (int result Main.rand.Next(3); == 0)
{
player.QuickSpawnItem(mod.ItemType("SparkyCard"));
}
else if (int result Main.rand.Next(3); == 1)
{
player.QuickSpawnItem(mod.ItemType("LumberJacksAxe"));
}
else if (int result Main.rand.Next(3); == 2)
{
player.QuickSpawnItem(mod.ItemType("PrincessesBow"));
}
return true;
}
}
}
I'm sorry for asking this but how do I set that up?
Code:using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace EpicnessModRemastered.Items { public class SuperMagicalChest : ModItem { public override void SetDefaults() { item.name = "Super Magical Chest"; item.maxStack = 1; item.consumable = true; item.width = 24; item.height = 24; item.useTime = 10; item.useAnimation = 10; item.useStyle = 4; item.toolTip = "Left click to open"; item.rare = 10; item.useSound = mod.GetSoundSlot(SoundType.Item, "Sounds/Item/Legendaryget"); } public override bool UseItem(Player player) { (Main.rand.Next(3) == int result Main.rand.Next(3));, if (int result Main.rand.Next(3); == 0) { player.QuickSpawnItem(mod.ItemType("SparkyCard")); } else if (int result Main.rand.Next(3); == 1) { player.QuickSpawnItem(mod.ItemType("LumberJacksAxe")); } else if (int result Main.rand.Next(3); == 2) { player.QuickSpawnItem(mod.ItemType("PrincessesBow")); } return true; } } }
Why are you not just checking f for equality (f == 0)? Isn't that a lot easier?i normally use right click but thats just me
he means something like this
------------------------------------------------------------ this is the right click function
public override bool CanRightClick()
{
return true;
}
public override void RightClick(Player player)
------------------------------------------------------------
{
int f = Main.rand.Next(0, 5);
if(f >= 0 && f <= 0)
{
player.QuickSpawnItem(mod.ItemType("item1"));
}
else if(f >= 1 && f <= 1)
{
player.QuickSpawnItem(mod.ItemType("item2"));
}
else if(f >= 2 && f <= 2)
{
player.QuickSpawnItem(mod.ItemType("item3"));
}
else if(f >= 3 && f <= 3)
{
player.QuickSpawnItem(mod.ItemType("item4"));
}
else if(f >= 4 && f <= 4)
{
player.QuickSpawnItem(mod.ItemType("item5"));
}
}
Good start, but I'll explain where and why you went wrong.I'm sorry for asking this but how do I set that up?
Code:using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace EpicnessModRemastered.Items { public class SuperMagicalChest : ModItem { public override void SetDefaults() { item.name = "Super Magical Chest"; item.maxStack = 1; item.consumable = true; item.width = 24; item.height = 24; item.useTime = 10; item.useAnimation = 10; item.useStyle = 4; item.toolTip = "Left click to open"; item.rare = 10; item.useSound = mod.GetSoundSlot(SoundType.Item, "Sounds/Item/Legendaryget"); } public override bool UseItem(Player player) { (Main.rand.Next(3) == int result Main.rand.Next(3));, if (int result Main.rand.Next(3); == 0) { player.QuickSpawnItem(mod.ItemType("SparkyCard")); } else if (int result Main.rand.Next(3); == 1) { player.QuickSpawnItem(mod.ItemType("LumberJacksAxe")); } else if (int result Main.rand.Next(3); == 2) { player.QuickSpawnItem(mod.ItemType("PrincessesBow")); } return true; } } }
int result = Main.rand.Next(5);
if (result == 0)
{
// Stuff.
}
else if (result == 1)
{
// Stuff.
}
// And so on.
Something must have happened to the *.wld file, but thankfully you have a backup. Copy the *.wld.bak file to the vanilla worlds folder and remove .bak from the filename. Hopefully that will work.The world I want to use on vanilla Terraria only has 3 files for some reason (.twld, .twld.bak, and wld.bak). The .wld file is missing. All my other worlds made in TModLoader have .wld files.
I'm guessing a bit here because I can't see the context, but I think you need 'ModNPC.npc.Center' not 'ModNPC.Center'. The ModNPC is kind of a parent class to the npc, so you need to refer to the child npc class.When I compile I get the error "error CS0117: 'Terraria.ModLoader.ModNPC' does not contain a definition for 'Center'"
I'm doing a spin-off EOC boss, just playing around with vanilla AIs to get more comfortable with AI stuff.Something must have happened to the *.wld file, but thankfully you have a backup. Copy the *.wld.bak file to the vanilla worlds folder and remove .bak from the filename. Hopefully that will work.
I'm guessing a bit here because I can't see the context, but I think you need 'ModNPC.npc.Center' not 'ModNPC.Center'. The ModNPC is kind of a parent class to the npc, so you need to refer to the child npc class.
It seems to work fine for me with the new update. I updated, installed gamelauncher and tmodloader and it was fine.They just pushed the smallest little do-nothing update they ever have. TmodLoader breaks again.... >:|
edit: On the other hand, ticking to the new version should be super easy.