Jump to content

Using SL animations on static item activation?


Recommended Posts

Posted

(Not sure if this is the right place to ask, if it is not, I am sorry. :blush: )

 

I am planning to use a static item in a mod. When the item is activated, I want it to play a specific category of SexLab animations.

Since I am pretty new to scripting and had only mixed success, I thought I ask here for help. Strange enough the tutorials for the CK from Bethesda didn't help with SexLab animation integration :lol:

 

My main question is, how do I call up an animation. I guess it isn't that different than creating a message box, is it?

I know the stuff about events and onActivate. I am not so sure about "properties" and "keywords".

 

For example, if I wanted to put a figurine of Dibella somewhere and want it to trigger a masturbation animation on activation (wow, a lot of -ations in that sentence!), how would I script this?

 

A second question: Can you put several events into one script, or several "actions" in one event? 

 

Example:

 

Event onActivate (ObjectReference etc)

cast spell

close door

do something else

EndEvent

 

 

Thanks in advance!

 

 

 

 

Posted

Hello , here something:

First of all you should know what the actors that will be involved have to be. (Player?, Activator?, Follower?, NPCs around?, preset of actors?)

Then you can just do a quick SexLab animation. Quick & Easy.

If you wish more control you can use some tags, of even a SexLab thread to configure whatever you want.

 

Here an example:

SexLabFramework Property SexLab Auto

Event onActivate(ObjectReference akActivator)
  SexLab.QuickStart(akActivator as Actor, AnimationTags = "Masturbation")
EndEvent

Remember to set the property for Sexlab after you save the script.

 

And, Yes, you can do whatever you want in your event. Just don't keep it run forever.

 

 

Posted

Thank you very much, I will fiddle around with this in the next few days.

I might (more probably: "will"  :lol:) have the one or other question when trying it and ask more stuff :)

 

 

Posted

Well, it took me a bit of time to get the CK scripting running through MO, but I think I did everything right, I compiled a script for testing and it worked.

 

 

 

Remember to set the property for Sexlab after you save the script.

 

 

Still struggling a bit with that part, though :blush:

 

I will fiddle around with it a bit more this weekend

 

Edit: It looks like I can't get scripting to work through Mod Organizer, despite my first thought. Getting loads of errors when trying to compile the sample script above. Might be that it has to do with me not being able to figure out how to set the Property for SexLab after making a new script.

 

Posted

Darn, I feel like an idiot (well, I do most of the time, but this time for a new reason...)

 

I only just found the link in the FAQ for SexLab that explains the property stuff and all that :blush:

Posted

Nobody is an idiot (Ok, "almost" nobody). We are just "learners"...

Posted

Well, I guess I am part of the "almost".... I can't get the scripting to work trough Mod Organizer. I guess I have to set up a second Skyrim folder for modding purposes.

 

Every time I want to compile a script, I get a lot of error messages, I am adding a .txt with them to the post.

 

I tried putting all the scripts in the original Skyrim data folder. I tried putting them all in Overwrite (in the correct folders there) and still it doesn't compile. I think I have a brain fart somewhere but I can't figure it out.

 

There is no option for me to select a "SexLab" property from the drop down menu when trying to assign properties. So I am obviously missing something here.

 

 

Posted

It seems that in your "copy of Skyrim folder" the SKSE scripts are missing.

For this reason SexLab scripts will not compile (or better, your scripts will not compile because the references to another script cannot compile.)

 

Just add the psc and pex files from SKSE (by replacing all the standard ones), and your script should compile.

 

If not, just post for help.

 

Cheers,

Posted

 

One thing about scripting for Skyrim, it always needs the SOURCE files for any script you are referencing. For some reason it is unable to use the .PEX compiled files for referenced script like every other language.

 

That is why you need to install the SKSE script source files (*.psc) if you are using SKSE (which you should).

Posted

Well, I have put all the *.pex and *.psc files in one scripts/source folder in my Skyrim Data directory. I have also put them in a scripts/source folder in the overwrite, just to make sure.

I am still getting the same error messages and I have no idea why. The Creation Kit should find them in one of the two places when run through Mod Organizer, shouldn't it?

I checked the first error message regarding F:\Steam\steamapps\common\Skyrim\Data\Scripts\Source\sslActorLibrary.psc and the .psc is in both source folders (the original one in Skyrim and the one in overwrite)

 

