Worlds of Magic

Worlds of Magic

评价数不足
MODDING WORLDS OF MAGIC - HOW TO GUIDE basics
由 Leszek 制作
Almost all gameplay stats and number in Worlds of Magic are located in xml files in the StreamingAssets folder, and can be easily modified. The purpose of this guide is to explain what exactly is located in each file and how to modify it without breaking the game.
   
奖励
收藏
已收藏
取消收藏
XML files
Almost all gameplay stats and number in Worlds of Magic are located in xml files in the StreamingAssets folder, and can be easily modified. The purpose of this guide is to explain what exactly is located in each file and how to modify it without breaking the game.
First, some basic tips:
- use Notepad++ or a similar tool. It makes it easier to spot any mistakes that might invalidate the file.
- do not add anything new. Right now you can only change existing data.
- all values are inside <brackets>. You always have to close all the brackets you use.
- if an in-game value is percentage-based, it will be shown as a fraction in the xml file (for example, 90% would be 0.9)
- for a binary resolution (yes/no), you can use both 1/0 or true/false.
- everything is case-sensitive.
- always back up your files.


Now then, the files itself:

Constants.xml contains all the basic mechanical stuff which does not belong anywhere else.
<disciplineConsts> contain values for disciplines. You can't change how disciplines work, only how powerful they are.
<specialAbilitiesVariables> contain values for some unit perks.
<resourcesConsts> govern crafting materials.
<defaultTilesValues> contain properties of all the tile types. <xIncome> is a flat numerical bonus. <xBonus> is a percentage bonus. <maxPopulation> increases maximum population.
<defaultResourcesValues> contain properties of all the resources. <xIncome> is a flat numerical bonus. <xBonus> is a percentage bonus. <spellResistance> confers resistance to the city. <acBonus> and <hitdamageBonus> increase AC and ToHit/Damage of units created in the city (need alchemists' guild). <populationGrowthBonus> increases population growth, <maxPopulation> increases maximum population.
<defaultMovementInfos> defines movement cost of each unit type for each terrain type. From the top, it's Ocean, Plain, Hill, Forest, Swamp, Desert, Mountain, Tundra, Shore, Quicksand, Lava, and Air. <isTileWalkable> checks if a unit can move through the terrain at all.
Then there are several entries used for crafting. I'm omitting these for now.
<raceParams> contain race properties, including starting units (see units.xml for IDs), buildings, citizen production rates, starting city size and militia unit.
<sLTemplates> contain the templates for existing sorcerer lords. Tiers are, from the top: Life, Death, Air, Earth, Fire, Water, Augmentation, Biomancy, Destruction, Mentalism, Protection and Summoning. The rest is rather self-explanatory.
In <disciplinesInfo> you can change the cost and prerequisites of all the disciplines.
Finally, <cityNames> with all the names for different factions' cities.



Buildings.xml contains all the city buildings in the game.
<WFCityBuildingTemplate> <-- each unit needs its own template.
<buildingID>13</buildingID> <-- do not change IDs
<spawnId>13</spawnId>
<race>HIGH_MEN</race> <-- race that can construct the building
<type>CATHEDRAL</type> <-- building type (used for prerequisites)
<requiredBuildings>
<WFCityBuildingType>PANTHEON</WFCityBuildingType> <-- buildings required for this construction (uses <type> above)
</requiredBuildings>
<productionCost>700</productionCost> <-- cost (in production, "hammers") to build
<goldCost>4</goldCost> <-- upkeep in gold
<manaCost>0</manaCost> <-- upkeep in mana
<foodCost>0</foodCost> <-- upkeep in food
<neCost>0</neCost> <-- upkeep in negative energy
<goldIncome>0</goldIncome> <-- flat incomes
<foodIncome>0</foodIncome>
<powerIncome>4</powerIncome>
<researchIncome>0</researchIncome>
<neIncome>0</neIncome>
<goldBonus>0</goldBonus> <-- %-based bonuses
<foodBonus>0</foodBonus>
<powerBonus>0</powerBonus>
<productionBonus>0</productionBonus>
<researchBonus>0</researchBonus>
<neBonus>0</neBonus>
<scrapValue>200</scrapValue> <-- gold you get for destroying the building
<abilities> <-- see below
<WFCityBuildingAbility>
<type>UNREST_BONUS</type>
<intValues>
<int>-10</int>
</intValues>
<adjacentTile>SEA</adjacentTile>
<adjacentResource>NONE</adjacentResource>
</WFCityBuildingAbility>
<WFCityBuildingAbility>
<type>RELIGIOUS</type>
<adjacentTile>SEA</adjacentTile>
<adjacentResource>NONE</adjacentResource>
</WFCityBuildingAbility>
</abilities>
<parcelNumber>24</parcelNumber>
<needSeaAccess>false</needSeaAccess> <-- if the city needs to be close to the sea to be able to construct the building
</WFCityBuildingTemplate>


<abilities> are the most complicated part. Some of them do not need any values, some need <intValues>, some need <floatValues>. The <adjacentX> part needs to be there always, but is used only in specific abilities. As a rule of thumb, if you want to change them, compare with those already existing. Here's a quick rundown on the existing abilities and their requirements:
AC_BONUS: int[0] - increases AC of units built
HIT_DAMAGE_BONUS: int[0] - increases To Hit & Damage of units built
XP_BONUS: int[0] - increases XP of units built
VIEW_RANGE_BONUS: int[0] - increases view range of the city
UNREST_BONUS: int[0] - increases unrest
FOOD_STORAGE_BONUS: int[0] - allows storing food
MAX_POPULATION_BONUS: float[0] - increases maximum population
POPULATION_GROWTH_BONUS: int[0] - increases population growth
SPELL_RESISTANCE_BONUS: int[0] - increases spell resistance



Units.xml contains all the units in the game. It's much easier to understand if you know d20, but still, it's quite long and complicated.
Here's an example unit with explanations:

<WorldUnitTemplate> <-- each unit needs its own template.
<id>4</id> <-- do not change this
<spawnId>4</spawnId> <-- do not change this.
<race>HIGH_MEN</race> <-- race.
<battleStats> <-- contains most of the units' stats
<name>Clerics</name> <-- only used here, if you want to change the name displayed in the game, modify a language file.
<defaultLevel>2</defaultLevel> <-- starting level of the unit.
<abilityScores> <-- contains ability scores.
<strength>
<score>12</score> <-- influences chance to hit and damage in melee
</strength>
<dexterity>
<score>10</score> <-- influences chance to hit ranged, armor class and reflex saves
</dexterity>
<constitution>
<score>12</score> <-- influences HPs and Fortitude saves
</constitution>
<intellegence>
<score>10</score> <-- influences ranged magical chance to hit
</intellegence>
<wisdom>
<score>16</score> <-- influences Will saves
</wisdom>
<charisma>
<score>14</score>
</charisma>
</abilityScores>
<attacks> <-- all attacks.
<Attack> <-- each attack needs to be in its own <Attack> node
<attackType>MeleeNormal</attackType> <-- attack type, includes also: MeleeThrown, MeleeGaze, RangedNormal, RangedMagical
<wielding>MainHand</wielding> <-- modifies the damage bonus from STR for melee weapons (MainHand x1, OffHand x0.5, TwoHand x1.5)
<additionalAttackBonus>0</additionalAttackBonus> <-- an additional way to modify chance to hit
<criticalRange>20</criticalRange> <-- chance of critical hit (roll on a 20-sided die, the lower the better)