Jump to content

SexLab scripting help with SexLab Romance.


Deathmaw

Recommended Posts

Posted

Hey all I'm trying to add some extra dialogue choices to SexLab Romance for my own use and was wondering if you could lend a hand. I want to restrict the new throne animations in NSAP from playing with certain choices. I have the new dialogue and scripts working fine in game I would just like to fine tune them.

 

So far the standard romance script looks like this:

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

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
actor[] sexActors = new actor[2]
sexActors[1] = Game.GetPlayer()
sexActors[0] = akSpeaker
sslBaseAnimation[] anims
anims = SexLab.GetAnimationsByTag(2, "Cunnilingus")
sdsMain.RemoveLover(akSpeaker,True)
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  

sdsSexLabRomanceMain Property sdsMain  Auto  

Now I read on the SexLab Wiki that the command to suppress animations is " string TagSuppress = "" "  now as a complete scripting noob could some one give an example how you would use that with a tag?

Posted

http://git.loverslab.com/sexlab/framework/wikis/animation-functions

anims = SexLab.GetAnimationsByTag(2, "Cunnilingus", TagSuppress="<whatever tags you want to include here, separated by commas>")
; You need to include TagSuppress because there are two more arguments (that already have default values) that precede it.
; For example, you could do...
anims = SexLab.GetAnimationsByTag(2, "Cunnilingus", "FF", "Lesbian", "Aggressive")
; and it will search for animations with all three of the tags "Cunnilingus", "FF", and "Lesbian", while omitting animations with the tag "Aggressive".

However, GetAnimationsByTags() is now the recommended succeeding function to GetAnimationsByTag() since it can accept more than three tags to look for.

Posted

Here we go:
 
 

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

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
actor[] sexActors = new actor[2]
sexActors[1] = PlayerREF
sexActors[0] = akSpeaker
String okTags = "Cunnilingus" ; Animation with "Cunnilingus" tag will be included
String koTags = "Threesome,Anal" ; Animations with "Threesome" and "Anal" tags will be excluded
sslBaseAnimation[] anims = SexLab.GetAnimationsByTags(sexActors.length, okTags, koTags, RequireAll = true)
anims = SexLab.RemoveTagged(anims, koTags)
sdsMain.RemoveLover(akSpeaker,True)
SexLab.StartSex(sexActors, anims, Victim = none, AllowBed = false) ; You can ignore Vitim and Bed if you wish
;END CODE
EndFunction
;END FRAGMENT

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

SexLabFramework Property SexLab Auto
sdsSexLabRomanceMain Property sdsMain Auto 
Actor Property PlayerREF Auto

Please never use Game.getPlayer() it is sloooooooow.

You can put directly the tags in the calls without defining a variable, of course.

 

Regards,

Posted

Ok They worked a charm thanks for the advice both of you.

 

How would I go about triggering the actor I am speaking to, to start marsturbating?

 

Would it be like :

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

