Jump to content

Is there a Sexlab call to know if an animation is happening?


Recommended Posts

I would like to avoid running scripts if there is a SexLab animation going on anywhere with any actor/actors.  If there a sexlab function call to determine this?   I have looked in the framework and found nothing.

 

I know I can scan for the animating faction, but would like to avoid any scripting other than the function call to get a variable or something.

Link to comment

Yup.

Function MyMaintenanceFunction() 
    RegisterForModEvent("HookAnimationStart", "OnAnimationStart")
EndFunction

...

Event OnAnimationStart(int threadID, bool HasPlayer)
    ; A Sexlab Animation has started: Do stuff.
EndEvent

Was this for Sexlab Aroused: Redux?

Link to comment

If what you want is a specific function within SexLab that tells you a simple yes/no if there is any animations going on. Then no, there isn't. 

 

It should be relatively easy to check however.

bool function IsSexLabActive()
	int i = SexLab.Threads.Length
	while i
		i -= 1
		if SexLab.Threads[i].IsLocked
			return true ; // There is a locked/active thread.
		endIf
	endwhile
	return false ; // No threads where locked/active
endfunction

Link to comment

Thanks all folks and yes it is for redux.  I'll use Ashal's code for now as it was simpler than what I had planned.  I don't want any heavy scripts running while there is an animation going on in an attempt to reduce script related CTDs.

 

Yup.

Function MyMaintenanceFunction() 
    RegisterForModEvent("HookAnimationStart", "OnAnimationStart")
EndFunction

...

Event OnAnimationStart(int threadID, bool HasPlayer)
    ; A Sexlab Animation has started: Do stuff.
EndEvent

Was this for Sexlab Aroused: Redux?

 

 

Well since I just wrote it, I've gone ahead and added a bool SexLab.IsRunning property to the current development version of SexLab.

 

 

 

If what you want is a specific function within SexLab that tells you a simple yes/no if there is any animations going on. Then no, there isn't. 

 

It should be relatively easy to check however.

bool function IsSexLabActive()
	int i = SexLab.Threads.Length
	while i
		i -= 1
		if SexLab.Threads[i].IsLocked
			return true ; // There is a locked/active thread.
		endIf
	endwhile
	return false ; // No threads where locked/active
endfunction

Thanks to everyone and yes it is for Redux.  I don't want any script heavy stuff going on while there is an animation in progress in an attempt to reduce the script related CTDs.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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