Jump to content

Recommended Posts

I did some thinking about this one not so long ago, and it really wouldn't be too hard to hookup to Buttplug (And for that matter to considerably improve the way this functions)....

 

A brief overview:

 

The papyrus scripting would require very few changes. All it really does is to call the User log function containing a string defining the vibration parameters (strength, sine etc.)

This logfile is then read by the Java app, which generates our vibrations to suit.

 

In order to hookup to Buttplug, the easiest / most stable method would be a SKSE plugin. I'm not familiar with the Buttplug interfaces / really low-level Windows interop (C# guy), but I'm assuming it's only really a case of calling the appropriate void within Buttplug itself with details of the vibe we want....

 

 

Are there any docs anywhere on how to call a Buttplug server from C++?

I'd *suspect* this can probably be done in under 200 lines of C++ code & altering the Papyrus scripting to call the SKSE plugin instead.

 

Flaws:

The Java app currently handles selection of vibration types. This would need to be re-implemented into the MCM.

I've got no idea how communication back from a SKSE plugin would work; Selection of the appropriate device to vibrate may be 'interesting' to say the least, and would probably require selection on the Buttplug side, not the Skyrim side.

I've probably completely underestimated this :P

 

Link to comment

Selection on the Buttplug side isn't a huge problem, we already have to do that with our Game Vibration Router software. Check out our GVR tutorial, gives you a basic idea of how we handle that there.

 

 

The C++ thing is slightly more of an issue. Mostly just 'cause we have like, a half done C library, but have mostly been concentrating on C# ('cause we have to hit UWP APIs for bluetooth, and makes it easier for Unity) and JS (for our web stuff). We need C++ for Unreal support anyways, just haven't started it yet.

 

BTW, we've got a discord at https://discord.buttplug.io if you want to yell at me about this in real time.

Link to comment

Nah, real-time isn't too helpful when I'm hitting the thing with a hammer :P

 

I've quite happily run up a SKSE plugin, which appears to work when called from Papyrus scripting, and for the minute have just set that to write it's own little logfile.

 

This means we've got a set of functions, one called for each vibration type, e.g. :

void StartConstantVibration(StaticFunctionTag *base, BSFixedString vibrationName, float strength);

void StartIntervalVibration(StaticFunctionTag *base, BSFixedString vibrationName, float strength, float interval, float onTime);

void StartSineVibration(StaticFunctionTag *base, BSFixedString vibrationName, float strength, float interval);

void StartSineVibration(StaticFunctionTag *base, BSFixedString vibrationName, float maxStrength, float minStrength, float interval);

void StartDownVibration(StaticFunctionTag *base, BSFixedString vibrationName, float strength, float interval);

void StartUpVibration(StaticFunctionTag *base, BSFixedString vibrationName, float strength, float interval);

void StopAllVibrations(StaticFunctionTag *base);

void StopVibration(StaticFunctionTag *base, BSFixedString vibrationName);

 

Reasonably simple, this works as follows:

vibrationName : Unique name for this vibration.

strength : Strength for the rumble, 0 - 100, or zero to this for a single parameter sine

maxStrength : Maximum strength for sine vibrations

minStrength : Minimum strength for sine vibrations

interval : Vibration repeats every N seconds, or the timer for sine

onTime : The active time for repetitive vibrations

 

