Jump to content

Recommended Posts

View File

Virtual Sex (Vstroker interaction comes to Skyrim!)

 

 

 

 


:heart:

 


First off this project uses this mod which saved me a LOT of time programming so give h38fh2mf a big thank you. With out the initial files he made, I wouldn't have been able to do it in a couple days. :)

 

If you are using sexlab animation speed control this will replace it BUT you MUST make a clean save. Remove the animation speed control load your game then save it. The reason is the configuration file has changed and is NOT compatible.

 

​This is initial release which works and would like to get feedback or thoughts about how to make it better. I haven't completed all the functions but the main control works and works quite well.

 

Here is the things to do on install. The vstroker uses the HID interface so I made a DLL. This DLL is called HIDAPI.DLL and

 

MUST be copied to the Skyrim root directory directly or SKSE will fail to load the plugin AnimSpeedPlugin.dll in SKSE plugins because the skse_loader.exe needs the interface.

 

Now this file is in a separate folder called SEE README VSTROKER which will be installed into Skyrim/data. The reason I did this is because mod programs will NOT install any file outside /data.

 

Anyone getting this and asking why the SKSE log says animspeedplugin.dll fails with error code 129 I will completely ignore you because I put this in BIG letters on the top of this description.

 

Now this file will be supported through its development cycle and will NOT be deleted like fapboy since this is a MOD and not a commercial test. It will be here until LL dies.

 

HOW it works:

 

This mod adds vstroker control to the animation speed. The faster you stroke the faster the speed. Future updates will include direction and possible bone control of the hips of both parties with full control of the animation loop. (still in research)

 

When you start a sex scene the initial frame is sent to the AnimSpeedPlugin and it is hooked into the animation itself. The faster you move the device the faster the actors animate. The speed can go VERY slow to VERY fast.
You control the animation speed through the Vstroker by how fast you move it.

 

At the last frame before exiting the animation loop the on update event is canceled and the data read stops.

 

At this time there is no means to turn it on or off but the future update will have the capability through the keyboard interface to start it and stop at any point in the animation. (depending on how this is received that is)

 

This only work when player is having sex with another NPC (works if player is female or Male) and does not work on others!

 

Future plans are to work with other modders by giving the modified source.

 

I do intend to go with SSE and Fallout4 in the near future but this has been asked for a lot all over the web.

 

 

 

To install: - Use NMM or any mod organizer. Best results.

 

Manually install:

 

STILL requires you to copy hidapi.dll to Skyrim root.

 

extract virtualsex.7z in a temp directory and copy the data into Skyrim root or extract virtualsex.7z into Skyrim root.

 

To uninstall: use NMM or any mod organizer

 

Manual uninstall:

 

delete hidapi.dll from skyrim root.

 

From data directory.
SLAnimSpeed.esp
the entire directory "SEE README VSTROKER"

 

From data/scripts
AnimSpeedHelper.pex
SLSpeedMCM.pex
SLSpeedRef.pex

 

From data/scripts/source
AnimSpeedHelper.psc
SLSpeedMCM.psc
SLSpeedRef.psc

 

From data/SKSE/plugins
AnimSpeedPlugin.dll

 


Troubleshooting 101:

 


Ok - so I downloaded this plugin and followed all direction yet it fails to load!

 

Windows 8.1 and Windows 10 use a new service called HID (Human Interface Device) which is a modified version of USB access.

 

Older versions of Windows do not have this by default so you must install it.

 

In order to find out if you have HID already go to you windows\system32 and in explorer and search 'hidserver.dll' If you do not find it there than you need to go here ( developer.microsoft.com/en-us/windows/hardware/windows-driver-kit) and select your operating system to get the latest windows development kit which includes hidserver.dll

 

NOTE - Download Virtualsex0.7.7z for latest fixes and updates


  • Submitter
  • Submitted
    02/15/2017
  • Category
  • Requires
    Sexlab, SKSE, Skyui
  • Special Edition Compatible

 

Link to comment

demack, would you mind making a video about how this works? You could screengrab your Skyrim while filming with your smartphone a carrot in a condom infiltrating this VStroker? (No need to show your dick! :D ) I have trouble to imagine how this is supposed to work with SexLab.

Link to comment

Would it be too much to ask for the source of your SKSE plugin? If it is, could you at least a link to any resources that helped you make it? I'd like to try my hand at making a similar mod to sync up in-game DD vibrators with Lovesense devices.

