Jump to content

HOWTO: Skysex Framework


DocClox

Recommended Posts

How to get sex animations in game

 

Make the animations.

 

I'm not an animator, so I can't help much here. As a bare minimum, we want one loopable animation for each participant in the scene. And we need them in .hkx format.

 

I don't want to go into much more detail here. Most of the people reading this already know more than I do about this part. However, there is one thing that is worth stressing.

 

Collisions need to be disabled in the animation for at least one of the participants. If that isn't the case then the engine will teleport one of the actors to a safe locaton. After which the sex engine will line them up again. Then the collision detection will teleport the first actor again, and the two of them end up chasing each other diagonally across the landscape.

 

Eventually, there should be a SKSE function to disable and enable collisions on a per-actor basis, and we'll be able to do away with this requirement. For now though we need this.

 

Get a modified behavior file.

 

To make the new animations show, they need to be referenced by a behavior file. That means we need a modified version of the file. Currently there are two ways of doing this, both incompatible.

 

The first way is to use FNIS1. The 2.0 version has a lot more slots and is probably better maintained. The downside is that mod conflicts are more likely, and your animation won't work with Animated Prostitution

 

Alternatively you can use JoshNZ's behavior patcher2 and create your own behavior file with as many slots as you need. The downside here is that the patcher doesn't work with FNIS 2.0, and so beaks things like XXX Adult Show.

 

Eventually we'll have a solution that works for all of them. For now, choose one. FNIS is probably more plug and play of the two, so I'll talk about FNIS for the main part of this document.

 

Copy them into a FNIS slot

 

FNIS works on the basis of creating unused “slots” for new animations. There are 800 slots for looping animations which. Each slot has its own filename. In the case of looping or "cyclic" files, that means the files are named FNISc001.hkx through to FNISc800.hkx.

 

All FINS animation files live in the folder "{skyrim_install_dir}\Data\meshes\actors\character\animations\FNIS"

 

You need to:

 

  • Find an unused slot. In the short-term any slot that doesn't have a corresponding file in the FNIS folder can be considered unused. If you're going to distribute your mod however, you should take a look at the nexus page and pick some numbers not reserved for another mod.
  • Copy your mod files into "{skyrim_install_dir}\Data
  • rename the files to be FNIScNNN.hkx and FNIScNNO.hkx where NNN and NNO are unuseds number from 1 to 800. Make a note of what numbner matches which animation. So if your animation names were "monkeysex_m.hkx" and "monkeysex_f.hkx" and the first free number was c100, you'd rename the copy of monkeysex_m.hkx the FNIS folder to be FNISc100.hkx and monkeysex_f.hkx to FNISc101.hkx. Or the other way around if you prefer.

 

What this does is associate your animation file with an animation event defined in fore's modifed behavior file. So when that animation event fires, your animation will be played. And that's enough to get them to work if all you want to do is use Debug.SendAnimationEvent in papyrus. But that can break your game, so we have a bit more work to do.

 

Create Idle Objects in the CK

To use the animations safely, we need to call them using PlayIdle. And do to that we need idle objects corresponding to the animation events we just defined. So:

 

  • Fire up the CK
  • Choose Gameplay->Animations from the main menu
  • In the left hand pane, there's an entry for Actors\Character\Behaviors\0_Master.hkx. Expand it, then scroll down to the entry marked LOOSE and expand that, too.
  • Right click on any entry and choose "insert sibling". This will add an unnamed Idle at the top of the LOOSE list. click on it.
  • In the right hand side pane type a descriptive name for your idle in the box marked ID. Monkeysex_M,for example.
  • In the "Anim Event" drop down, choose the zFNIScNNN (same as the filename but with a leading "z") from the list
  • Repeat for your other animation.
  • Close the window

 

You have now created idles for your new animation. From this point on you can go ahead and write your own animation handlers using PlayIdle to make it work.

 

Alternatively you could use the Skysex framework developed for SSG and Sexrim. Which I'll talk about next

 

