Aurorus Posted July 9, 2019 Share Posted July 9, 2019 (edited) Anyone know how to push "cold shaking" animation on item mod? https://gyazo.com/afbf5f9e4a3a597fe6925913ef8aa80a Edited July 9, 2019 by Aurorus Link to comment Share on other sites More sharing options...
Ultroman Posted July 9, 2019 Share Posted July 9, 2019 Have you tried inst.components.talker:Say(GetString(inst, "ANNOUNCE_COLD")) I can't find anywhere where it actually reacts to cold by playing an animation, so I'm guessing there may be some code listening for announcements and pushing the fitting animation for it if there is one. Sort of like an emote, but automatic. Link to comment Share on other sites More sharing options...
Aurorus Posted July 10, 2019 Author Share Posted July 10, 2019 After swap item to hand game crashes Link to comment Share on other sites More sharing options...
Ultroman Posted July 10, 2019 Share Posted July 10, 2019 If you need help, then I need more information. At least the logs with the error in it, and if you want me to do more than just decipher the error I'll need a zip of your mod, as well. Link to comment Share on other sites More sharing options...
Aurorus Posted July 10, 2019 Author Share Posted July 10, 2019 (edited) This is files what making error  Edited July 10, 2019 by Aurorus Link to comment Share on other sites More sharing options...
Ultroman Posted July 10, 2019 Share Posted July 10, 2019 In the OnEquip function in the weapon you're doing inst.components.talker:Say(GetString(inst, "ANNOUNCE_COLD")) but in the scope of that function inst is the weapon, which can't talk. Change inst to owner. Link to comment Share on other sites More sharing options...
Aurorus Posted July 10, 2019 Author Share Posted July 10, 2019 it works but animation of shaking isnt reaction for announce Link to comment Share on other sites More sharing options...
Ultroman Posted July 10, 2019 Share Posted July 10, 2019 Oh well, worth a try. I can't find it anywhere. Find out what the animation is called (it should be in the animation build for the player) and do a search through the game code for that name. It must be triggered somewhere. Link to comment Share on other sites More sharing options...
Aurorus Posted July 10, 2019 Author Share Posted July 10, 2019 (edited) ok i know one mod what trigger this animation https://steamcommunity.com/sharedfiles/filedetails/?id=565382325&searchtext=cute+plushies Edited July 10, 2019 by Aurorus Link to comment Share on other sites More sharing options...
Ultroman Posted July 10, 2019 Share Posted July 10, 2019 Well, please do post your solution when you find it, so others can find it here in the future Link to comment Share on other sites More sharing options...
Aurorus Posted July 10, 2019 Author Share Posted July 10, 2019 Now i know what animation this is but dont know how to trigger this inst.AnimState:PlayAnimation("idle_shiver_pre") inst.AnimState:PushAnimation("idle_shiver_loop") Â Link to comment Share on other sites More sharing options...
Ultroman Posted July 10, 2019 Share Posted July 10, 2019 Well, that should do it. Did you try it out? Link to comment Share on other sites More sharing options...
Aurorus Posted July 11, 2019 Author Share Posted July 11, 2019 yea but i dont know how to trigger this by taking item to hand Link to comment Share on other sites More sharing options...
Ultroman Posted July 11, 2019 Share Posted July 11, 2019 If you just want it to happen once when the character equips it, you can put the lines into the OnEquip function of the item. If you want it to continuously trigger the animation, then you have to start a periodic task, which you then stop in OnUnequip. Link to comment Share on other sites More sharing options...
Aurorus Posted July 11, 2019 Author Share Posted July 11, 2019 it works but only when item is picked from ground Link to comment Share on other sites More sharing options...
Ultroman Posted July 11, 2019 Share Posted July 11, 2019 That's odd. OnEquip should be called every time you equip it. Try putting a print-statement in the onequip function to verify. If your onequip is indeed called, there may be something else going on behind the scenes we don't know about. Link to comment Share on other sites More sharing options...
Aurorus Posted July 11, 2019 Author Share Posted July 11, 2019 it works with print but dont work with animation animation is still triggered by take item from ground Link to comment Share on other sites More sharing options...
Ultroman Posted July 11, 2019 Share Posted July 11, 2019 I have no idea, m8. I'm just guessing things here. Now you've established that whatever code you need can be triggered in onequip, but apparently it doesn't work unless you pick it up from the ground. Unless you've added a check for whether "owner" is false, it should be crashing if there is no owner. Just to be sure, you did change the lines to this, right? owner.AnimState:PlayAnimation("idle_shiver_pre") owner.AnimState:PushAnimation("idle_shiver_loop")  Link to comment Share on other sites More sharing options...
Aurorus Posted July 11, 2019 Author Share Posted July 11, 2019 yea it still dont work Link to comment Share on other sites More sharing options...
Ultroman Posted July 11, 2019 Share Posted July 11, 2019 (edited) I'd guess it's somehow in a state where it can't play the animation, then. Try this: -- This line outside and above both functions. local freezetask = nil -- This in onequip freezetask = owner:DoPeriodicTask(5.0, function(inst) inst.AnimState:PlayAnimation("idle_shiver_pre") inst.AnimState:PushAnimation("idle_shiver_loop") end) -- This in onunequip freezetask:Cancel()  That should keep playing the animation every 5 seconds, if it's in a state where it can. Since they're called something with "idle", I guess your character has to be idle for it to play (complete speculation, though). You can adjust the 5 seconds to whatever you like. Edited July 12, 2019 by Ultroman Link to comment Share on other sites More sharing options...
Aurorus Posted July 11, 2019 Author Share Posted July 11, 2019 after this i got bug splats or dont working Link to comment Share on other sites More sharing options...
Ultroman Posted July 11, 2019 Share Posted July 11, 2019 "Bug splats"? Link to comment Share on other sites More sharing options...
Aurorus Posted July 12, 2019 Author Share Posted July 12, 2019 (edited) i think about error screen like this and this bug splat is only for preview and i did it dont analyze this please Edited July 12, 2019 by Aurorus Link to comment Share on other sites More sharing options...
Ultroman Posted July 12, 2019 Share Posted July 12, 2019 (edited) Ah, ok. Oops, I just saw a bug in my previous code. I've fixed it in the previous post (changed it from owner.AnimState to inst.AnimState, since the scope changed from the code we had previously). Edited July 12, 2019 by Ultroman Link to comment Share on other sites More sharing options...
Aurorus Posted July 12, 2019 Author Share Posted July 12, 2019 after this item cant be spawned Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now