Ren'Geon - D&D 5e Stat Roller and Character Creator

A place for Ren'Py tutorials and reusable Ren'Py code.
Forum rules
Do not post questions here!

This forum is for example code you want to show other people. Ren'Py questions should be asked in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
User avatar
Morhighan
Miko-Class Veteran
Posts: 973
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Ren'Geon - D&D 5e Stat Roller and Character Creator

#1 Post by Morhighan » Sat Apr 01, 2017 2:40 am

Image
Current update: 1.20200202

I've decided to share the code I worked on for a D&D style Stat Roller/Character creator. It's still in progress so I'll be adding to it from time to time.

I'm going to be attempting to maintain this project an release updates on here as well as my itch.io, where you can download it.

This project includes files for a D&D style Stat Roller/Character creator made in Ren'Py. You can use this as a tool for a campaign or in your own Ren'Py project.

This is still very much a WIP but I'm hoping to add stuff here and there to improve it as I am able to.

Please note that I am using the Systems Reference Document for 5e as a reference and will be going by the open game license standards to avoid any legal troubles. I recommend you do the same should you use this in a project of your own.

If you like what I'm doing, please consider giving me a one-time tip via the MysteryCorgi Token of Appreciation so I can continue to work on projects like these. Or you can support me on Ko-fi as well.

Credits:
Page Background/Icon Background - Parrallax Forest Background by Digital Moons
Lucy Sprite - Karamelow
Code stuffs - MysteryCorgi
Attachments
script.rpy
The script file I'm using. Make sure to add the code for options.rpy!
(5.5 KiB) Downloaded 238 times
Last edited by Morhighan on Wed Oct 28, 2020 6:52 am, edited 3 times in total.

User avatar
Scribbles
Miko-Class Veteran
Posts: 636
Joined: Wed Sep 21, 2016 4:15 pm
Completed: Pinewood Island, As We Know It
Projects: In Blood
Organization: Jaime Scribbles Games
Deviantart: breakfastdoodles
itch: scribbles
Location: Ohio
Contact:

Re: D&D 5e Stat Roller and Character Creator (1.20170331)

#2 Post by Scribbles » Sat Apr 01, 2017 11:05 am

I was building one myself, but yours looks way more efficient! lol I might be playing around with this in my free time ^^
Image - Image -Image

User avatar
Morhighan
Miko-Class Veteran
Posts: 973
Joined: Sun Jun 27, 2010 12:54 pm
Completed: AIdol, When Our Journey Ends, Forgotten Not Lost
Organization: MysteryCorgi
Tumblr: MysteryCorgi
Deviantart: MysteryCorgi
Soundcloud: MysteryCorgi
itch: MysteryCorgi
Location: USA
Contact:

Re: Ren'Geon - D&D 5e Stat Roller and Character Creator

#3 Post by Morhighan » Wed Oct 28, 2020 6:47 am

Version: 1.20170331

Put this into your option.rpy file:

Code: Select all

init python:
    def roll_stats():
        a = renpy.random.randint(1, 6)
        b = renpy.random.randint(1, 6) 
        c = renpy.random.randint(1, 6)
        d = renpy.random.randint(1, 6)
        list = [a, b, c, d]
        list.sort()
        add = sum(list[1:4])
        return add

default strength = 0
default dexterity = 0
default constitution = 0
default charisma = 0
default intelligence = 0
default wisdom = 0
default speed = 0
default darkvision = 0
To roll your initial stats in the script.rpy file:

Code: Select all

    $ strength = roll_stats()
    $ dexterity = roll_stats()
    $ constitution = roll_stats()
    $ charisma = roll_stats()
    $ intelligence = roll_stats()
    $ wisdom = roll_stats()

    "Your Strength is [strength]. Your Dexterity is [dexterity]. Your Constitution is [constitution]. Your Charisma is [charisma]. Your Intelligence is [intelligence]. Your Wisdom is [wisdom]."
To choose a race from the core races in the script.rpy file:

