DeveloperDeveloper
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
  • AI
Forum
Projects Library
Dev Discord
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
  • AI
Forum
Projects Library
Dev Discord
  • Game Engine Plugin
  • Unity Universal Plugin For Remote
  • Unity Plugin - Android SDK
  • Unity Plugin - iOS SDK
  • Unity Plugin - Windows
  • Unity Plugin - Dongle
  • Unity Plugin - Mac
  • Unreal Plugin For Remote
  • Windows BLE DLL (C/C++/C#)
  • Ren'Py Plugin For Remote

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 offers a straightforward Python interface for connecting with Lovense toys via the Remote App - Game Mode feature. It’s built on the Standard API, where you can find more details and the full list of toy commands.

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

  1. Download the demo project package
  2. Extract all files to a folder
  3. Run the renpy_demo.exe (Windows) or open the project in Ren'Py launcher
  4. Follow the in-game instructions to connect to Lovense Remote App

Download Demo Project

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

  1. Extract the Plugin Files

    • Copy the lovenseplugin folder to your game directory (at the same level as script.rpy)
    • The plugin contains the following files:
      • LovenseRemoteSDK.py: Main SDK wrapper
      • LvsConstant.py: Domain URL storage
      • Toys.py: Get connected toy information
      • Functions.py: Send vibration/action commands
      • Pattern.py: Send custom or preset patterns
      • PatternV2.py: Advanced pattern control (Solace Pro only)
      • StopFunction.py: Stop current toy actions
      • PositionCommand.py: Send positioning commands (Solace Pro only)
  2. 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. In the demo project, all connection setting panels are located in game/screens.rpy.

  1. Add Global Variables

    default lovense_ip_address = "192.168.31.65" // game mode ip address
    default lovense_port = "20010" // game mode port
    default lovense_use_https = False // game mode use https or http as default
    default lovense_connected_domain = None // use for display connected domain
    default lovense_toys = [] // use for display toys from lovense
    default lovense_message = "" // use for display message from lovense              # Store connected toys list
    
  2. Create Connection Functions

    init python:
         def connect_and_notify():
             domain, msg = LovenseRemoteSDK.ConvertIpToDomain(lovense_ip_address, lovense_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
    
  3. Add Settings Screen

    Add a Lovense settings screen to your screens.rpy so players can enter connection details and test the connection. For an example implementation, see the lovense_settings() screen in the Demo Project game/screens.rpy.

    Lovense Setting

Basic Usage

1. Connect to Lovense Remote

Players need to connect to the Lovense Remote App in settings first:

  1. Open the Lovense Remote App
  2. Enter Game Mode
  3. Enter the IP address and port in the game
  4. Click the connect button

Lovense Remote Game Mode

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!

Last Updated:
Prev
Windows BLE DLL (C/C++/C#)
Explore our Forum or Support to get more inspiration or solve your problems.
Discord Channel
It is an online real-time channel where you can communicate directly with our official administrators or many excellent developers.
Forum
It is a place for Lovense developers to communicate, where you can find solutions to problems or get inspired for your projects.
Support
Find documents and tutorials that may be helpful to you.