I will post it soon. Probably Sunday. The HIDapi is from GitHub https://github.com/signal11/hidapi.git. I compiled it for 32bit and 64 bit and am testing a 64 bit version.

 

Reason for the delay here is I didn't exactly understand the data coming in until today when I realized the 10 bytes are a matrix. With the first byte being the decoder so the only action I have is speed.

 

I will be more than happy to do this!

 

 

Considering that these devices all are the same functionally except for the VID I may be something that we can all configure in One file and a interface directly through the dll. This will give MUCH more control.

Nothing in your description tells players specifically what this mod does which is a huge oversight.

It was late I had 17 hour day. I am working on the page tonight so as it is in WIP it is a WIP no?

So if you have a female character you are basically fucked right ?

Absolutely not it works on player not gender

send me a vstroker unit to test with and ill add support to display model and soulgem oven.

If I had 100 buck I would take you up on it. :D 

demack, would you mind making a video about how this works? You could screengrab your Skyrim while filming with your smartphone a carrot in a condom infiltrating this VStroker? (No need to show your dick! :D ) I have trouble to imagine how this is supposed to work with SexLab.

I stopped naughtymachina but I suppose I can put up a video there. I a working on the page now and will be much more information tonight.

to those who are asking, google Vstroker....

 

now this (VirtualSex) is a mod to enable Skyrim to be used alongside Vstroker...

 

capiche?

 

fleshlight, lube and batteries sold separately...

:D  :P 

Link to comment

I was working on the vstroker with files supplied by the manufacture when I made fapboy media player. I deleted the source and without thinking about the future, deleted the entire tree which had the manufactures code with it. I don't recall exactly how this was done but I remember the code doing vectors.

 

Here is some information for others before I put up the source. Maybe someone here can suggest better math.

 

I came across some other projects using Java which took the first two words and decoded them by exchanging the left 4 high bits with the lower 4 bit in each byte. This is correctly done for the 9 bytes so I assumed this was 3 WORDs BUT then I have this deviation in motion of the device which does not make sense even the media player had this issue so I simply discarded the higher deviation . I was reading the data in the same manner then today it hit me this is a MATRIX!

 

