Jump to content

Script problem


klmnoop

Recommended Posts

I'm making a mod and I'm trying to learn the papyrus scripting. I tried to make a dialog that activates an animation as the end of it. But the animation doesn't play, but when I activate the animation through another mod it works fine.

 

Load order:

00 Skyrim.esm
01 Update.esm
02 Dawnguard.esm
03 HearthFires.esm
04 Dragonborn.esm
05 SexLab.esm [Version 1.59b]
06 Unofficial Dawnguard Patch.esp [Version 2.0.7]
----> Delinquent MASTER: Unofficial Skyrim Patch.esp
07 Unofficial Dragonborn Patch.esp [Version 2.0.7]
----> Delinquent MASTER: Unofficial Skyrim Patch.esp
08 Unofficial Hearthfire Patch.esp [Version 2.0.7]
----> Delinquent MASTER: Unofficial Skyrim Patch.esp
09 Unofficial Skyrim Patch.esp [Version 2.0.7]
0A ZaZAnimationPack.esm
0B HighResTexturePack01.esp
0C HighResTexturePack02.esp
0D HighResTexturePack03.esp
0E Alternate Start - Live Another Life.esp [Version 2.5.3]
0F Devious Thanes.esp
10 SkyUI.esp

 
The script is from the tutorial on this website which can be found here:
 
Script:

 

sslThreadModel AnimationObject = SexLab.NewThread()

AnimationObject.AddActor(Game.GetPlayer(), isVictim = false)

AnimationObject.AddActor(akSpeaker, isVictim = false)

sslBaseAnimation[] anims

anims = new sslBaseAnimation[1]

anims[0] = SexLab.GetAnimationByName("Arrok Lesbian")

AnimationObject.DisableLeadIn(true)

AnimationObject.SetAnimations(anims)

AnimationObject.SetBedding(0)

AnimationObject.SetHook("TestingFoo")

RegisterForModEvent("AnimationStart_" + "TestingFoo", "TestingFoo")

AnimationObject.StartThread()

Debug.MessageBox("Script ran")

 

The only thing I have changed in the script is the debug box at the end to see if the script was actually executing. So my question what have I done wrong and how can I fix it?
Link to comment

OK, my note isn't on your script issue, but your load order is putzed.  The unofficial patches need to be after each one it updates:

 

00 Skyrim.esm
01 Update.esm
02 Unofficial Skyrim Patch.esp [Version 2.0.7]
03 Dawnguard.esm
04 Unofficial Dawnguard Patch.esp [Version 2.0.7]
05 HearthFires.esm
06 Unofficial Hearthfire Patch.esp [Version 2.0.7]
07 Dragonborn.esm
08 Unofficial Dragonborn Patch.esp [Version 2.0.7]

...All other mods...

 

That will get rid of the "Delinquent MASTER: Unofficial Skyrim Patch.esp" errors you see in your pasted load order, and may help with other issues you may encounter (again, not sure if will help with your script issue).

Link to comment

Did you add the properties for the script? Post the entire script from the editor so we can see the entire thing.

 

Pretty sure I did (by that I mean I did everything in the tutorial), below is what you requested.

 

 

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment

;NEXT FRAGMENT INDEX 1

Scriptname TIF__04000D68 Extends TopicInfo Hidden

 

;BEGIN FRAGMENT Fragment_0

Function Fragment_0(ObjectReference akSpeakerRef)

Actor akSpeaker = akSpeakerRef as Actor

;BEGIN CODE

sslThreadModel AnimationObject = SexLab.NewThread()

 

AnimationObject.AddActor(Game.GetPlayer(), isVictim = false)

 

AnimationObject.AddActor(akSpeaker, isVictim = false)

 

sslBaseAnimation[] anims

 

anims = new sslBaseAnimation[1]

 

anims[0] = SexLab.GetAnimationByName("Arrok Lesbian")

 

