Jump to content

How to GetAnimationByName?


Recommended Posts

Posted

Hello!

 

I tried to start a animation, but use a specific one.

For this, I choosed the command GetAnimationByName.

 

But something seems to go wrong and I couldn't find a solution yet. Even with Papyrus Guide.

 

Here is the code:

 

 

Actor[] sexActors = new Actor[2]
if PlayerRef.getActorBase().getSex()==1
sexActors[0]=playerRef
sexActors[1]=akSpeaker
else
sexActors[0]=akSpeaker
sexActors[1]=playerRef
endIf
sslBaseAnimation[] anims
anims = SexLab.GetAnimationByName("(Dog) LeitoDogCunni")
SexLabUtil.StartSex(sexActors,anims)

 

 

Error:

 

 

Starting 1 compile threads for 1 files...
Compiling "TIF__08073964"...
H:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\TIF__08073964.psc(18,0): type mismatch while assigning to a sslbaseanimation[] (cast missing or types unrelated)
No output generated for TIF__08073964, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__08073964

 

 

 

And because its creature, I also tried this:

 

 

Actor[] sexActors = new Actor[2]
if PlayerRef.getActorBase().getSex()==1
sexActors[0]=playerRef
sexActors[1]=akSpeaker
else
sexActors[0]=akSpeaker
sexActors[1]=playerRef
endIf
sslBaseAnimation[] anims
anims = SexLab.CreatureSlots.GetByName("(Dog) LeitoDogCunni")
SexLabUtil.StartSex(sexActors,anims)

 

 

The Error:

 

 

Starting 1 compile threads for 1 files...
Compiling "TIF__08073964"...
H:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\TIF__08073964.psc(18,0): type mismatch while assigning to a sslbaseanimation[] (cast missing or types unrelated)
No output generated for TIF__08073964, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__08073964Starting 1 compile threads for 1 files...

 

 

 

Maybe someone has a clue. Couldn't remember a mod that calls a specific animation, so I could look in that code.

Posted

Here is the fix:

 

sslBaseAnimation[] anims = new sslBaseAnimation[1]
anims[0] = SexLab.GetAnimationByName("(Dog) LeitoDogCunni")
The problem is that get anim by name will not create the array for you.

You need to initialize and then assign the values you get.

And the second script is worst that the first.

 

Use (and because you know that is a creature anim, just use the second example):

 

sslBaseAnimation[] anims = new sslBaseAnimation[1]
anims[0] = SexLab.GetCreatureAnimationByName("(Dog) LeitoDogCunni")
Posted

 

 

Here is the fix:
 

sslBaseAnimation[] anims = new sslBaseAnimation[1]
anims[0] = SexLab.GetAnimationByName("(Dog) LeitoDogCunni")
The problem is that get anim by name will not create the array for you.
You need to initialize and then assign the values you get.
And the second script is worst that the first.

Use (and because you know that is a creature anim, just use the second example):
 
sslBaseAnimation[] anims = new sslBaseAnimation[1]
anims[0] = SexLab.GetCreatureAnimationByName("(Dog) LeitoDogCunni")

 

 

 

That was fast! Thanks!

But still get an error. On both examples:

H:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\TIF__08073964.psc(17,31): unknown type sslBaseAnimation

Posted

You need to put SexLab as master.

 

It has.

To go more specific: The script should be called from a Dialogue. Since its all edited in Sexlab Dialogues, Sexlab as Master is set and loaded. In the Properties of the script is also sexlab set. Prior I called the animations with tags with this script. This worked. For Name, I just changed this lines. hmm..

Posted

Are you using CK from Mod Organizer?

 

CK yes, but I didn't start it over MO. 

For me it seems like he doesn't know what to do with the second sslBaseAnimation. The first is fine.

Posted

If you run CK directly but SexLab is inside MO, then CK have no way to find the .psc files.

Just copy all sexlab scripts in the Skyrim\Data\Scripts\Sources\ folder, and go with compiling.

Posted

If you run CK directly but SexLab is inside MO, then CK have no way to find the .psc files.

Just copy all sexlab scripts in the Skyrim\Data\Scripts\Sources\ folder, and go with compiling.

 

Yeah, I know what you mean. But this isn't the problem I fear. All source files are already there. I double checked.

 

From my understanding, CK knows about sexlab because scripts where I call the animation via tags works. Its just the approach via names when things got wrong. When he is missing the source, he couldn't interpret the first sslbaseanimations. But he does. The second one after the "new" is what he is complaining about.

Or do I miss something?  :-/

Posted

Check that you have the file Skyrim\Data\Scripts\Source\sslBaseAnimation.psc

 

Posted

OK, try to compile it again, and post the code (full not just the part in the fragment window) and the errors of the compilation.

