Not really as there are many cross-references and especially the scripts/triggers reference other items by their number. So for example you need to know all the troops in order to reference one particular one. It is "possible" but not really feasible.Scion said:Is it possible to mix the XML system together with the native Module system? I mean, I would like to use this system for my definition of troops, but do my triggers and scripts in Python. Sorry if it has been answered, I could not find it.
True, but in fact that was my goal, because having a solid descriptive base is always good. Adding higher abstractions can follow afterwards.svaucher said:I think a major problem that we have here and the cause for Hellequin's incomprehension is that the module system provides a low-level way to structure your mod and it ressembles too much what is done with python. I mean low level since the conversion seems pretty straight forward between code and produced text files. (For the coders out there, this is much like C -> assembly.)
Keep in mind that higher abstractions are fine for people writing them by hand but are way harder to be put into an editor. So, yes, you can code loops creating 20 npcs in 3 lines in python and, yes, it is possible but maybe a bit more complicated to do it in xslt, but both of them are editor unfriendly. The thing is, the resulting xml can be read by a tool, the 20 npcs created by the python code not so easily. You'll need to create python code in your python code to have any chance at all to make it editor friendly.IMO, what is needed for extra productivity is the following:
1/ Higher levels of abstraction : These can be achieved by using the tooling that using XML provides. You automatically have a declarative language with processors (XSL). Of course this is might be more complex than python tuples. Using XML will be useful only when you can properly use its tools. Python is an OO language and could also be more adequately used.
In fact, this is possible with a few restrictions already. the following module generates a new troop which simply extends and slightly changes an existing troop:2/ Less duplication : There's so much duplication in the current mod codebase, it isn't even funny. The XML editors provide a clean and short way to add a new troop/city. Using XML inheritance can help a lot (this new hero will act by default like the others except for ...). This can also be achieved through Python.
<?xml version="1.0"?>
<Module Version="0.4" xmlns="urn:mount-and-blade:xml-module-system:0.4">
<Name>My Item Contribution</Name>
<Version>0.2</Version>
<Definitions>
<Troop Id="elite_swadian_skirmisher" BaseId="swadian_skirmisher">
<Name>Elite Swadian Skirmisher</Name>
<Level>20</Level>
<WeaponProficiencies>
<WeaponProficiency Name="default">120</WeaponProficiency>
</WeaponProficiencies>
</Troop>
<Troop Id="swadian_skirmisher" Mode="modify">
<CanUpgradeTo>
<Troop RefId="swadian_crossbowman"/>
<Troop RefId="elite_swadian_skirmisher"/>
</CanUpgradeTo>
</Troop>
</Definitions>
</Module>
It's already possible as stated multiple times.3/ Better structure : It seems to be "obvious" to most that troops should be kept separate from parties and quest. Why is that? If I create a new NPC, I might to have him bundled together with his quests. If I were to add boats, I might have to include scripts, parties, party_templates, etc... Grouping these by functionality would be just as valid as following the output structure. Any tool that can break down these artificial barriers is welcome. Since XML includes inclusion mechanisms, this tools is promising.
Well, in fact, it was the first goal. But of course it's not the only goal and it already offers more features in a tool-friendly manner. "More" being relative as python, being a programming language, has the greatest possible flexibility, if and only if you understand it. And understanding python is hard for a toolI'll be sticking with python for now, but those are little things to remember. Duplicating what does python is not the goal.
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.
Well, the same as you can mod with the official module system, to be exact: conversations, faction, menus, items, map icons, mission-templates, particle systems, parties, party-templates, quests, scene props, scenes, scripts, sounds, triggers and troops. The map and art data like meshes, textures and sound are resources not directly handled in the module systems (official and this one).sirgrigor said:What are the XML definitions for various 'things' in the game. Please provide examples of all the types of things we can mod in and I'll try using your system for my new mod Dogs of War.
Of course, just take a look at the 'native' folder in the 'Modules' folder of my package. The module is split into multiple files resembling the original structure of the module. This was only done because it makes it easier to convert the original module into xml structure, as i said before, you can mix all definitions in the xml files.Also, do you have an XML file that duplicates Native? That would help people to 'convert' over to your system I think.
codewright said:V0.6 is out, mostly bug fixing this time.
As i said before i am strongly considering replacing the xml representation of code with a textual one. So what do you think: is this one
Code:store_encountered_party #1 store_encountered_party2 #2 try_begin lt #2,0 try_begin ge #1,towns_begin lt #1,towns_end jump_to_menu menu:town else_try ...
aGorilla said:codewright said:V0.6 is out, mostly bug fixing this time.
As i said before i am strongly considering replacing the xml representation of code with a textual one. So what do you think: is this one
Code:store_encountered_party #1 store_encountered_party2 #2 try_begin lt #2,0 try_begin ge #1,towns_begin lt #1,towns_end jump_to_menu menu:town else_try ...
Any chance you could make it YAML compatible?
This thread wasn't dead, it just needed a bump
ottomanski said:Very very thanks for making this editor because i have a problem (maybe in my brain ) and cant use python
I tried a little mod with your editor. (I am telling what I did because there is a problem and I will ask 'why' at the end.) I copied all content of XmlModuleSystem-0.9\Modules\native and put these xml files into a new folder in XmlModuleSystem-0.9\Modules\ Then I edited some of xml files using notepad. I edited troops, parties, party_templates, factions and tried to add a new faction, 3 new troops of this faction and a spawn point for parties of this faction. Then I double clicked XmlModuleSystem.exe, selected my new module file (which I copied and edited from native files), I clicked export then it showed an error:
When I only select native or native with skeleton-simple.xml, it exports normaly. What did I do wrong?
Edit: If I click continue, the bar that shows the percentage freezes and I have to close the program.