Setting up Skysex

 

(A word of warning: from this point on, things a have been fairly lightly tested. This works for me, but it's all badly in need of beta testing. Now with that out of the way ...)

 

To get the sex scene playing correctly needs more than just getting the participants animated. They need to be the right distance apart and facing the right way. To make it easier to manage this information, Skysex has a quest with functions to both record that data when your mod loads, and to play it later.

 


  • * The first thing you'll need is the Skysex mod. At time of writing, latest version is at
http://www.mediafire.com/?r22y51mc9r0y961 Open the CK and create a quest for your animations. MonkeysexQuest, using the earlier example.
Click OK to close the quest, and then reopen it. You need to do this to access all the quest tabs.
Go to the script tab and add a script. We'll call this one MonkeysexQuestScript.
Give the script two idle properties called monkeysex_m and monkeysex_f and point them at the relevant idles.
Give it a quest property and set that to point at the skysex resources quest. You can save some casting later on if you set the type to SkySex_Resources_Script

 

Registering the animations with Skysex

 

Ok. Registering the animations is as simple as making a couple of calls to functions belonging to the SkySex_Resources_Script. So set up the script like this:

script MonkeysexQuestScript extends Quest

Idle Property Monkeysex_m auto
Idle Property Monkeysex_f auto
SkySex_Resources_Script property resources auto

Event OnInit()
	int zero_index

	; stuff to go here.
EndEvent

 

OK. Just so we're all on the same page, let's stop for a second and talk about how sex actions (or any other collaborative animation for that matter) are arranged here.

 

  • Each sex act has a name and a mod name. These are so we can look the animation up in the warehouse list, and so we can have three different sets of "buttsex" animations from three different mods and not have them conflict.
  • Each sex act has a number of participants. Each participant has its own idle and its own number. The number determines the order in which the actors are placed in position.
  • The first actor placed is special, since the other animations are placed relatve to this one. This is the zeroth or prime actor in the scene.

 

So the first thing to do is add our prime actor.

 

	Event OnInit()
	int zero_index

	zero_index = resources.add_animation(	\
		a_animation = monkeysex_f, 			\
		a_name 	= "Monkeysex",		\
		a_mod = "Monkeysex Mod", 			\
		a_slot 	= 0							\
	)
EndEvent

 

That creates an entry in the resource warehouses list of sex animations.

 

 

  • a_animation is the idle for the female monkeysex animation
  • a_name and a_mod are so we have names to look up the animation
  • a_slot is set to zero to indicate that this is the prime actor as discussed above.

 

You'll be able to play that just by using the name and the mod name. Of course, there's only one participant at the moment. That would work for some acts, but this one is a 2-P scene. So let's add number two.

 

	Event OnInit()
	int zero_index

	zero_index = resources.add_animation(	\
		a_animation = monkeysex_f, 			\
		a_name 	= "Monkeysex",		\
		a_mod = "Monkeysex Mod", 			\
		a_slot 	= 0							\
	)

	add_animation(						\
		a_animation = m_doggie, 		\
		a_name 	= "Monkeysex",		 	\
		a_mod 	= "Monkeysex Mod", 		\
		a_slot 	= 1, 					\
		a_displacement 	= 80.0,			\
		a_zrot 	= 0						\
	)
EndEvent

 

That adds the male part of the act in as well.

 

 

  • a_animation, a_name and a_mod are as above
  • a_slot is set to 1 this time. The numebers determine the order actors are placed.
  • a_displacement is how far from the prime actor this actor is placed
  • a_zrot is the rotation about the prime actor position in the z-axis

 

What happens when a non-prime actor is placed:

 

  • They get moved to the same position and facing as the prime
  • They then get moved forward by the number of game units in a_displacement
  • They then get rotated around the prime's position by the value of a_zrot in degrees
  • They then get turned to face the prime again.

 

With this information we should be able to build up most combinations of sex scenes, however many the participants. There are a few more bells and whistles in the mod, but I'm not sure how well they work so I'll leave them for now.

 

Anyway, that's the animation registered and ready to play.

 

Playing Skysex animations

 

This is the easy bit:

resources.start_anims("Monkeysex", "Monkeysex Mod", girl_actor, boy_actor)

 

That'll position the actors relative to the current position of girl_actor and start the loops going.

resources.end_anims(girl_actor, boy_actor)

That stops the action.

 

It'll probably be useful beforehand to make sure the participants are fairly close to one another, and that they're not already engaged in some idle.

 

OK. I've probably left a ton of stuff out, so feedback welcome. And have fun!

Link to comment

Thanks. I'm glad it makes sense.

 

In answer to your question, it depends on what you mean by "two person". I you mean paired animations, like killmoves or the hugging animation, then no.

 

If you mean two person sex using separate animations, Animated Prostitution does it, and I've had it working in a test cell using the approach above.

 

It's still a little wobbly, I think, in all cases, but we're definitely getting there.

Link to comment

I don't know if this is the right question to ask this, but will Skysex have some kind of tagging or keyword capability for each individual animation?

 

I ask because, when the time comes to develop the equivalent of Lover's Voice SSP, it might be interesting to have each animation key certain dialog lines depending on the animation's tags, such as oral, anal, vaginal, rough, deep, slow, fast, etc.

 

That way dialog could be closely tailored to match the position currently in use.

 

I imagine we could build something like this into the Voice plugin instead, so that the Voice plugin detects which animation is playing and then uses its own associated array of keywords...

Link to comment

Good idea. I can easily add a keyword array to the parameters, copy it, and save it with the entry.

 

Probably need to be strings rather than CK Keywords, since there's currently no way to add Keywords to Idles. There is a request with the SKSE guys, but they've got a lot on their plate at the moment.

 

Of course, a better way to do this might be to add the data to the animation events at the havok level. But that needs programming support too. I might do another post about how that all works when I get a bit more time.

Link to comment

now all we need is all the script sets for use in SResource...

 

is it possible to use the same animation slot doing it this way as well... for instance actor_A has one slot and actor_B has the next slot, then you switch out animations depending on approach and dialogue and then advancement through animations while 'in the act'?!

 

you could try to run a C++/sql/dll/xml file to run animations from other mods with no conflicts, not sure on all the programming involved... then whatever control mod that uses these would be able sync everything together hopefully without causing lag in-game. that way you could give yourself extra 'slots' so to speak within a given slot effectively changing the name of the animation when its used in-game, both from the dll and sql files to keep call orders organized and then within the mod you could script the 'extra' names so that when it is called (previous animation being removed just before) it will be loaded into the proper slot under a name that works for the game or FNIS or inspite of FNIS or any other animation/behavior mod.

 

to go even further in that direction we could inject any new animation scripting from other mods into the necessary files... keeping track of all names from the other mods and changing them as needed during gameplay.

 

can use the xml file for all the extra mod data and have the mod and C++ file auto-setup name change.

 

of course currently hypothetical and academic.

 

dont suppose you know the scripting/coding differences between AP and FNIS?

 

edit:

it would be more stable using the extra files, but i think the skysex setup is easier and will work ok... hopefully they will release a proper upgrade to the CK with dawngaurds release as well and make this stuff easier, and in the meantime ill try and teach pigs to fly lol

Link to comment
  • 2 weeks later...

Is there any way to make new animation events other than idles? I would like to make a custom race that can walk around like a normal player character, and at the press of a button, switch over into flight without having to use some workaround like changing the race to something with a completely different behavior file.

Basically it's a race of pegasus horses.

Link to comment

Collisions need to be disabled in the animation for at least one of the participants

 

In Morrowind and Oblivion I changed the collision position in the animation file, that is, while animating I used a Z-coordinate value of 0 for one actor's collision, and let's say a -800 for the other one. Don't know if this can be done with Skyrim too.

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use