Also did the whole thing with setting the compiler to run as 32bit as required for MO. I am at a loss here.

 

 

ETA: Just checked with a script that I made before, I definetly can compile scripts in MO.

Posted

Are you running the CK under MO?  That should be making the Sexlab Framework sources available as well but I think you can add the path to them directly in the "sScriptSourceFolder" field of the SkyrimEditor.ini file.

 

 

Posted

Yes, I am running the CK through MO. Everything else works fine (adding books, working on the house etc) 

When I try to add a new script to an activator and search for "sex" it shows Sexlab Framework there.

If I create an empty script (just with a comment)  and want to add the properties, the error messages appear and the property is not added in the window.

It does show up in the script though. The problem is that the errors appear again and the script is not compiled when I click compile inside the script again.

 

Maybe I should drop the whole trying to run it through MO and copy my Skyrim folder and do a manual install of the Framework and all the stuff needed and go old school.

I guess, I am missing a little thing, but I can't figure it out. Just glad that my life doesn't depend on it :lol:

 

 

Posted

Worst case just add the PSC files from the Sexlab Framework Mod to the ~\Data\Scripts\Source folder and they will become available to the CK and the Papyrus compiler.  That said, I still run my own development environment with everything used by the MOD I'm working on installed to Skyrim directly and use MO only for mods I'm not working on (I rename the Skyrim folder and have multiple copies of it, MO is installed to the Skyrim folder so I have unique copies for my development and playing configurations).  It's only recently that people figured out how to get Papyrus to compiler under the CK and my current dev environment predates that.

Posted

Yes, I guess it is the easier way to just use a second Skyrim folder for modding and renaming them accordingly if I want to play or mod.

I will give it a try and see how it works out that way.

 

ETA: I just set up the whole stuff in a copied Skyrim folder. No errors anymore, but I hit another snag:

 

Point 6 of the tutorial for the use of fragments says:

 

You should now see the property you added in the property window for your script fragment, select it and click "Edit Value" You should then have an option for what to set it as, and only one option, SexLabSystem. With that set, click OK to close the properties window.

 

But my only option is SexLabQuestFramework, is this correct and the guide just a bit outdated?

 

 

ETA2: The script now works and I can trigger it with my character. I can tell a follower to activate it as well and the animation kicks in. Since I am still new to all the scripting business and even after spending some time on different tutorial pages, I haven't found out how to make a Follower and/or NPC use the activator by themselves. I am not even sure if it is possible, since it kind of is different to the idles they use, right?

 

ETA3: Gaaah, I am turning gray here with yet another problem. I wanted to make sure that a female activator uses female animations and a male one uses male animations. But after almost 5 hours of trying to make sense of it I can't look straight anymore.

I either get the errors that "GetSex" or "GetGender" are no a function.

The "akActivator" refers to the character actually activating the Activator, right?

So I should get the the gender/sex of the activator and make SL treat the char accordingly.

SexLabFramework Property SexLab1  Auto  

Event onActivate(ObjectReference akActivator)
(akActivator.GetSex())
if (akActivator.GetSex() == 1)
SexLab1.TreatAsFemale(akActivator)
elseif (akActivator.GetSex() == 0)
SexLab1.TreatAsMale(akActivator)
endif
  SexLab1.QuickStart(akActivator as Actor, AnimationTags = "Masturbation")
SexLab1.ClearForcedGender(akActivator)
EndEvent

This was my last try getting told that GetSex is not a function. There were other errors as well, maybe someone can look at it and point out the errors? Just reading the whole tutorials without some explanation makes it tough for me. My whole life I never could learn just from books  :lol:

 

Thanks in advance again!

 

 

 

 

 

 

Posted

aKactivator is an ObjectReference object so "GetSex()" is not a function of that object. You need to cast the ObjectReference object as an Actor object but wait, GetSex is also not a function of the Actor object so you have to use a function to get the ActorBase object. Oh NO! There are "TWO" ActorBase objects for each actor and while GetSex() is a function available to both for best results you need to use the GetLeveledActorBase() function to get the correct current actorbase object instead of the GetActorBase() function which has the initial settings for the actor but not the current one and for actors created by a template like bandits where different sexes may be generated the ActorBase may not be the same sex.

 

