Divinity: Original Sin 2 – Definitive Edition Guide

Class Creation by Helaene (Part 4) - Books & Trade for Divinity: Original Sin 2

Class Creation by Helaene (Part 4) – Books & Trade

Overview

This series will explain from start to finish how to create a class mod (similar to mine) for D:OS2.Part 4 covers creating and placing a trader, skillbooks and treasure tables.

Designing a Trader

Before placing your trader in levels of the game, you need to create a trader.

Overview: you’ll need to…
1. create a root template copied from an existing character
2. add the TRADER tag
3. create a dialog for them
4. set their ‘TradeTreasure’ to sell all of your skillbooks
5. place them in game levels

To create a new character to act as your trader, go to the Root Template Manager and right-click the character icon. (Note: if the sidebar is empty, click the ‘Load’ button at the upper-left of the Root Template Manager pane.) Type in ‘Trader’ in the search box and hit enter to search.

Now right-click one of the resulting entries on the right and select ‘Create new from selected’. Change the Display Name property to whatever you’d like your character’s name to be, and set the name of the new template at the bottom of the window (ex. ‘Helaene_Venomancer_Trader’), and click Create.

Double-click your new root template to continue editing their properties in the Sidebar. Click the button to the right of the Tags field. In the resulting pop-up, type TRADER into the input field at the top and press the ‘+’ button, then hit ‘Apply’. Now scroll down to the Combat section, and uncheck the boxes for ‘Can Fight’ and ‘Can Join Combat’. You’ll want to check that Good NPC is selected from the Alignment dropdown as well. At this point you should save going to the main File menu and selecting Save All.

This is the part where you ask me how to make your trader look different! The easiest way to tweak their look is to click the … button next to Visual Set Indices. In the pop-up, you can then cycle through a few limited options to change their look. Don’t forget to Save.

If you want to take a more advanced approach, copy a different type of root template originally, or set the Visual Set Resource ID to a different clothing set. You can even copy and existing clothing set and modify it for your own purposes (new hair or clothing colors, new hairstyles and clothing items), and then use that. You’ll likely need to create your own trader portrait icon (80×100), create a texture atlas for it (like we did for skill icons), and then set that as your character’s icon in the Sidebar as well.

Creating Skillbooks

To create a skillbook, you’ll need two major parts:
1. the object stats
2. the root template

To start, open the Stats Editor. Browse to Stats > Object in the Shared project. Copy the row for any existing skillbook (use one that looks like you want – ex. I’ll pick an Earth book).

Click the plus icon next to Stats in your own project to create your own Object file. Paste in the row you copied. Start by modifying the Name column to something like ‘SKILLBOOK_Venomancer_AcidRain’ and then save your changes.

Looking at the row, you can see where we’ll specify our new Root Template for this book, as well as the Memorization Requirements and cost (Value). Feel free to modify any other columns if you’re ready, and save your changes.

Now, we’ll create our new Root Template for our skillbook by going to the Root Template Manager and searching for the same skill we copied (you may want to right-click the barrel icon to view only objects). Just as we did with the trader, right-click that template and select ‘Create new from selected’.

Modify the display name to be something like ‘Acid Rain Skillbook’ and then set the name of the template itself at the bottom (ex. ‘BOOK_Skill_Venomancer_AcidRain’) and press ‘Create’.

Now find your new template in the Root Template Manager (you’ll need to change your search term) and double-click it to edit in the Sidebar. There are two very important fields to change for skillbooks, and some other optional ones. The first important one is the Stats dropdown, where we’ll want to select our new SKILLBOOK stats entry.

The second important field to change is the Use Actions. We want this skillbook to grant our new skill when it is ‘consumed’. Click the button next to Use Actions and select your new skill from the dropdown on the right, then press Apply. Save All from the File Menu.

The last critical thing to update is back in your object stats in the Stats Editor. In the Root Template column of your Object stats file in the row for your skillbook, select your new skillbook root template from the dropdown, then Save.

Optionally, you can go back to your skillbook’s root template and select a different icon image, change the Visual Resource ID to a different look, or modify the Description.

Configuring a Treasure Table

To get a sense of how Treasure Tables work, open TreasureTable > TreasureTable in the Shared project in the Stats Editor. Find the one called ST_SkillbookEarth as a good reference.

Now create your own TreasureTable > TreasureTable file using the plus button in your own project. Add in a name for your table (ex. ‘TT_Venomancer_Books’). Set the StartLevel and Frequency to ‘1’, and the DropCount to ‘1,1’. In the ObjectCategory column, add the name of your skillbook’s object stats entry with one important change – add a capital i and underscore (‘I_’) in front of it (see image).

