dinidini4000
Skeletron Prime
any reason for why the chest opening animation is not working for modded chests?
I think when bluemagic was making it, he didn't have access to a hook necessary to make it work. There might still be a hook we need to fix it.any reason for why the chest opening animation is not working for modded chests?
I think when bluemagic was making it, he didn't have access to a hook necessary to make it work. There might still be a hook we need to fix it.
Sorry. I know I would express this ambiguously.I'm not sure what you mean by "attack interval", I don't think there is a field named that. Also, you can just check the vanilla item field spreadsheet and learn from there if you want to. Are you actually talking about how many times it can hit on a single swing?
I'm not sure what you mean. The recipe is passed in, you don't need to "refer to" it at all, it's just there. Maybe you can explain what you mean, which OnCraft method you are using, and what you need to know to do it correctly.
public override void OnCraft(Recipe recipe)
{
Main.PlaySound(7, (int)player.position.X, (int)player.position.Y, 0);
ItemText.NewText(item, item.stack, false, false);
for (int i = 0; i < 50; i++)
{
Item item2 = player.inventory[i];
if (item2.stack > 0 && item2.type > 0 && item2.type == mod.ItemType("IchorThrowingKnife"))
{
((IchorThrowingKnife)item2.modItem).durability += 100; break;
}
}
If you aren't changing useTime and useAnimation at the same time, I don't think your tests will prove all that useful. Also, looking at the code, all the swords have various useTimes.Sorry. I know I would express this ambiguously.
By Attack Interval, it's just the use time. Only I found a little something wrong with it. Let's say the night's edge, it has a DPS of 50. And I actually set a melee weapon (it's a mod sword) as the same damage as that of the night's edge. And a really slow speed, definitely not faster than the night's edge, maybe an use time of 40, but its DPS still reaches 70 easily. Even if I change the use time of my sword to 50 or something higher, the DPS won't change too much, seems to remain at 70 or 68. So by these strange phenomenon, I suspected that a melee weapon's use time doesn't depend on, or merely depend on the use time of the item, which is defined with the weapon's item.cs. Also, I can find use time of guns, bows or let's say all the ranged weapons. But no, I can't find any melee weapon in Item.cs has been granted with a specific use time. Then where is the vanilla melee weapon's use time?
By this recipe stuff... Well, let me first tell you the details about my ideas(not some good ideas but ideas)!
I made myself some throwing knives right? They're with durability types, you know. In order to resupply this durability when a throwing knife's durability reached 0, I think I should make a certain item, which will resupply the relative throwing knife when being crafted... So what I was wondering was, how far can OnCraft influence?
Let's say I made an item named "Ichro Throwing Knife Supply". And it is only a simply item can't be used to do nothing. But it has its OnCraft hook. I guess I may be supposed to write the same codes what I write in OnPickup before, only with a larger supply number. Something like:
But, does this mean, whenever this "Knife Supply" item was crafted, as long as the recipe's output includes this item, this hook will be called? I was wondering what this "Recipe recipe" parameter refers to...Code:public override void OnCraft(Recipe recipe) { Main.PlaySound(7, (int)player.position.X, (int)player.position.Y, 0); ItemText.NewText(item, item.stack, false, false); for (int i = 0; i < 50; i++) { Item item2 = player.inventory[i]; if (item2.stack > 0 && item2.type > 0 && item2.type == mod.ItemType("IchorThrowingKnife")) { ((IchorThrowingKnife)item2.modItem).durability += 100; break; } }
K, I'll think about it. And I dunno whether you received my bug just now, any idea?If you aren't changing useTime and useAnimation at the same time, I don't think your tests will prove all that useful. Also, looking at the code, all the swords have various useTimes.
For the recipe, that is the recipe that was used to craft the item. For example, consider a mod that has 2 recipes for the same thing, with a high quality recipe and a low quality recipe. The mod can check the recipe and maybe "break" the item half of the time with the low quality recipe. The issue you might have with your idea is how do craft the item but not actually end up with the item in your inventory. Maybe setdefaults to 0?
EDIT: Oh! And I found some bug of my durability system just now! I made 2 knives, but only used one of them. So there would be a lot of items on the ground waiting for my picking up. However, there is actually only one throwing knife, with its full durability, in my inventory. The items on the ground still can be picked up, and the OnPickup hook still got called. How to ban the picking behavior when the player's inventory has no available durability to fulfill or simply has no throwing knife?
public override void AI()
{
projectile.rotation += 1.5f * projectile.direction * (-1);
if (Main.rand.Next(3) == 0 && player.direction == 1)
{
//projectile.velocity.Y *= 1.0f;
projectile.velocity.X *= 1.05f;
}
else if (Main.rand.Next(3) == 1 && player.direction == -1)
{
//projectile.velocity.Y *= 1.0f;
projectile.velocity.X *= 1.05f;
}
Just taking a guess I would say what you're seeing is the projectile.velocity.X *= 1.05f; line increasing the velocity over time.Code:public override void AI() { projectile.rotation += 1.5f * projectile.direction * (-1); if (Main.rand.Next(3) == 0 && player.direction == 1) { //projectile.velocity.Y *= 1.0f; projectile.velocity.X *= 1.05f; } else if (Main.rand.Next(3) == 1 && player.direction == -1) { //projectile.velocity.Y *= 1.0f; projectile.velocity.X *= 1.05f; }
There is some kind of "force" pushing the shurikens, how to use the normal gravity?
Not seeing the code for the item I'm going to guess that theres something wrong with the code that sets the number of frames in the animation.My next problem ...
Player is holding all 4 sprites I use for the animation in the inventory. why ?
What OS?When I try to run the installer it says ''Could not find a place to install to!'' How can I fix this?
We don't know yet.modded chest (any mod) turn into dresser why is that?
I'm not sure if animated use items is fixed yet, but you have an exception being thrown in your draw codeMy next problem ...
Player is holding all 4 sprites I use for the animation in the inventory. why ?
do it manually, read the readme.When I try to run the installer it says ''Could not find a place to install to!'' How can I fix this?
What makes you think it doesn't work?What i need to do if PostUpdate for player and world doesn't work correctly on the server? I've already asked about it
I believe tmodloader only works with the steam version@aerlock @jopojelly I'm using Windows 7 GOG version.
I've tried installing it manually but that didn't work either. What do I have to do after copying the files?
I believe tmodloader only works with the steam version
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace RCT.Projectiles
{
public class GuardianSphereProj : ModProjectile
{
public override void SetDefaults()
{
projectile.name = "Guardian Sphere Projectile";
projectile.width = 20;
projectile.height = 20;
projectile.aiStyle = 47;
projectile.ranged = true;
projectile.penetrate = 2;
projectile.timeLeft = 1800;
projectile.ignoreWater = true;
projectile.friendly = true;
projectile.hostile = false;
projectile.tileCollide = false;
}
public override void AI()
{
projectile.rotation += (float)projectile.direction * 0.8f;
projectile.velocity.X = 0.5f;
projectile.velocity.Y = 0.5f;
projectile.light = 1;
Player owner = Main.player[projectile.owner];
if (projectile.position.X < owner.position.X + owner.width && projectile.position.X + projectile.width > owner.position.X && projectile.position.Y < owner.position.Y + owner.height && projectile.position.Y + projectile.height > owner.position.Y) // Need to fix (make it so if within a certain radius)
{
owner.AddBuff(2, 1800);
}
}
}
}
How to deny an item's being picked up under certain conditions?EDIT: Oh! And I found some bug of my durability system just now! I made 2 knives, but only used one of them. So there would be a lot of items on the ground waiting for my picking up. However, there is actually only one throwing knife, with its full durability, in my inventory. The items on the ground still can be picked up, and the OnPickup hook still got called. How to ban the picking behavior when the player's inventory has no available durability to fulfill or simply has no throwing knife?
public override bool UseItem(Player player)
{
NPC.SpawnOnPlayer(player.whoAmI, NPCID.SkeletronHead);
Main.PlaySound(15, (int)player.position.X, (int)player.position.Y, 0);
return true;
}
He could just make it use the hide the items graphic code when usingWe don't know yet.
I'm not sure if animated use items is fixed yet, but you have an exception being thrown in your draw code
do it manually, read the readme.
[doublepost=1461526469,1461526425][/doublepost]
What makes you think it doesn't work?