DnD Character Creation + Stat Point Distribution

DnD Character Creation and Stat Point Distribution v1.06 Option 1 / 1.02 Option 2
Created by Roninator2​

Introduction
Continuing to work on a script I made for a member, I took my hand at making an entire DnD character creation script.
Has the basics of DnD characters but if you know of what should be included that's not here then please ask.
I only included making the characters and assigning stats.
The rest of what makes a DnD game is up to you to do. Unless you can explain it in detail and It's a script I could make.

Features
- Too numerous to mention
- Please try the demo
- Two versions are now available
--- 1 is where all classes are planned and configured in the classes database
* Potential issue if you have something that will change the actor params. Making two actors of the same class will probably cause the params to change for both. but if you only do stat point distribution, then it's not a problem.
--- 2 is where every actor is a new class. This means that the classes.rvdata2 file is now located in a new folder. Please read instructions in script slot below materials.

How to Use
Download the demo and try it out
The current settings have two actors in the party, but their race is not assigned (demo 2). You have to assign a race to an actor before you can assign points to the stats. Of course you can just remove these two and configure the script to start the character creation when the new game starts. Up to you
Classes tab must be configured for each race and all classes each race can be. See both Demo's, but you might not be able to see any difference.

Not Included
Control over what the stats do. Only the text was changed
Stat changes by leveling up. You only gain points when reaching level markers

Images
Spoiler: Images
1701823464315.png

1701823489814.png

1701823533625.png

1701823702556.png

1701823767318.png

1701823802275.png

1705859931550.png

Download Project to get Script
Version 1
Version 2
1. Stat point distribution
2. Character creation
3. Additional races for character creation

Credit and Thanks
- Roninator2

Terms of use
Follow the original Authors terms of use where applicable
- When not made by me (Roninator2)
Free for all uses in RPG Maker except nudity
Anyone using this script in their project before these terms
were changed are allowed to use this script even if it conflicts
with these new terms. New terms effective 03 Apr 2024
No part of this code can be used with AI programs or tools
Credit must be given
Hey Roninator, thanks for this script, I'm using it for my dungeon crawler type game.

I have been tinkering with it for a few days to accommodate it for my project, but i think it lacks a couple of features;

Let's say you already have 4 actors created, and you do a fifth, this one gets obscure because it is below the fourth, it will be cool to add some feedback and make the actors move one position up so you can see your recently made character.

Another thing is that if you have more than 4 when you use the command to delete a character you can only choose between the first four, the select window doesn't go down, meaning you are unable to delete the fifth actor.

I know there is an option to choose how many you can see in the window but if you have a lot (8 in my case) they group together obscuring everyone stats.

Now some suggestions:

