Jump to content

Old style vs New style animation hooks


Recommended Posts

Posted

I see there is a way to get thread_id from the new style animation events, but is there a way with the old style?

 

Thanks

Posted

in the old style hooks argstring IS the thread_id. 
 

Event NewStyle(int thread_id, bool HasPlayer)
	sslThreadController Thread = SexLab.GetController(thread_id)

Event OldStyle(String eventName, String argString, float argNum, Form Sender)
	sslThreadController Thread = SexLab.HookController(argString)
	; // Exact same and basically just a shortcut to doing:
	sslThreadController Thread = SexLab.GetController(argString as int)

The point of the new hook style is simply that they make more sense syntactically without all the needless and cryptic arguments of the old style.
 

I understand this post, but I don't understand why the registration uses "_helpless" as the end of the event name... Was that a typo?

 
Not a typo, it's a thread specific hook rather than a global one.

Registering for "AnimationStart" will trigger your callback for ALL animations that start. If you start a thread and use Thread.AddHook("helpless") then in addition to sending the global "AnimationStart" event, it will ALSO send a thread specific event "AnimationStart_helpless" Or rather in the new style hooks, "HookAnimationStart" and "HookAnimationStart_helpless"

Posted

in the old style hooks argstring IS the thread_id. 

 

Event NewStyle(int thread_id, bool HasPlayer)
	sslThreadController Thread = SexLab.GetController(thread_id)

Event OldStyle(String eventName, String argString, float argNum, Form Sender)
	sslThreadController Thread = SexLab.HookController(argString)
	; // Exact same and basically just a shortcut to doing:
	sslThreadController Thread = SexLab.GetController(argString as int)

The point of the new hook style is simply that they make more sense syntactically without all the needless and cryptic arguments of the old style.

 

I understand this post, but I don't understand why the registration uses "_helpless" as the end of the event name... Was that a typo?

 

Not a typo, it's a thread specific hook rather than a global one.

 

Registering for "AnimationStart" will trigger your callback for ALL animations that start. If you start a thread and use Thread.AddHook("helpless") then in addition to sending the global "AnimationStart" event, it will ALSO send a thread specific event "AnimationStart_helpless" Or rather in the new style hooks, "HookAnimationStart" and "HookAnimationStart_helpless"

 

Oh, I see. Thanks!

Archived

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

  • Recently Browsing   0 members

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