Jump to content

How to add current follower as actor to sex animation script?


Recommended Posts

Posted

I`m trying to create simple dialogue with NPC. And after last NPC response here should start script that initiate sex animation between this NPC and my current follower. I`m using this script from tutorial. 

 

; // Create our actor array using our chosen actor references
actor[] sexActors = new actor[2]
sexActors[0] = SexLab.PlayerRef
sexActors[1] = akSpeaker

; // Initialize our animation array as empty, so SexLab will pick the animations based on defaults
sslBaseAnimation[] anims

; // "Buisness Time"
SexLab.StartSex(sexActors, anims)

 

Looks like i should change reference from sexActors[0] = SexLab.PlayerRef on something another. I`m appreciate any help. Google didn't help me.

 

 

Posted
19 minutes ago, fortun said:

 

Did you declare properties?

 

Sexlab would need to be a property of this script, and I would make PlayerRef one as well and ditch the Sexlab.PlayerRef.

 

Can you show the complete script for this?  Is it a TopicInfo fragment?

 

EDIT:  Sorry, I misunderstood your post.  Ignore above.

 

You will need a way to mark the intended NPC for the dialogue script to find.  If you always want it to be with that one NPC (and never anyone else), you can just add that person as a property instead of PlayerRef.

 

I assume though that you want this to work more broadly, so you might need to add a search system into it that finds the desired NPC, maybe using FindClosestActorFromRef() or something similar.

 

You could also have a quest that tags the correct NPC as a quest alias and feed that alias into the dialogue script.

 

Lots of ways to do this, just not sure how you would want to proceed.

Posted

I`m need that it would work with any possible follower that will be my current now. FindClosestActorFromRef() looking some usefull, i`m gonna check this. Thanks!

Posted
16 minutes ago, fortun said:

In this case im only have " SexLabFramework property SexLab auto" as a property.

 

 

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
;NEXT FRAGMENT INDEX 2
Scriptname TIF__0C0CF370 Extends TopicInfo Hidden

;BEGIN FRAGMENT Fragment_1
Function Fragment_1(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
; // Create our actor array using our chosen actor references
actor[] sexActors = new actor[2]
sexActors[0] = SexLab.PlayerRef
sexActors[1] = akSpeaker

; // Initialize our animation array as empty, so SexLab will pick the animations based on defaults
sslBaseAnimation[] anims

; // "Buisness Time"
SexLab.StartSex(sexActors, anims)
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

SexLabFramework property SexLab auto

 

 

 

 

I just need some another reference that points to my current follower instead of SexLab.PlayerRef. Or any way to create actor property with my follower, if its possible.

Since this is a fragment anyway, your best bet would be to use the SexLab Quickstart function.

Posted
24 minutes ago, fortun said:

 

You could do something like:
 

Function Fragment_1(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor

Actor TargetActor
int n

While (TargetActor == none) && n <= 10
	n += 1
	TargetActor = Game.FindRandomActorFromRef(PlayerRef, 2048.0)
	If (TargetActor.GetFactionRank(CurrentFollowerFaction) < 0) || TargetActor == akSpeaker || TargetActor.IsDead() || TargetActor.IsDisabled()
		TargetActor = none
	EndIf
EndWhile

If TargetActor != none
  	actor[] sexActors = new actor[2]
  	sexActors[0] = TargetActor
  	sexActors[1] = akSpeaker

	sslBaseAnimation[] anims

	SexLab.StartSex(sexActors, anims)
Else
	Debug.Notification("Unable to find actor for scene.")
EndIf

EndFunction

SexlabFramework property Sexlab auto
Faction property CurrentFollowerFaction auto 
Actor property PlayerRef auto

... which would look around the player for someone who is a current follower (and isn't dead or disabled) within 2048 units (a fair-sized room -- any follower who isn't waiting somewhere else should be found with this).

 

If it couldn't find anyone, it would notify you of that fact for debugging purposes.

 

EDIT: small tweak to make sure akSpeaker isn't selected for both.

Posted
45 minutes ago, Seijin8 said:

You could do something like:
 


Function Fragment_1(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor

Actor TargetActor
int n

While (TargetActor == none) && n <= 10
	n += 1
	TargetActor = Game.FindRandomActorFromRef(PlayerRef, 2048.0)
	If (TargetActor.GetFactionRank(CurrentFollowerFaction) < 0) || TargetActor == akSpeaker || TargetActor.IsDead() || TargetActor.IsDisabled()
		TargetActor = none
	EndIf
EndWhile

If TargetActor != none
  	actor[] sexActors = new actor[2]
  	sexActors[0] = TargetActor
  	sexActors[1] = akSpeaker

	sslBaseAnimation[] anims

	SexLab.StartSex(sexActors, anims)
Else
	Debug.Notification("Unable to find actor for scene.")
EndIf

EndFunction

SexlabFramework property Sexlab auto
Faction property CurrentFollowerFaction auto 
Actor property PlayerRef auto

... which would look around the player for someone who is a current follower (and isn't dead or disabled) within 2048 units (a fair-sized room -- any follower who isn't waiting somewhere else should be found with this).

 

If it couldn't find anyone, it would notify you of that fact for debugging purposes.

 

EDIT: small tweak to make sure akSpeaker isn't selected for both.

Really thanks mate! This works great! This is exactly what I was looking for.

Archived

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

  • Recently Browsing   0 members

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