Yes, I have been thinking of a way to add you semi-random commands feature to my editor, and I think I found a way to use a similar system in XML.
It will take some work to code it, but it should be useful.
This is an exemple of a province in XML form :
(it's the central province from the map "fourmaggedon")
Quote:
<PROVINCE killpop="1" poptype="61" population="45000">
<commanders name="Chalidor" mag_earth="5" mag_nature="4" unit_id="Troll King" xp="300">
<units number="35" unit_id="Troll" />
</commanders>
<commanders name="Morghal" mag_earth="5" mag_water="4" unit_id="Troll King" xp="300">
<units number="25" unit_id="Troll Moose Knight" />
</commanders>
<commanders name="Urgya" mag_fire="5" unit_id="Vaetti Hag" xp="300">
<units number="50" unit_id="Vaetti" />
</commanders>
<commanders name="Urgyuur" mag_fire="5" unit_id="Vaetti Hag" xp="300">
<units number="25" unit_id="Wolf Rider" />
</commanders>
<terrain_types>manysites</terrain_types>
<terrain_types>nostart</terrain_types>
<terrain_types>farm</terrain_types>
<terrain_types>somewater</terrain_types>
<terrain_types>large</terrain_types>
</PROVINCE>
|
The same province, but instead of having all the commanders, you would have one of them chosend randomly, *and* a lone normal troll king with 5 vaettis bodyguards :
Quote:
<PROVINCE killpop="1" poptype="61" population="45000">
<RANDOM>
<commanders name="Chalidor" mag_earth="5" mag_nature="4" unit_id="Troll King" xp="300">
<units number="35" unit_id="Troll" />
</commanders>
<commanders name="Morghal" mag_earth="5" mag_water="4" unit_id="Troll King" xp="300">
<units number="25" unit_id="Troll Moose Knight" />
</commanders>
<commanders name="Urgya" mag_fire="5" unit_id="Vaetti Hag" xp="300">
<units number="50" unit_id="Vaetti" />
</commanders>
<commanders name="Urgyuur" mag_fire="5" unit_id="Vaetti Hag" xp="300">
<units number="25" unit_id="Wolf Rider" />
</commanders>
</RANDOM>
<commanders unit_id="Troll King">
<bodyguards number="5" unit_id="Vaetti" />
</commanders>
<terrain_types>manysites</terrain_types>
<terrain_types>nostart</terrain_types>
<terrain_types>farm</terrain_types>
<terrain_types>somewater</terrain_types>
<terrain_types>large</terrain_types>
</PROVINCE>
|
The "<RANDOM>" tag should be usable, when I've finished coding, with any other tag to make the function generating the map code chose randomly one of the child nodes to use in plance of the random tag.