Jump to content

Sexlab: script: difficulty hooking a specific SLAL animation


Recommended Posts

Posted (edited)

I don't seem to be able to get a script to hook an animation I want it to play:

 

sslThreadModel AnimationObject = SexLab.NewThread()
AnimationObject.AddActor(Game.GetPlayer(), isVictim = false)
AnimationObject.AddActor(akSpeaker, isVictim = false)
sslBaseAnimation[] anims
anims = new sslBaseAnimation[1]
anims[0] = SexLab.GetAnimationByName("Ayasato Counter")
 

I have also tried by ID, and by tags. The animation won't come up.

 

I'm open to suggestions as to what to try.  NB I am not a capable scripter, I just bumble along. So please, no wall of words or algebraic analysis...  ?

 

Thanks!

 

PS - yes SLAL all registered in game, of course.

Edited by Bluegunk
Posted (edited)

SexLabFramework.GetAnimationByName(string) calls sslAnimationSlots.GetByName(string) which calls sslAnimationSlots.FindByName(string) which appears to compare the string passed to it to the Name property of the animation slot. That's a roundabout way of saying are you using the thing I made for you here, and are you sure you've written the name exactly as it was dumped by my script? Including all capital letters, all invisible leading an trailing whitespace and other weirdness like that (copy-paste is your friend)?

 

Edit: Also, I should mention that there is another *ByName function for creature animations.

Edited by traison
Posted (edited)
17 minutes ago, traison said:

That's a roundabout way of saying are you using the thing I made for you

Hello again! Thanks for responding.

 

I confide I have not used it, mostly because I could not think how to do it in game. I suppose I could knock up a quick spell for your MGEF. I'll do that and run it.

 

I'm using the details in the animation's JSLOT files. So far as I can tell it's the right one. I've also tried variations.

 

Give me a moment please...

Edited by Bluegunk
Posted

Nope. That is it. That's all the comes out.

 

These are the SLAL packs I have on board:

Billyy's  (ESP)

K4 Anims  (ESP)

Funny Biz (no ESP)

MilkySLAL (no ESP)

Nibbles (no ESP)

SL-Ayasato (no ESP)

 

The results in the JSON are a fraction of what is in the system, despite re-registering stuff.

 

Here's a screenshot:

enb2022_10_31_15_25_06.thumb.jpg.d6e04f1a963a7507af9f63a0db27ebc8.jpg

 

I am puzzled.

 

Posted (edited)

Have you checked the result from SexLab.GetAnimationByName("Ayasato Counter")?

 

sslBaseAnimation test = SexLab.GetAnimationByName("Ayasato Counter")

If (!test)
	Debug.Notification("GetAnimationByName returned none")
Else
	Debug.Notification("Animation is fine, the problem is elsewhere. Stage count check = " + test.StageCount())
EndIf

 

Edit: At least all the Ayasato* animations are there in the JSON dump file so missing animations is not the problem in this specific case.

Edited by traison
Posted

Right, thanks for that! I knocked up a spell to run the script and it tells me the animation is fine, problem elsewhere.

 

Something must be up with either my mod script, or Sexlab / SLAL.

 

Here's the script I currently use (please...no laughing at names)

 



;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment

;NEXT FRAGMENT INDEX 1

Scriptname BG01Loversbreastscript Extends TopicInfo Hidden

 

;BEGIN FRAGMENT Fragment_0

Function Fragment_0(ObjectReference akSpeakerRef)

Actor akSpeaker = akSpeakerRef as Actor

;BEGIN CODE

 

actor[] sexActors = new actor[2]

sexActors[0] = SexLab.PlayerRef

sexActors[1] = akSpeaker

 

sslThreadModel AnimationObject = SexLab.NewThread()

AnimationObject.AddActor(Game.GetPlayer(), isVictim = false)

AnimationObject.AddActor(akSpeaker, isVictim = false)

sslBaseAnimation[] anims

anims = new sslBaseAnimation[1]

anims[0] = SexLab.GetAnimationByName("Ayasato Counter")

SexLab.StartSex(sexActors, anims)

 

Debug.Notification("Number of animations: " + anims.length)

 

;END CODE

EndFunction

 

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

 

actor property TargetREF auto

SexLabFramework Property SexLab Auto

Posted (edited)

Pretty much the only thing I can think of is that maybe the Ayasato animation does not have slots for 2 non-victims, or 2 characters of the races/genders you're giving it. Info on this you'd find in the json file you were inspecting earlier (not the animation list from my script). Edit: The one used by SLAL to register the animation.

 

Failing this, last option would be to inspect the inner workings of SexLab to figure out what is going on.

Edited by traison
Posted

Thanks. So the script and the set-up I am using is correct? 

 

If that is the case, I can do nothing else but experiment until I get the script to find the animation. At least I know where to look to get this working! That's a good stage further on than when I placed the enquiry.

 

Interestingly, I have had problems hooking other SLAL animations, so it looks like I need to do some poking around.

 

On another note, since FunnyBiz is part of my SLAL set up, have you any clues why the animation dump not find his animations?

Posted

Well correct in the sense that that's what I'd do. I do not know the inner workings of SL. When something doesn't work I typically search through all my installed mods (*.psc) for another script where the same thing was done and try to figure out what the difference is. You could do the same here, search through all psc scripts you have for "GetAnimationByName". If you find nothing, and you have a decent amount of mods that in itself could be a clue - no one else got it working either. Failing that it's time to hit the SL source scripts and do it yourself as it were.

 

Same logic goes for the animation list. So why didn't it find FunnyBiz? I have no idea. I used the same source as the SL MCM menu. Could be I made a mistake, but I think the first thing I'd do is search for the missing animations in the SL Animation Editor. If it's not there, then I'd say its working as expected. If it is there, then maybe have a second look at the enumeration code in my script. Is it for instance possible it skipped a page? Looking at the list I wouldn't assume so, since it has 125 entries and usually arrays are limited to 128 in papyrus. This could however be the last page of two (128 + 125), maybe my initial testing which suggested that the pages start at index 1 is incorrect?

Posted

Thank you. That's some excellent information for me to work on. I have also learnt a great deal from what you have explained and shown.

 

I have enough to go on, now. So this query can be closed.  I really, really appreciate your time and interest in helping me out! Thank you very much!

If I can ever return the favour, let me know.

 

Cheers!

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...