• Announcements

    • Ashal

      SITE MOVED - IN READ ONLY MODE   12/08/2015

      Please use http://www.loverslab.com moving forward. Site has been restored to a previous version, and this one placed into a read-only mode. This is available for a limited time so users may reference/copy content that has been lost in the transition. This will no longer be accessible by December 22nd, 2015.
Sign in to follow this  
Followers 0
Veladarius

Trouble defining a specific animation to use.

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.


0

Share this post


Link to post

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")

1

Share this post


Link to post

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


 


 


0

Share this post


Link to post
Sign in to follow this  
Followers 0