Jump to content

Animation stops immediately after it starts


Recommended Posts

Hi

 

I am trying to attach a startsex event to a summoned NPC.

 

I am able to trigger the effect and see both the NPC and the player undress, but the animation stops immediately after it starts and they both stand back up.

 

The code I attached to the summon event looks like this:

Scriptname _SL_Dremora_AME extends activemagiceffect  
SexLabFramework Property SexLab  Auto  
Actor Property _DremoraAvatar  Auto  

Event OnEffectStart(Actor akTarget, Actor akCaster)

	RegisterForSingleUpdate( 1 )
EndEvent

Event OnUpdate()
	Actor kCaster = GetCasterActor()
	Actor kTarget = GetTargetActor()
	actor[] sexActors = new actor[2]

	Debug.Notification( "The Dremora pins you down..." )
	sexActors[0] = SexLab.PlayerRef 
	sexActors[1] = _DremoraAvatar
	sslBaseAnimation[] animations = SexLab.GetAnimationsByTag(2, "Aggressive")
	SexLab.StartSex(sexActors, animations)
	Utility.Wait(15)
	RegisterForSingleUpdate( 30 )

ENDEVENT

First I thought it was because the OnEffectStart event was short lived, but that is still happening in the OnUpdate loop.

 

I did check that the event is fired On Update. I have a new attempt at StartSex every 30 seconds but they all result in aborted sequences.

 

My thought at the moment is that the summoned NPC reference is not correct and only the player side of the animation is firing up. I will keep digging...

Link to comment

More oddities with this experiment.

 

I noticed that for a brief moment, my character shrinks to half its size just before the animation is aborted. 

 

I am working on solo animations so far, so there is no reference issue anymore. 

 

It is just very odd - when I run SexLab in the NPC summon magic effect, the animation is aborted as soon as it starts.

 

Maybe SexLab is not designed to work on a summon magic effect. I will have to think about another way to attach the script to the summoned NPC (I tried at the Actor level but the result was the same).

 

Other than that, SexLab works fine in other mods. I even have a customized NPC follower working without problem (the scripts were attached to topics instead of magic effects).

 

The script looks something like this now:

Scriptname _SL_Dremora_AME extends activemagiceffect  
SexLabFramework Property SexLab  Auto  

Event OnEffectStart(Actor akTarget, Actor akCaster)
	RegisterForSingleUpdate( 1 )
EndEvent

Event OnUpdate()
	sexActors[0] = SexLab.PlayerRef 
	sslBaseAnimation[] animations = SexLab.GetAnimationsByTag(1, "Standing", "Sex")

	Debug.Notification( "The Dremora is so hot you lose control..." )

	SexLab.StartSex(sexActors, animations)
	Utility.Wait(15)
	RegisterForSingleUpdate( 30 )

EndEvent

Of course this is just a test to make sure the animation runs (which it doesn't at the moment). Eventually, there will be more random variations.

Link to comment

In your 2nd example you aren't initializing sexActors. You need

actor[] sexActors = new actor[1]
sexActors[0] = SexLab.PlayerRef

Apart from that, check your debug log, which you can enable by following these instructions: http://forums.steampowered.com/forums/showpost.php?p=31562721&postcount=2

 

SexLab will print the reason for an aborted animation in most cases there.

 

Thanks... I actually do initialize the array. I just missed it when I copy and pasted the simplified version of the script :)

 

I noticed that my other mod (the customized follower which I believe worked...) is actually showing the same behavior for solo animations.

 

So I can conclude this:

 

1- part of my problem here is the lack of proper reference for the summoned NPC (for couples animations). I need to find how to reference reliably a newly summoned NPC.

 

2- I am not calling StartSex correctly for solo animations. I will look at other mods that are using masturbation scenes and see what I am missing. 

 

I will double check the logs.

 

Too many details... not enough time to research them correctly :)

Link to comment
  • 3 weeks later...

So I eventually fixed my problem with solo animations.

 

I needed two small changes.

 

1- Make sure the actor array was set to a size of 1 (I had it set to a size of 2 and only assigned one actor... not good it turns out). Thanks Ashal.

actor[] sexActors = new actor[1]
sexActors[0] = SexLab.PlayerRef

2- Use the "Masturbation" tag instead of "Standing" and "Sex".

 

Is there a way to view all available tags by the way?

 

I still can't find a way to get the reference of a freshly summoned dremora but I will mark this topic as solved because of the solution for solo animations.

Link to comment

Is there a way to view all available tags by the way?

 

I still can't find a way to get the reference of a freshly summoned dremora but I will mark this topic as solved because of the solution for solo animations.

 

 

In your OnEffectStart you could use something like Game.FindClosestReferenceOfTypeFromRef(PlayerRef, DremoraRef, 1000) to get the newly summoned dremora reference. I'm not 100% positive the dremora would be available to be found at the time of OnEffectStart() though, you may need to delay it some.

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use