Veladarius Posted March 28, 2015 Posted March 28, 2015 I am having some trouble getting sexlab to play a specific animation, specifically the script won't compile. I have been looking over the github documentation as well as documentation in the SexLab and ZAP scripts and it looks correct but it won't compile. This is what I have: Function StartSpanking() debug.notification("Start Encounter Sex") anims = SexLab.findAnimationByName("spanking01") actor[] sexActors = new actor[2] sslBaseAnimation[] anims sexactors[1] = Playerref sexactors[0] = xxxx sexlab.startsex(sexactors, anims, allowBed = false, centeron = spankPos, hook = "Spanking") RegisterforModEvent("HookAnimationend_Spanking", "xxxxSpanks") endfunction This is the error I am getting: CDxSlavery_Property.psc(1355,1): type mismatch while assigning to a sslbaseanimation[] (cast missing or types unrelated) The error line # is for the line in orange I have also tried GetAnimationByName as well as different names but I get the same error. Other than the Find/GetAnimationByName use the script is pretty much the same as all the other places I have a sex scene so I know it works overall.
Ashal Posted March 28, 2015 Posted March 28, 2015 Several things: You are trying to set anims before you even define it. The 2nd argument of StartSex() is an array of animations, not a single animation object. FindAnimationByName() returns the index of an animation, not the actual animation. Use GetAnimationByName() instead Going by "spanking01" I'm assuming that's probably the registry name and not the actual animation name, in which case it should be GetAnimationByRegistry() instead. sslBaseAnimation[] anims = new sslBaseAnimation[1] anims[0] = SexLab.GetAnimationByName("spanking01") ; // Or GetAnimationByRegistry("spanking01")
Veladarius Posted March 28, 2015 Author Posted March 28, 2015 Thanks Ashal, I was able to get it working. I ended up using GetAnimationByName as the GetAnimationByRegistry gave me errors and was an invalid command. This is what I ended up with that worked: Function StartSpanking() debug.notification("Start Encounter Sex") actor[] sexActors = new actor[2] sslBaseAnimation[] anims = new sslbaseanimation[1] sexactors[0] = Playerref sexactors[1] = xxxx anims[0] = SexLab.GetAnimationByName("zaz otk spanking") sexlab.startsex(sexactors, anims, allowBed = false, centeron = spankPos, hook = "Spanking") RegisterforModEvent("HookAnimationend_Spanking", "xxxxSpanks") endfunction
Recommended Posts
Archived
This topic is now archived and is closed to further replies.