To add more skillbook entries later, you’ll want to right-click your treasure table’s name and select ‘Add sub-stat’ (otherwise it would be added as a completely different table).

Now that our treasure table exists, open your trader root template again. In the Sidebar, set the Trade Treasure field to your new table’s name (ex. TT_Venomancer_Books) and Save.

Placing your Trader

Let’s first place your new trader in the Fort Joy level. From the File menu, select ‘Load Level’.

You’ll want to click the ‘Load Inherited’ button in the upper-right if you’re not seeing the game levels. Select the Fort Joy folder and the Fort Joy level within it, then press ‘Select’.

The easiest way to get your bearings in this big level is by turning on Game Mode, and double-clicking the player character’s portrait to find them. Move the player to the part of the level where you want your trader to appear, then exist Game Mode.

Select your trader root template and then click the button in the game window that looks like a mountain/cone with a plus. This will allow you to plop an instance of your root template into the level – simply click where you’d like them to appear. (If you’re like me, you find this weirdly satisfying when they start using idle animations and so forth). If you need to rotate or move the character after placing them, use the buttons to the left of the game window and then drag the controls that appear. Time to save!

Turn Game Mode back on and have your player character try to interact with the trader. As you can tell by me using the word ‘try’ they won’t be able to yet, because we haven’t yet set a default dialog for our trader.

After we set them up with their dialog, you can open whatever other levels you want to add them to, and plop your root template there as well.

Writing Trader Dialog

To create your very first dialog, open the Dialog Editor from the top menu bar.

In the Dialog Editor, click File > New > Empty Dialog to create your new dialog.

First, we’ll set up the basic settings for the dialog. Generic NPC dialog type will already be selected, which is fine to keep. Click Edit next to Speakers.

In the pop-up, you’ll want to click Add to add a new speaker. Click Edit next to the input box that appears. In the new window, type in the name of your trader (if they don’t appear here, make sure you’ve saved your level already). Click the arrow to move your trader to the selected panel, and click Okay.

This is a good time to save your dialog progress. Go to the File menu in the Dialog Editor and select Save > Save As. Give it a descriptive name (ex. Helaene_Venomancer_Trader_Dialog).

Now we’ll actually add something for your trader to say. Right-click in the main grey area of the Dialog Editor window and click Add Node > Greeting.

Notice the new green bubble that appears in your window, and see that your trader is automatically listed as the speaker for it. Double-click the bubble to edit the text.

In the pop-up window, click ‘Add’. We don’t have to worry about any conditional logic here, so just type the text you want your trader to say into the text box.

Close the textbox’s window when you’re done (it saves automatically). You should now see your text in the green bubble. We’re not going to do any prompting of trade windows, and just expect users to use the default trade button that will appear in the dialog in-game. We can now set this node as an End Node by checking that box in the right side of the Dialog Editor window (while our node is selected). You’ll notice that the bubble turns red after doing so. File > Save to save your progress.

The dialog itself is ready to go, now we just need our trader to know that she’s supposed to say it. You might be inclined to select your trader in the level in order to modify her dialog settings, but we want to set the default dialog regardless of which level your trader appears in. To do so, we’ll select your trader from the Root Template Manager, and then enter your dialog’s name into the Default Dialog field in the Sidebar, and save.

You may need to delete your existing trader character from the level and plop another one after the dialog has been properly set on the root template. Don’t forget to save your changes. Turn on Game Mode and test it out – your trader should be using the text your wrote, as well as selling your skillbook!

Setting Up a Skill Chest

Often, class and skill creators place a container full of skillbooks where its easy for players to test out their work (or just ignore money and have fun).

To do this, we’ll want to plop a container root template object into our level, and then set some additional configuration on it.

In the Root Template Manager, click on the Containers folder on the left side of the pane. On the right, if you select any of the objects, you should see a preview of them in the Preview pane.

Find one that you like, and place it in your level using the +mountain button to the left of the game window. Change the Display Name after selecting your placed object, and Save.

Now scroll down in the Sidebar to the Treasure field. Find your treasure table and move it to the right, then press OK.

Note that right now your skillbooks are set to show up at Level 1 per your Object stats, but if you change the level at which they become available, you’ll need to set the level higher on your skillbook chest as well.

Save your changes. Reload the level and check that your skillbook appears inside the chest! Don’t forget to try out your skillbook to ensure you learn the skill when used, if you haven’t yet.

Additional References

Other helpful information can be found here:
* [link]

SteamSolo.com