Endless Legend Tutorial Guide
Endless Legend Tutorial Guide
Revision 3
Modding Tutorial
Introduction ............................................................................................................................... 1
How to create a mod ................................................................................................................ 2
How to install and run a mod................................................................................................... 4
Basics on simulation ................................................................................................................ 6
How to tweak season ............................................................................................................... 9
How to add a new faction trait ............................................................................................. 10
How to add a technology ....................................................................................................... 12
How to add a city improvement ........................................................................................... 16
How to add an item ............................................................................................................... 20
How to add a skill .................................................................................................................. 23
How to change a resource..................................................................................................... 26
How to add a quest ................................................................................................................ 29
How to add a victory .............................................................................................................. 34
How to add or change text .................................................................................................... 36
How to add or change 2D assets.......................................................................................... 38
Advanced: Simulation Descriptor ......................................................................................... 43
Advanced: Interpreter Prerequisites .................................................................................... 47
Advanced: AI Parameter ....................................................................................................... 49
Modding Tutorial
Modding Tutorial
Introduction
Multiplayer games
Please take notice that if you want to play a multiplayer game with a specific mod you will have
to ensure that every player have activated it through the main menu.
1
Modding Tutorial
In order to run, a new xml file will have to be added at the root of your mod.
When it is created you must add info in it about the things you changed.
For instance: here I dedicated my changes to some elements in GUI and in Localization.
2
Modding Tutorial
<Tags />
<Author>Unknown</Author>
<Homepage></Homepage>
<Title>A new super mod!</Title>
<Version Major="1" Minor="0" Revision="0" />
<Description>A major new super change to the game.</Description>
<ReleaseNotes />
<Plugins>
</Plugins>
</RuntimeModule>
</Datatable>
You can now create a Zip file and upload your mod on the internet.
IMPORTANT:
Next to the Name="NewSuperMod" you can read a Type="Conversion".
It means that all the files you created will change existing information or add new content to the
already existing files in the game.
There is another Type="Standalone" that will replace the files in the game by the new files you
created. You have to be very careful with this Type not forgetting any requirements from any
connection otherwise it won’t launch.
To ensure each file you may change is correctly set into the root xml, best should be to use the
file in reference (ModdingReference.xml) from the tutorial example. Indeed it contains every bit
of database plugin and will cover any changes you could make.
<FilePath> is in fact the path of your own document in the modding folder. The names can be
different from the example but you have to ensure the link is always correct between the folder
name and the name in this “root” xml.
3
Modding Tutorial
4
Modding Tutorial
5
Modding Tutorial
Basics on simulation
In each and every xml of the game you will see text between the marks <PathPrerequisite> or
like Path="". What is written follows some rules that allow checking specific elements that are
going in your current game.
The structure
The structure is based on hierarchy. There is the Empire at the top and it has a lot of different
children which have their own children. It has this kind of look:
ClassEmpire (or EmpireTypeMajor)
>ClassCity
>ClassDistrict
>ClassPointOfInterest
>ClassArmy
>ClassUnit
>ClassEmpirePlan
>ClassResearch
Then, when you look at a specific moment in-game where one of your army has a hero in it you
will make the corresponding path:
../ClassEmpire/ClassArmy/ClassUnit,UnitRankHero
1) The easiest thing to understand is that the / is the link between parent and child.
6
Modding Tutorial
What you have to remember is that each time you create an object it should have a descriptor
to work correctly (simulationdescriptor often contains game effects).
Then, if you want to check for example that your new city improvement is built in a city the path
will be:
../ClassCity/CityImprovementNew
4) Last information to take in consideration is that each class has properties that can be also
check through calculation.
It is mainly numbers and you can check them through formulas thanks to
<InterpreterPrerequisite > instead of <PathPrerequisite>
For example, in the ClassEmpire (EmpireTypeMajor), you can check several numbers:
AllianceCount, WarCount, HeroCount, EmpirePointStock, CurrentTurn, EmpireApproval, etc.
Simulation hierarchy
The path will always depend on where you are starting in the hierarchy.
If you start on the empire (like it is for the faction traits) and you want to modify a property in all
the unit of all the armies of your empire, you have to write this path:
ClassEmpire/ClassArmy/ClassUnit
If you are modifying a unit ability which is applied directly on a unit and you want to modify a
property in the corresponding unit your path will be:
ClassUnit or nothing
If you are modifying a unit ability which will modify a property on all units alongside it and this in
a city or an army then you will need
../Garrison/ClassUnit
Sealed properties
Another good thing to know concerns the sealed properties.
7
Modding Tutorial
You will find them sometimes. They are used to define a property which is not modifiable by
modifier and simulation. They are used when we need to store a value computed in the code.
Like the health of a unit for example.
If you want to modify the Health of a unit you have to modify the MaximumHealth or the unit
regeneration but you should never try to modify directly the health.
Also, there is no one shot instruction in the simulation. Like, “loose 10 hp now”.
You should go to the last pages of this tutorial to have a look at the advanced parts about
simulation descriptors and Interpreter prerequisite for a bit more information.
8
Modding Tutorial
- NumberOfPastSeason: It will indicate that the effect could trigger starting from the winter
number X. If it is not trigger, it will add itself to the pool of available effects for the next winter.
Please note that the first winter is a bit special because all effect set to 1 will be in the list of
first winter maluses.
Ref: Simulation\SimulationDescriptors[Season].xml
About the simulation descriptor it should have the same name in both files.
But it is in the xml just above that you will set up the effects itself.
The specifity here is that every of those simulation descriptors are modifiers. It means that they
are modifying existing values (don’t forget to check winter immunities as in the example below).
Please do not hesitate to have a look at the end of the document to have more info on
possibility (Advanced: Simulation Descriptor)
Example:
<SimulationDescriptor Name="YourWinterMalus">
<SimulationModifierDescriptors>
<SimulationModifierDescriptor TargetProperty="CityFood" Operation="Percent"
Value="-0.25" Path="EmpireTypeMajor/!WinterFoodReductionImmunity,ClassCity"/>
</SimulationModifierDescriptors>
</SimulationDescriptor>
9
Modding Tutorial
- Name: The trait's "id", serves as a tag to identify it in any xml file. Different levels for a same
trait should have different names (eg: NewTrait1, NewTrait2, etc.).
- Title: If you want your faction trait to be localized, use”%” to reference a localization key (eg:
%CrusaderTitle) and go to a). Otherwise skip to b).
- Name: The trait's "id", serves as a tag to identify it in any xml file. Has to be the same as the
Gui element.
- SubCategory: There are different categories of trait according to their purpose. "StandardTrait"
should be used for new trait.
- Custom: When you add a trait you must set this value to "true" to make it available for custom
faction.
10
Modding Tutorial
Ref: Simulation\SimulationDescriptors[FactionTrait].xml
- Name: The trait's "id", serves as a tag to identify it in any xml file. Has to be the same as the
Gui element and custom faction trait.
<SimulationModifierDescriptors>
<SimulationModifierDescriptor TargetProperty="MaximumMovement" Operation="Addition"
Value="2" Path="EmpireTypeMajor/Garrison/ClassUnit,#Winter"/>
<SimulationModifierDescriptor TargetProperty="VisionRange" Operation="Addition"
Value="1" Path="EmpireTypeMajor/Garrison/ClassUnit,#Winter"/>
</SimulationModifierDescriptors>
TargetProperty: The variable you want to modify. The target properties accessible can be found
in majority in SimulationDescriptors[Class].xml.
Operation: It can be a multiplication, addition, percentage, subtraction, division or power.
Value: By how much you want to modify the variable (positive or negative)
Path: Very important. It shows what TargetProperty you want to modify exactly.
Eg: You want to modify Approval for your empire, affecting all the cities then
Path=”EmpireTypeMajor/ClassCity”. However, if you want to modify Approval only for a specific
affinity, add that affinity using a “,”. Path = “EmpireTypeMajor,AffinityBrokenLords/ClassCity”.
Other eg: You want to change the DamageMax for unit type ranged only. This is the Path you
would use: EmpireTypeMajor/ClassArmy/ClassUnit,UnitTypeRanged.
11
Modding Tutorial
Ref: Gui\GuiElements[Technology].xml
- Name: The technology definition name, serves as a tag to identify it in any xml file. Each
technology should have different names (eg: Technology1, Technology 2, etc.).
- Coordinates: Find below the coordinates inside an era. It works with technology barycentre.
12
Modding Tutorial
- Title: If you want your technology to be localized, use”%” to reference a localization key (eg: %
Technology Title) and go to a). Otherwise skip to b).
- Icon: Please refer to the modding/assets part to learn how to add pictures
- TechnologyEra: Depends in which era you want to see your technology placed,
TechnologyEraDefinition1, or 2, or 3, etc.
- Name: The technology definition name, serves as a tag to identify it in any xml file. Has to be
the same as the Gui element.
- Category and SubCategory: There are different category and subcategories of technologies
according to their purpose. It depends on the major bonus.
- SimulationDescriptorReference: There are 2 different thing. The technology count of the era in
which is your technology and the reference to the effects descriptor (see below where to create
effects).
- Cost: It is a formula common to each tehcnology depending once again their era.
- Name: The technology's "id", serves as a tag to identify it in any xml file. It has to be the name
refered into the SimulationDescriptorReference of the technology definition.
13
Modding Tutorial
<SimulationModifierDescriptors>
<SimulationModifierDescriptor TargetProperty="AttributeAttack" Operation="Addition"
Value="30" Path="./EmpireTypeMajor/Garrison/ClassUnit"/>
<SimulationModifierDescriptor TargetProperty="AttributeDefense" Operation="Percent"
Value="0.20" Path="./EmpireTypeMajor/Garrison/ClassUnit"/>
</SimulationModifierDescriptors>
AIEmpireGrowth
AIEmpireProduction
AIUnitProduction
AIBuildingProduction
AIEmpireMoney
AIEmpireResearch
AIEmpireEmpirePoint
AIEmpireDefense
AIEmpireStrategicResource1
AIEmpireStrategicResource2
AIEmpireStrategicResource3
AIEmpireStrategicResource4
AIEmpireStrategicResource5
AIEmpireStrategicResource6
AIEmpireLuxuryResource
AIEmpireImproveSearch
AIEmpireImproveBribe
AIEmpireImproveTalk
AIEmpireBuyout
AIEmpireMilitaryDefense
AIEmpireMilitaryOffense
AIEmpireBoosterFood
AIEmpireBoosterIndustry
14
Modding Tutorial
AIEmpireBoosterSciene
AIEmpireDiplomacy
AIEmpireMinorFactionAssimilation
AIEmpireBoosterScience
AIEmpireExploration
15
Modding Tutorial
Ref: Gui\GuiElements[CityImprovement].xml
- Name: The city improvement's "id", serves as a tag to identify it in any xml file. Each city
improvement should have different names (eg: CityImptovement1, CityImptovement2, etc.).
- Title: If you want your city improvement to be localized, use”%” to reference a localization key
(eg: %BuildingTitle) and go to a). Otherwise skip to b).
- Icon: Please refer to the modding/assets part to learn how to add pictures
Ref: Simulation\DepartementOfIndustry+Constructibles[CityImprovement].xml
- Name: The city improvement's "id", serves as a tag to identify it in any xml file. Has to be the
same as the Gui element.
- SubCategory: There are different categories of city improvement according to their purpose. It
depends on the major bonus.
16
Modding Tutorial
- PathPrerequisite: All the conditions required to make the city improvement appear. You can
hide it for some faction. Commonly it is done for some factions like the faction tutorial.
<PathPrerequisite Inverted="true"
Flags="Prerequisite,Discard">../ClassEmpire,AffinityTutorial</PathPrerequisite>
You also have to add a line to check if the city improvement is not already built in the empire or
the city.
<PathPrerequisite Inverted="true"
Flags="Prerequisite,Discard">.../ClassEmpire/Uniques,CityImprovementNew</PathPrerequisite
>
Note: In the example the city improvement is a unique one.
Ref: Simulation\SimulationDescriptors[CityImprovement].xml
- Name: The city improvement's "id", serves as a tag to identify it in any xml file. Has to be the
same as the simulation descriptor line you write in the city improvement reference.
<SimulationModifierDescriptors>
<SimulationModifierDescriptor TargetProperty="CityFood" Operation="Addition"
Value="5" Path="./ClassCity"/>
<SimulationModifierDescriptor TargetProperty="CityIndustry" Operation="Percent"
Value="0.15" Path="./ClassCity"/>
<SimulationModifierDescriptor TargetProperty="VisionRange" Operation="Addition"
Value="2" Path="./ClassCity/ClassDistrict"/>
<SimulationModifierDescriptor TargetProperty="CityExpansionDisapproval"
Operation="Multiplication" Value="0" Path="./ClassCity"/>
</SimulationModifierDescriptors>
17
Modding Tutorial
For each improvement, you must write an AIParameterDatatableElement (as explained in the AI
part).
Improvements’ data can be converted (with AIParameterConverters) only in these AIParameters:
AICityGrowth
AICityEmpirePoint
AICityProduction
AICityResearch
AICityMoney
AICityMoneyUpkeep
AICityMilitary
AIEmpireExploration
AIEmpireColonization
AIEmpireMilitaryDefense
AIEmpireMilitaryOffense
AICityLuxuryResource
AICityStrategicResource
AICityGrowth
AICityApproval
AICityProduction
AICityMoney
AICityResearch
AICityEmpirePoint
AICityLevelUp
AICityDistrictNeighbours
Ref: DepartmentOfScience+Constructibles[EraXTechnology].xml
No need for a lot of details.
Just create the technology definition of the technology that will be used.
<TechnologyDefinition Name="TechnologyDefinitionNewCityImprovement"
TechnologyFlags="Affinity" Visibility="VisibleWhenUnlocked">
<SimulationDescriptorReference Name="TechnologyNewCityImprovement" />
</TechnologyDefinition>
Ref: Simulation\SimulationDescriptors[Technology].xml
No need for a lot of details either.
Just create an empty technology descriptor. The effects will come from the city improvement
itself. Must be the same name as in the previous reference though.
18
Modding Tutorial
Ref: Simulation\DepartementOfIndustry+Constructibles[CityImprovement].xml
This is where your city reference should be.
You only need to add a technology prerequisite to make the link with your new technology.
<TechnologyPrerequisite
Flags="Prerequisite,Discard,Technology,AIEconomicRatio">TechnologyNewCityImprovement</T
echnologyPrerequisite>
Ref: GuiElements[Technology].xml
Of course you must not forget to add a Gui element for the technology. Please look at the details
on creation of a technology to know how to do this.
19
Modding Tutorial
Ref: Gui\GuiElements[ItemDefinitions].xml
- Name: The item's "id", serves as a tag to identify it in any xml file. Each item should have a
different name (eg: item 1, item 2, etc.).
- Title: If you want your item to be localized, use”%” to reference a localization key (eg:
%ItemTitle) and go to a). Otherwise skip to b).
- Icon: Please refer to the modding/assets part to learn how to add pictures
Ref: Simulation\ItemDefinitions[Unique].xml
- Name: The item's "id", serves as a tag to identify it in any xml file. Has to be the same as the
Gui element.
- SubCategory: There are different subcategories of item according to their genre (eg: For armors
it is legs, torso, head)
- Tags: This is an optional info. It can be used to ensure the item will never move into the
obsolete part of the equipment vault.
20
Modding Tutorial
In this case it will take the category, the class, the slot and ensuring this one is not already used.
In other words, each time someone creates a Head armor it prevents the creation of clone lines.
- PathPrerequisite: All the conditions required to make the item appear. You can hide it for some
factions for instance or only for heroes.
Ref: Simulation\SimulationDescriptors[ItemUnique].xml
- Name: The item's "id", serves as a tag to identify it in any xml file. Has to be the same as the
simulation descriptor line you write in the city improvement reference.
<SimulationModifierDescriptors>
<SimulationModifierDescriptor TargetProperty="EquipmentDefense" Value="3"
Operation="Addition" Path="../ClassUnit" />
<SimulationModifierDescriptor TargetProperty="EquipmentMaximumHealth" Value="3"
Operation="Addition" Path="../ClassUnit" />
</SimulationModifierDescriptors>
21
Modding Tutorial
In both cases you will need to make a link between the 2 elements by adding some files related
to the creation of a new technology.
Ref: DepartmentOfScience+Constructibles[EraXTechnology].xml
No need for a lot of details.
Just create the technology definition of the technology that will be used.
<TechnologyDefinition Name="TechnologyDefinitionNewItem"
TechnologyFlags="Affinity Quest" Visibility="VisibleWhenUnlocked">
<SimulationDescriptorReference Name="TechnologyNewItem" />
</TechnologyDefinition>
If this technology is supposed to stay hidden (if item is a quest reward) put Visibility=”Hidden”
Ref: Simulation\SimulationDescriptors[Technology].xml
No need for a lot of details either.
Just create an empty technology descriptor. The effects will come from the item itself. Must be
the same name as in the previous reference though.
Ref: Simulation\ItemDefinitions[Unique].xml
This is where should be your item reference.
The only need is to add a technology prerequisite to make the link with your new technology.
<TechnologyPrerequisite
Flags="Prerequisite,Discard,Technology">TechnologyNewItem</TechnologyPrerequisite>
Ref: GuiElements[Technology].xml
Of course you must not forget to add a Gui element for the technology definition. Please look at
the details on creation of a technology to know how to do this.
If you want to unlock this item through quest reward you will have to use in the droplist the
previous Gui element and the one of the GuiElements[ItemDefinitions].xml:
<Blueprint Name="TechnologyDefinitionNewItem" ConstructibleName="ItemNew"
Weight="1"/>
22
Modding Tutorial
Ref: Gui\GuiElements[UnitSkill].xml
- Name: The skill's "id", serves as a tag to identify it in any xml file. Each skill should have
different names (eg: Skill1, Skill2, etc.).
- Coordinates: The sector is the zone (left=0, center=1, right=2). Radius is the "floor" (0= at the
bottom, 1= a level higher, etc.) Angle is the position inside the radius which will depend of the
place inside the radius chosen (0= to the left and a greater number= going to the center/right).
- Title: If you want your skill to be localized, use”%” to reference a localization key (eg:
%SkillTitle) and go to a). Otherwise skip to b).
- Icon: Please refer to the modding/assets part to learn how to add pictures
You have to note that those icons require being white in order to be of the desired color. But of
course you can chose to change the established order.
/!\ IMPORTANT/!\
If you choose to put a skill in a sector which already has a skill in it you might need to move a bit
this already existing skill. Best thing to do is to recover the name of this skill. Look at the
localization file and search the in-game name. For example: Strength of the Wild will be
%HeroSkillLeaderBattle10InfantryTitle. It means that the UnitSkillGuiElement
23
Modding Tutorial
Ref: Simulation\UnitSkills[Hero].xml
- Name: The skill's "id", serves as a tag to identify it in any xml file. Has to be the same as the
Gui element.
- Category and SubCategory: Category is always "UnitSkill" but there are different subcategories
of skills according to their purpose. It depends on the major bonus.
- SimulationDescriptorReference: You can choose the number of levels here, each making
reference to the effects descriptor (see below where to create effects).
- Prerequisite: If you want to link the skill to another it is the way to do so. You can also hide or
allowed some skill for very specific hero (based on faction or genre for instance).
Ref: Simulation\SimulationDescriptors[SkillsHero].xml
- Name: The skill's "id", serves as a tag to identify it in any xml file. Has to be the name refered
into the SimulationDescriptorReference of the UnitSkills[Hero].xml.
<SimulationModifierDescriptors>
<SimulationModifierDescriptor TargetProperty="AttributeAttack" Operation="Addition"
Value="30" Path="UnitHero" />
<SimulationModifierDescriptor TargetProperty="AttributeDefense Operation="Addition"
Value="30" Path="UnitHero" />
</SimulationModifierDescriptors>
24
Modding Tutorial
For each hero skill, you must write an AIParameterDatatableElement (as explained in the AI
part).
Each AIParameterDatatableElement must contain these 6 AIParameters:
AICity
AIArmy
AIExploration
AIYoungCityAssignment
AIArmyAssignment
AIMatureCityAssignment
The three first AIParameters define the category of the skill. The three last AIParameters define
where the AI should assign a hero with this skill.
25
Modding Tutorial
- Name: The resource name, serves as a tag to identify it in any xml file. Each resource have
different names (eg: Luxury1, Luxury2, Strategic3, etc.). There are 15 Luxury resources and 6
Strategic resources.
- Title: If you want your resource to be localized, use”%” to reference a localization key (eg:
%ResourceTitle) and go to a). Otherwise skip to b).
- Icon: Please refer to the modding/assets part to learn how to add pictures
(be careful with the name of the resource small icon as it must be different from what is already
existing)
- SymbolString and Color: This element is related to the small symbol you can see near a luxury
or strategic resource. Unfortunately it cannot be changed at the moment because the info is in
the game assets part that you cannot access.
26
Modding Tutorial
- Title: If you want your deposit resource to be localized, use”%” to reference a localization key
(eg: %DepositResourceTitle) and go to a). Otherwise skip to b).
- Icon: Please refer to the modding/assets part to learn how to add pictures
- Name: The extractor name, serves as a tag to identify it in any xml file. Each extractor have
different names (eg: ExtractorLuxury1, ExtractorLuxury2, ExtractorStrategic3, etc.). There are 15
Luxury resources and 6 Strategic resources.
- Title: If you want your resource to be localized, use”%” to reference a localization key (eg:
%ExtractorTitle) and go to a). Otherwise skip to b).
- Icon: Please refer to the modding/assets part to learn how to add pictures
- Name: The booster definition's "id", serves as a tag to identify it in any xml file. Has to be the
name refered into the SimulationDescriptorReference of the technology definition.
- Duration: You can manage how many turn the booster will work.
- SimulationDescriptorReference: You have to enter the name of the effect you create. See the
part "Create the effects" below for details.
27
Modding Tutorial
- Name: The booster effects' "id", serves as a tag to identify it in any xml file. Has to be the name
refered into the SimulationDescriptorReference of the Booster definition.
- SimulationModifierDescriptor: Those will be the formulas used to create the effects. It is written
as follows.
<SimulationModifierDescriptors>
<SimulationModifierDescriptor TargetProperty="DistrictFood" Operation="Addition"
Value="2" Path="./ClassCity/TerrainTagFood"/>
<SimulationModifierDescriptor TargetProperty="CityGrowth" Operation="Percent"
Value="0.2" Path="./ClassEmpire/ClassCity"/>
<SimulationModifierDescriptor TargetProperty="CityApproval" Operation="Addition"
Value="15" Path="./ClassCity"/>
</SimulationModifierDescriptors>
28
Modding Tutorial
- Name: The quest's "id", serves as a tag to identify it in any xml file. Each Quest should have
different names (eg: Quest1, Quest2, etc.).
- Title: If you want your quest to be localized, use”%” to reference a localization key (eg:
%QuestTitle) and go to a). Otherwise skip to b).
- Icon: Please refer to the modding/assets part to learn how to add pictures [4]
- Steps: Will be the way to show the step into the game journal.
29
Modding Tutorial
- SkipLockedQuestTarget: In case the quest target a ruin it can lock the location for it own
purpose only ("false") or not ("true").
The tags
Will be the basic way the quest is triggered. Before even ensuring the quest is allowed to happen
(thanks to a prerequisite check).
Several types of tags exist at this time. The most common are:
<Tags>Interact</Tags> trigger a quest as soon as you search a ruin
<Tags>Talk</Tags> trigger a quest as soon as you parley with a
<Tags>BeginTurn</Tags> trigger a quest at the beginning of a turn (this one is mandatory if you
want to trigger a quest based on a current turn or after a specific change in game simulation)
<Tags>Chapter #</Tags> mean to make link between chapters
<Tags>#FactionType</Tags> trigger only according a specific faction
<TagsMainQuest</Tags> to mark a quest as a main one
The prerequisites
It is the way to define what is limiting or mandatory for the quest to trigger. It mainly concerns
the state of the game or the type of faction you play.
<Prerequisites Target="$(Empire)">
<PathPrerequisite
Flags="Prerequisite">EmpireTypeMajor/ClassResearch,TechnologyEra2</PathPrerequisite>
<InterpreterPrerequisite Flags="Prerequisite">$Property(ClassEmpire:WarCount) ge
0</InterpreterPrerequisite>
<PathPrerequisite Inverted="true"
Flags="Prerequisite">../EmpireTypeMajor,Necrophages</PathPrerequisite> <--It means that if
you play Necrophages quest cannot be triggered-->
</Prerequisites>
There is more info on prerequisite in another part of the document. Please refer to the summary
table at the beginning.
The variables
It will regroup all the elements you want to interact with. It can be a village, a ruin, a resource,
etc. It will follow the conditions you decide. But the logic is very thorough. For more info on the
variable request logic you will have to go on the wiki for further details. [http://LINK]
You will sometime need to get the variables of all your cities in order to get the region of your
city in order to get the point of interests’ type “ruins” in it in order to pick one and choose it as a
30
Modding Tutorial
location to go on your quest. This means that if you still don’t have a city, the variables will work
as a prerequisite and will prevent your quest from launching.
Here is an example where I need cities. But more generally, if I want to check the surrounding
regions around my empire being on the same continent I will have to write down this:
<Var VarName="$EmpireCity">
<Any>
<From Source="$Empire.$Cities"/>
</Any>
</Var>
<Var VarName="$EmpireCityRegion">
<From Source="$EmpireCity.$Region"/>
</Var>
<Var VarName="$SurroundingRegions">
<From Source="$EmpireCityRegion.$RegionWithNeighbourRegions">
<Where>
<FilterRegionIsOnSameContinent RegionContextVarName="$EmpireCityRegion"/>
</Where>
</From>
</Var>
Now that I have retrieved the info I can have a look at the point of interest in the variable of the
region that has been chosen by the system. I will get a variable of a ruin (QuestPOI) in order in
one of my step to ask the player to search the ruin in question.
<Var VarName="$PointOfInterestToInspect">
<Limit LimitMin="5" LimitMax="6">
<From Source="$SurroundingRegions.$PointsOfInterest">
<Where>
<PathPrerequisite>PointOfInterestTypeQuestLocation</PathPrerequisite>
</Where>
</From>
</Limit>
</Var>
<Var VarName="$PointOfInterestToInspectLocation">
<From Source="$PointOfInterestToInspect.$Position"/>
</Var>
And then if I want to give info on the POI in the text of the journal I will have to set a localization
variable.
The sequence
It is the main structure of the quest. It is mandatory that the entire sequence remains between
the marks <Controller_Sequence> </Controller_Sequence>
There can be different step(s) (at least one) that you will be able to see in the game journal
(thanks to GuiElements, details at the bottom). All the variables from before will be used here.
31
Modding Tutorial
First I need to update the game journal to indicate this is the current step.
Then if there is a ruin that will be targeted best is to lock it to avoid conflict with other quests
that could retrieve this same variable.
<Action_LockQuestTarget TargetVarName="$PointOfInterestToInspect"
LockOption="Lock"/>
<Decorator_Inspect TargetEntityVarName="$PointOfInterestToInspect"
Output_InstigatorSimObjectVarName="$InspectionInstigatorSimObject"
PrerequisiteNotVerifiedMessage="%QuestPrerequisiteNotVerified" Initiator="Empire">
<--The Output_InstigatorSimObjectVarName is a variable created by this decorator and it will
allow you to check what is in the army which is searching the ruin-->
<ConditionCheck_Prerequisite>
<Prerequisites Target="$InspectionInstigatorSimObject">
<PathPrerequisite
Flags="Prerequisite">ClassArmy/ClassUnit,UnitHero</PathPrerequisite>
</Prerequisites>
</ConditionCheck_Prerequisite>
</Decorator_Inspect>
<--This is the check, looking if there is a hero unit in the searching army-->
<Action_RemoveQuestMarker
TargetQuestMarkerVarName="$QuestMarkerPointOfInterestToInspect" />
<Action_LockQuestTarget TargetVarName="$PointOfInterestToInspect"
LockOption="Unlock"/>
<Action_UpdateStep StepName="SideQuestPOI#New-Step1" State="Completed"/>
<Action_UpdateQuest State="Completed"/>
<--As soon as the decorator is validated, all the actions are instant. Do not forget to update the
step for each step and the quest when it is finished-->
The reward
There is a global Droplist.xml where you can take rewards from. Or add new ones. For the
moment the most common available are:
- DroplistAdvancedTechnologies
> You will get a technology from the next available era
- DroplistTechnologies
> You will get a technology not already unlocked from the current era
32
Modding Tutorial
- DroplistDust
> You will get an amount of Dust proportional to your technological advancement
- DroplistPrestige
> You will get an amount of Influence proportional to your technological advancement
- DroplistItems
> You will get a random item
- DroplistResources
> You will get an amount of resources (luxury or strategic) proportional to your
technological advancement
Of course you can create your own droplist on the same model but changing the values or the
technologies as will.
Then you need to link the reward to a step and choose the number of reward itself.
Here is an example with the first step of a quest.
<Steps>
<Step Name=" SideQuestPOI#New- Step1">
<Reward Droplist=" DroplistAdvancedTechnologies " Picks="1"/>
</Step>
</Steps>
You can also write a text if you have given the reward through an action during the step
sequence.
Pacification is done this way.
<Reward LocalizationKey="%Pacification"/>
33
Modding Tutorial
- Name: The name of the victory. Each victory should have a different name (eg: Victory1,
Victory2, Victory3, etc.).
- Title: If you want your resource to be localized, use”%” to reference a localization key (eg:
%VictoryTitle) and go to a). Otherwise skip to b).
Note: No need to add picture information here. It will be automatically created according to the
victory condition name.
Example: Name=”Hero”
Image name in Resources\GUI\DynamicBitmaps\Factions folder of your mod will be:
majorFaction(FactionName)MoodVictoryHero
(FactionName) should be replaced by each faction name in the game (because by default each
will be able to trigger the victory).
It is the place to define what is mandatory for the victory to trigger. It mainly concerns the
expression of the victory itself and the alert(s) before the trigger happens.
34
Modding Tutorial
<Expression>($Property(./ClassEmpire/ClassUnit,UnitHero:LevelDisplayed) ge 30) or
($Property(./ClassEmpire/Garrison/ClassUnit,UnitHero:LevelDisplayed) ge 30)</Expression>
Here I ask to have at least 1 hero in your empire at level 30, with an alert when one reach level
20.
For the alert the messae loc key is generated automatically according to the following pattern:
Message for you
%NotificationVictoryConditionAlertHero#0TitleYou
%NotificationVictoryConditionAlertHero#0DescriptionYou
Message for the others
%NotificationVictoryConditionAlertHero#0Title
%NotificationVictoryConditionAlertHero#0Description
Just change “Hero” to the name of your own victory (from xml reference) and the number #0
corresponds to the alert 0, then 1, then 2, according to the number of Alert you created.
It is related to the statistics you will see on the score screen after victory completion.
Activation of a victory
Ref: Options\ GameOptionDefinitions.xml
You just need to make a link with the name of your own victory and it should be enough to do
the trick.
35
Modding Tutorial
1) Whenever you see text (like titles and descriptions) in your modified xml, instead of directly
writing the text in that space, use an id like %YourText.
</Datatable>
3) Add a new LocalizationPair entry with %YourText between the Datatable marks.
36
Modding Tutorial
1) Whenever you see text (like titles and descriptions) you want to change, you must get their
reference name in-game through Steam\SteamApps\common\Endless
Legend\Public\Localization\ AnyLanguage
It can become:
<LocalizationPair Name="%UnitBrokenLordsBlackBishopTitle">Dust
Archbishop</LocalizationPair>
Create a GuiElement:
1) Ref for technology: GuiElements[TechnologyUnlock].xml
Ref for city improvement: GuiElements[PointOfInterestImprovement].xml
Add an ExtendedGuiElement. Be careful the name must be exactly the same as the simulation
descriptor of the city improvement or technology you want to override.
<ExtendedGuiElement Name="NewElementTooltip">
<TooltipElement Ignore="true">
<EffectOverride>%NewElementTooltipEffect</EffectOverride>
</TooltipElement>
</ExtendedGuiElement>
For instance, if I want to override the technology Signal Corps I will write the
Name=”TechnologyArmySize2” according to the localization key it is bind to.
2) Override the tooltip with your own localization key as you can see above.
37
Modding Tutorial
- The name must be “Standard” in order to override the main palette of the game.
- ColorReference: You have to add a color reference but you can also use the name of an
existing one to replace it.
Then you just have to find the RGB reference of your color. Add them on the line.
<Color Red="56" Green="73" Blue="204" Alpha=" 255"/>
The Alpha part should remain at 255.
- Why? All the AtlasedBitmaps are generated at the beginning of the game on a big texture and
will never be computed again.
- What to do? You need to change the name of the picture and the GuiElement accordingly.
- Best to do? We recommend you to create in the resources folder a simple “pictures” folder to
put everything in it: Community\”ModName”\Resources\Pictures\Units
38
Modding Tutorial
That is true for a lot of the small picture in the game. So if you stumble on the problem just think
about changing the picture name in correct the GuiElement file.
To change the images of a faction the path should be the same as in-game (to avoid changing
GuiElement): Documents\Endless
Legend\Community\”ModName”\Resources\GUI\DynamicBitmaps\Factions
39
Modding Tutorial
> You can add the following suffix in order to change the image of a specific victory: Economy /
Expansion / GlobalScoreWhenLastTurnReached / LastEmpireStanding / Supremacy / Wonder /
MostTechnologiesDiscovered
If you want to change the picture of units it is pretty much the same. What you have to know is
that there are 2 different formats, large icons (256x128 px) and small icons (96x48 px).
You will need to change the path and name (at least for the small icon) in not less than 3
GuiElement files:
Ref: GuiElements[BodyDefinitions].xml, GuiElements[UnitDesigns#Mercenaries].xml,
GuiElements[UnitDesigns].xml
<GuiElement Name="CityImprovementNew">
<Title>%CityImprovementNewTitle</Title>
<Description>%CityImprovementNewDescription</Description>
<Icons>
<Icon Size="Small" Path=" Pictures/Improvements/CityImprovementNewSmall" />
<Icon Size="Large" Path=" Pictures/Improvements/CityImprovementNewLarge" />
</Icons>
</GuiElement>
In order for the icons to be in the game after your mod is installed and launched you need to
create a folder which includes the Large icons (256x128 px) and the Small icons (96x48 px).
In order for the icons to be in the game after your mod is installed and launched you need to
create 1 folder which includes the Large icons (256x128 px) and Small icons (96x48 px).
40
Modding Tutorial
<GuiElement Name="ItemHeadIronNew">
<Title>%ItemHeadIronNewTitle</Title>
<Description>%ItemHeadIronNewDescription</Description>
<Icons>
<Icon Size="Small" Path="Pictures/EquipmentItems/ItemHeadIronNewSmall" />
<Icon Size="Large" Path="Pictures/EquipmentItems/ItemHeadIronNewLarge" />
</Icons>
</GuiElement> <Icons DefaultSize="">
<Icon Size="Small" Path="Pictures/Technology/TechnologyDefinitionNewSmall" />
<Icon Size="Large" Path="Pictures/Technology/TechnologyDefinitionNewLarge" />
</Icons>
<TechnologyEraReference Name="TechnologyEraDefinition1" />
</TechnologyGuiElement>
In order for the icons to be in the game after your mod is installed and launched you need to
create 1 folder according the path below:
Documents\Endless Legend\Community\NewTechnology\Resources\Pictures\Technology
It includes the Large icons (256x128 px) and the Small icons (96x48 px).
In order for the icons to be in the game after your mod is installed and launched you need to
create 1 folder which includes the Large icons (256x128 px) and the Small icons (48x48 px).
In order for the icon to fit in the game it should be a white image with transparency around it (a
color is applied through xml files).
Please note that if you want it can work with only 1 folder and giving it other name. We just
show the right game structure as a reference here.
41
Modding Tutorial
<ExtendedGuiElement Name="Luxury5">
<Title>%LuxuryNewTitle</Title>
<Description>%LuxuryNewDescription</Description>
<Icons>
<Icon Size="Small" Path="Pictures/GameVariables/LuxuryNewHD" /> <--It is mandatory
that the name is different from an already existing resource. Otherwise it will not override the
previous image.-->
<Icon Size="Large" Path="Pictures/Resources/Luxury5Large"/>
</Icons>
<SymbolString>\7725\</SymbolString>
<Color Red="255" Green="255" Blue="255" Alpha="255" />
</ExtendedGuiElement>
In order for the icons to be in the game after your mod is installed and launched you need to
create 1 folder which includes the Large icons (256x128 px) and the Small icons (24x24 px).
In order for the icon to fit in the game it should be a white image with transparency around it (a
white color is applied through xml files).
Please note that if you want it can work with only 1 folder and giving it other name. We just
show the right game structure as a reference here.
To change the resource deposit or resource extractor it is the same process as adding a 2D
asset for an item or city improvement.
In order for the icons to be in the game after your mod is installed and launched you need to
create 1 folder which includes the Large icons (256x128 px) and the Small icons (96x48 px).
You can have up to 6 heroes per faction (sometime a hero from a quest can exist and be a 7th
one).
Name of the image should override existing ones. Follow the example:
BrokenLordsHero1Large.png / BrokenLordsHero1Small.png
Do not forget that names of the factions can change in xml from what is written in game:
Wild Walkers = MadFairies / Broken Lords = BrokenLords / Vaulters = Vaulters / Mezari =
Mezari / Necrophages = Necrophages / Ardent Mages = RageWizards / Roving Clans =
RovingClans / Drakken = Drakkens / Cultists = Cultists
42
Modding Tutorial
43
Modding Tutorial
Examples:
Modifier operations
Operation
Addition
Subtraction
Multiplication
Division
Power
Percent
44
Modding Tutorial
Then we apply the percent modifiers based on intermediate value. This is to avoid appliying the
percent on another percent:
If intermediate value = 100 and we have one modifier with +10% and another with +20% the
result have to be: 100 * (1 + 0.1 + 0.2) and not 100 * 1.1 * 1.2
A “Force” operation will override all the other operations of the same Priority. If you use two
force modifiers on the same property, only the first one will be active. If you use force and
another operation in the same priority range it won’t work either...
Force will "force" a value to the property. And this, no matter of the other operation applied
before or during the same priority.
So, for instance, if you want to reset a value to 0 and then modify it we would recommend
something like that:
<SimulationDescriptor Name="NameOfYourDescriptorHere">
<SimulationModifierDescriptors>
<SimulationModifierDescriptor Path="YourPathHere" TargetProperty="TheTargetedProperty"
Operation="Force" Value="0" Priority="5"/>
<SimulationModifierDescriptor Path="YourPathHere" TargetProperty="TheTargetedProperty"
Operation="Subtraction" Value="0.1" Priority="6"/>
</SimulationModifierDescriptors>
</SimulationDescriptor>
So first you force the property to 0 and then you substract 0.1. I used the priority 5 to be sure to
be after anything else.
Examples:
Examples:
45
Modding Tutorial
Examples:
<!-- A city improvement give +4 CityScience to the City for each Anomaly in the city. -->
<CountSimulationModifierDescriptor TargetProperty="CityScience" Operation="Addition"
Value="4" Path="./ClassCity" CountPath="ClassCity/TerrainTagAnomaly"/>
46
Modding Tutorial
<PathPrerequisite
Flags="Prerequisite,Discard">.../ClassEmpire/Uniques,CityImprovement8</PathPrerequisite>
With InterpreterPrerequisite you can look at checking values or specific situations in the game
simulation.
InterpreterPrerequisite
Here are the functions you can use.
Function Description
Return the number of simulation objects that
$Count(simulationPath)
valid the path simulationPath.
$Path(simulationPath) Return true if the simulationPath is valid.
$Property([simulationPath:]propertyName) Return the value of propertyName.
Return the name of the descriptor of type
$Descriptor([simulationPath:]descriptorType)
descriptorType.
$HasDescriptor([simulationPath:]descriptorTy Return true if the context simulation object have
pe) a descriptor of type descriptorType.
Return the value returned by the interpreter
$Link(variableName|functionName|function function functionName (called with parameters
Params) functionParams) if the variable in context named
variableName is a simulation object.
Return the number of simulation objects that
$PropertyFilteredCount([simulationPath:]prop
valid the path simulationPath AND the property
ertyName;operator;value)
condition (propertyName operator value).
$SumProperty([simulationPath:]propertyNam
Return the sum of the value of propertyName.
e)
47
Modding Tutorial
$MaxProperty([simulationPath:]propertyName
Return the maximum value of propertyName.
)
$MinProperty([simulationPath:]propertyName
Return the minimum value of propertyName.
)
Examples:
<InterpreterPrerequisite Inverted="false">($Property(ClassEmpire:MaximumLuxury1Count) -
$Property(ClassEmpire:NetLuxury1)) eq 0</InterpreterPrerequisite>
<InterpreterPrerequisite
Inverted="false">$PropertyFilteredCount(EmpireTypeMajor/ClassCity/DistrictTypeDistrict:Level;
ge;1) ge 2</InterpreterPrerequisite>
48
Modding Tutorial
Advanced: AI Parameter
Add a AIParameterDatatableElement
The AI cannot read the simulation files. For each element from the simulation, it needs an
object to translate the gameplay data into the AI’s language. This object is called
“AIParameterDatatableElement”.
An AIParameterDatatableElement contains parameters called “AIParameter”. Each parameter
translates a gameplay data into an AI data.
For instance, this is the AIPArameterDatatableElement corresponding to the Seed Storage
technology:
<AIParameterDatatableElement Name="TechnologyDefinitionFood0">
<AIParameter Name="CityFood" Value="10"/>
<AIParameter Name="CityFoodPercent" Value="0.15"/>
</AIParameterDatatableElement>
You can create as many AIParameters as you want. However, new AIParameters must be
converted into known AIParameters with another kind of object: the “AIParameterConverter”. If
you don’t want to write new AIParameterConverters, you can use the existing AIParemeters. To
understand how to write an AIParameterConverter, please see below.
Add a AIParameterConverter
Ref: AI\AIParameterConverters[Empire].xml
An AIParameterConverter allows the AI to convert an unkown AIParameter into another
AIParameter. For instance, this AIParameterConverter converts BaseSciencePerPopulation
(science per population) into two AIParameters:
<AIParameterConverter Name="BaseSciencePerPopulation">
<ToAIParameter AIParameter="AICityResearch">$(Input) *
$Property(SciencePopulation)</ToAIParameter>
49
Modding Tutorial
<ToAIParameter AIParameter="AIEmpireResearch">$(Input) *
$SumProperty(ClassEmpire/ClassCity:SciencePopulation)</ToAIParameter>
</AIParameterConverter>
FIRST STEPS: the city is young the AI focused its city on food and industry
BALANCE: the city is mature the AI tries to have a balanced city
WAR BORDER: there is a war against an empire with common frontiers with the city
the AI tries to produce defenses and units with this city
BESIEGED: the city is besieged the AI tries to produce defenses and units with this city
FORGE: the city produces more industry than others and is mature the AI specializes
the city into industry and units production
The second part of the file also contains similar states only used when the players chose to
automate constructions in their cities.
50