Introduction to Modding Divinity: Original Sin 2
As an avid modder and fan of Divinity: Original Sin 2, I've spent countless hours tinkering with the game's inner workings. One of the most rewarding projects I've undertaken was creating a custom follower mod. In this comprehensive guide, I'll walk you through the process of bringing your own unique character to life in the world of Rivellon.
Divinity: Original Sin 2 is a game that welcomes creativity, and its modding community is thriving. Whether you're a seasoned modder or a complete novice, this tutorial will equip you with the knowledge and tools to craft your very own companion. So, let's dive in and unlock the secrets of follower mod creation!
Prerequisites and Setting Up Your Modding Environment
Before we embark on our modding journey, let's make sure we have everything we need:
- A copy of Divinity: Original Sin 2 Definitive Edition
- The Divinity Engine 2 (available for free on Steam)
- Basic understanding of XML and Lua scripting (don't worry, I'll guide you through the specifics)
- A text editor (I recommend Visual Studio Code with the Lua extension)
- Patience and creativity (trust me, you'll need both!)
First things first, let's set up our modding environment:
- Install Divinity: Original Sin 2 Definitive Edition and the Divinity Engine 2 from Steam.
- Launch the Divinity Engine 2 and create a new mod project. Name it something like "MyCustomFollower".
- In the engine, go to File > Preferences > Game Paths and ensure it points to your Divinity: Original Sin 2 installation directory.
- Create a new folder in your Documents directory called "Larian Studios\Divinity Original Sin 2 Definitive Edition\Mods" if it doesn't already exist.
With our environment set up, we're ready to start crafting our custom follower!
Designing Your Custom Follower
Before we dive into the nitty-gritty of coding, let's flesh out our custom follower. For this tutorial, I'll be creating a charismatic bard named Melody who specializes in supportive magic and witty remarks. Here's a quick rundown of her characteristics:
- Name: Melody
- Race: Human
- Class: Bard (custom class combining elements of Enchanter and Rogue)
- Personality: Witty, charming, with a penchant for getting into trouble
- Special Ability: "Inspiring Tune" - A unique skill that buffs nearby allies
Feel free to adapt these details to your own character concept. The sky's the limit when it comes to creativity in Divinity: Original Sin 2!
Creating the Character Model
Now that we have our character concept, it's time to bring Melody to life visually. Divinity: Original Sin 2 uses a combination of pre-existing assets and custom textures for character models. Here's how we'll create Melody's unique look:
- In the Divinity Engine 2, navigate to the Character Creator tool.
- Select "Human" as the base race.
- Choose a female preset that closely matches your vision for Melody.
- Customize the facial features, hair, and body type to your liking.
- For clothing, select a mix of light armor and roguish attire to reflect her bard class.
- Export the character model and note down the generated CharacterVisualResourceID.
Remember, the visual design is crucial for creating a memorable follower. Take your time to get it just right!
Scripting Character Behavior and Dialogue
With our character model ready, it's time to breathe life into Melody through scripting. We'll use a combination of XML for character definitions and Lua for more complex behaviors. Let's start with the basic character definition:
<?xml version="1.0" encoding="UTF-8"?> <save> <header version="2" time="0" /> <version major="3" minor="6" revision="6" build="0" /> <region id="CharacterCreationClass"> <node id="root"> <attribute id="ClassDescription" value="A charismatic bard with a talent for supportive magic and witty remarks." /> <attribute id="ClassLongDescription" value="Melody's silver tongue and magical melodies have gotten her out of (and into) many sticky situations." /> <attribute id="ClassName" value="Bard" /> <attribute id="ClassType" value="Bard" /> <attribute id="Name" value="Melody" /> <attribute id="UUID" value="c1c45e7a-f0e7-4b10-a10d-9b0e34e95e7f" /> </node> </region>
Save this as "CharacterCreationClass.lsx" in your mod's Public folder. Now, let's create a Lua script for Melody's unique behavior:
Save this as "Melody.lua" in your mod's Scripts folder. This script gives Melody some basic combat AI, making her use her unique "Inspiring Tune" skill when appropriate.
Implementing Custom Dialogue
A follower isn't complete without some personality-filled dialogue. We'll use the Divinity Engine 2's Dialogue Editor to create conversations for Melody. Here's a sample dialogue tree:
Save this as "MelodyDialogue.lsx" in your mod's Public/Dialogs folder. This gives Melody a memorable introduction and allows the player to recruit her.
Adding Custom Skills and Abilities
To make Melody truly unique, we'll add her signature "Inspiring Tune" skill. This involves creating a new skill in the Divinity Engine 2 and then scripting its effects. First, let's define the skill:
Save this as "InspiringTune.lsx" in your mod's Public/Skills folder. Now, let's script the skill's effects:
Add this to your "Melody.lua" script. This code applies the "Inspired" and "Hasted" statuses to nearby allies when Melody uses her Inspiring Tune skill.
Testing and Debugging Your Mod
With all the pieces in place, it's time to test our custom follower mod. Here's how to do it:
- In the Divinity Engine 2, go to File > Export Mod.
- Launch Divinity: Original Sin 2 and enable your mod in the Mod Manager.
- Start a new game or load a save where you can access Fort Joy.
- Look for Melody near the Fort Joy square (you may need to add a script to spawn her if she doesn't appear automatically).
- Interact with Melody and test her dialogue and recruitment options.
- If you recruit her, enter a combat scenario to test her AI and custom skill.
If you encounter any issues, don't panic! Modding often involves a bit of trial and error. Use the Divinity Engine 2's console to check for error messages, and don't be afraid to tweak your scripts and XML files as needed.
Conclusion: Your Journey into Divinity: Original Sin 2 Modding
Congratulations! You've just created a custom follower mod for Divinity: Original Sin 2. Melody, our witty bard, is now ready to accompany players on their adventures through Rivellon. This process has given you a solid foundation in various aspects of modding, from character creation to scripting and dialogue writing.
Remember, modding is an iterative process. Don't be discouraged if everything doesn't work perfectly the first time. Keep refining your mod, and don't hesitate to seek help from the vibrant Divinity modding community.
As you continue your modding journey, consider expanding Melody's capabilities with more custom skills, unique equipment, or even a personal questline. The possibilities are endless, limited only by your imagination and dedication.
Happy modding, and may your creations bring joy to Divinity: Original Sin 2 players around the world!
Leave a Reply
Your email address will not be published.*