AnimationObject.DisableLeadIn(true)

 

AnimationObject.SetAnimations(anims)

 

AnimationObject.SetBedding(0)

 

AnimationObject.SetHook("TestingFoo")

 

RegisterForModEvent("AnimationStart_" + "TestingFoo", "TestingFoo")

 

AnimationObject.StartThread()

 

Debug.MessageBox("Script ran")

;END CODE

EndFunction

;END FRAGMENT

 

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

 

SexLabFramework property SexLab auto

 

Link to comment

This is the script segment that handles the sex scene with Elenwen from the 2nd Expansion quest in Captured Dreams:

 

Function StartElenwenOral() ;start sex with Elenwen

debug.notification("Start Elenwen sex.")
actor[] sexActors = new actor[2]
sexactors[0] = Playerref
sexactors[1] = ActorElenwen
 
sslBaseAnimation[] anims
anims = SexLab.GetAnimationsByTag(2, "oral", "69", TagSuppress = "boobjob" , RequireAll = true)
 
RegisterforModEvent("HookAnimationend_Elenwen", "CheckElenwenDone")
sexlab.startsex(sexactors, anims, centeron = PosElenwenSol02, allowbed = false, hook = "elenwen")
Endfunction

 

From the looks of what you have the actors have not been defined so it does not know who to use.

Link to comment

This is the script segment that handles the sex scene with Elenwen from the 2nd Expansion quest in Captured Dreams:

 

Function StartElenwenOral() ;start sex with Elenwen

debug.notification("Start Elenwen sex.")
actor[] sexActors = new actor[2]
sexactors[0] = Playerref
sexactors[1] = ActorElenwen
 
sslBaseAnimation[] anims
anims = SexLab.GetAnimationsByTag(2, "oral", "69", TagSuppress = "boobjob" , RequireAll = true)
 
RegisterforModEvent("HookAnimationend_Elenwen", "CheckElenwenDone")
sexlab.startsex(sexactors, anims, centeron = PosElenwenSol02, allowbed = false, hook = "elenwen")
Endfunction

 

From the looks of what you have the actors have not been defined so it does not know who to use.

Thank you! Trying to define the actors showed me what I was doing wrong, and now the animations are playing!

That was the main problem, not defining the actors. After that I had problems with the fragment compiling because I didn't realize that a fragment was classed as a function! So I was adding a function in a function essentially...damn I'm a noob. :P

Link to comment
  • 3 months later...

 

This is the script segment that handles the sex scene with Elenwen from the 2nd Expansion quest in Captured Dreams:

 

Function StartElenwenOral() ;start sex with Elenwen

debug.notification("Start Elenwen sex.")
actor[] sexActors = new actor[2]
sexactors[0] = Playerref
sexactors[1] = ActorElenwen
 
sslBaseAnimation[] anims
anims = SexLab.GetAnimationsByTag(2, "oral", "69", TagSuppress = "boobjob" , RequireAll = true)
 
RegisterforModEvent("HookAnimationend_Elenwen", "CheckElenwenDone")
sexlab.startsex(sexactors, anims, centeron = PosElenwenSol02, allowbed = false, hook = "elenwen")
Endfunction

 

From the looks of what you have the actors have not been defined so it does not know who to use.

Thank you! Trying to define the actors showed me what I was doing wrong, and now the animations are playing!

That was the main problem, not defining the actors. After that I had problems with the fragment compiling because I didn't realize that a fragment was classed as a function! So I was adding a function in a function essentially...damn I'm a noob. :P

 

 

How do you do this? I am so fucking sick of fiddling around with the mods to get this damn shit to work. Would love to continue on with the quests, but i cant. I can get up to Elenwen's room without a hitch, but then it just absolutely dies. I dont know a thing about software programming (See also modding and script editing, nor do i have any interest to teach myself said skills) so i am absolutely clueless as to how to get the mod working otherwise.

 

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