- Help window for races/classes at the top so you know what are you choosing (in my case I have a class named Mahoutsukai, I don't expect people to know his meaning)

- HP and MP display

-A command to check your already created characters Status/Skills menu.

-Calling the Name input processing at the end of character creation.

-Removing all the equipment of the actor you select with the "Delete" command.

-Options to unlock new Races/Classes through the game.

-The "make it - not sure" window at the end of the character creation (I don't see why is only there when you choose race, maybe is DnD related?)

And now a personal request:

I'm using Yanfly Class System with all his addons, and they are "not" compatible, when you made a character it takes the class of his actor not the one you choose.

My list of actors are just different face graphics, they are named Human 1, Human 2 etc.

I would be really grateful if you were to make some compatibility, I'm saying this with very little knowledge of scripting, I understand if this is too much work.

Thanks for your time.
thanks for this script,
Which version are you using Version 1 or Version 2.
They do character creation differently.
I'm using Version 1 atm.

Done some more testing and found out the Class Specifics addon to be the culprit

Here it is for easy reference

Spoiler
Code:
#==============================================================================
#
# ▼ Yanfly Engine Ace - Class Specifics v1.00
# -- Last Updated: 2011.12.23
# -- Level: Normal
# -- Requires: YEA - Class System v1.03+
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-ClassSpecifics"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2011.12.23 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script allows for certain classes to be primary-only or sublcass-only.
# In addition to that, subclasses can require certain classes to be primary
# classes in order to be applied.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Class Notetags - These notetags go in the class notebox in the database.
# -----------------------------------------------------------------------------
# <primary only>
# Makes this class equippable only if it's the primary class.
#
# <subclass only>
# Makes this class equippable only if it's the subclass class.
#
# <subclass to: x>
# <subclass to: x, x>
# This makes the class subclass only and only equippable if the primary class
# is one of the listed x classes.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
# This script requires Yanfly Engine Ace - Class System v1.03+.
#
#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

if $imported["YEA-ClassSystem"]

module YEA
  module REGEXP
  module CLASS
  
    PRIMARY_ONLY  = /<(?:PRIMARY_ONLY|primary only)>/i
    SUBCLASS_ONLY = /<(?:SUBCLASS_ONLY|subclass only)>/i
    SUBCLASS_TO = /<(?:SUBCLASS_TO|subclass to):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
  
  end # CLASS
  end # REGEXP
end # YEA

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
 
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_csp load_database; end
  def self.load_database
    load_database_csp
    load_notetags_csp
  end
 
  #--------------------------------------------------------------------------
  # new method: load_notetags_csp
  #--------------------------------------------------------------------------
  def self.load_notetags_csp
    for obj in $data_classes
      next if obj.nil?
      obj.load_notetags_csp
    end
  end
 
end # DataManager

#==============================================================================
# ■ RPG::Class
#==============================================================================

class RPG::Class < RPG::BaseItem
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :primary_only
  attr_accessor :subclass_only
  attr_accessor :subclass_to
 
  #--------------------------------------------------------------------------
  # common cache: load_notetags_csp
  #--------------------------------------------------------------------------
  def load_notetags_csp
    @primary_only = false
    @subclass_only = false
    @subclass_to = []
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::CLASS::PRIMARY_ONLY
        @primary_only = true
        @subclass_only = false
        @subclass_to = []
      when YEA::REGEXP::CLASS::SUBCLASS_ONLY
        @primary_only = false
        @subclass_only = true
      when YEA::REGEXP::CLASS::SUBCLASS_TO
        @primary_only = false
        @subclass_only = true
        $1.scan(/\d+/).each { |num|
        @subclass_to.push(num.to_i) if num.to_i > 0 }
      end
    } # self.note.split
    #---
  end
 
end # RPG::Class

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
 
  #--------------------------------------------------------------------------
  # alias method: change_class
  #--------------------------------------------------------------------------
  alias game_actor_change_class_csp change_class
  def change_class(class_id, keep_exp = false)
    return if $data_classes[class_id].subclass_only
    game_actor_change_class_csp(class_id, keep_exp)
    correct_subclass
  end
 
  #--------------------------------------------------------------------------
  # alias method: change_subclass
  #--------------------------------------------------------------------------
  alias game_actor_change_subclass_csp change_subclass
  def change_subclass(class_id)
    return unless subclass_requirements_met?(class_id)
    game_actor_change_subclass_csp(class_id)
  end
 
  #--------------------------------------------------------------------------
  # new method: subclass_requirements_met?
  #--------------------------------------------------------------------------
  def subclass_requirements_met?(class_id)
    subclass = $data_classes[class_id]
    return false if subclass.primary_only
    return subclass_to?(class_id) if subclass.subclass_to != []
    return true
  end
 
  #--------------------------------------------------------------------------
  # new method: subclass_to?
  #--------------------------------------------------------------------------
  def subclass_to?(class_id)
    return true if class_id == 0
    subclass = $data_classes[class_id]
    return false if subclass.nil?
    for class_id in subclass.subclass_to
      return true if class_id == self.class.id
    end
    return false
  end
 
  #--------------------------------------------------------------------------
  # new method: correct_subclass
  #--------------------------------------------------------------------------
  def correct_subclass
    return if @subclass_id == 0
    subclass = $data_classes[@subclass_id]
    return if subclass.nil?
    return if subclass.subclass_to == []
    @subclass_id = 0 if !subclass_to?(@subclass_id)
  end
 
end # Game_Actor

#==============================================================================
# ■ Window_ClassList
#==============================================================================

class Window_ClassList < Window_Selectable
 
  #--------------------------------------------------------------------------
  # alias method: enable?
  #--------------------------------------------------------------------------
  alias window_classlist_enable_csp enable?
  def enable?(item)
    case @command_window.current_symbol
    when :primary
      return false if item.subclass_only
    when :subclass
      return false if item.primary_only
      return @actor.subclass_to?(item.id) if item.subclass_to != []
    end
    return window_classlist_enable_csp(item)
  end
 
end # Window_ClassList

end # $imported["YEA-ClassSystem"]

#==============================================================================
#
# ▼ End of File
#
#==============================================================================
I'm using Version 1 atm.

Done some more testing and found out the Class Specifics addon to be the culprit
Here is an updated script. Let me know if this does what you were asking for.
Next I'll look at the compatibility issue.
The locked races is set to unlock with switches.
The changes you wanted are there. So try it without the class specifics and see if everything is good so far.
*update. Editing. A few minor errors
issues remove. * 2 - First post updated

I put in yanfly scripts and don't get any problems.
Cool, I've been testing the new version and I encounter a couple of bugs:

The confirmation window was showing in the wrong place, I fixed changing line 593 to

Code:
y = @option_window.y + @command_window.height

Next bug I don't know how to fix. The confirmation window stays on screen as you press cancel/back.

Another thing I did was putting

Code:
Graphics.wait(24)

Between lines 828–829, so the name window don't appear instantly.

Did you put the help window? I don't see it.

I decided to scrape the yanfly script, btw.

Thank you for your time.
Cool, I've been testing the new version and I encounter a couple of bugs:

The confirmation window was showing in the wrong place, I fixed changing line 593 to

Code:
y = @option_window.y + @command_window.height

Next bug I don't know how to fix. The confirmation window stays on screen as you press cancel/back.

Another thing I did was putting

Code:
Graphics.wait(24)

Between lines 828–829, so the name window don't appear instantly.

Did you put the help window? I don't see it.

I decided to scrape the yanfly script, btw.

Thank you for your time.
I didn't see any issues with the confirmation window, but sure.

What did you want to happen if the actor naming window is to be delayed?

I fixed the confirmation window staying. I'll change the script above in a second.

Where did you want the help window? there isn't any room.
1705673122343.png
I didn't see any issues with the confirmation window, but sure.

What did you want to happen if the actor naming window is to be delayed?

I fixed the confirmation window staying. I'll change the script above in a second.

Where did you want the help window? there isn't any room.
View attachment 292334

Probably at the top where "Character Creation Module" is, do you think it could work?, or maybe creating a new window on top of the party window that disappear once you pick your race and class.

Everything else looks really good.
- Help window for races/classes at the top so you know what are you choosing (in my case I have a class named Mahoutsukai, I don't expect people to know his meaning)
What does the help window need to say?
As you can see in the images, the race and class is shown, in their own windows.
Probably at the top where "Character Creation Module" is, do you think it could work?, or maybe creating a new window on top of the party window that disappear once you pick your race and class.
That is not a standard desired practice most people would want. I thought about shortening the actor list and making the help window at the bottom so you can show a description of the actor class and/or race. But didn't know what your idea was because you said to show the actor race and class selected, which is already done.
What does the help window need to say?
As you can see in the images, the race and class is shown, in their own windows.

That is not a standard desired practice most people would want. I thought about shortening the actor list and making the help window at the bottom so you can show a description of the actor class and/or race. But didn't know what your idea was because you said to show the actor race and class selected, which is already done.
Oh, i mean a help window while you are selecting your options, let me get you and example:

Top window
mockuphelpwindow1.png

Right window
mockuphelpwindow2.png
First post updated
Does this work?
I'd do! I apologize for the confusion, I should have explained it better, but I'm afraid I found another bug.

Looks like changing the actor's name lets you pick the same actor you pick before, here is a quick video:



This happens regardless of the "Specific actors" set to true or false.
but I'm afraid I found another bug.
It was because I had in there to compare the name.
Main post updated
Looks like everything works now! Thanks!! you are a beast.

I let you know if I find something else 👍
Looks like everything works now! Thanks!! you are a beast.

I let you know if I find something else 👍
I changed the help window.
It is now larger and adjustable.
I changed the help window.
It is now larger and adjustable.
Awesome, perfect for larger descriptions and putting the class initial stats like so:

recruit.png
Scripts updated in include a status windows that shows the breakbowd of the points allocated.
Also adjusted how the params are collected. previously the points added on would not have been calculated so when doing formulas you would have been off in the results.
Sorry, I am probably huffing the stupid gas here, but both versions of the system don't work for me due to the bug showcased in the screenshot above.

The problem is in the "R2 Additional Races" script specifically, without it the system works just fine, but I want to be able to add additional races to the character creation and this issue really bums me out.
And before somebody asks: no additional scripts are being used, as this error pops up in the demo itself 🙁 Would greatly appreciate if somebody was able to help me out with this predicament.


1730352008758.png
The problem is in the "R2 Additional Races" script specifically, without it the system works just fine, but I want to be able to add additional races to the character creation and this issue really bums me out.
And before somebody asks: no additional scripts are being used, as this error pops up in the demo itself 🙁 Would greatly appreciate if somebody was able to help me out with this predicament.
Must have missed that when I last uploaded this demo.
Easy fix, but I'll upload new demos with the one change.
Spoiler: Additional Races script - fixed
Ruby:
# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: D&D Additional Races         ║  Version: 1.02     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║                                     ╠════════════════════╣
# ║   Allows to add additional races    ║    04 Dec 2023     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Requires: DnD Distribution Points by Roninator2          ║
# ║           DnD Character Creation by Roninator2           ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Adding Orc Race type to Config                           ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions:                                            ║
# ║  Follow Parent script instructions                       ║
# ║                                                          ║
# ║  To use this for more races just change a few parts      ║
# ║  You can either copy and paste each section to add on    ║
# ║  more, or you can make a new script slot for each race.  ║
# ║  and copy this script into each slot, then change stuff  ║
# ║                                                          ║
# ║ Race_Settings[:orc] <- change to another name            ║
# ║    e.g. [:goblin]                                        ║
# ║   Change the stat parameters to that race's normal       ║
# ║                                                          ║
# ║ Race_Bonus[:orc] <- change to the same you changed above ║
# ║                                                          ║
# ║ Initial_Points[:orc] <- change to the same as above      ║
# ║                                                          ║
# ║ Max_Initial_Value[:orc] <- change to the same as above   ║
# ║                                                          ║
# ║ Gain_Points[:orc] <- change to same name as above        ║
# ║     Set the points for that race                         ║
# ║                                                          ║
# ║ In R2_DnD_Character_Creation                             ║
# ║   Races[:orc] = "Orc" <- Chnage to new race values       ║
# ║                                                          ║
# ║ Jobs[:orc] = {:fighter => "Fighter",                     ║
# ║               :cleric => "Cleric",                       ║
# ║              }                                           ║
# ║   Change to race name you're using and change the jobs   ║
# ║     that the new race is able to do.                     ║
# ║                                                          ║
# ║ All done. New race will show up when creating a character║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║ 1.00 - 03 Dec 2023 - Script finished                     ║
# ║ 1.02 - 21 Jan 2024 - Capitalized                         ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use:                                            ║
# ║ Free for all uses in RPG Maker except nudity             ║
# ╚══════════════════════════════════════════════════════════╝

module DISTRIBUTE_CONFIG
  # Race Bonus
  RACE_BONUS[:orc] = 5

  # one point is gained when reaching a level that is evenly
  # divided by the number below by race.
  GAIN_POINTS[:orc] = 4
 
  # Points each hero starts with when the race is applied
  INITIAL_POINTS[:orc] = 30
                    
  # Initial Max value for assigning stats
  MAX_INITIAL_VALUE[:orc] = 22
                    
  # Race Settings
  RACE_SETTINGS[:orc] = {
 
      0 => { # 2 = attack
      vocab: "Strength",
      icon: 3,
      base: 12,
      point_price: 1,
      change_price_level: [14,16],
      max_value: 30,
      desc: "Stronger is better!"
      },
      
      1 => { # 3 = Defense
      vocab: "Dexterity",
      icon: 4,
      base: 6,
      point_price: 1,
      change_price_level: [14,16],
      max_value: 30,
      desc: "Avoid the attack is important, \nleast you fall in battle."
      },
      
      2 => { # 4 = Magic Attack
      vocab: "Constitution",
      icon: 5,
      base: 12,
      point_price: 1,
      change_price_level: [14,16],
      max_value: 30,
      desc: "Good health is long life!"
      },
      
      3 => { # 5 = Magic Defense
      vocab: "Wisdom",
      icon: 6,
      base: 6,
      point_price: 1,
      change_price_level: [14,16],
      max_value: 30,
      desc: "The Power under your command is great!"
      },
      
      4 => { # 6 = Agility
      vocab: "Intelligence",
      icon: 7,
      base: 6,
      point_price: 1,
      change_price_level: [14,16],
      max_value: 30,
      desc: "Use magic to protect yourself, \nif you have the spells."
      },
      
      5 => { # 7 = Luck
      vocab: "Charisma",
      icon: 8,
      base: 6,
      point_price: 1,
      change_price_level: [14,16],
      max_value: 30,
      desc: "How Charming can you be?\nWill they fall under your spell?"
      },
  }
    
end

module R2_DND_CHARACTER_CREATION
 
  # Add race type here
  RACES[:orc] = "Orc"
  # Professions for this race
  JOBS[:orc] = {:fighter => 45,
                :cleric => 43,
                }
  # Descriptions for help Window
  RACE_DESCRIPTION[:orc] = "Brutish and very strong"

end

Original thread: https://forums.rpgmakerweb.com/threads/dnd-character-creation-stat-point-distribution.163619/