;BEGIN FRAGMENT Fragment_0
Function Fragment_0(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
actor[] sexActors = new actor[1]
sexActors[1] = akSpeaker
String okTags = "Masturbation"
sslBaseAnimation[] anims = SexLab.GetAnimationsByTags(sexActors.length, okTags, RequireAll = true)
sdsMain.RemoveLover(akSpeaker,True)
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
sdsSexLabRomanceMain Property sdsMain Auto 
Posted

GetAnimationsByTags(1, "Masturbation") will probably get both male and female masturbation animations, so you may want to use instead GetAnimationsByTags(1, "F") or GetAnimationsByTags(1, "M") if you know the sex of the target. Notice that animations are usually tagged "M", "F", "MF", "FF", "MMF", etc. giving both the number of participants and the number of participants of each sex. And of course if you don't know the sex,

String okTags
if SexLab.GetGender(akspeaker) == 0
okTags = "M"
else
okTags = "F"
endif
sslBaseAnimation[] anims = SexLab.GetAnimationsByTags(sexActors.length, okTags)
Guest privateuser99
Posted

if you need help with scripting, get look at my faites des bebes 

INCLUDES SOURCE!

 

its written as simply i can //as i hate hard readable code

 

as editor, best is notepad++.

Posted

Ok Ive made a dialogue option for a female follower to masturbate. However it is not tirggering. This is the script im using:

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

;BEGIN FRAGMENT Fragment_3
Function Fragment_3(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
actor[] sexActors = new actor[1]
sexActors[1] = akSpeaker
String okTags = "Masturbation"
sslBaseAnimation[] anims = SexLab.GetAnimationsByTags(sexActors.length, okTags, RequireAll = true)
sdsMain.RemoveLover(akSpeaker,True)
SexLab.StartSex(sexActors, anims)
;END CODE
EndFunction
;END FRAGMENT

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

sdsSexLabRomanceMain Property sdsMain  Auto  

SexLabFramework Property SexLab  Auto  
Posted

Hi Deathmaw,

 

can I ask you about what do you mean for: not triggering ?

* The dialogue does not show

* The dialogue shows but the sex animation is not started

 

If the first one is the case please triple check the conditions (if any) you put on the dialogue' topic.

If the second one is the case then add a few trace lines in your code to check what is not going well.

 

I will add some better explanation in about one hour.

 

 

Posted

Hi Deathmaw,

 

can I ask you about what do you mean for: not triggering ?

* The dialogue does not show

* The dialogue shows but the sex animation is not started

 

If the first one is the case please triple check the conditions (if any) you put on the dialogue' topic.

If the second one is the case then add a few trace lines in your code to check what is not going well.

 

I will add some better explanation in about one hour.

 

Hey thanks. Its the sex animation not starting. The dialogue shows up no problem, I'm fairly decent at working with dialogue in the CK.

Posted

Hi @Deathmaw,

 

as promised I added an entry on my modding blog to help people to debug the scripts.

Have a look here: http://www.loverslab.com/blog/232/entry-1086-optimize-your-scripting/#comment_2697

 

If you want help directly on your code I can try to add to it some trace information to better understand why it is not working.

 

Let me know.

 

Yeah adding the trace info would be great. I'm kind of completely new at scripting.

Posted

Do you want help for your first tracing script?

If so just copy/paste your code here and I will add the traces for you.

 

Posted

Ok:

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

;BEGIN FRAGMENT Fragment_3
Function Fragment_3(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
actor[] sexActors = new actor[1]
sexActors[1] = akSpeaker
String okTags = "Masturbation"
sslBaseAnimation[] anims = SexLab.GetAnimationsByTags(sexActors.length, okTags, RequireAll = true)
sdsMain.RemoveLover(akSpeaker,True)
SexLab.StartSex(sexActors, anims)
;END CODE
EndFunction
;END FRAGMENT

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

sdsSexLabRomanceMain Property sdsMain  Auto  

SexLabFramework Property SexLab  Auto  
Posted

Here we go:

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

;BEGIN FRAGMENT Fragment_3
Function Fragment_3(ObjectReference akSpeakerRef)
Actor akSpeaker = akSpeakerRef as Actor
;BEGIN CODE
actor[] sexActors = new actor[1]
debug.trace("SDS: up here is good.")
sexActors[1] = akSpeaker ; THIS WILL FAIL!!!!
debug.trace("SDS: this trace will never be printed.")
String okTags = "Masturbation"
sslBaseAnimation[] anims = SexLab.GetAnimationsByTags(sexActors.length, okTags, RequireAll = true)
sdsMain.RemoveLover(akSpeaker,True)
SexLab.StartSex(sexActors, anims)
;END CODE
EndFunction
;END FRAGMENT

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

sdsSexLabRomanceMain Property sdsMain Auto 

SexLabFramework Property SexLab Auto

The error in the code is this one:

you define your array for actors to have just one element (actor[] sexActors = new actor[1]). It is ok.

 

Arrays in Papyrus start from 0 not from 1.

 

So your line: sexActors[1] = akSpeaker

will never work.

 

Just change it to:

sexActors[0] = akSpeaker

 

 

Good luck

Posted

The error in the code is this one:

 

you define your array for actors to have just one element (actor[] sexActors = new actor[1]). It is ok.

 

Arrays in Papyrus start from 0 not from 1.

 

So your line: sexActors[1] = akSpeaker

will never work.

 

Just change it to:

sexActors[0] = akSpeaker

 

 

Good luck

 

 

 

 

 

That sorted it out! Thank you so much!

Archived

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

  • Recently Browsing   0 members

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