Yesterday, 12:08 PM
Hey everyone, Nikhil here.
I know a lot of you are trying to mod your own campaigns and getting stuck because the file structure is... unique. It’s basically the game's internal memory dumped into an XML format, so it’s not exactly user-friendly.
I’m going to break down Stage 1 (story01) to explain what’s actually happening under the hood. If you can understand this file, you can pretty much build anything.
The Basics (The Tags)
Before we look at the code, here is a quick cheat sheet for the tags you’ll see most often. The engine reads these sequentially.
1. Stage Setup
At the top of the file, you’ll see the first <bar>. This initializes the map.
Important: The x and z here are for the camera, not the player. If you set these to 0, the camera might start off the map (since the map art usually starts around x=1000 or x=2000).
2. Cutscene Logic (<drama>)
This is the part that usually trips people up. The nesting here is strict.
Two things to note here:
Nesting: The outer <a> tags define the sequence. The inner tags define what happens during that step. If you put multiple actions inside one outer <a>, they happen simultaneously.
<s> vs <id>: <s> is just a nickname for the script to use. <id> is the actual character being loaded.
3. Combat Spawns (<obj>)
Once the <drama> block ends, we usually switch to gameplay.
XML
If you use <toHire/>, make sure you specify the x and z coordinates. If you don't, they default to 0,0, and you'll never see them.
4. Movement Logic (The <c> tag)
In the ending cutscene of Stage 1, you see Giggs running away. That uses the <c>-3 command.
XML
Common Validator Error: If you set <c>-3 but forget the <x> or <z>, the game crashes because the character tries to run to a null location.
Common Pitfalls
Here are the most common mistakes people make:
The <hide> tags: You’ll see these at the start of the file wrapping z_infantry01. This is commented-out code. If you edit anything inside <hide>...</hide>, it won't show up in the game.
Deleting Line IDs (<i>): Inside the dialogue <t> tags, there is a number like <i>10</i>. Do not delete this. The game uses it for syncing and lookups.
Boss Groups: If you look at the Giggs fight, his minions have <bossGrp>1</bossGrp>. This links them to Giggs' HP bar. If you don't link them, the stage might not end correctly when the boss dies.
I know a lot of you are trying to mod your own campaigns and getting stuck because the file structure is... unique. It’s basically the game's internal memory dumped into an XML format, so it’s not exactly user-friendly.
I’m going to break down Stage 1 (story01) to explain what’s actually happening under the hood. If you can understand this file, you can pretty much build anything.
The Basics (The Tags)
Before we look at the code, here is a quick cheat sheet for the tags you’ll see most often. The engine reads these sequentially.
<bar>This represents a "Section" or a "Scene" of the stage. The game plays one bar at a time. It won't move to the next bar until the current one is finished (usually when all enemies are dead or a cutscene ends).<drama> Triggers "Cutscene Mode." It disables player controls and executes a script.<obj> Gameplay objects. This is how you spawn enemies, items, or allies during actual combat.<a> Action. Used inside cutscenes to make things happen (move, talk, animate).<c> Command State. This overrides the AI.- -2: Stop/Idle.
- -3: Move to specific coordinates.
1. Stage Setup
At the top of the file, you’ll see the first <bar>. This initializes the map.
XML
<bar>
<bg>
<bgid>story01</bgid>
<x>1700</x>
<z>800</z>
</bg>
<left>0</left>
<right>9000</right>
<effect>showTitle</effect>
</bar>Important: The x and z here are for the camera, not the player. If you set these to 0, the camera might start off the map (since the map art usually starts around x=1000 or x=2000).
2. Cutscene Logic (<drama>)
This is the part that usually trips people up. The nesting here is strict.
XML
<drama>
<state>start</state>
<o>
<s>drew</s>
<id>drew</id>
<x>390</x> <z>980</z>
</o>
<a>
<a>
<id>z_villager01</id>
<ac>drama_lie2</ac>
</a>
</a>
<a>
<t>
<s>lucas</s>
<en>It's been over a month now...</en>
<i>10</i>
</t>
</a>
</drama>Two things to note here:
Nesting: The outer <a> tags define the sequence. The inner tags define what happens during that step. If you put multiple actions inside one outer <a>, they happen simultaneously.
<s> vs <id>: <s> is just a nickname for the script to use. <id> is the actual character being loaded.
3. Combat Spawns (<obj>)
Once the <drama> block ends, we usually switch to gameplay.
XML
<bar>
<left>0</left> <right>6000</right>
<obj>
<id>z_bandit01</id>
<times>2</times>
<ratio>1</ratio>
</obj>
<obj>
<id>z_villager01</id>
<times>10</times>
<toHire/>
<x>1400</x>
<z>800</z>
</obj>
</bar>If you use <toHire/>, make sure you specify the x and z coordinates. If you don't, they default to 0,0, and you'll never see them.
4. Movement Logic (The <c> tag)
In the ending cutscene of Stage 1, you see Giggs running away. That uses the <c>-3 command.
XML
<o>
<id>giggs</id>
<c>-3</c>
<x>22000</x>
<z>810</z>
</o>Common Validator Error: If you set <c>-3 but forget the <x> or <z>, the game crashes because the character tries to run to a null location.
Common Pitfalls
Here are the most common mistakes people make:
The <hide> tags: You’ll see these at the start of the file wrapping z_infantry01. This is commented-out code. If you edit anything inside <hide>...</hide>, it won't show up in the game.
Deleting Line IDs (<i>): Inside the dialogue <t> tags, there is a number like <i>10</i>. Do not delete this. The game uses it for syncing and lookups.
Boss Groups: If you look at the Giggs fight, his minions have <bossGrp>1</bossGrp>. This links them to Giggs' HP bar. If you don't link them, the stage might not end correctly when the boss dies.



