GithubHelp home page GithubHelp logo

renpy_rpc's Introduction

Ren'Py RPC

pypresence

Download python.zip

Discord server, ℱŮℱṦøℬ#1337

Instructions:

  1. Put discord.py, setupRPC.rpy and python.zip in your game folder.
  2. Edit your splash.rpy [all labels are currently exist, you just need to add code] (code's below)
  3. Create your own Rich Presence application on Discord API page, Video Guide (till 0:58)
  4. Edit discord.py for your own, using your application id; adding assets and text you wanted.
  5. Add $ state = "something" everywhere you wanted status to change.
  6. Just run your game. First of all - it'll unzip python.zip and delete it after that. Then it will rewrite status to "Loading" and run discord.py. After you've tested that, you can public your project with rpc (including all 3 .py, .rpy(c) and .zip files).
splash.rpy
label after_load:
  # ...
  if discordrun:
      python:
          try:
              import io
              import os
              io.open("game/state.txt", 'w+', encoding = "utf-8").write(state)
          except:
              import io
              open("game/state.txt", 'w+')
              io.open("game/state.txt", 'w+', encoding = "utf-8").write("err3")
              state = "err3"
  # ...
  return

label before_main_menu:
  # ...
  if discordrun:
      python:
          import io
          state = "mm"
          io.open("game/state.txt", 'w+', encoding = "utf-8").write(state)
  # ...
  return

label quit:
  # ...
  if discordrun:
      python:
          import os
          os.popen('taskkill /f /im python.exe')
  # ...
  return

Examples:

Doki Doki Literature Club

As first big example I've chosen DDLC, 'cause it's my first VN (in particular - Ren'Py) game.

Edited files: script.rpy, screens.rpy, splash.rpy, script-ch*.rpy, script-exclusives*.rpy, script-poemresponses.rpy Added files: discord.py, setupRPC.rpy

To check how it works you just need to add all these files in DDLC "game" folder.

Known bugs:

  1. Incorrect text in "small image" when you have to choose in game.
Screenshots

Profile vision, small image text

Profile vision, large image text

Small vision

Small vision, large image text

renpy_rpc's People

Contributors

fufsob avatar

Stargazers

MO_DEV avatar Nikita Gordeev avatar Evax The Fox avatar Jared Holston avatar Albert Tavares de Almeida avatar Carslo_45 avatar CoreBear avatar Takehiro Ogura avatar  avatar JM Fergeau avatar

Watchers

CoreBear avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.