xcafe Posted December 9, 2016 Share Posted December 9, 2016 Hi nexus! So, I'm trying to make a mod that, as far as I know, has never really been done before. (My first mistake, shoulda just made a booby follower, smh.) But since I don't have a whole lot of material to reference, I'm running in to some problems. For example, this animation. Game.DisablePlayerControls(True, True, True, False, True, True, True, True) Game.ForceThirdPerson() playerref.PlayIdle(IdleChairRead) Utility.Wait(5) ; sets when studying will be complete Debug.Notification("wait complete") playerref.PlayIdle(IdleChairRead) Debug.Notification("animation sent") Game.EnablePlayerControls() This is part of a larger script, and the whole thing works fine up until the second PlayIdle is called. The animation I have the property set toshould be a looped animation (I'm like 90% sure it is) which would mean that if you played it a second time, it would stop. It's not doing that though.And I've tried replacing the second playidle with other idles, like the idlestop_loose idle that some other mods use, but no dice. For example, here's a script where the animation works perfectly: Game.DisablePlayerControls(True, True, True, False, True, True, True, True) PlayerREF.UnequipItem(DDDMyLute, false, true) DDDplayLuteText.Show() Game.ForceThirdPerson() debug.SetGodMode(true) Utility.wait(2.0) PlayerREF.playidle (IdleLuteStart) Utility.wait(0.5) MUSCategory.mute() Utility.wait(0.5) DDDplaylutesound.Play(PlayerREF) Utility.wait(31.0) PlayerREF.playidle (IdleStop_Loose) Utility.wait(1.0) MUSCategory.unmute() Game.EnablePlayerControls() debug.SetGodMode(False) This is basically the same thing I have, so how come mine doesn't work? P.S. My script compiles just fine, and the debug after the second playidle function also works. :psyduck: Link to comment Share on other sites More sharing options...
NexusComa Posted December 9, 2016 Share Posted December 9, 2016 1st glance Utility.Wait(5) ; sets when studying will be complete Utility.Wait(5.0) ; sets when studying will be complete Link to comment Share on other sites More sharing options...
xcafe Posted December 9, 2016 Author Share Posted December 9, 2016 (edited) 1st glance Utility.Wait(5) ; sets when studying will be complete Utility.Wait(5.0) ; sets when studying will be completeMaybe, but the debug still fires, so wouldn't that not be it? EDIT: Wow that totally ended up being it, boy do I feel dumb :laugh:EDIT EDIT: Wait nope, the player controls are being enabled, but the animation still isn't stopping, and the part of the script that comes after that isn't firing either. :( Edited December 9, 2016 by xcafe Link to comment Share on other sites More sharing options...
fore Posted December 9, 2016 Share Posted December 9, 2016 The function name "PlayIdle" is misleading. It's not an idle that is played, but an animation event that is sent to the behavior system. Big difference. Now the behavior system does not react on arbitrary events. Only when a certain event is expected in a certain behavior status the system will react. Therefore you don't see a reaction. Also, sending an animation event a second time will not stop the animation. That is something FNIS Spells is doing, but not the behavior system. Try "playidle(IdleForceDefaultState)" to stap an animation. Link to comment Share on other sites More sharing options...
xcafe Posted December 9, 2016 Author Share Posted December 9, 2016 OMG fore! #celebrity :laugh: Thanks, I'll try that right away! Link to comment Share on other sites More sharing options...
xcafe Posted December 9, 2016 Author Share Posted December 9, 2016 The function name "PlayIdle" is misleading. It's not an idle that is played, but an animation event that is sent to the behavior system. Big difference. Now the behavior system does not react on arbitrary events. Only when a certain event is expected in a certain behavior status the system will react. Therefore you don't see a reaction. Also, sending an animation event a second time will not stop the animation. That is something FNIS Spells is doing, but not the behavior system. Try "playidle(IdleForceDefaultState)" to stap an animation.Well that didn't work :( At least now it seems to be running through the rest of the script, although another part of it isn't working quite right. Function AddSpells() Debug.Notification("addspells called") Int ListSize = CentralQuest.GSL.GetSize() Int Index = 0 While Index < ListSize Form Entry = CentralQuest.GSL.GetAt(Index) If (Entry as Spell) PlayerRef.AddSpell(Entry as Spell) EndIf Index += 1 EndWhile Debug.Notification("spells added") EndFunction This is throwing up all the debugs but not adding the spells! Link to comment Share on other sites More sharing options...
fore Posted December 9, 2016 Share Posted December 9, 2016 Hold it. I lend you my animation finger, but you grap my full arm. :smile: Sorry, but I'm usually not providing general scripting support. Only animations/behaviors in general, and FNIS in particular. I don't even know what this Centralquest.GSL construct is that you use. Just one advice: if there is a success return like for AddSpell() then ALWAYS use that. At least as long as you develop a script. And what is "didn't work". Still doesn't stop? It HAS to stop that way. Did you fill the IdleForceDefaultState property? I generally advise against using Playidle(). In almost all cases it is fully sufficient to use Debug.SendAnimationEvent("<animation_event>") instead. And you don't need that nasty extra idle layer, and in particular you don't need to fill properties. Except for paired animations and idle markers I NEVER use playidle() in my mods. In almost all cases, Skyrim uses the same name for <idle> and <animation_event>. If not, you have to look it up in the CK Idle definition. But what ALWAYS works is Debug.SendAnimationEvent("IdleForceDefaultState") Link to comment Share on other sites More sharing options...
xcafe Posted December 9, 2016 Author Share Posted December 9, 2016 Oki doki, I'll try that out! And thank you for lending me your full arm ;) Oh and the centralquest thing is a quest property with a script that this script relies on attached :laugh: Link to comment Share on other sites More sharing options...
xcafe Posted December 10, 2016 Author Share Posted December 10, 2016 (edited) Hm, so I replaced the playidles with the sendanimation events, and now it doesn't play any animations at all. :sad: EDIT: So I looked in the CK, and the animation event for the sitting/reading idle is ChairReadingStart (IIRC) but how do I define that? Not in an idle property, since it's not an idle, so how? EDIT EDIT: Aha! I forgot the quotation marks, it works perfectly! Thank you! Edited December 10, 2016 by xcafe Link to comment Share on other sites More sharing options...
Recommended Posts