Waits while GornGrimm's head explodes..........

 

 

 

 

 

 

 

.... so the code should look like this:

if (akActivator as Actor.GetLeveledActorBase().GetSex() == 1)
...
Posted

Here a couple of answers:

 

1) Your only option is the correct one.

 

2) I don't know, but I will find this out.

 

3) you can specify better tags in your "QuickStart" in this way: AnimationTags="Tag1,Tag2,Tag3,..."

 

The problem is that the "masturbation" anims have no tag to specify if they are for a male or female character.

Maybe you need to get the animation directly using a little bit more advanced SexLab option: Threads.

SexLabFramework Property SexLab1  Auto  


Event onActivate(ObjectReference akActivator)
 ; (akActivator.GetSex()) -- not useful


 String animName


 if (akActivator.GetSex() == 1)
   SexLab1.TreatAsFemale(akActivator)  ; Not really required but a cast may be useful: SexLab1.TreatAsFemale(akActivator as Actor)
   animName = "Bleagh Female Masturbation"
 elseif (akActivator.GetSex() == 0)
   SexLab1.TreatAsMale(akActivator) ; Not really required
   animName = "Arrok Male Masturbation"
 endif


 ; SexLab1.QuickStart(akActivator as Actor, AnimationTags = "Masturbation") --- This will be replaced


 sslThreadModel Thread = SexLab1.NewThread()
 if Thread.AddActor(akActivator as Actor) == -1
   debug.notification("Failed to slot '" + (akActivator as Actor).GetLeveledActorBase().GetName())
   return ; Stop the function now since we failed to add the actor.
 endIf
 sslBaseAnimation[] anims = new sslBaseAnimation[1]
 anims[0] = SexLab.GetAnimationByName(animName) ; This will get the animation with the specified name
 Thread.SetForcedAnimations(anims)
 sslThreadController t = Thread.StartThread()


 SexLab1.ClearForcedGender(akActivator)
EndEvent

Regards,

Posted

 

mindblown.gif

 

 

 

Thank you both! Although I understood.... well... almost half of it, I will give it a go. At least it helps me understand the whole syntax a bit (tiny bit) more. Just seeing the generic stuff in the tutorials could clear it up for me :lol:

Posted

Wonderful spoiler!

 

I love it!  :D

 

It was me about one year ago when I started... 

Posted

Soooo, using

if (akActivator as Actor.GetLeveledActorBase().GetSex() == 1)

I get these errors: 

no viable alternative at input 'actor'

required (...)+ loop did not match anything at input ')'
 

If I use the script with threads, I get these:

 if (akActivator.GetSex() == 1)

GetSex is not a function or does not exist
cannot compare a none to a int (cast missing or types unrelated)

SexLab1.TreatAsFemale(akActivator)

type mismatch on parameter 1 (did you forget a cast?)

 

I get the above messages for several lines including either GetSex or TreatasFemale/Male or the ClearForcedGender.

 

Sorry for being so dense :blush:

I am guessing that I still miss something and after reading some more, I was wondering if I need to set a Property for "Actor", so I can use (akActivator as Actor)? Although I have no idea what it should be. ActorRef?

 

Thank you for your patience with me :)
 

Posted

if (akActivator as Actor.GetLeveledActorBase().GetSex() == 1) ; the cast requires parenthesis
if ((akActivator as Actor).GetLeveledActorBase().GetSex() == 1) ; this is the correct way to do a cast

 

 if (akActivator.GetSex() == 1)
That is wrong because akActivator is not an ActorBase (that implements the .getSex())

 

 

SexLab1.TreatAsFemale(akActivator) ; Wrong because akActivator is not an Actor
SexLab1.TreatAsFemale(akActivator as Actor) ; a cast will solve your problem
Kind Regards,
Posted

If you really want you can do something like:

 

Actor theActor = (akActivator as Actor)

SexLab1.TreatAsFemale(theActor)
if (theActor.GetLeveledActorBase().GetSex() == 1)
...
endif
Posted

I will skip the Actor theActor thingy for now. The script works now! Thanks again for your patience :)

 

Now I am off to read more about triggering an animation with a follower when using another activator.

 

So, I guess what I want to say is:

 

I'll be back :lol:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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