Well this changes thing a LOT because matrix information and tell me a lot more about the device internals. I am unsure which order this matrix is using but I am sure it is 3x3 (it may contain direction of x,y,z and acceleration.

 

[px] [py] [pz] - position

[dx] [dy] [dz] - Direction

[ax] [ay] [az] - acceleration.

 

it may be inversed or any other method here. thoughts?

 

The code at this point is simple

 

read the device 10 bytes (always 10 bytes no matter what)

 

decode the bytes by exchanging high order bits with low order bits using the XOR of the first byte.

 

shift the second byte 8 bits left and OR it to the first byte.

 

This make one word.

 

repeat this 3 times BUT I have 3 bytes left.

 

matrix would not leave anything left since a 3x3 matrix is 9 bytes!

 

so the next step in this is to build a better piece of code for device reading.

 

 

 

 

Link to comment

 

Would it be too much to ask for the source of your SKSE plugin? If it is, could you at least a link to any resources that helped you make it? I'd like to try my hand at making a similar mod to sync up in-game DD vibrators with Lovesense devices.

I will post it soon. Probably Sunday. The HIDapi is from GitHub https://github.com/signal11/hidapi.git. I compiled it for 32bit and 64 bit and am testing a 64 bit version.

 

Reason for the delay here is I didn't exactly understand the data coming in until today when I realized the 10 bytes are a matrix. With the first byte being the decoder so the only action I have is speed.

 

I will be more than happy to do this!

 

 

Considering that these devices all are the same functionally except for the VID I may be something that we can all configure in One file and a interface directly through the dll. This will give MUCH more control.

 

I've been researching the possibility of interfacing with the Lovense vibrators with a SKSE plugin. Someone already created a python API for interacting with them, so it should be possible to follow that example in a SKSE C++ DLL using sockets.

 

Unfortunately the only Lovense device I currently own is the Hush, which uses Bluetooth LE instead of Bluetooth. I'm able to pair it using Windows 10's Bluetooth menu and a fairly cheap Bluetooth LE dongle, however judging from this thread on the python API's github there may be some additional work required to communicate with it.

 

This project has really piqued my interest, so I put in an order for the other three Lovense vibrators (though 2 of them are incompatible with my current genitalia). Since they only use normal Bluetooth 2 it should be much easier to experiment with them using the python api's example and give the ladies something to play with.  :blush:

 

Edit: Apparently I've been misspelling it wrong this whole time. It's Lovense, not Lovesense. Fixed both my posts.

 

Edit2: Funnily enough, the day I started researching this they launched pre-orders for another 4 toys. They'll likely be using BLE like the Hush, so if we can crack that nut it shouldn't be too hard to support them.

Link to comment

 

 

Would it be too much to ask for the source of your SKSE plugin? If it is, could you at least a link to any resources that helped you make it? I'd like to try my hand at making a similar mod to sync up in-game DD vibrators with Lovesense devices.

I will post it soon. Probably Sunday. The HIDapi is from GitHub https://github.com/signal11/hidapi.git. I compiled it for 32bit and 64 bit and am testing a 64 bit version.

 

Reason for the delay here is I didn't exactly understand the data coming in until today when I realized the 10 bytes are a matrix. With the first byte being the decoder so the only action I have is speed.

 

I will be more than happy to do this!

 

 

Considering that these devices all are the same functionally except for the VID I may be something that we can all configure in One file and a interface directly through the dll. This will give MUCH more control.

 

I've been researching the possibility of interfacing with the Lovense vibrators with a SKSE plugin. Someone already created a python API for interacting with them, so it should be possible to follow that example in a SKSE C++ DLL using sockets.

 

Unfortunately the only Lovense device I currently own is the Hush, which uses Bluetooth LE instead of Bluetooth. I'm able to pair it using Windows 10's Bluetooth menu and a fairly cheap Bluetooth LE dongle, however judging from this thread on the python API's github there may be some additional work required to communicate with it.

 

This project has really piqued my interest, so I put in an order for the other three Lovense vibrators (though 2 of them are incompatible with my current genitalia). Since they only use normal Bluetooth 2 it should be much easier to experiment with them using the python api's example and give the ladies something to play with.  :blush:

 

Edit: Apparently I've been misspelling it wrong this whole time. It's Lovense, not Lovesense. Fixed both my posts.

 

Edit2: Funnily enough, the day I started researching this they launched pre-orders for another 4 toys. They'll likely be using BLE like the Hush, so if we can crack that nut it shouldn't be too hard to support them.

 

If it is USB device there is just one thing to do in order to get access. Download the Hidapi either by zip or git. It is NOT included because it is GNU license which is why it is dynamically linked. The test program that come with it will probe the device and give you a path. In that path is a VID and a PID pair it is the hex representation of the devices identification (type).

 

The reason I am writing all this here BTW is because I have not made any comments in my code yet and it is going up tonight later since I need to take some time to develop matrix equations AND this is not that complex but it can add a bit of anxiety if you are not familiar with SKSE interfacing. You will need to download and extract SKSE development resources. You need this build.

 

Absolutely have to have hidapi.dll in Skyrim root to make this work! It took me 3 hours to debug this one!

 

Extract and copy the files from the archive I post to skse\src\skse\<pluginname>

 

 

use hidtest.exe to identify all USB devices.

<snip other devices>

Device Found
  type: 0451 55a5
  path: \\?\hid#vid_0451&pid_55a5#6&4068a2b&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: (null)
  Manufacturer: Vstroker
  Product:      Vstroker
  Release:      100
  Interface:    -1

This I did because I forgot the VID/PID pair.

This is the ONLY code I actually added to the existing animation framework.

 

Create most variables global. Reason is the code is running in a multiprocessor environment and these variables must be synced so the read and write are taking place with the correct values. Using stack is not wise when interfacing dlls with other dlls. We could make a class here too but to me this is not necessary since only class needing access is animation plugin itself so I did it classless..

 

 

#include "../skse/PapyrusVM.h"
#include "../skse/PapyrusNativeFunctions.h"
#include "../skse/GameReferences.h"
#include <list>
#include <mutex>
#include <fstream>
#include "hidapi.h"  /added
#include "Tools.h"
//Vairables used by my code.

int sensitivity = 1;
int res; //used as results for reading
unsigned char buf[10];
int data[4]; //used for averaging the data from device.
hid_device *handle;
int i; //counter
int a; // used for data cuz I am lazy
int b;
int c;
float tabledata = 0; //used for returning the data outside the plugin.
bool is_active = false;
bool devstatus = false;

This is vstroker the VID is 0451 and the PID is 55a5. (the type)

 

From this we can access the device to find out its capabilities.

 

use file open functions from hidapi.dll to access the system file HIDserver.dll located in windows/system32

 

use the VID/PID pair which will be enumerated from hidapi.dll to get its handle and opens the device as a file.

// procedure to read device.
void do_hid_open()
{
 handle = hid_open(0x451, 0x55a5, NULL);
 if (handle == 0)
 {
  is_active = false;
 }
 else
 {
  is_active = true;
 }}
//Isolated function outside of Papyrus

void i_IVS(StaticFunctionTag * base)
{
 do_hid_open();
}

 

//Going to change this to return a status tomorrow or Sunday and add some other functions I feel are needed to prevent false data.

 

Some things are not accessible like read and write reports with Vstoroker. All you can do is read and it is the 10 bytes. Byte 1 is the decoder byte and byte 2 to 10 are the data which is encrypted with low 4 bits and high 4 bit interchanged so it has to be decoded. With your device it may be the same or a different encryption so the python code will tell you how it is encrypted.

 

void read_data()
{
 if (is_active == true)  //don't try to read it if it didn't open or you'll be sorry since it throws a GPF.
 {
  tabledata = 0;
  for (int tl = 0; tl < 5; tl++) //do increments of 4 reads. to get a average over ~60 milliseconds.
  {
   memset(buf, 0, 10);
   // Read requested state. hid_read() has been set to be
   // non-blocking by the call to hid_set_nonblocking()  don't have to do this with vstroker.
   // This loop demonstrates the non-blocking nature of hid_read().
   res = 0;
   while (res == 0) {
    res = hid_read(handle, buf, sizeof(buf));
   }
   if (res < 0)
    devstatus = false;
   for (i = 0; i < 3; i++)
   {
    a = (((buf[(i * 2) + 1] & 0xf) << 4) | (buf[(i * 2) + 1] >> 4)) ^ buf[0];
    b = (((buf[(i * 2) + 2] & 0xf) << 4) | (buf[(i * 2) + 2] >> 4)) ^ buf[0];
    c = a | b << 8;
    if (c > 0x8000)     //test it for sign could also (if c^0x8000 == 1 which saves 10 clock cycles)
     c = c - 0x10000;  //force it to signed integer.
    data[i] = c;
   }
   int x1 = (int)data[0];
   int y1 = (int)data[1];
   int z1 = (int)data[2];
   // int uk1 = (int)data[3];
   Sleep(17);       // Delay for next read.
   memset(buf, 0, 10);
   // Read requested state. hid_read() has been set to be
  
   res = 0;
   while (res == 0) {
    res = hid_read(handle, buf, sizeof(buf));
   }
   if (res < 0)
    devstatus = false;
   for (i = 0; i < 3; i++)
   {
    a = (((buf[(i * 2) + 1] & 0xf) << 4) | (buf[(i * 2) + 1] >> 4)) ^ buf[0];
    b = (((buf[(i * 2) + 2] & 0xf) << 4) | (buf[(i * 2) + 2] >> 4)) ^ buf[0];
    c = a | b << 8;
    if (c > 0x8000)
     c = c - 0x10000;
    data[i] = c;
   }
   int x2 = (int)data[0];
   int y2 = (int)data[1];
   int z2 = (int)data[2];
​
//this is bad and needs to be re-worked since squaring any number removes the minus sign!
​//finding the distance difference between x1,y1,z1 and x2,y2,z2 again not correct. The data is a MATRIX.
​// returned values is average multiplied by 1/time to prevent divide by zero error. NEVER use division always use 
// the reciprocal of the function to multiply!\

   float totaldevation = (float)(sqrt(((x1 - x2)*(x1 - x2)) + ((y1 - y2)*(y1 - y2)) + ((z1 - z2)*(z1 - z2))));
   tabledata = tabledata + totaldevation;
  }

​//save this data for reading back to pyprus

  tabledata = (tabledata / 4);
  devstatus = true;
 }

}

 

//isolated from Papyrus.

float i_UTick(StaticFunctionTag * base)
{
 read_data();
 if (devstatus == false)
  return 0.0;     //some error so we return 0.0 saying there was and error which informs the caller to stop polling.
 else
  return tabledata;
}

in Papyrus registration of classes add in the routines you want to call.

bool _registerAnimationFunctions(VMClassRegistry * registry)
{
 const char * className = "AnimSpeedHelper";
 UInt32 fl = 0;
<snip existing code for clarity>
 {
  const char * methodName = "IVS";
  registry->RegisterFunction(new NativeFunction0<StaticFunctionTag, void>(methodName, className, i_IVS, registry));
  registry->SetFunctionFlags(className, methodName, fl);
 }

 { //not shown
  const char * methodName = "DVS";
  registry->RegisterFunction(new NativeFunction0<StaticFunctionTag, void>(methodName, className, i_DVS, registry));
  registry->SetFunctionFlags(className, methodName, fl);
 }
 {
  const char * methodName = "UTick";
  registry->RegisterFunction(new NativeFunction0<StaticFunctionTag, float>(methodName, className, i_UTick, registry));
  registry->SetFunctionFlags(className, methodName, fl);
 }
 {//not shown.
  const char * methodName = "GetHidState";
  registry->RegisterFunction(new NativeFunction0<StaticFunctionTag, UInt32>(methodName, className, i_GetHidState, registry));
  registry->SetFunctionFlags(className, methodName, fl);
 }
  return true;
}

// couple other functions I added but have not used yet

 

To get it to work you need to take the interface helper script and compile it with papyrus (in this case animationspeedhelper.psc)

 

; Init the vstroker for use.
function IVS() global native
; Close the vstroker
function DVS() global native
​;reads the tabledata.
float function UTick() global native

 

That is literally all that needs done to get a file read/write access.

Link to comment

I'm not familiar with HID but it sounds from a quick google like it only with with devices if they were designed to interface with it, so I'm not sure Lovense devices will work with it. They're normally controlled through a smart phone using the Lovense Wearables app. The phone pairs with the devices over Bluetooth and the app sends commands over a serial port.

 

Based on the python API this is the simplest way to query the device type and issue a command to vibrate at max power for 5 seconds:

import serial
port = serial.Serial("/dev/tty.LVS-Z001-SPPDev")
command = "DeviceType;"
port.write(command)
response = ""
while True:
	ch = port.read()
	if not ch:
		continue
	response += ch
	if ch == ';':
		break
print("Device Type: {}".format(response))

level = "255"
command = "Vibrate:%s;" % (level)
port.write(command)
print("Maximum power!")

import time
time.sleep(5)

level = "0"
command = "Vibrate:%s;" % (level)
port.write(command)
print("Turned it back off")

Bluetooth LE devices will likely take similar commands but calling them will require using serial port emulation if the devs of the python API are correct.

Link to comment

I'm not familiar with HID but it sounds from a quick google like it only with with devices if they were designed to interface with it, so I'm not sure Lovense devices will work with it. They're normally controlled through a smart phone using the Lovense Wearables app. The phone pairs with the devices over Bluetooth and the app sends commands over a serial port.

 

Based on the python API this is the simplest way to query the device type and issue a command to vibrate at max power for 5 seconds:

import serial
port = serial.Serial("/dev/tty.LVS-Z001-SPPDev")
command = "DeviceType;"
port.write(command)
response = ""
while True:
	ch = port.read()
	if not ch:
		continue
	response += ch
	if ch == ';':
		break
print("Device Type: {}".format(response))

level = "255"
command = "Vibrate:%s;" % (level)
port.write(command)
print("Maximum power!")

import time
time.sleep(5)

level = "0"
command = "Vibrate:%s;" % (level)
port.write(command)
print("Turned it back off")

Bluetooth LE devices will likely take similar commands but calling them will require using serial port emulation if the devs of the python API are correct.

 

Can be added to skse with c++ with out to much effort.  it's just another device as far as C++ coding is concerned. Can even vary the speed of vibration with the keyboard controls which control the animation speed already. Of course this is kind of reversed order but highly doable.

 

Also client server types where vstroker controls the vibe interfaced with camera was early concept but someone beat me to it.

Link to comment
  • 3 weeks later...

New fix is up today which helps the speed function better.

 

I have been busy with another project which is a test of the COM port plugin for vibrators and such but waiting on feedback so this project will eventually include other toys once I get the information. /hint

 

Link to comment
  • 2 weeks later...

Another update to help speed and make the animation stop and start form hot keys.

 

MCM has a new hotkey to start and stop the vStroker in or out of animation. The default setting is off so you need to assign a key to turn it on. The keyboard works if the vStroker is off and also can be used with the vStroker.

 

The new script has taken the sensitivity and using it for update. This means a setting of 1 is updating 100 times a second and a setting of 100 is updating 1 time a second. The transition can be now set up to 2000 or 2 seconds.

 

The best performance is up to you but a rule of thumb is to get faster animations with slower movement use a low setting for the sensitivity and a high setting for transitions so the update is constantly pushing the speed higher. example: sensitivity 1 and transition 2000 will probably give you 10 time the speed.

 

Setting sensitivity a 50 and transition at 100 is a good starting point and I forgot to do this so the setting is low and the transition is high.

Link to comment

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

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