Jump to content

Dampiir

Vintarian
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Dampiir's Achievements

Berry Picker

Berry Picker (2/9)

0

Reputation

  1. I know you can animate blocks I am trying to animate items though. 2 different things my friend
  2. Ok so I tried using OnAttackStart and Step instead and it works but now I can't get it to stop the custom action. Just to clarify I am trying to add a stream of particles to the attack/mining action of my item. Also the custom action (particles) stops itself if used with OnInteractStart and Step but the returns are different for OnAttack so I am sure it's a simple fix to do with where/how the return is used I just can't figure it out. Here is my code: namespace ExampleMods { public class MinerMod : ModSystem { public override void Start(ICoreAPI api) { base.Start(api); api.RegisterItemClass("miner", typeof(MinerItem)); } } public class MinerItem : Item { //particles public static SimpleParticleProperties particles = new SimpleParticleProperties( 1, 1, ColorUtil.ToRgba(50, 220, 220, 220), new Vec3d(), new Vec3d(), new Vec3f(-0.25f, 0.1f, -0.25f), new Vec3f(0.25f, 0.1f, 0.25f), 1.5f, -0.075f, 0.25f, 0.25f, EnumParticleModel.Cube ); public override void OnHeldAttackStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, ref EnumHandHandling handling) { handling = EnumHandHandling.PreventDefaultAnimation; } public override bool OnHeldAttackStep(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) { if (byEntity.World is IClientWorldAccessor) { ModelTransform tf = new ModelTransform(); tf.EnsureDefaultValues(); tf.Origin.Set(0, -1, 0); tf.Rotation.Z = Math.Min(30, secondsUsed * 40); byEntity.Controls.UsingHeldItemTransformAfter = tf; if (secondsUsed > 0.6) { Vec3d pos = byEntity.Pos.XYZ.Add(0, byEntity.EyeHeight, 0) .Ahead(1f, byEntity.Pos.Pitch, byEntity.Pos.Yaw) ; Vec3f speedVec = new Vec3d(0, 0, 0).Ahead(5, byEntity.Pos.Pitch, byEntity.Pos.Yaw).ToVec3f(); particles.MinVelocity = speedVec; Random rand = new Random(); particles.Color = ColorUtil.ToRgba(255, 255, 100, 200); particles.MinPos = pos.AddCopy(-0.05, -0.05, -0.05); particles.AddPos.Set(0.1, 0.1, 0.1); particles.MinSize = 0.1F; particles.MaxSize = 0.5F; particles.SizeEvolve = new EvolvingNatFloat(EnumTransformFunction.LINEAR, 0); byEntity.World.SpawnParticles(particles); } } return true; } } }
  3. Hi I am trying to make tools and weapons that use the right mouse click instead of left click. I know right click is OnHeldInteractStart and step but how could I make it attack or mine blocks when the interact is held?
  4. Mod updated, check original post for exciting goodies!
  5. Yes 10 stacks, I might make more tiers with a lower one made from linen with less slots or something. Also looking at adding some functionality to the belts.
  6. Hi I just made a new mod called Quivers! It's very simple and just allows you to craft the quiver which currently does not seem craftable for some reason but after some testing it seems functional, so now with this you can make and use it! I have changed the mod a little, it now adds the leather quiver with 12 slots AND there are now also more quivers for early and mid game. Tiered Quivers: Primitive Quiver - 4 slots and made from cattails, twine and a knife. Linen Quiver - 8 slots and made the same as primitive but with linen instead of cattails. Leather Quiver - 12 slots! Made the same as previous tiers but with leather. Ideas and suggestions welcome. This is my first completed mod ever so while constructive criticism is greatly appreciated, be gentle Version history and downloads Downloads are inside the spoilers!
  7. Hi I'm making my first mod following the basic item mod guide on the wiki (wands) and I was wondering: if we want to animate a hand held item do we need to export the animation as a gif or individual png files? Also how do we apply the animation to the model in game? EDIT: more specifically how do I get the animation to trigger? So I just found it put the code for the animation into the shape file when I saved it. It's just an idle spinning animation for a cube, very simple but cannot find any info on how to get the animation to run. Any help would be greatly appreciated!
  8. Thank you for the update, seems the issue we had has been fixed! Time to grind some levels Do you have an info page on how to create new skills?
  9. Dampiir

    BvBows

    It seems all of BunnyVikings mods are down right now, site wide.....
  10. Hi thanks for this, the core game really needs an option to have this imo but mods save the day again. Now my issue is every time we try to cut down a tree with an axe we get kicked off the server. Here is the error code from the log file: 31.3.2020 09:23:24 [Error] System.NullReferenceException: Object reference not set to an instance of an object at XSkills.XSkillsWoodBehavior.GetDrops (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.MathTools.BlockPos pos, Vintagestory.API.Common.IPlayer byPlayer, System.Single dropChanceMultiplier, Vintagestory.API.Common.EnumHandling& handling) [0x00057] in <3f667d904a234185a43a5607f064aff5>:0 at Vintagestory.API.Common.Block.GetDrops (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.MathTools.BlockPos pos, Vintagestory.API.Common.IPlayer byPlayer, System.Single dropQuantityMultiplier) [0x00014] in <dc4ea4766ec149aea6ecf1251deb4a8d>:0 at Vintagestory.API.Common.Block.OnBlockBroken (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.MathTools.BlockPos pos, Vintagestory.API.Common.IPlayer byPlayer, System.Single dropQuantityMultiplier) [0x00055] in <dc4ea4766ec149aea6ecf1251deb4a8d>:0 at Vintagestory.Common.BlockAccessorBase.BreakBlock (Vintagestory.API.MathTools.BlockPos pos, Vintagestory.API.Common.IPlayer byPlayer, System.Single dropQuantityMultiplier) [0x00007] in <7813a981fe8d480daf699b5bcc5e6745>:0 at Vintagestory.GameContent.ItemAxe.OnBlockBrokenWith (Vintagestory.API.Common.IWorldAccessor world, Vintagestory.API.Common.Entities.Entity byEntity, Vintagestory.API.Common.ItemSlot itemslot, Vintagestory.API.Common.BlockSelection blockSel) [0x001db] in <51512a76caf94b518b146ff54257d7e6>:0 at Vintagestory.Server.ServerMain.TryModifyBlockInWorld (Vintagestory.Server.ServerPlayer player, _CGdpdCWXDDnS95LUBcSC8jPcNis cmd) [0x0047f] in <7813a981fe8d480daf699b5bcc5e6745>:0 at Vintagestory.Server.ServerMain.HandleBlockPlaceOrBreak (_3j0rPeawc5f6wo32B33cuCPNv1G packet, Vintagestory.Server.ConnectedClient client) [0x00118] in <7813a981fe8d480daf699b5bcc5e6745>:0 at Vintagestory.Server.ServerMain.HandleClientPacket (Vintagestory.Server.ConnectedClient client, System.Byte[] data) [0x0005a] in <7813a981fe8d480daf699b5bcc5e6745>:0 at Vintagestory.Server.ServerMain.ProcessNetMessage (Vintagestory.Common.NetIncomingMessage msg, Vintagestory.Common.NetServer mainSocket) [0x0014d] in <7813a981fe8d480daf699b5bcc5e6745>:0 Any ideas? Anyone else ever get this? Other mods we have on are: LazyTweaks BvBows CarryCapacity Wild Goblins
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.