Jump to content

[SSE] How to properly get the actor list of an animation?


Recommended Posts

Posted

Since the animspeed plugin has been ported to SE, I decided to try it out, but for some reason i can't get the correct actorlist from current sex event correctly.

 

this is my code, modyfied from the original code :

 

function DoSpeed(float speed)

    ObjectReference Target = Game.GetCurrentCrosshairRef()

    if(Target == None)
        Target = Game.GetCurrentConsoleRef()
        if(Target == None)
            Debug.Notification("Not A Target")
            return
        endif
    endif
    int labtid = SexLab.FindActorController(Target as Actor)
    Debug.Notification("AnimSpeedSL: selected thread : "+ labtid)
    
    

    Actor[] Positions = SexLab.GetController(labtid) .Positions
    Debug.Notification("AnimSpeedSL: actors in thread: "+ Positions.Length)

    float transition = GetConfig(4) as float

    int idx = 0
    while(idx < Positions.Length)
      AnimSpeedHelper.SetAnimationSpeed(Positions[idx], speed, transition * 0.001, false)
      Debug.Notification("CurrentSpeed: " + speed)
    idx += 1
    endwhile
endfunction

 

what I got in-game is, the length of the actor list is always 0. Any help ?

Posted (edited)


    Debug.Notification("AnimSpeedSL: actors in player thread: "+ SexLab.GetPlayerController().Positions.Length)
 this line of code always says that the length of thread is 0. What the hell? 

 

Edited by Hi_v_Gundam_HWS
Posted
Looks like the animation is not started. I get proper values with those SL calls in my own mods (with glitches when the same actor is scheduled in two animations back-to-back).

I recommend adding debugging traces to verify what "target" you get from Game.getCurrentCrosshairRef() and "labtid" from SexLab.FindActorController, and all the other intermediate variables and sub-expressions you are using.

You may also want to double check in game whether all your properties are correctly filled, with the SQV console command (or SV; not sure what kind of script you are including these functions in).
Posted
5 hours ago, pfB6cs said:

Looks like the animation is not started. I get proper values with those SL calls in my own mods (with glitches when the same actor is scheduled in two animations back-to-back).

I recommend adding debugging traces to verify what "target" you get from Game.getCurrentCrosshairRef() and "labtid" from SexLab.FindActorController, and all the other intermediate variables and sub-expressions you are using.

You may also want to double check in game whether all your properties are correctly filled, with the SQV console command (or SV; not sure what kind of script you are including these functions in).

The animation is started, my guess is I didn't init the sexlab variabe when started, I'll have a look, thank you

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...