Posted

OK, try to compile it again, and post the code (full not just the part in the fragment window) and the errors of the compilation.

Okay, since CK don't save the source when it fails (not even in source\temp), I c+p the line in the code that I used as a base. Only this lines changed.

 

First code only:

 

 

 

Actor[] sexActors = new Actor[2]

if PlayerRef.getActorBase().getSex()==1

sexActors[0]=playerRef

sexActors[1]=akSpeaker

else

sexActors[0]=akSpeaker

sexActors[1]=playerRef

endIf

sslBaseAnimation[] anims = new sslBaseAnimation[1]

anims[0] = SexLab.GetCreatureAnimationByName("(Dog) LeitoDogCunni")

SexLabUtil.StartSex(sexActors,anims)

 

 

 

Error:

 

 

 

Starting 1 compile threads for 1 files...

Compiling "TIF__08073964"...

H:\Program Files (x86)\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\TIF__08073964.psc(17,31): unknown type sslBaseAnimation

No output generated for TIF__08073964, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on TIF__08073964

 

 

 

And the whole thing for overview with c + p because no source at fail:

 

 

 

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

;NEXT FRAGMENT INDEX 2

Scriptname TIF__Self_PresentD_No Extends TopicInfo Hidden

 

;BEGIN FRAGMENT Fragment_1

Function Fragment_1(ObjectReference akSpeakerRef)

Actor akSpeaker = akSpeakerRef as Actor

;BEGIN CODE

Actor[] sexActors = new Actor[2]

if PlayerRef.getActorBase().getSex()==1

sexActors[0]=playerRef

sexActors[1]=akSpeaker

else

sexActors[0]=akSpeaker

sexActors[1]=playerRef

endIf

sslBaseAnimation[] anims = new sslBaseAnimation[1]

anims[0] = SexLab.GetCreatureAnimationByName("(Dog) LeitoDogCunni")

SexLabUtil.StartSex(sexActors,anims)

;END CODE

EndFunction

;END FRAGMENT

 

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

 

Actor Property PlayerRef Auto

ReferenceAlias Property talkingActor Auto

SexLabFramework Property SexLab Auto

 

 

 

 

Edith:

That was the working base:

 

 

 

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

;NEXT FRAGMENT INDEX 2

Scriptname TIF__Self_PresentD_No Extends TopicInfo Hidden

 

;BEGIN FRAGMENT Fragment_1

Function Fragment_1(ObjectReference akSpeakerRef)

Actor akSpeaker = akSpeakerRef as Actor

;BEGIN CODE

Actor[] sexActors = new Actor[2]

if PlayerRef.getActorBase().getSex()==1

sexActors[0]=playerRef

sexActors[1]=akSpeaker

else

sexActors[0]=akSpeaker

sexActors[1]=playerRef

endIf

sslBaseAnimation[] anims

anims = SexLab.GetAnimationsByTag(2,"aggresive")

SexLabUtil.StartSex(sexActors,anims, victim = playerRef)

;END CODE

EndFunction

;END FRAGMENT

 

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

 

Actor Property PlayerRef Auto

ReferenceAlias Property talkingActor Auto

SexLabFramework Property SexLab Auto

 

 

Posted

Your Papyrus Compiler is not finding the references.

Probably because you have a NON standard installation.

 

Is the SexLab property correctly filled?

Posted

Your Papyrus Compiler is not finding the references.

Probably because you have a NON standard installation.

 

Is the SexLab property correctly filled?

 

It is.

The code in the edit is working. Only thing that changed are the two lines.

Code with GetAnimationsByTag does he compile with no problem.

Posted

Your code, on my end, compiles flawlessly.

 

Do a "hard reset", remove the properties (clean them), save in CK, remove the script, save in CK.

Then create a new fragment and re-try.

 

Posted

Still the same. Did a whole new dialogue and script from the start.

What comes to my mind: Did something in this regard changed between Sexlab 1.61 and 1.62?

 

I tried also a second attempt via Tags. Added a cunnilingus Tag to the animation and let the script find the animation by Tag. Started with missionary. Did creatures there also work different?

Edith: okay, looks like the tag gets ignored by creatures. It chooses all activated animations.

Posted

No, Tags are correctly handles for both human and creature animations.

 

Something is wrong in your install.

Posted

No, Tags are correctly handles for both human and creature animations.

 

Something is wrong in your install.

 

Well, at least its good to know that tags should work on creatures.

Did a test on humans and it appears to be working there.

 

Maybe I can find the reason or a way. To bad I don't know any mod that calls creature animations by tag.

But I thank you for all your help and patience! :)

Archived

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

  • Recently Browsing   0 members

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