Code: Select all

    menu: 
        dm "Now let's pick a race."
        "Dragonborn":
            $ race = "Dragonborn"
            $ language_common = True
            $ language_draconic = True
            $ strength += 2
            $ charisma += 1
            $ speed += 30
            "You chose Dragonborn! You speak Common and Draconic languages. Your strength has increased by two to become [strength]. Meanwhile your Charisma has increased by one, becoming [charisma]. Your speed is [speed]."
            jump class_select
        "Dwarf":
            $ race = "Dwarf"
            $ language_common = True
            $ language_dwarvish = True
            $ constitution += 2
            $ speed += 25
            $ darkvision += 60
            "You chose Dwarf! You speak Common and Dwarvish languages. Your Constitution has increased by two to become [constitution]. Your speed is [speed]. You have Dark Vision up to [darkvision] feet."
            jump class_select
        "Elf":
            $ race = "Elf"
            $ language_common = True
            $ language_elvish = True
            $ dexterity += 2
            $ speed += 30
            $ darkvision += 60
            "You chose Elf! You speak Common and Elvish languages. Your Dexterity has increased by two to become [dexterity]. Your speed is [speed]. You have Dark Vision up to [darkvision] feet."
            jump class_select
        "Gnome":
            $ race = "Gnome"
            $ language_common = True
            $ language_gnomish = True
            $ intelligence += 2
            $ speed += 25
            $ darkvision += 60
            "You chose Elf! You speak Common and Gnomish languages. Your Intelligence has increased by two to become [intelligence]. Your speed is [speed]. You have Dark Vision up to [darkvision] feet."
            jump class_select
        "Half-Elf":
            $ race = "Half-Elf"
            $ language_common = True
            $ language_elvish = True
            $ charisma += 2
            $ speed += 30
            $ darkvision += 60
            "You chose Half-Elf! You speak Common and Elvish languages. Your Charisma has increased by two to become [charisma]. Your speed is [speed]. You have Dark Vision up to [darkvision] feet."
            jump class_select
        "Half-Orc":
            $ race = "Half-Orc"
            $ language_common = True
            $ language_orc = True
            $ strength += 2
            $ constitution += 1
            $ speed += 30
            $ darkvision += 60
            "You chose Half-Orc! You speak Common and Orc languages. Your Strength has increased by two to become [strength]. Meanwhile your Constitution has increased by one to become [constitution]. Your speed is [speed]. You have Dark Vision up to [darkvision] feet."
            jump class_select
        "Halfling":
            $ race = "Halfling"
            $ language_common = True
            $ language_halfling = True
            $ charisma += 2
            $ speed += 25
            "You chose Halfling! You speak Common and Halfling languages. Your Charisma has increased by two to become [charisma]. Your speed is [speed]."
            jump class_select
        "Human":
            $ race = "Human"
            $ language_common = True
            $ strength += 1
            $ dexterity += 1
            $ constitution += 1
            $ charisma += 1
            $ intelligence += 1
            $ wisdom += 1
            $ speed += 30
            "You chose Human! You speak Common language. Each of your ability scores has increased by 1. Your Strength is now [strength]. Your Dexterity is now [dexterity]. Your Constitution is now [constitution]. Your Charisma is now [charisma]. Your Intelligence is now [intelligence]. Your Wisdom is now [wisdom]. Your speed is now [speed]."
            jump class_select
        "Tiefling":
            $ race = "Tiefling"
            $ language_common = True
            $ language_infernal = True
            $ charisma += 2
            $ intelligence += 1
            $ speed += 30
            $ darkvision += 60
            "You chose Tiefling! You speak Common and Infernal languages. Your Charisma has incrased by two to become [charisma]. Meanwhile your Intelligence has increased by one to become [intelligence]. Your speed is [speed]. You have Dark Vision up to [darkvision] feet."

I'll hopefully be adding more to the character race creation, like the ability to pick an additional language for Humans and other things like that.
I'm also going to work on the class selection soon.

It's simple and not perfect, but it was quite fun to work on this as an exercise for the last couple of days. :D
I hope you enjoy!

Post Reply

Who is online

Users browsing this forum: No registered users