glittertind Posted September 15 Share Posted September 15 I've mad a little dance club in Drunken Huntsman. In this club I've added ai packages for the dancers so they have daily routines such as sandboxing, dancing (custom animations) and sleeping. The custom dance animations are linked in an Ai package with the template package "useidlemarker", and the Ai package instructs the NPC to dance near a patrolidlemarker. All this works okay ingame. The issue arrise when the Ai package with the dance animation has ran out (duration = 60). The NPC will instead of using the next Ai package in the list, which is resting on a bench, just won't stop dancing but seems stuck in an animation loop. What can I do to make sure the NPC stops dancing when those 60 ingame time units has passed? What I've tried, but failed: -Linking animations to idle marker instead of Ai package -Setting patrol data to 60 on patrol idle marker to force an stop ,(didn't change template package in Ai package) -Linking the patrol idle marker to another idle marker to try to interrupt the dance animation by moving the actor to next marker - turn off "must complete" on Ai package. Any other ideas I can try? Link to comment Share on other sites More sharing options...
xkkmEl Posted September 15 Share Posted September 15 If you are expecting the AI package to stop because of some condition changes, that won't happen. Package conditions are only evaluated when the currently executing procedure finishes or becomes invalid, or when the currently running package is removed from the stack, or a new one pushed on the stack. Try using a custom package with useIdleMarker and wait procedures on simultaneous branches. Or use a scene with a timer to place the useIdleMarker package temporarily. Calling evaluatePackage on the NPC can also help. If this is not sufficient, try sending a "ForceIdleDefaultState" animation event to force the dance to abort (after having removed or rendered invalid the useIdleMarker AI procedure). Link to comment Share on other sites More sharing options...
PeterMartyr Posted September 15 Share Posted September 15 FNIS, Nemesis and Code... but I have a feeling that not what you wanted to hear.. btw if you take the Code route, you do not need FNIS or Nemesis Plus about using FNIS or Nemesis, it may set to loop cause it is ridiculously short animation, before doing this, I would check the length.. if it is 3 second rinse and repeat , you cannot set it to play once So knowing the asset your using is essential to solution, but code is like a cure all.. Onstart register for update 600 seconds (ten minutes) On Update stop with a debug and maybe a Global for cool down too So even if someone comes up with CK fix, for play once and move on ¯\_(ツ)_/¯ and it is a 3 second dance, that may not be the solution you want or need OFC I have no idea what the length is, but unless it is Hatsune Miku type dance ported to skyrim (which I doubt) that leave a certain adult only site that likes animations, I would go ask for help there, they are experts at this sort of thing. Or you may find a dance animation that is more appropriate set to play once, that is acceptable here and OK to use Link to comment Share on other sites More sharing options...
glittertind Posted September 15 Author Share Posted September 15 (edited) 1 hour ago, xkkmEl said: If you are expecting the AI package to stop because of some condition changes, that won't happen. Package conditions are only evaluated when the currently executing procedure finishes or becomes invalid, or when the currently running package is removed from the stack, or a new one pushed on the stack. Hi. Thank you for replying. Shouldn't my Ai package be evaluated when it started at 8:00pm, lasted for 60 minutes, and at 09:00pm another package is valid? All other packages I've made earlier terminates when the time runs up. But with this dancing animatoin, the NPC is dancing for eternity, even skipping all other packages. If I "interrupt" the NPC, with a shout, spell or etc etc... said NPC will stop the dance animation and start following the valid package at the time. It seems all other idles and idle markers work fine in my mod. It's just this custom dance animation, which I used FNIS, to get registrated in CK. 1 hour ago, xkkmEl said: Calling evaluatePackage on the NPC can also help. If this is not sufficient, try sending a "ForceIdleDefaultState" animation event to force the dance to abort (after having removed or rendered invalid the useIdleMarker AI procedure). "Calling evaluatePackage on the NPC". This sounds like something I should try. I am not good with scripts. Where exactly do I set up this function? Do you add it inside the AI package itself? Like the tab I've attached a screenshot of? Or is this an script already existing in CK? 1 hour ago, PeterMartyr said: FNIS, Nemesis and Code... but I have a feeling that not what you wanted to hear.. btw if you take the Code route, you do not need FNIS or Nemesis Thanks for trying to help. My mod is already FNIS dependent if that was what you meant . 1 hour ago, PeterMartyr said: Plus about using FNIS or Nemesis, it may set to loop cause it is ridiculously short animation, before doing this, I would check the length.. if it is 3 second rinse and repeat , you cannot set it to play once So knowing the asset your using is essential to solution, but code is like a cure all.. Onstart register for update 600 seconds (ten minutes) On Update stop with a debug and maybe a Global for cool down too So even if someone comes up with CK fix, for play once and move on ¯\_(ツ)_/¯ and it is a 3 second dance, that may not be the solution you want or need OFC I have no idea what the length is, but unless it is Hatsune Miku type dance ported to skyrim (which I doubt) that leave a certain adult only site that likes animations, I would go ask for help there, they are experts at this sort of thing. Or you may find a dance animation that is more appropriate set to play once, that is acceptable here and OK to use It's one of those dances that comes with the mod "https://www.nexusmods.com/skyrimspecialedition/mods/70279". The dance animations are pretty long. Up two minutes at least. I've used the FNIS options b -h,a (acyclic animation: 1-time only) just make sure it's not looping. About this: Onstart register for update 600 seconds (ten minutes) On Update stop with a debug and maybe a Global for cool down too I need to create a new script to compile fo this then? And attach it to the AI package itself? I appreciate all help I can get on this. I am a complete noob when it comes to scripting. Edited September 15 by glittertind Link to comment Share on other sites More sharing options...
PeterMartyr Posted September 15 Share Posted September 15 OK got it they are Hatsune Miku type dances how about set it they only dance during certain time of the day? so it starts (which it is) and it then it invalidate the package at the end of the shift On End the middle frag use this Debug.SendAnimationEvent(akActor, "ForceIdleDefaultState") Or if it more on demand, it will require a different approach, OFC you can create an Alias with AI Stack with different dance during the shift Link to comment Share on other sites More sharing options...
glittertind Posted September 15 Author Share Posted September 15 7 minutes ago, PeterMartyr said: OK got it they are Hatsune Miku type dances how about set it they only dance during certain time of the day? so it starts (which it is) and it then it invalidate the package at the end of the shift On End the middle frag use this Debug.SendAnimationEvent(akActor, "ForceIdleDefaultState") Hatsune Miku? It sounds Hentai... but yeah.. the dances are weird . Most dances for Skyrim is pretty weird if you ask me. I'm going to try what you suggest. Sounds professional But what is this called? It's not really scripting is it? I mean, I am compiling this to create a script in scripts folders (I've done this a couple of times before). perplexity did tell me to try this and add it to the On End as well. No idea if it would work: Actor akActor = GetOwningActor() if akActor akActor.PlayIdle(None) ; This stops any current idle animation endif Link to comment Share on other sites More sharing options...
PeterMartyr Posted September 15 Share Posted September 15 it is a package so the Actor should be already defined ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 1 ScriptName SomePackage Extends Package Hidden ;BEGIN FRAGMENT Fragment_0 Function Fragment_0(Actor akActor) ;BEGIN CODE Debug.SendAnimationEvent(akActor, "ForceIdleDefaultState") ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment Just use akActor.PlayIdle(None) in the frag OK Link to comment Share on other sites More sharing options...
PeterMartyr Posted September 15 Share Posted September 15 OOPS should explain defining a Variable with the same Type and Name twice will create a compile ERROR Link to comment Share on other sites More sharing options...
PeterMartyr Posted September 15 Share Posted September 15 cos I am devil, you made me check this, I thought this site when offline years and years ago cira 2015-2017 https://casualmods.net/MainFileEng That is RVS site where the https://www.nexusmods.com/skyrimspecialedition/mods/70279 got their dances from incase you're looking for more dances to use.. I was shocked to see it was back.. those are 32 bit ok, they will need converting to 64 bit for SE EDIT they have attrition requirements but a another mod that uses their dances is https://www.nexusmods.com/skyrimspecialedition/mods/12848 Link to comment Share on other sites More sharing options...
glittertind Posted September 15 Author Share Posted September 15 1 hour ago, PeterMartyr said: OK got it they are Hatsune Miku type dances how about set it they only dance during certain time of the day? so it starts (which it is) and it then it invalidate the package at the end of the shift On End the middle frag use this Debug.SendAnimationEvent(akActor, "ForceIdleDefaultState") Or if it more on demand, it will require a different approach, OFC you can create an Alias with AI Stack with different dance during the shift Okay. I managed to compile it. It didn't stop the dance animation though. 38 minutes ago, PeterMartyr said: it is a package so the Actor should be already defined ;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment ;NEXT FRAGMENT INDEX 1 ScriptName SomePackage Extends Package Hidden ;BEGIN FRAGMENT Fragment_0 Function Fragment_0(Actor akActor) ;BEGIN CODE Debug.SendAnimationEvent(akActor, "ForceIdleDefaultState") ;END CODE EndFunction ;END FRAGMENT ;END FRAGMENT CODE - Do not edit anything between this and the begin comment Just use akActor.PlayIdle(None) in the frag OK I am struggling with compiling this one. It fails no matter what I do. Get the errors no viable alternative at input 'ScriptName" and "Object reference not set to an instance of an object". It's getting late now so I will continue tomorrow. 32 minutes ago, PeterMartyr said: cos I am devil, you made me check this, I thought this site when offline years and years ago cira 2015-2017 https://casualmods.net/MainFileEng That is RVS site where the https://www.nexusmods.com/skyrimspecialedition/mods/70279 got their dances from incase you're looking for more dances to use.. I was shocked to see it was back.. those are 32 bit ok, they will need converting to 64 bit for SE EDIT they have attrition requirements but a another mod that uses their dances is https://www.nexusmods.com/skyrimspecialedition/mods/12848 I will defently check this out. I've had my eyes on the Selen Kate mod. I used to have it back when I was playing LE. Regarding "my task", I may have taken a too quick decision when claiming "the dances lasts forever and won't stop, ever". I just put my ADHD on hold for some minutes and started watching the dances. The dance actually lasted only 89 in game minutes (using the wait function ingame did not surpass this). After that the NPC continued with the next package. So with that in mind, I'm wondering If should just sit down and watch these dances one by one and customize my ai packages duration according to the dance.hkx length. I mean.. why do it the hard way . Besides the dance animations comes with animated starts and ends. Link to comment Share on other sites More sharing options...
Recommended Posts