The Java app in the OP seems to keep track internally somehow of conflicting vibrations (I'm *guessing* that the most recent vibration has priority until it ends), not the game internals.

 

The C++ plugin basics work OK, so the basic principle is sound. What we need to do now is get the data out of our C++ plugin, and into something Buttplug understands.

Keeping track of the current vibration etc. can probably be handled in our C++ code, so if I'm understanding the API correctly, we need to do something like the following:

* Register with the server, and retrieve the list of devices.

* Decide on the device to use.

* Send command to the sever. [We must keep track of what vibration is current internally?]

 

My first wonderings would be whether we can just build a second stub C# DLL & use that to interface with your C# code?

 

However, at the minute, I can't even get your main C# project to build mind. If I'm reading the error messages (and the crappy Microsoft documentation) correctly, there's no way to build this without Windows 10, as you're using some of the new UWP interfaces. That's a marginal problem, as the dev box has never gone above Windows 8.

Link to comment
  • 2 weeks later...

Yeah, I've been getting some complaints about UWP not compiling out of the box lately, most likely due to a missing SDK which I need to add to the compile instructions. We've got a bug to fix that at https://github.com/buttplugio/buttplug-csharp/issues/354

 

I just need to get around to bringing up a clean VM and checking it out to make sure what's up. Once that's done I'll let you know. It should definitely compile on Win 8 though, as I've compiled and used it on Win 7.

Link to comment
  • 3 weeks later...

Yes i needed to rewrite some of the code because i lost the latest source code. I got it working again with SSE and the new Java version(i used some outdated scripting which was not supported by java anymore). Well i haven't worked on it for a long time and just started to port to SSE but i think i can make a workable program and upload it here.

 

One question for the few persons using this script: what devices do you use? I mainly use a Arduino and i will add some better support for this in the new release

Link to comment
3 hours ago, Mr. private said:

Yes i needed to rewrite some of the code because i lost the latest source code. I got it working again with SSE and the new Java version(i used some outdated scripting which was not supported by java anymore). Well i haven't worked on it for a long time and just started to port to SSE but i think i can make a workable program and upload it here.

 

One question for the few persons using this script: what devices do you use? I mainly use a Arduino and i will add some better support for this in the new release

When I use this, i stick a PS4 controller in my lap. I is poor man.

Link to comment
7 hours ago, deviant51 said:

and like, how does that work with this vibrator mod?

It is explained in the very first post.  If you want a more extensive explanation then I suggest you search for all the references to Arduino in this thread using the forums Search feature.

Link to comment
11 hours ago, NightHawk10 said:

Really sorry if this has been asked before, but I'm having trouble finding the Papyrus logs file while using MO. 

SKSE comes with Papyrus, right? So I should have it already. I just don't know where the file would be, or what I am even looking for. 

The Papyrus logs are in the exact same place they would be if you weren't using MO.  MO does nothing whatsoever with the folder where papyrus logs are written.

 

As always you will find them in your DOCUMENTS folder, MY GAMES\SKYRIM\LOGS\SCRIPT subfolders

Link to comment
9 hours ago, WaxenFigure said:

As always you will find them in your DOCUMENTS folder, MY GAMES\SKYRIM\LOGS\SCRIPT subfolders

I see my problem, I'm missing the Logs folder. It doesn't seem to be created when I start it after I load a save, unless it's supposed to be created by some other mod. 

Link to comment
10 minutes ago, NightHawk10 said:

I see my problem, I'm missing the Logs folder. It doesn't seem to be created when I start it after I load a save, unless it's supposed to be created by some other mod. 

Yo have to enable Papyrus logging in your SKYRIM.INI file:

 

[Papyrus]  
bEnableLogging=1  

 

Link to comment

Thanks a lot, you've been a big help. 

But of course there's always one more problem. The controller vibrate file isn't being created in the user folder. Do I have to launch the program before I start Skyrim, to prevent Skyrim from crashing with the alt-tab? I've tried loading a save from the main menu, loading from main menu, then loading a different save, and still no dice. I also tried enabling Tracing. 

 

EDIT: I've also tried adding bEnableProfiling=1 to Skyrim.ini file like earlier in the thread suggested, but it didn't help either. 

 

EDIT#2: 

I needed to have MO install the NMM file, and enable the ESB in there. I'm so blind.

Link to comment

Thanks for the program I like.

Just got an error... last year it worked. Could that happen because of installing developing environments like eclipse, netbeans, unity, code blocks or anything that messed up my system? Or the latest java-version? I am not used to java and couldn't find out more about that error. This is the start with debug:

 

D:\Skyrim\Program>java -Xmx1024m -jar start.jar
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by j.pivate.main.start (rsrc:./) to field jav
a.lang.ClassLoader.usr_paths
WARNING: Please consider reporting this to the maintainers of j.pivate.main.star
t
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflect
ive access operations
WARNING: All illegal access operations will be denied in a future release
D:\Skyrim\Program\lib\\Native\win64
GLOBAL ERROR CATCHER:net/java/games/input/ControllerEnvironment

D:\Skyrim\Program>pause

Link to comment
  • 3 weeks later...
On 5/24/2018 at 10:47 PM, qdot said:

Creator of Buttplug here. Just lemme know if there's any interest in integration, happy to help out however I can.

I love to see your program content to this mod. I know few friends that been wanting have a way to have devious devices plug and sexlab animation to trigger her real life toys.

Link to comment
  • 3 weeks later...

So I did a fresh install of windows/steam/skyrim/NMM/SKSE and have run into an issue I haven't encountered before and haven't been able to solve.

Here is the debug:

Spoiler


D:\V3.0(stable)\Program>java -Xmx1024m -jar start.jar
D:\V3.0(stable)\Program\lib\\Native\win64
WARNING: Found unknown Windows version: Windows 10
Attempting to use default windows plug-in.
Loading: net.java.games.input.DirectAndRawInputEnvironmentPlugin
XboxController V1.06 (www.aplu.ch)
Current JVM: 64 bit
java.lang.RuntimeException: Can't load DLL xboxcontroller64
        at ch.aplu.jaw.NativeHandler.loadLib(NativeHandler.java:978)
        at ch.aplu.jaw.NativeHandler.<init>(NativeHandler.java:343)
        at ch.aplu.xboxcontroller.XboxController.init(XboxController.java:123)
        at ch.aplu.xboxcontroller.XboxController.<init>(XboxController.java:90)
        at j.pivate.main.vibrator.VibratorXbox.ConnectedControllers(VibratorXbox.java:61)
        at j.pivate.main.gui.GUIStartMenu.connectedVibrators(GUIStartMenu.java:184)
        at j.pivate.main.gui.GUIStartMenu.connectedVibrators(GUIStartMenu.java:162)
        at j.pivate.main.gui.GUIStartMenu.<init>(GUIStartMenu.java:211)
        at j.pivate.main.start$1.run(start.java:46)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)

D:\V3.0(stable)\Program>pause
Press any key to continue . . .

 

It can't load xboxcontroller64 DLL. I have place a copy of the native libraries to the C:/windows folder, but still won't load.

 

This is rather annoying as I don't even use a controller but an Arduino.

 

Any help in regards to this would be much appreciated.

Link to comment
  • 2 weeks later...

Given the possibility of an outside framework, would there be any interest in porting the Java application to C#? The languages are pretty similar and I suspect I could take a look at refactoring it so there was an opportunity for "native" hooks. If that's of interest I'm happy to dive in and see what I can do.

 

Alternatively, I'm also happy to help troubleshoot any of the Java issues if there's some source code I can play with. Feel free to message me if that's of interest. I have a fair amount of "native Java" experience so I might be able to help.

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