Jump to content

Make animation hook send custom parameter?


Recommended Posts

Posted

Is it possible to somehow force my own parameter (or value into one of existing parameters) when setting animation hooks?

Or make SexLab send a completely custom ModEvent when animation ends?

 

Why do i need it:

I need to do some post-animation cleanup in a callback function - which one, may depend on the animation played.

The callback function is defined on a "furniture library", which is a quest script providing "modular" adding of interactions/animations into my "furniture framework".

The code that runs in these callback functions, needs to access properties (references/aliases) of one of my "furniture framework" threads (system similar to SexLab animation threads), but there is never direct connection between "furniture library" and any of these FF threads.

Being able to specify custom ModEvent, or "inject" custom parameter, or overwrite value of some of the original parameters, would solve my problem, because i could pass ID of my FF thread into the callback.

 

Why can't i use SexLab's animation hooks:

Sometimes the Animation End callback functions are run too late - when the SexThread already released some/all of its actors, so i cannot find my FF thread by looking for same actors assigned into it.

I also tried storing SexThread's ID in a property of appropriate FF thread when starting the animation, hoping i could use the SexThread ID (received by the callback function) to find this FF thread - but that is not reliable either, because some other FF thread may start another interaction in the meantime, reusing same SexThread and thus storing same SexThread ID into this other FF thread's property.

 

 

Any ideas?

Does SexLab have some feature i missed, that could solve this problem?

Posted

 

Sometimes the Animation End callback functions are run too late

There are various hooks that can be used - for example OrgasmStart or End might fix your issues with things running too late. It depends ofc.

Posted

 

 

Sometimes the Animation End callback functions are run too late

There are various hooks that can be used - for example OrgasmStart or End might fix your issues with things running too late. It depends ofc.

 

 

Unfortunately, i think it wont help...

 

First of all, i need to handle even interrupted animations.

And as such, they wouldn't even fire OrgasmStart/End events, because they never get to that point.

 

Secondly, even if that would work, or if i would hook to every animation event possible, how would i know i am supposed to run my cleanup procedure?

That is why i need to hook to animation End/Ending, where it is given that animation is ending and therefore i know i have to run my cleanups.

Posted

Is it possible to somehow force my own parameter (or value into one of existing parameters) when setting animation hooks?

Or make SexLab send a completely custom ModEvent when animation ends?

 

I don't think you can make the SexLab framework do that, but you can catch a SexLab AnimationEnd event then send your own custom event as soon as that occurs, which will give you the same functionality as you need.

Posted

 

Is it possible to somehow force my own parameter (or value into one of existing parameters) when setting animation hooks?

Or make SexLab send a completely custom ModEvent when animation ends?

 

I don't think you can make the SexLab framework do that, but you can catch a SexLab AnimationEnd event then send your own custom event as soon as that occurs, which will give you the same functionality as you need.

 

 

Nope, i am afraid you missed the point completely.

I need to call a function when animation ends, and pass it some info related to the animation that just ended.

In other words, the problem is how to get that info into the AnimationEnd handler in first place - sending custom modevent from the animationEnd handler doesn't help to solve the problem that occurs BEFORE i could even do anything like this.

Posted

From what you describe, as far I can tell you're trying to get the list of actors during animationend so you can check if any of them need to be further handled by your scripts. 

 

If your Furniture threads are handling the actors BEFORE the sexlab thread starts, than the actor/faction hook system in SexLab solves your problem exactly. Within your furniture scripts, add any actor you need to handle to a custom faction in your mod, and add that faction to sexlab's tracked list for monitoring. Once any actor from that faction is added to a sexlab scene, they are checked if they are considered "tracked" or not by checking the list of monitored actors and factions. If they are, SexLab will send a "Added", "Start", and "End" event to your custom mod event.

 

Couple of basic examples:

; // DEFAULT USAGE WITH SEXLAB THREADS:
; // Set the faction to be tracked, and give it a custom callback prefix
SexLab.TrackFaction(MyFurnitureFaction, "Furniture")
; // Register your custom callback's prefix for the "end" hook
RegisterForModEvent("Furniture_End", "SexThreadCleanup")
event SexThreadCleanup(Form ActorForm, int thread_id)
	; // An actor currently in MyFurnitureFaction has ended a sexlab scene
endEvent


; // POSSIBLE CUSTOM USAGE SENDING YOUR OWN CUSTOM HOOKS OUTSIDE OF SEXLAB THREADS:
; // Register an arbitrary hook not used by SexLab threads (added, start, end)
RegisterForModEvent("Furniture_DoStuff", "DoStuff")
; // Send modevent for actor, triggering <callback>_DoStuff for all of their registered tracking events.
SexLab.SendTrackedEvent(ActorRef, "DoStuff", custom_furniture_thread_id)

event DoStuff(Form ActorForm, int custom_furniture_thread_id)
	; // An actor currently in MyFurnitureFaction has been passed by SendTrackedEvent() with this custom hook
endEvent

Posted

 

From what you describe, as far I can tell you're trying to get the list of actors during animationend so you can check if any of them need to be further handled by your scripts. 

 

If your Furniture threads are handling the actors BEFORE the sexlab thread starts, than the actor/faction hook system in SexLab solves your problem exactly. Within your furniture scripts, add any actor you need to handle to a custom faction in your mod, and add that faction to sexlab's tracked list for monitoring. Once any actor from that faction is added to a sexlab scene, they are checked if they are considered "tracked" or not by checking the list of monitored actors and factions. If they are, SexLab will send a "Added", "Start", and "End" event to your custom mod event.

 

Couple of basic examples:

; // DEFAULT USAGE WITH SEXLAB THREADS:
; // Set the faction to be tracked, and give it a custom callback prefix
SexLab.TrackFaction(MyFurnitureFaction, "Furniture")
; // Register your custom callback's prefix for the "end" hook
RegisterForModEvent("Furniture_End", "SexThreadCleanup")
event SexThreadCleanup(Form ActorForm, int thread_id)
	; // An actor currently in MyFurnitureFaction has ended a sexlab scene
endEvent


; // POSSIBLE CUSTOM USAGE SENDING YOUR OWN CUSTOM HOOKS OUTSIDE OF SEXLAB THREADS:
; // Register an arbitrary hook not used by SexLab threads (added, start, end)
RegisterForModEvent("Furniture_DoStuff", "DoStuff")
; // Send modevent for actor, triggering <callback>_DoStuff for all of their registered tracking events.
SexLab.SendTrackedEvent(ActorRef, "DoStuff", custom_furniture_thread_id)

event DoStuff(Form ActorForm, int custom_furniture_thread_id)
	; // An actor currently in MyFurnitureFaction has been passed by SendTrackedEvent() with this custom hook
endEvent

 

 

 

Thank you, problem solved.

Archived

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

  • Recently Browsing   0 members

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