Hoamaii Posted October 8, 2014 Share Posted October 8, 2014 Hi guys, I'm testing a mod with animations and I'm trying to find a way to clear the animobjects from the actors hands once the animation has played. Most animations have an "exit" anim which can be used to do that - but some others don't. Specifically, I'm referring to the "SoupServe" animation. The anim plays smoothly with SAE but once done, the actor keeps the 2 animobjects in hand: CastIronPot and WoodenLadle. There is no "exit" animation that I know of for this one. Through script debug, I realized the game recognizes the actor's hands are equipped with an object, but of course unequip won't work as it seems animobjects are not considered as weapons. "IdleForceDefaultState" does not unequip the animobjects either, only jumping or drawing weapons will (as far as I know) but I'm trying to find a smoother way. So far, the "smoothest" way I've found is to make the actor quickly draw a weapon and sheathe it again - but it still looks out of place. Anybody knows a nicer way I may have overlooked? Many thanks in advance to any "Nexuser" who will enlighten me!.. :). PS. I'm using FNIS and SKSE in my game but I'm trying to create a mod which will not require them from users. Link to comment Share on other sites More sharing options...
fore Posted October 8, 2014 Share Posted October 8, 2014 I'a a little confused. There is no SoupServe. You talk about IdleOffsetCarryPotServe? There is no exit animations, or, what you rather want, an exit AnimEvent. Exit AnimEvents are mostly used for furniture animations. But what we have here are (arm) offset animations. These animations at blended into the regular unarmed movement, turning, standing idles, and dialog animations. Everything else, like you found out, will stop the offset animation. And you can stop them with SAE("OffsetStop") Link to comment Share on other sites More sharing options...
Hoamaii Posted October 8, 2014 Author Share Posted October 8, 2014 Hi Fore, Sorry, I should have been more specific, yes, I'm talking about the IdleOffsetCarryPotServe. I had read your notes about the offset animations and Exit AnimEvents - maybe in your "FNIS for modder", or on one of your threads. I have tried the SAE("OffsetStop") too but, unless I coded it wrong, it does not seem to work on that one - at least on the player. I have not tested it with NPCs yet. So I tried SAE("IdlePlayer"), which if I remember correctly, is listed in the CK as the AnimEvent for the Player "OffsetStop" - no luck either. Some SAE don't seem to work on the player - SAE("DefaultSheathe") won't work for instance while Playidle(DefaultSheathe) does. Do we need to call for any other event before we call SAE("OffsetStop")? Here are all the events I've tried: Event OnActivate(ObjectReference akActionRef) Utility.Wait(0.5) Game.GetPlayer().PlayIdle(IdleOffsetCarryPotServe) Utility.Wait(5.5) ; Game.GetPlayer().PlayIdle(IdleStop_Loose) ; Debug.Notification("IdleStop Called") Utility.Wait(4.0) ; Debug.SendAnimationEvent(Game.GetPlayer(), "OffsetStop") ; Debug.Notification("OffsetStop called") ; Debug.SendAnimationEvent(Game.GetPlayer(), "IdlePlayer") ; Debug.Notification("IdlePlayer called") ; Utility.Wait(3.0) ; Debug.SendAnimationEvent(Game.GetPlayer(), "IdleForceDefaultState") ; Debug.Notification("DefaultState called") ; Utility.Wait(3.0) ; Debug.SendAnimationEvent(Game.GetPlayer(), "Unequip") ; Debug.Notification("Unequip called") If (!Game.GetPlayer().GetEquippedItemType(0)) && (!Game.GetPlayer().GetEquippedItemType(1)) Debug.Notification("Player has no hand equipped") Else If (Game.GetPlayer().GetEquippedItemType(1)) Debug.Notification("Player has object equipped in right hand") EndIf If (Game.GetPlayer().GetEquippedItemType(0)) Debug.Notification("Player has object equipped in left hand") EndIf EndIf Utility.Wait(2.5) Game.GetPlayer().UnequipItemSlot(1) ; unequips gloves but not the pot Utility.Wait(3.0) Game.GetPlayer().DrawWeapon() ;Vanilla function Utility.Wait(1.2) Game.GetPlayer().PlayIdle(DefaultSheathe) ; that one works ; Debug.SendAnimationEvent(Game.GetPlayer(), "DefaultSheathe") ; don't work EndEvent Debug showed that all other events are properly called - but none has any effect. Perhaps I should try calling another event than drawing weapons - I was thinking of making the WoodLadle a weapon, having the player draw it, then sheathe it to get rid of the animobjects but that seems rather farfetched, isn't it? Thanks for your help!.. Link to comment Share on other sites More sharing options...
fore Posted October 8, 2014 Share Posted October 8, 2014 I have to confess that I made all my Offset tests with NPCs, and I can't test player right now. But I don't see any reason why player should not work as well. But I see a possible problem in your script. It's the Game.GetPlayer().PlayIdle(IdleStop_Loose). IdleStop is not expected in this context. And it could well be that it will force the graph away from it's expected end state "UnequipAnimObjectState". Which is supposed to do what you are missing. So try without this idle. Link to comment Share on other sites More sharing options...
Hoamaii Posted October 9, 2014 Author Share Posted October 9, 2014 Oops, I didn't think of that - yeah I will try it 1st thing when I open the CK tomorrow!.. Since you're so nice as to help me in this (even though I'm trying to create a mod that could work without FNIS... :blush:), I have another question for you if you don't mind: I've modified the Vanilla Tankard animobjects meshes to add wine - or beer - in the empty tankard, and the CastIronPotSmall to add soup in the pot (yeah, testing stuff...). All seem to work absolutely fine in game but there are different versions of animobjects for each of them and I'm having a hard time determining which is used in which AnimEvent. I've modified them all. My question is: does it happen that the game uses several animobjects in one single scene - or animation event? For instance, there are 3 tankard animobjects in the CK:- animobjecttankard- animobjecttabletankard- animobjectdrinkingtankard The last one is singlehandedly used in the "ChairDrinkingStart" anim event and in the "IdleDrinkingStandingStart". Though I haven't tested them yet, I assume the "animobjecttabletankard" and "animobjecttankard" are used in other animations, maybe the Drunk or Toast scenes or some Counter animations. I have not been able to find the animation which uses the "animobjecttankard" for instance. I know, I could test them all by myself, but it takes endless hours testing on NPCs... :confused: What I'm wondering is - for the sake of consistency - if all 3 animobjects should be all "beer" version or all "wine" version in users' games or if it didn't matter to mix beer and wine - in case the game only uses one animobject per scene anyway... Huh, I hope that question makes sense (English is not my native language, sorry). I'd like to avoid seeing the tankard content change in the middle of an animation - that's the purpose of my question (not sure it's much more clear... ahem...). A miilion thanks again for bearing with my questions, Fore :). Cheers! Link to comment Share on other sites More sharing options...
fore Posted October 9, 2014 Share Posted October 9, 2014 Did you really see all those 3 AOs in-game? Both in CK and in the behaviors I can only see one with "tankard", the first one. It's not the first time that there are files in the bsa which are not used in the game. animobjecttankard is used at about 17 or 18 places im mt_behavior. There are more references to it, but most of the time it takes 2 AnimEvents to equip an AO. If you want to understand the relationship between AnimEvents, AnimFiles, AOs and AnimVars I recommend that you use CondenseBehavior. FOr your case get mt_behavior.hkx, turn it into an xml with hkxcmd, and from here create a "condensed" output with CondenseBehavior. I would never be able to tell you anything, or even make FNIS without such a tool. And your English is great. At least for me. I'm not native English speaker myself. :smile: Link to comment Share on other sites More sharing options...
Hoamaii Posted October 9, 2014 Author Share Posted October 9, 2014 Nope, I can't say I've seen those 3 AOs in game - as far as my tests go, I've only seen the animobjectdrinkingtankard and the animobjectcastitonpotsmall used in game (there's also an animobjectpotsmall with collision - but I couldn't figure out where it may be used). And you're right there's only one of each in the CK - why didn't I check there before I modified 5 different meshes in 3DS?!.. The strange thing though is I'm fairly sure at first I only tested one AO which was the animobjectDrinkingTankard (which is not in the CK) and it DID change the tankard look in the standing and sitting drinking animations. I'll double check. Yeah, I had been tracking your CondenseBehavior utility but I'm afraid it's still out of my league atm - I'm still learning my way around animations, if it goes like I did with 3D modeling or scripting, I'll get there at some point, just not there yet... About the SAE("OffsetStop") to get rid of the AnimObjectCastIronPotSmall after playing the IdleOffsetCarryPotServe - it does not seem to work on the player. As you suggested, I tried it to call SAE("OffsetStop") on its own in a small script but my player kept carrying his pot and ladle around anyway. PlayIdle(OffsetStop) shows no effect either. I found a rather complicated way around it however: as I was testing other anims in the same cell, I realized if my pot-carrying PC went and activated another activator with a PlayIdle(IdleWarmHands) function, the idleWarmHands did not quite play completely but it did get rid of the pot and ladle and restored the default idle. So at first, I tried adding the PlayIdle(IdleWarmHands) as an Exit AnimEvent attempt in the same script which called the PlayIdle(IdleOffsetCarryPotServe) in the 1st place - but that did not work. Which worked however was, in the same script, to silently call activation of a remote activator which triggered the beginning of IdleWarmHands then called IdleStop_Loose after a second or so. Pretty far-fetched, no doubt, but it does remove the AO from the PC's hands almost a "natural" way since the IdleWarmHands does not have time to play. I'm not sure what it means except that, in my "apprentice" empirical way, I noticed that:- there's no point calling or activating anything as long as the full IdleOffsetCarryPotServe has not finished playing (8 or 9 seconds, I'd say) - I'd guess this Offset anim disables player controls?- calling another anim has no effect on its own nor activation on its own either, but activating something + calling another anim does the trick (why? no idea). Not any type of anim, but obviously "IdleWarmHands" does reset the graph.That being for the player - like I said, I haven't tried it on NPCs yet. I just hope that SAE("OffsetStop") works on NPCs 'cause my way around this "CastIron" puzzle without FNIS seems a little bit complicated, isn't it?.. ;) Again, thanks a LOT for your help and reading my learner's babble, Fore, you're great! :thumbsup: PS. Thanks for the compliment about my English, I sincerely return it to you, I'd have never noticed it was not your native language. (I haven't been on your profile in a while and I can't remember where you're from but it'd be quite funny if we actually spoke the same language) (though I'm still more comfortable in English in this case as I have absolutely no idea how you say "mesh" or "behavior" or "event" in French!..) Link to comment Share on other sites More sharing options...
fore Posted October 9, 2014 Share Posted October 9, 2014 Ok, I double checked, and in fact had been confused about these PotServe animations. This "IdleOffsetCarryPotServe" is not one of those typical arm offset animations that I have implemented in FNIS. And it doesn't react on "OffsetStop". I have no idea what the intended use of this animation is, because this shitty CK find function doesn't give me a match, and it is not used in Skyrim scripts. What is a similar PotServe animation, and works with "OffsetStop" is "OffsetCarryPotStart". However this animation doesn't stir with the laddle, but the laddle lies in the pot. So what I came up with is a combination of those 2 animations. It works for both NPC and player, and it ends with properly unequipping the AOs. Here is my test script: Game.ForceThirdPerson() Debug.SendAnimationEvent(self, "IdleOffsetCarryPotServe") Utility.Wait(5) Debug.SendAnimationEvent(self, "OffsetCarryPotStart") Utility.Wait(5) Debug.SendAnimationEvent(self, "OffsetStop") Utility.Wait(3) Debug.SendAnimationEvent(player, "IdleOffsetCarryPotServe") Utility.Wait(5) Debug.SendAnimationEvent(player, "OffsetCarryPotStart") Utility.Wait(5) Debug.SendAnimationEvent(player, "OffsetStop")But Offset animation do NOT disable player controls. Behaviors generally are not able to do that. This is purely engine controlled. Link to comment Share on other sites More sharing options...
Hoamaii Posted October 9, 2014 Author Share Posted October 9, 2014 Wow, I did not expect you to go to so much trouble, I'm really sorry!.. ... and I feel kind of stupid not to have thought of trying that combination which obviously uses the same AO :wallbash: Man, thanks a LOT - I'll try that first chance I get to launch the CK tomorrow. Cheers to you, Fore!.. Link to comment Share on other sites More sharing options...
Hoamaii Posted October 11, 2014 Author Share Posted October 11, 2014 Hey thanks again, Fore, I just tried that quickly in game (on player) and it works just great!.. :D The length of the IdleOffsetCarryPotServe anim is something like 10.5" to let the actor actually use the ladle to pour soup and with that duration the transition with the OffsetCarryPotStart is just perfect. I think for NPCs, I'll attach the script to a furniture marker - not sure it will work for them as furniture have their own anim graphs (is that the correct word?) but it does works for the player with a sit furniture set to FurnitureSpecial. I've tried using the Idle Marker for NPCs but unfortunately once they leave the idle marker, they will also keep the pot in hand while doing other stuff (like drinking or reading). Anyway, many thanks again for your help - I'm finishing my soup and pot textures and will send you a screenshot :). PS. From what I saw in the CK, that AE looks like it's used in a few scenes in one of the DB's quests where you try to poison the emperor. Maybe part of a patrol package - haven't checked. And definitely, yes, the AnimObjectDrinkingTankard, though not in the CK, is used for the ChairDrinkingStart AE and in the IdleDrinkingStandingStart. I kept only that one in my files and the anim does show my wine texture in the tankard - strange it's not in the CK, huh? Link to comment Share on other sites More sharing options...
Recommended Posts