Ren'Py Plugin For Remote
Ren'Py is a visual novel engine that allows you to create interactive stories. This plugin enables you to use Lovense toys in your Ren'Py games through the Lovense Remote App.
Quick Links:
📥 Download Plugin
🎮 Download Demo Project
📖 View Integration Example
Plugin Overview
The Lovense Ren'Py plugin provides a simple Python interface for interacting with Lovense toys through the Game Mode API. The plugin is designed to be easily integrated into visual novels, interactive games, and custom scripts.
Supported Features
- Connection to Lovense Remote App Game Mode
- Retrieving connected toy information
- Sending vibration commands
- Sending preset patterns
- Creating custom vibration patterns
- Support for advanced pattern control for Solace Pro
Demo Project
We provide a complete demo project that shows how to integrate and use the Lovense Ren'Py plugin in a real game environment. The demo includes:
- Ready-to-run Ren'Py project with Lovense integration
- Sample settings screen for connection setup
- Example scenes demonstrating different toy control methods
- Code comments explaining key implementation details
Download and Run the Demo
- Download the demo project package
- Extract all files to a folder
- Run the
renpy_demo.exe
(Windows) or open the project in Ren'Py launcher - Follow the in-game instructions to connect to Lovense Remote App
Installation Guide
Download the Plugin
First, download the Lovense Ren'Py Plugin package containing all necessary files:
Download Lovense Ren'Py Plugin
Integrate into Your Project
Extract the Plugin Files
- Copy the
lovenseplugin
folder to your game directory (at the same level asscript.rpy
) - The plugin contains the following files:
LovenseRemoteSDK.py
: Main SDK wrapperLvsConstant.py
: Domain URL storageToys.py
: Get connected toy informationFunctions.py
: Send vibration/action commandsPattern.py
: Send custom or preset patternsPatternV2.py
: Advanced pattern control (Solace Pro only)StopFunction.py
: Stop current toy actionsPositionCommand.py
: Send positioning commands (Solace Pro only)
- Copy the
Import the Plugin in Your Project
init python: import sys import os sys.path.append(config.gamedir + "/lovenseplugin") import LovenseRemoteSDK
Setting Up Connection
Add the following global variables and settings screen to your Ren'Py project:
Add Global Variables
default lovense_ip_address = "192.168.1.1" # Can be modified by player in-game default lovense_https_port = "30010" # Default port default lovense_connected_domain = None # Store the connection domain default lovense_toys = [] # Store connected toys list
Create Connection Functions
init python: def connect_and_notify(): domain, msg = LovenseRemoteSDK.ConvertIpToDomain(lovense_ip_address, lovense_https_port) store.lovense_message = msg store.lovense_connected_domain = domain if domain: refresh_toy_list() return def refresh_toy_list(): if not lovense_connected_domain: renpy.notify("Please connect first") return try: data = LovenseRemoteSDK.GetToys(lovense_connected_domain) toys_str = data["data"]["toys"] toys_dict = json.loads(toys_str) lovense_toys.clear() for toy_id, toy_info in toys_dict.items(): toy_info["id"] = toy_id lovense_toys.append(toy_info) return except Exception as e: renpy.notify(f"Failed to get toys: {str(e)}") return
Add Settings Screen
Add a Lovense settings screen in your screens.rpy for players to input connection information and test the connection. Refer to the
lovense_settings
screen in the example code for implementation.
Basic Usage
1. Connect to Lovense Remote
Players need to connect to the Lovense Remote App in settings first:
- Open the Lovense Remote App
- Enter Game Mode
- Enter the IP address and port in the game
- Click the connect button
2. Get Connected Toys
Use the GetToys
function to retrieve a list of connected toys:
def test_get_toys():
try:
toys_data = LovenseRemoteSDK.GetToys(lovense_connected_domain)
renpy.notify(f"GetToys success: {toys_data}")
except Exception as e:
renpy.notify(f"GetToys error: {str(e)}")
3. Send Vibration Commands
Send vibration commands to all toys:
def vibrate_all_toys(strength=10, seconds=5):
try:
LovenseRemoteSDK.SendFunctions("", f"Vibrate:{strength}", seconds)
renpy.notify("Vibration command sent successfully")
except Exception as e:
renpy.notify(f"Vibration error: {str(e)}")
Send commands to a specific toy:
def vibrate_toy(toy_id, strength=10, seconds=5):
try:
LovenseRemoteSDK.SendFunctions(toy_id, f"Vibrate:{strength}", seconds)
renpy.notify(f"Vibration command for toy {toy_id} sent successfully")
except Exception as e:
renpy.notify(f"Vibration error: {str(e)}")
4. Send Preset Patterns
def send_preset(pattern_name, seconds=5):
"""
Send a preset pattern
pattern_name can be: pulse, wave, fireworks, earthquake
"""
try:
LovenseRemoteSDK.SendPresetPattern("", pattern_name, seconds)
renpy.notify(f"Preset pattern `{pattern_name}` sent successfully")
except Exception as e:
renpy.notify(f"Preset pattern error: {str(e)}")
5. Send Custom Patterns
def send_custom_pattern():
try:
# V:1;F:v;S:1000# format:
# V:1 - Vibrate 1 time
# F:v - Vibration function
# S:1000 - Duration 1000ms
# # - Terminator
commands = "V:1;F:v;S:1000#"
# Strength values (0-20), separated by semicolons
strengthValues = "20;20;5;20;10"
LovenseRemoteSDK.SendPattern("", commands, strengthValues, 5)
renpy.notify("Custom pattern sent successfully")
except Exception as e:
renpy.notify(f"Custom pattern error: {str(e)}")
6. Stop Toy Actions
def stop_all_toys():
try:
LovenseRemoteSDK.SendStopFunction("")
renpy.notify("Stop command sent successfully")
except Exception as e:
renpy.notify(f"Stop command error: {str(e)}")
Advanced Usage (PatternV2 - Solace Pro)
For Solace Pro toys, you can use the more advanced PatternV2 API:
1. Set Up PatternV2 Sequence
def setup_patternv2():
try:
actions = [
{"ts": 0, "pos": 41},
{"ts": 400, "pos": 92},
{"ts": 800, "pos": 14},
{"ts": 1200, "pos": 30},
# More action points...
]
LovenseRemoteSDK.SendPatternV2Setup(actions)
renpy.notify("PatternV2 setup successful")
except Exception as e:
renpy.notify(f"PatternV2 setup error: {str(e)}")
2. Play PatternV2 Sequence
def play_patternv2():
try:
LovenseRemoteSDK.SendPatternV2Play("", 0, 0)
renpy.notify("PatternV2 started playing")
except Exception as e:
renpy.notify(f"PatternV2 play error: {str(e)}")
3. Get PatternV2 Sync Time
def get_patternv2_synctime():
try:
data = LovenseRemoteSDK.GetPatternV2SyncTime()
renpy.notify(f"PatternV2 sync time: {data} seconds")
except Exception as e:
renpy.notify(f"PatternV2 sync time error: {str(e)}")
4. Stop PatternV2 Sequence
def stop_patternv2():
try:
LovenseRemoteSDK.StopPatternV2("")
renpy.notify("PatternV2 stopped successfully")
except Exception as e:
renpy.notify(f"PatternV2 stop error: {str(e)}")
Game Scene Integration Example
Here's an example of how to integrate Lovense control into a game scene:
label love_scene:
"Character A approaches Character B and begins caressing gently..."
# Send light vibration
$ LovenseRemoteSDK.SendFunctions("", "Vibrate:3", 5)
"Character A's movements gradually become more intense..."
# Send stronger vibration
$ LovenseRemoteSDK.SendFunctions("", "Vibrate:10", 8)
"Character A's actions turn into rhythmic movements..."
# Send wave pattern
$ LovenseRemoteSDK.SendPresetPattern("", "wave", 10)
"The story reaches its climax..."
# Send stronger pattern
$ LovenseRemoteSDK.SendPresetPattern("", "earthquake", 15)
"The characters calm down..."
# Stop all actions
$ LovenseRemoteSDK.SendStopFunction("")
"End scene"
return
Want to see this in action? Check out our complete Demo Project with working examples!