Adding more Classes for PC to choose from during Character Creation.

Discuss modding questions and implementation details.
Post Reply
User avatar
harbinger451
Posts: 202
Joined: Mon Apr 13, 2020 4:08 pm
Contact:

Adding more Classes for PC to choose from during Character Creation.

Post by harbinger451 »

I'm on the verge of completing my Classes Redone mod which improves the existing classes, and it got me wondering. Is it possible to add new classes by making additional CLASS.CFG files and providing suitable BIOG files and class Description/History text strings for them ... or is it more complicated than that?

The CreateCharClassSelect.cs (here: https://github.com/Interkarma/daggerfal ... ect.cs#L50) seems to suggest so, but can it really be that easy?

If so. how come no one has done it before.

After I've complete my Classes Redone mod, I would really like to make a Classes Expanded mod that adds some of my favorite custom classes (though possibly toned down a little) and some classes that were introduced in later TES games as well.
Image

User avatar
MrFlibble
Posts: 423
Joined: Sat Jan 27, 2018 10:43 am

Re: Adding more Classes for PC to choose from during Character Creation.

Post by MrFlibble »

I just tested this by copying an existing CLASS.CFG and giving it the number 19, then put it in the ARENA2 folder along with the BIOG file in both vanilla and DFU, and it did not show up in the available classes list. An yeah, I opened the file and edited it to say Kneght instead of Knight just to be sure.

UPD: I also tried naming the new class CLASS18.CFG, to the same effect.

User avatar
harbinger451
Posts: 202
Joined: Mon Apr 13, 2020 4:08 pm
Contact:

Re: Adding more Classes for PC to choose from during Character Creation.

Post by harbinger451 »

My experiment proved the same ... though it might need a sequential class description and history added to the text strings before it works, thus enabling the "Do you wish your character to be a ..." Yes/No prompt after selection. I'll do a bit more experimenting, but I'm wondering if any new classes also need to be added to a class list somewhere else in the code.
Image

User avatar
harbinger451
Posts: 202
Joined: Mon Apr 13, 2020 4:08 pm
Contact:

Re: Adding more Classes for PC to choose from during Character Creation.

Post by harbinger451 »

Can confirm that adding new text strings for the Class Descriptions and Histories with the CLASS and BIOG files totally works... so expect a Classes Expanded mod from me very soon.
Image

User avatar
Cheb Gonaz
Posts: 5
Joined: Wed Apr 17, 2024 12:50 am
Location: Australia
Contact:

Re: Adding more Classes for PC to choose from during Character Creation.

Post by Cheb Gonaz »

Hello, I recently worked in this area for my Cheb's Necromancy mod and would like to share my findings to make things easier for the next person. Thanks very much to Harbinger451 for helping me and also to Hazelnut & Ralzar for their work on Roleplay Realism.

It basically boils down to:

1. Create the DFCareer
2. Create the BIOG
3. Add the starting equipment and spells (so the game doesn't crash in Privateer's Hold)

DFCareer

So there's basically two approaches to this:

1. You've got the approach outlined by Harbinger451 which works and is possibly the best way, which is to create new data files. The downsides to this approach is you need to use old software that doesn't work well on modern systems. The utility is called DaggerClass and is documented here.

2. A pure-code approach also works and is what I chose for my mod because I didn't want to bother with these old utilities.

For option 2, you need to first create the DFCareer in code. Then, because of how restrictive the code-base is in terms of events available, everything being non-public in scope, etc. I found no better way to get my DFCareer in the menu than to recreate the entire wizard with the only difference being a modified class selection window that adds the custom classes to the listbox. I tried for hours to get it to work with the existing stuff, but nothing would work.

Then, you need to monitor for when the vanilla wizard opens by subscribing to the OnWindowChanged event and when it does close it and open yours instead.

Create the BIOG

You can just copy & paste one of the existing BIOG files from StreamingAssets/BIOGs and give it a new index eg. BIOG18T0.TXT, or you can further modify/extend your pure-code solution to generate this. I didn't decide to do that due to complexity. Unlike the DFCareer it is just a text file and no old utility is required, so I think it's ok.

Add Starting Equipment

Finally, and this is very important, you need to add starting equipment to your new class in the summary stage of the wizard. This stops the crash in Privateer's Hold.

For a non-code solution, you can do what Harbinger451 does which is rely on the Roleplay Realism Items Mod which is capable of equipping new custom classes.
Check out Cheb's Necromancy on GitHub and Nexus Mods

User avatar
harbinger451
Posts: 202
Joined: Mon Apr 13, 2020 4:08 pm
Contact:

Re: Adding more Classes for PC to choose from during Character Creation.

Post by harbinger451 »

Well done Cheb for working out this code method and getting it working. My Classes Expanded mod has maxed out the available slots for adding new classes using my method, so using your coded method would now be the only way to add more, not that I have plans atm to add any, but you never know in the future, lol.
Image

User avatar
Cheb Gonaz
Posts: 5
Joined: Wed Apr 17, 2024 12:50 am
Location: Australia
Contact:

Re: Adding more Classes for PC to choose from during Character Creation.

Post by Cheb Gonaz »

Thank you :)

I think a big problem with class mods moving forward is that they're going to conflict. Especially if they use my method because only one of the wizards will successfully open. But even if it's just data files, people are going to need to at the very least rename them. And then you run into the issue you just mentioned about a class limit.

There probably needs to be a generic Custom Class Mod which takes some nice format (like a JSON) and then when people want to make custom classes, they need that one custom class mod dependency and then all these different class mods can register their classes and any duplicates get resolved (eg. if they installed both my mod and your mod, which both have a Necromancer class, maybe it lists them twice in the menu like "Necromancer (Classes Expanded)" and "Necromancer (Cheb's Necromancy)". This mod could also handle assigning the items and any custom spells (these things are probably also laid out in the JSON).

Maybe if you decide to work on classes again, we can work in that direction to make class modding awesome & easy for everyone who wants to do it.
Check out Cheb's Necromancy on GitHub and Nexus Mods

l3lessed
Posts: 1410
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Adding more Classes for PC to choose from during Character Creation.

Post by l3lessed »

This can be done numerous ways. You could do a Json file for the custom class data, or you could even do a basic text file (which is what I did to setup custom stats for each individual weapon). It really is up to how you want the constructor in the code to pull and read the data to construct and inject the new class list into the character creation class list ui.

The framework for reading the file and pulling the data would be simple enough to construct. All that matters is the data can be stored in a general and standardized file people can access and edit. Json is the most common approach for a reason I think though.

I do plan on, at some point, releasing some modding tools. Maybe, if it's still needed, I can get to this when I do that.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Cheb Gonaz
Posts: 5
Joined: Wed Apr 17, 2024 12:50 am
Location: Australia
Contact:

Re: Adding more Classes for PC to choose from during Character Creation.

Post by Cheb Gonaz »

That sounds good. Maybe doing it as JSON with the same format as the modsettings.json file so that it can be read and shown as a window with sliders and all that stuff could be good. That way it uses a familiar format that's extensible and also easily parsed (and also already in-use elsewhere in the game).
Check out Cheb's Necromancy on GitHub and Nexus Mods

Post Reply