StarmanUltra

  • Content Count

    50
  • Joined

  • Last visited

Community Reputation

4 Neutral

About StarmanUltra

  • Rank
    Junior Member
...

Badges

Recent Profile Visitors

1052 profile views
  1. What you can do is swap the image for one that has transparency. Doing that several times can give a decent fadeout effect. When I ran into the issue, I opted to have the object shrink into nothing.
  2. Weird, I tried lots of different variations, and I could only ever get one or two of the actions to go. Either - it wouldn't properly unequip the ham bat, - the eat animation wouldn't occur - eat animation would play, but no hunger value gained But it turns out using DoTaskInTime allows the functions to not pile up, I guess? I found the perfect balance in this: local function equipchange(inst, data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equiphand and equiphand.prefab == "hambat" theninst:DoTaskInTime(0,function() inst:PushEvent("unequip",inst) equiphand:Remove() end) inst:DoTaskInTime(0.75,function() local food = SpawnPrefab("meat") local buffaction = BufferedAction(inst, food, ACTIONS.EAT) inst:PushBufferedAction(buffaction) end) inst:DoTaskInTime(3,function() inst.components.talker:Say("Meat on stick!") end) endendThis allows the unequip animation and prefab removal to happen fluidly, but then the eat action forces the character to stop and eat. I'm really happy with the result Thanks! You thought you were going to equip the ham bat? Think again!
  3. That doesn't work any better, unfortunately (looks a lot prettier though ). And it does need the inst:PushEvent("unequip",inst) to update the inventory bar (otherwise it looks like the ham bat is still equipped. Even cutting out most of the function and just pushing an eat action doesn't play the animation for eating, it just changes hunger and does the sound effect. It seems like adding a talker component makes that a priority, even at the end of the function. What I really want in the end is an eating animation to show. This is pretty close to what I want, not quite perfect yet since the eating animation can be cut off by movement. local function equipchange(inst, data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) if equiphand and equiphand.prefab == "hambat" then--inst.components.locomotor:Stop() local food = SpawnPrefab("meat")inst:DoTaskInTime(0,function() inst:PushEvent("unequip",inst)equiphand:Remove()end) inst:DoTaskInTime(0.75,function() inst.AnimState:PlayAnimation("eat_pre",false)inst.AnimState:PushAnimation("eat", false)BufferedAction(inst, food, ACTIONS.EAT):Do()end) inst:DoTaskInTime(3,function() inst.components.talker:Say("Meat on stick!")end) endend
  4. How can I make the eating animation play for this function? It also doesn't complete the unequip action (it leaves the icon in the equip slot) local function equipchange(inst,data) local equiphand = inst.components.inventory:GetEquippedItem(EQUIPSLOTS.HANDS) local food = nil if equiphand == nil then return end if equiphand.prefab == "hambat" then inst:PushEvent("unequip",inst) equiphand:Remove() inst:DoTaskInTime(0,function() food = SpawnPrefab("meat") inst.components.eater:Eat(food) end) --inst.AnimState:PlayAnimation("eat_pre") --inst.AnimState:PushAnimation("eat", false) endend
  5. Haven't the foggiest... I'm pretty new too, which means I've been running into a lot of "attempt to index nil" as well.
  6. looking at componentactions.lua, the line it's failing on is t = MOD_COMPONENT_ACTIONS[modname][type]There's a little error catcher just above this line that tests if modname is nil. In the printout, it says "This is likely a result of your mod's calls to AddComponentAction not happening on both the server and the client."
  7. Took a break from working on the ranged attack code for now, wanted to finalize his attack animation by adding in the tongue. Problem is, it doesn't want to show up in game, nor does the new headbase I had to use to get the layering to show up correctly. Look at the comparison gifs: Am I just not allowed to have a headbase-5.png or add in a beard-0.png? Or is there something else I have to declare in the game code?
  8. I really like the character concept! Especially females losing sanity near him. The crown probably shouldn't reduce his sanity though. It makes sense in the context of the character/show, but that means you'll hardly ever be wearing his iconic crown. I actually think she should go insane if you're *not* wearing his crown. And it shouldn't give you crazy amounts of armor, it's just a crown. I think the tradeoff could be something more like: you need to wear the crown or go insane, meaning you can't really benefit from other headgear. But while you *are* wearing the crown, you get ice powers. And if anyone else puts on the crown, it drives them insane. If you wanted to go all-out, you could make the crown give other people ice powers, but that might take a lot of code.
  9. I'm running into an issue where my projectile prefab is causing a crash due to inventoryitem_replica calling the following function: function InventoryItem:GetImage() return self.classified ~= nil and self.classified.image:value() ~= 0 and self.classified.image:value() or (self.inst.prefab..".tex")endThe crash happens because it can't load in the .tex file (which I set up). I can use the console to spawn it in my inventory, even equip it in my hand, but when I try to create a projectile out of it, there's problems. The error is: "attempt to concatenate field 'prefab' (a nil value)" wogmaw.lua has a function called rangedattack that attempts to call the projectile: local function rangedattack(inst,data)local weapon = CreateEntity() weapon.entity:AddTransform() MakeInventoryPhysics(weapon) weapon:AddComponent("weapon") weapon.components.weapon:SetDamage(25) weapon.components.weapon:SetRange(inst.components.combat.attackrange, inst.components.combat.attackrange+4) weapon.components.weapon:SetProjectile("spit") weapon:AddComponent("inventoryitem") weapon.persists = false weapon.components.inventoryitem:SetOnDroppedFn(function() WeaponDropped(weapon) end) weapon:AddComponent("equippable") inst.weapon = weapon inst.components.inventory:Equip(inst.weapon) inst.components.inventory:Unequip(EQUIPSLOTS.HANDS)end
  10. You're awesome This answers a lot of questions, including but not limited to: what to name entities/animations (looks like specific names aren't required),what it is your lua scripts call,yes you are able (but not required) to use bones,each animation requires a different facing of the character,animations are not all side-by-side like the .scml file in the mod character template,swap_hat, swap_body, swap_object examples!etc. etc. So, for the benefit and convenience of others, I'll attach your archery mod as it exists now. I think this serves as an excellent example of how to customize a weapon and give it an attack animation. workshop-488009136.zip
  11. Still showing up blank. I think the forum user Zupalex is going to upload their .scml files, but if you have the time, maybe you can just look at how I have things set up. My animation stuff is pretty messy right now because I've tried several different things (such as having a separate folder in exported for the attack animation, as well as renaming it to "rangedattack". I've also been unable to intercept the attack command by listening for it via inst:ListenForEvent("doattack", RangedAttack) Thank you in advance for any help you can and have provided, this animation stuff is *not* straight-forward in Don't Starve. EDIT: Sooo it took me nearly a full week to get animations to actually *show up in game*. Geez, the documentation is far from sufficient... Turns out, the entity in spriter and the assignments within the .lua scripts need to give the animation to "wilson" even though they're specifically for my character "wogmaw"... I guess since the mod character replaces Wilson's stuff, you give it to Wilson first. But holy crap I was wracking my brain for days trying to get this working. Now I need to tweak the animations for atk_pre vs atk, etc. But yeah, animations are in! I'm psyched! Getting pretty close to a 1.0 release.
  12. I think it would be very helpful, not only to me, but to anyone trying to create custom animations. I'm currently failing to get the game to compile a "rangedattack.zip" -_-
  13. i like your avatar

    1. Show previous comments  2 more
    2. StarmanUltra
    3. DwerBomb

      DwerBomb

      We are best friends now

    4. StarmanUltra

      StarmanUltra

      haha I'm glad you recognize my excellent taste in media B)

  14. There really should be a tutorial on custom animations. The one regarding idle animations is too limited in scope to be useful for other animations. I'm going through your archery mod files trying to figure out how to do my own, but mods themselves don't contain the .scml files, which is a huge pain. I will say, though, that your struggles haven't been in vain, since they've been very helpful to me
  15. I'm having a very hard time replacing his attack animation. So far, he goes blank upon attacking and until moving again, at which time his sprite shows back up. I created a custom animation (seen above) using the character template in Spriter and named the file player_attacks.scml. Beyond that, I'm not sure where to go. Obviously it's trying to replace the animation, but nothing is showing up in-game. I'm guessing a factor is the animation name itself "template - BUILD_PLAYER_ATTACKS" (for the entity - animation) doesn't work. I have most of the rest of the mod worked out, so this is really the thing holding me back from a 1.0 release.