(archive) old 0.1 Itch page


This is an easy-to use pattern rumble plugin for RPG Maker MV.

The plugin works both in standalone games and web deployments.
It works with the stock version of NW.js and instead uses Intiface to connect to Xbox 360 style gamepads (Windows only) as well as a wide variety of vibrating sex toys (cross-platform).

Read https://buttplug-developer-guide.docs.buttplug.io/intro/buttplug-ethics.html before starting and always respect the player's maximum intensity settings.

The https://desktop.intiface.com/desktop/ server must be running on port 12345 to connect. When running in the browser, connections to localhost must be allowed.
Error messages are printed into debug/browser console (F12) but should be silent otherwise.

The minified/binary files in the archive are verbatim from buttplug - npm (npmjs.com) (version 1.0.17), from the dist/web/ folder, and you can replace them with fresh copies if necessary.
Generally speaking, you only need to extract the archive into your game folder though.

A note on compatibility:

I had to add delete process.versions.node; for this to work, as https://github.com/rust-random/getrandom doesn't work correctly in NW.js without the Node Crypto module otherwise. (This removes the package versions table entry for Node.js at runtime, to make getrandom not detect it and use the browser API instead.)

If this plugin causes issues with others, it's most likely because of that.

Tested with RPG Maker MV Version 1.6.2.

Parameters:

nameForIntiface:
    The application name to show in the intiface server GUI.
    (Defaults to game title.)

stopOnTitle:
stopOnGameover:
    automatically stop all activity when reaching certain screens.
    stopOnTitle defaults to `true`.

Plugin Command:

     PlugPlug connect
         # Connect to all available devices (and pulse each briefly to confirm).

     PlugPlug disconnect
         # Stop all devices and disconnect from Intiface.

     PlugPlug config vibe strength <multiplier>
         # Set global vibe strength multiplier. 0.0 - 1.0. Default: 1.0

     PlugPlug config vibe duration <multiplier>
         # Set global vibe duration multiplier: 0.0 - infinity. Default: 1.0

     PlugPlug config vibe pause <multiplier>
         # Set global vibe pause duration multiplier: 0.0 - infinity. Default: 1.0

Configuration works offline but is not saved automatically across game restarts.
It and the device connections should persist across game-overs though.

     PlugPlug vibe pulse <on-duration> <pattern>
         # Vibrate once.

     PlugPlug vibe start <on-duration> <off-duration> <pattern>
         # Set a vibration pattern to repeat until told otherwise.

     PlugPlug vibe stop
         # Stop vibration.

     PlugPlug stop
         # Stop all motion.

* There is currently no difference between `PlugPlug vibe stop` and `PlugPlug stop`, but this may change with updates (if I get my hands on test hardware).

Vibration commands are applied only to currently connected devices.

About Parameters:

     <multiplier>
         # A decimal number, scalar and unit-less.

     <on-duration>
         # The playback duration of the pattern, in seconds.

     <off-duration>
         # The pause between patterns.

     <pattern>
         # A pattern definition.

There are two possible types of patterns:

- Constant strength (decimal numbers from 0 to 1), for example 0.9
- More complex patterns defined using the letters A through Z (case-insensitive) as well as the . character. 'A' will use the lowest possible non-zero intensity, 'Z' will use the maximum intensity (1.0) and '.' turns off vibration.

A single pattern is applied to all vibration features at once.
If you pass multiple patterns, they are assigned in order to the first features, as available, and run in parallel.

Examples:

     PlugPlug vibe start 0.5
         # Constant half intensity.

     PlugPlug vibe pulse 1 0.8 0
         # 1-second pulse with constant 80% intensity,
         # but using the first motor only.

     PlugPlug vibe start 2.5 0 ZZZ...ZZ....ZZZ...
         # Strong pulsed vibration.

     PlugPlug vibe start 5 0 Vbvbvbvbvb..
         # Alternating strong and weak vibration, with a pause at the end.

     PlugPlug vibe pulse 10 mm...mm
         # Slow medium strength vibration, with a pause.

     PlugPlug vibe start 1 2 rrrrrrrr
         # Relatively strong vibration,
         # but it is not recommended to unnecessarily repeat the pattern.

     PlugPlug vibe start 3.0 0 X.X.X.X.X. Y.Y.Y.Y.
         # Two patterns in parallel, with mismatched timings.
         # (The total duration will be the same.)

     PlugPlug vibe pulse 0.5 0 0 abfjmpsvyz
         # A curved ramp pattern,
         # but only on the third vibration feature,
         # and only if such a feature is available at all.

The durations likely won't be entirely accurate and timings may drift a bit, as I tried to make sure the game keeps running no matter what.

JS API:

     All commands are available through the global `PlugPlug` object.
     Just concatenate the command identifiers and pass all parameters in parentheses.

For example:

     `PlugPlug.config.vibe.strength(0.8);`
         # Set global vibe strength multiplier.

     `PlugPlug.connect();`
         # Connect to all devices.

     `PlugPlug.vibe.start(3, 2, 0.2, 'Vb.vb.vb.vb.vb.');`
         # Play back the patterns 0.2 and `Vb.vb.vb.vb.vb.`
         # on the first two motors stretched over three seconds,
         # then pause for two seconds. Repeat indefinitely.

Device control commands return `true` if they found a matching device.
This means you can use the `stop` commands to probe for device connections, and fall back to alternative action when using the JS API. If `PlugPlug` isn't ready yet, you will instead see `undefined` returned from those functions.

What about RPG Maker MZ?

I don't have MZ, so I can't test this plug₂in there. I strongly advise against using robot control software like this in a way that hasn't been thoroughly tested for (reasonable standards of) safety.

What about (e-stim, linear, rotation…)?

While it would be easy to add additional commands for those interactions, as they are already supported by Intiface, I don't have any test devices for those features.

I'm not comfortable with releasing software that controls mechanical actuators without testing it thoroughly.

How to make a configuration menu?

A configuration menu text listing and hopefully working command list data are available in the Plug2inMenu.… files.

Ideally, use RPG Maker MV Tools - Database ConVerter MV to import the .csv file into your game. You'll have to renamed it to replace the exported common event file first.

Get Plug₂in for RPG Maker MV and MZ

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.