codewright
Sergeant at Arms
Xml Module System Version 0.9 (Updated 06-01-2007)
The idea of this project is to improve editing of existing and creation of new content by describing it in xml rather than python code. Additionally it allows you to create small modules that only add or change content without providing the base content as well.
It has undergone rather large changes and got updated to 0.808. It generates fully functional 0.808 modules, the generated native module text files only differ slightly from the official module system. Those differences are different order of variables and dialog states, random values and some bugs in the official module system (items.txt). An important change has been made to references which will make tool development easier.
There are still some some nasty formatting/structure things that i might consider to change. But then again, xml can be transformed pretty swiftly using xslt so a structural upgrade is not too complicated. So it is of highest importance to make sure no _information_ is missing in the xml, because this can not be added by an upgrade utility. Ah, skins are missing, btw.
Requirements: Microsoft .NET 2.0 Framework
Download: XmlModuleSystem 0.9
Readme file with more detailed information
There are small examples included in the package as well. See support/examples and/or the mini-tutorial below.
There is no real need for screenshots as this is much more a data thing, but as i like screenshots myself, here are spme (old syntax!):
Pic1: The window for exporting text files from multiple xml modules.
Pic2: A syntax highlighted example of an item definition.
Pic3: Auto completition provided by Visual C# Express.
Pic4: Examples for modification statements.
Pic5: The loops.xslt in action.
Current Features:
Planned Features:
Mini-Tutorial: How to add an item
Step one: Create a new module file.
Simply create a new file in the Modules directory called "my-module.xml" and open it in a text or xml editor. Then put in the following text:
Step two: Add your definition.
Now that you have your own single-file module you can add any definition like items, dialogs, troops and so on. As we want to add an item in this tutorial you will want to have a look at the items.xml in the native module. There you can copy/paste the basic structure of any item to your new module and modify it to your needs. The new definition needs to be put inside the Definitions tag. For example, a helmet may look like this:
Step three: Export to text module.
Now that your new xml module is done you need to generate the text files used by Mount&Blade. To do that you need to open up the XmlModuleSystem.exe. In the list on the left side you should see the official module and your new module, called "My Module". Simply enable both by checking the boxes and click export. The text files will be put into the "export" folder. To use them in M&B you need to copy them into a module under the Modules folder of Mount&Blade.
Attention: By default savegames are not compatible with exports of the xml module system, because the order of dialog_states and variables is different. If you want to get best compatibility possible you may want to copy the predef files from support/predef into the same directory as the XmlModuleSystem.exe resides and reexport the module. The files provided are the same files as the official module system (0.80 exported and will be used to use the same order of definitions. This MAY cause problems with many changes to the native module, but should work fine most of the time.
Version 0.9
(6 Jan 2006)
* updated to MB Version 0.808
* changed naming schema to Pascallike (i.e. AnIdentifier)
* explicit difference between reference and definition for most entities
(no longer nested definitions)
complete ChangeLog
i appreciate any comments, hints, bug reports, suggestions and proposals about the xml structure, the whole idea and everything else.
Have fun
The idea of this project is to improve editing of existing and creation of new content by describing it in xml rather than python code. Additionally it allows you to create small modules that only add or change content without providing the base content as well.
It has undergone rather large changes and got updated to 0.808. It generates fully functional 0.808 modules, the generated native module text files only differ slightly from the official module system. Those differences are different order of variables and dialog states, random values and some bugs in the official module system (items.txt). An important change has been made to references which will make tool development easier.
There are still some some nasty formatting/structure things that i might consider to change. But then again, xml can be transformed pretty swiftly using xslt so a structural upgrade is not too complicated. So it is of highest importance to make sure no _information_ is missing in the xml, because this can not be added by an upgrade utility. Ah, skins are missing, btw.
Requirements: Microsoft .NET 2.0 Framework
Download: XmlModuleSystem 0.9
Readme file with more detailed information
There are small examples included in the package as well. See support/examples and/or the mini-tutorial below.
There is no real need for screenshots as this is much more a data thing, but as i like screenshots myself, here are spme (old syntax!):
Pic1: The window for exporting text files from multiple xml modules.
Pic2: A syntax highlighted example of an item definition.
Pic3: Auto completition provided by Visual C# Express.
Pic4: Examples for modification statements.
Pic5: The loops.xslt in action.
Current Features:
- Definition of game data in XML, which is more readable and very tool-friendly.
- File-independece: different definitions (items, dialogs,...) can be mixed in one file or distributed over multiple files.
- Simple merging of modules: Modules do not need to contain the whole game data but can only define the data that is new.
- conversation tool to create a XML module from python code
- Complete xml schema allows validation and auto-completition provided by xml editors and parsers.
- automatic "slot" handling: just declare and use them, numbers will be associated automatically
- automatic "category" handling: just mark a party, troop or quest with spawnpoints, towns, merchants,... and the exporter will put them into the right order.
- more flexible modification operations like redefine, partial overwrite and removal of items while merging modules.
- xslt processor tool for user defined xml transformations (currently there is the loops.xslt bundled)
Planned Features:
- resources included: module brings all the resources that it adds to the game and the export function makes sure all _needed_ resources are in the m&b module.
- support for skins and music
- an alternative to the current code syntax which can be used in code blocks
Mini-Tutorial: How to add an item
Step one: Create a new module file.
Simply create a new file in the Modules directory called "my-module.xml" and open it in a text or xml editor. Then put in the following text:
Code:
<?xml version="1.0"?>
<Module Version="0.4" xmlns="urn:mount-and-blade:xml-module-system:0.4">
<Name>My Module</Name>
<Version>1.0</Version>
<Definitions>
<!-- your definitions go here -->
</Definitions>
</Module>
Now that you have your own single-file module you can add any definition like items, dialogs, troops and so on. As we want to add an item in this tutorial you will want to have a look at the items.xml in the native module. There you can copy/paste the basic structure of any item to your new module and modify it to your needs. The new definition needs to be put inside the Definitions tag. For example, a helmet may look like this:
Code:
<Item Id="my_helmet">
<Name>My New Helmet</Name>
<Type>head_armor</Type>
<Value>433</Value>
<MeshAssignments>
<MeshAssignment>
<Mesh Resource="lamellar_helmet_a"/>
</MeshAssignment>
</MeshAssignments>
<ItemModifiers>
<ItemModifierList RefId="cloth"/>
</ItemModifiers>
<Stats>
<Weight>2</Weight>
<Abundance>100</Abundance>
<HeadArmor>19</HeadArmor>
</Stats>
</Item>
Step three: Export to text module.
Now that your new xml module is done you need to generate the text files used by Mount&Blade. To do that you need to open up the XmlModuleSystem.exe. In the list on the left side you should see the official module and your new module, called "My Module". Simply enable both by checking the boxes and click export. The text files will be put into the "export" folder. To use them in M&B you need to copy them into a module under the Modules folder of Mount&Blade.
Attention: By default savegames are not compatible with exports of the xml module system, because the order of dialog_states and variables is different. If you want to get best compatibility possible you may want to copy the predef files from support/predef into the same directory as the XmlModuleSystem.exe resides and reexport the module. The files provided are the same files as the official module system (0.80 exported and will be used to use the same order of definitions. This MAY cause problems with many changes to the native module, but should work fine most of the time.
Version 0.9
(6 Jan 2006)
* updated to MB Version 0.808
* changed naming schema to Pascallike (i.e. AnIdentifier)
* explicit difference between reference and definition for most entities
(no longer nested definitions)
complete ChangeLog
i appreciate any comments, hints, bug reports, suggestions and proposals about the xml structure, the whole idea and everything else.
Have fun