Guest GuyWhoAbruptlyDisappeared Posted March 18, 2014 Posted March 18, 2014 Hi, I'm trying to use the ForceAnimation function, but even though other functions work fine, this one does not. It is as if it doesn't exist in the API, even though I can clearly see it on the website. Am I doing something wrong? Can I use another function to the same effect? I'm trying to get familiar with the SexLab API by making a quest involving a scene where Lydia becomes angry if the dragonborn leaves her for too long (lol), with a scripted piece-by-piece animation rather than a usual sex-starts sex-ends sequence that ends with Lydia strangling the dragonborn to the point of passing out (using imagespace modifiers on the final stage). I planned to use ForceAnimation(), but the function doesn't seem to actually exist.
Ashal Posted March 18, 2014 Posted March 18, 2014 Show the script you are trying to use ForceAnimation with.
Guest GuyWhoAbruptlyDisappeared Posted March 18, 2014 Posted March 18, 2014 Show the script you are trying to use ForceAnimation with. Without imagespace complications: http://pastebin.com/BUtdQKhe
Ashal Posted March 18, 2014 Posted March 18, 2014 actor[] Actors = new actor[2] Actors[1] = Game.GetPlayer() Actors[2] = akSpeaker Arrays are zero indexed, meaning they start with 0 and not 1. So this should be [0] and [1] respectively. RegisterForModEvent("StageStart_LydiaCrazy", "LydiaCrazyFunction") SexLab.StartSex(Actors, anims, victim=Game.GetPlayer(), allowbed=false, hook="LydiaRape") Your hook point doesn't exists, you named the hook LydiaRape, so want to attach your mod event to StageStage_LydiaRape OR name your hook LydiaCrazy instead of LydiaRape. This is likely the reason your ForceAnimation()'s aren't working, since as it is now your LydiaCrazyFunction() won't ever get called.
Ashal Posted March 18, 2014 Posted March 18, 2014 What your trying to do in the event itself also won't work, you'd essentially reach stage 3 of an animation, and then bounce instantly between one or two of the animations in rapid succession before getting to a nonexistant stage 5 or 6 and forcing the animation to end.
Guest GuyWhoAbruptlyDisappeared Posted March 18, 2014 Posted March 18, 2014 actor[] Actors = new actor[2] Actors[1] = Game.GetPlayer() Actors[2] = akSpeaker Arrays are zero indexed, meaning they start with 0 and not 1. So this should be [0] and [1] respectively. sslBaseAnimation[] anims = SexLab.GetAnimationsByTag(2, "AggressiveDefault,Missionary,") Why bother selecting any animations at all if your planning to force a specific animation later? RegisterForModEvent("StageStart_LydiaCrazy", "LydiaCrazyFunction") SexLab.StartSex(Actors, anims, victim=Game.GetPlayer(), allowbed=false, hook="LydiaRape") Your hook point doesn't exists, you named the hook LydiaRape, so want to attach your mod event to StageStage_LydiaRape OR name your hook LydiaCrazy instead of LydiaRape. This is likely the reason your ForceAnimation()'s aren't working, since as it is now your LydiaCrazyFunction() won't ever get called. I force the specific animation at stage 2. The idea is she begins strangling, at stage 3, moves to face down anal and goes back a stage, advances a stage, goes to another, advances a stage, goes back to the strangling, animation finishes. The LydiaRape thing was a quirk. I fixed that right after I used pastebin. I fixed the things you mentioned. This is my current file: http://pastebin.com/b5CERiCC This is the compiler error: Starting 1 compile threads for 1 files... Compiling "_LydiaCrazy"... C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\_LydiaCrazy.psc(24,7): ForceAnimation is not a function or does not exist C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\_LydiaCrazy.psc(30,7): ForceAnimation is not a function or does not exist C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\_LydiaCrazy.psc(36,7): ForceAnimation is not a function or does not exist No output generated for _LydiaCrazy, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed. Failed on _LydiaCrazy
Ashal Posted March 18, 2014 Posted March 18, 2014 Because it's not actually ForceAnimation(), it's SetForcedAnimations(), and expects an array of animations rather than a single one, though you could still make that array just a single animation sslBaseAnimation[] FaceDown = new sslBaseAnimation[1] FaceDown[0] = SexLab.GetAnimationByName("AP Face Down Anal") Con.SetForcedAnimations(FaceDown) But more importantly see my last post before you replied.
Guest GuyWhoAbruptlyDisappeared Posted March 18, 2014 Posted March 18, 2014 What your trying to do in the event itself also won't work, you'd essentially reach stage 3 of an animation, and then bounce instantly between one or two of the animations in rapid succession before getting to a nonexistant stage 5 or 6 and forcing the animation to end. I read from the source that the function is AdvanceStage(bool backwards), so I said AdvanceStage(true) in an attempt to move the stage backwards. Should I be using something else? I'll try making that change with the function and array. I guess it's reasonable to assume at this point that the examples on the wiki are out of date? Edit: With your changes, the code compiles fine. Now to see if it actually works.
Ashal Posted March 18, 2014 Posted March 18, 2014 What your trying to do in the event itself also won't work, you'd essentially reach stage 3 of an animation, and then bounce instantly between one or two of the animations in rapid succession before getting to a nonexistant stage 5 or 6 and forcing the animation to end. I read from the source that the function is AdvanceStage(bool backwards), so I said AdvanceStage(true) in an attempt to move the stage backwards. I'll try making that change with the function and array. I guess it's reasonable to assume at this point that the examples on the wiki is out of date? Yes, parts of the wiki are out of date. Just check the scripts themselves if you need to reference a certain function. Even with AdvanceStage(backwards = true) your still going to have the same problem, just in reverse. You'll get to stage 3 , then the actors will glitch around for a couple seconds rapidily changing between the 3 animations and ending on stage 1. Something like this may do what your looking for, I haven't tested it or even tried to compile, but it should at least push you in the right direction. bool GoingCrazy = false event LydiaCrazyFunction(string eventName, string argString, float argNum, form sender) sslThreadController Thread = SexLab.HookController(argSstring) ; // You want to do it on stage 4 and not 3, since you are going to go back 3 stages to stage 1. if !GoingCrazy && Thread.Stage == 4 ; // Start the reverse progression, and flag the subsequent StageStarts to perform the forced animation GoingCrazy = true endIf ; // Only perform on the stagestart if stage 4 has been reached. if GoingCrazy ; // Array container for the forced animations sslBaseAnimation[] Forced = new sslBaseAnimation[1] ; // Selects the animation to play on the previous stage, and adds the cum as you had listed if Thread.Stage == 4 SexLab.ApplyCum(Game.GetPlayer(), 1) Forced[0] = SexLab.GetAnimationByName("AP Face Down Anal") elseIf Thread.Stage == 3 SexLab.ApplyCum(Game.GetPlayer(), 2) Forced[0] = SexLab.GetAnimationByName("AP Skull Fuck") elseIf Thread.Stage == 2 SexLab.ApplyCum(Game.GetPlayer(), 3) Forced[0] = SexLab.GetAnimationByName("Rough Missionary") ; // end the reverse stage progression from triggering next StageStagt, it's no longer needed. GoingCrazy = false endIf ; // Set the forced animation on the thread. Thread.SetForcedAnimations(Forced) ; // Start playing the animation by going back a stage to 3, 2, and 1 respectively. Thread.AdvanceStage(true) endIf endEvent There is still a majorish problem with that solution I can see, but I'll leave that to you to experiment with, can't learn by being given all the answers.
Guest GuyWhoAbruptlyDisappeared Posted March 18, 2014 Posted March 18, 2014 Okay, I've modified the script with your suggestions, but it doesn't play now. Here's my current script: http://pastebin.com/rLY33qrv It looks fine to me but it doesn't change animations like it should. Am I missing something here? Thanks a lot for the help, by the way. Soon I will get the hang of this. Edit: Using debug messages, I was able to determine that the mod event stops working entirely at stage 4. If I simply put Debug.MessageBox("Hello from stage" + con.Stage) at the beginning of the event, it will print at stage 1, 2, and 3, but not 4, even though it is before any other code.Edit 2: Just spotted the comparator errors at lines 12, 30, 31. Trying again. Edit 3: Still doesn't work. Is the final stage given a different integer or something, perhaps? Final edit: I went back to the original SexLab source files and got a sense of how the controller works. First try after reading the source files, I got it. The script works perfectly, and now I can put my imagespace modifiers and everything back in. I used the adjustments you suggested with my original code order and layout, but this time actually knowing what the controllers and everything are for and what they do, and it works great. Here's the working script if anyone is curious: http://pastebin.com/pDYVmt3n The mod event is initiated by a fragment in TopicInfo: actor Lydia = akSpeakerRef as Actor actor[] Actors = new actor[2] Actors[0] = Game.GetPlayer() Actors[1] = Lydia sslBaseAnimation[] anims = SexLab.GetAnimationsByTag(2, "AggressiveDefault,Missionary,") RegisterForModEvent("StageStart_LydiaCrazy", "LydiaCrazyFunction") SexLab.StartSex(Actors, anims, victim=Game.GetPlayer(), allowbed=false, hook="LydiaCrazy") Thanks for the help!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.