Modding: Difference between revisions

From Ara: History Untold Wiki
m I'm just picky about wording
tried to update the modding set up and give some basics
 
Line 1: Line 1:
[[File:SettingsFile.png|thumb|Example of the Settings_v121.txt file]]
= Ara Modding Setup Guide =
= Ara Modding Setup Guide =
This document will show you how to get started with modding Ara: History Untold.
This document will show you how to get started with modding and playing with mods in Ara: History Untold.
 
In this initial version of mod support, we provide a copy of our source game data files in the Ara installation directory. You can install these source files as a mod in your Documents folder and enable mod loading in the Ara settings. We will walk through each step below.
 
== QuickStart ==
# Find the game data source files in the Ara installation folder at `assets\SourceMods\.
# Copy the folder SourceMods (files and sub-folders) it into `Documents\My Games\Ara History Untold\Mods\`. Create the "Mods" folder first if it does not exist.
# Navigate to `%LOCALAPPDATA%\Ara History Untold` with File Explorer (open File Explorer with WinKey + E) and open the latest settings text file (e.g. `Settings_V122.txt`).
# Set the line `EnableMods=0` to `EnableMods=1`. If this line is missing, add it to the end of the file.
# Set the line `GameCoreMod0Source=` to `GameCoreMod0Source="YourModName"`. If this line is missing, add it to the end of the file.
# Start Ara – it will load your modified source files from your Documents folder into the game. Multiplayer and achievements will be disabled while mods are enabled.
== Step 1: Find the game data source mods files ==
If you own the game through Steam, you can get to your installation files quickly through the Steam Library tab. For Windows Store installations (e.g. from Game Pass), you can find the top-level Ara folder by starting at `%LOCALAPPDATA%\Microsoft\WindowsApps`.
 
=== Find Ara in your Steam library ===
Right-click the game in the library list, select Manage -> Browse Local Files.
 
You should have a File Explorer window (WinKey + E) open with the following folder:
 
Open the `assets\SourceMods` folder and copy the whole folder (files and sub-folders).
 
== Step 2: Paste SourceMods into Mods folder ==
Use File Explorer to open your Documents folder and navigate to `My Games` and then, in a separate window, the `Ara History Untold` folder.
 
In `Documents\My Games\Ara History Untold`, create a `Mods` folder (if it does not already exist).
 
Open the Mods folder and select the Paste the whole SourceMods folder into it.
 
You should end up with a folder SourceMods in the Mods folder, containing all of the game data files.
 
== Step 3: Enable modding in Ara settings ==
Open a File Explorer window and navigate to `%LOCALAPPDATA%\Ara History Untold`.
 
This folder contains a settings file, such as `Settings_v121.txt`. Open the one with the largest version number (the "v121" or similar at the end).


You can open this file using a text editor such as Notepad or Visual Studio Code.
As of the 1.2 Modder's Paradise update, you can enable mods easily in the main menu -- simply navigate to Mods and click either the button labeled "Enabled Modding" or click the checkbox in the corner of the main modding window. Within this menu, you can also use the Mod Browse and access the mods hosted on [https://mod.io/g/ara-history-untold/ the official mod.io repository]. You can also download these mods as reference for your own modding ideas!


In the file, you should find two lines: `EnableMods=0` and `GameCoreMod0Source=`. If you haven't run the game since the last update, you may need to do so for these to show up. Alternatively, you can also add them to the end of the file manually.
To get started with modding, you'll want to get the Example Mod -- in the "Installed" tab of the modding window, there should be a button labeled "Setup Example Mod". This will copy a folder full of base game files and give a lot of helpful reference material for the syntax and structure of mod files. It should copy over to your Mods folder, which is located at ''Documents\My Games\Ara History Untold\Mods\.''


Change these lines to: EnableMods=1 and GameCoreMod0Source="YourModName"
The Example Mod (or DefaultMod as it appears in the Mods directory) is a copy of one of the game's source folders, located at ''assets\SourceMods\'' from the game's installation folder. These ''SourceMods'' files update with each game update, so you may want to delete the Example Mod as the game updates.


Save and close the file.
== Modding Basics ==
Every mod requires a file named ''GameCoreData.zdata''. The file tells Ara which files it should import into the game, and what part of the game should be updated or added to. For example, from a published developer mod:<syntaxhighlight>
schema ZNODataLibrary;


== Step 4: Run Ara ==
export Library Root =
If you launch Ara again, you should now start with mods enabled and the source files from "YourModName" loaded as your active game rules.
{
    .Groups =
    {
       
        .Technologies =
        {
            .FromFiles = { "files/Tech_Axe.zdata" },
        },


If there are errors loading the mod files, you will receive a data error popup, and the game will proceed loading only its built-in, un-modded data.
        .Improvements =
        {
            .FromFiles = { "files/Improvement_Axe.zdata" },
        },
       
    }
};
</syntaxhighlight>When you're at a loss as to how you should import your files, you should refer to the Example Mod's own ''GameCoreData.zdata'' file.


(Note: Pressing 'Ctrl-C' will copy all the text from the error popup)
For art assets, documentation is lacking, but it starts with an AssetData.zdata file, not named within GameCoreData.zdata. Here is an example snippet from the same developer mod:<syntaxhighlight>
schema ModAssets;


`%LOCALAPPDATA%\Ara History Untold\logs\Ara.log` contains a diagnostic log of the mods loaded (if any) and errors found.
export AssetList Root =
{
    .IconAtlases =
    {
   
        .Items_160 =
        {
            .Textures =
            {
                ."item_axe" = "files/item_axe.png",
                ."item_axeman" ="files/project_Axeman.png",
            },
        },


While you are running with mods enabled, achievements and multiplayer will be disabled.
          .Improvements_256 =
        {
            .Textures =
            {
                ."AxeImp" = "files/WoodCutter.png",
            },
        },
       
    },
};
</syntaxhighlight>The left side of the Textures data (e.g. item_axe, AxeImp) seems to be used for the AtlasID attribute on improvements, items, etc. It's worth noting that the Atlas group Improvements_256 does not add the yellow icon border -- you will have to add the border yourself if you wish to copy the style of the game's icon assets. A copy of the [https://mod.io/g/ara-history-untold/m/axe-man Axe Man mod] is recommended for study to add art assets, at least until more official documentation is provided.


== Step 5: Update your folder SourceMods ==
If you work within the modding folder of the game, be sure that the ''GameCoreData.zdata'' file is available inside your mod folder at the same level viewed when opening the folder. To test your mod changes, make sure the mod is 'checked' and active, and either click New Game or click the "Reload mod configuration" button in the modding window to reload your changes.
The original SourceMods folder is changed whenever the game is updated (V1.04, V1.06 and then V1.1). To keep your Mods folder up to date you must


repeat the procedure to copy the SourceMods folder in the game folder to your Mods folder.
At the moment, a new game is required for all mod testing and changes made to the mod.


== Attributes & Modifiers ==
== Attributes & Modifiers ==

Latest revision as of 00:49, 18 February 2025

Ara Modding Setup Guide[edit | edit source]

This document will show you how to get started with modding and playing with mods in Ara: History Untold.

As of the 1.2 Modder's Paradise update, you can enable mods easily in the main menu -- simply navigate to Mods and click either the button labeled "Enabled Modding" or click the checkbox in the corner of the main modding window. Within this menu, you can also use the Mod Browse and access the mods hosted on the official mod.io repository. You can also download these mods as reference for your own modding ideas!

To get started with modding, you'll want to get the Example Mod -- in the "Installed" tab of the modding window, there should be a button labeled "Setup Example Mod". This will copy a folder full of base game files and give a lot of helpful reference material for the syntax and structure of mod files. It should copy over to your Mods folder, which is located at Documents\My Games\Ara History Untold\Mods\.

The Example Mod (or DefaultMod as it appears in the Mods directory) is a copy of one of the game's source folders, located at assets\SourceMods\ from the game's installation folder. These SourceMods files update with each game update, so you may want to delete the Example Mod as the game updates.

Modding Basics[edit | edit source]

Every mod requires a file named GameCoreData.zdata. The file tells Ara which files it should import into the game, and what part of the game should be updated or added to. For example, from a published developer mod:

schema ZNODataLibrary;

export Library Root =
{
    .Groups =
    {
        
        .Technologies =
        {
            .FromFiles = { "files/Tech_Axe.zdata" },
        },

        .Improvements = 
        {
            .FromFiles = { "files/Improvement_Axe.zdata" },
        }, 
        
    }
};

When you're at a loss as to how you should import your files, you should refer to the Example Mod's own GameCoreData.zdata file. For art assets, documentation is lacking, but it starts with an AssetData.zdata file, not named within GameCoreData.zdata. Here is an example snippet from the same developer mod:

schema ModAssets;

export AssetList Root =
{
    .IconAtlases =
    {
    
        .Items_160 = 
        {
            .Textures =
            {
                ."item_axe" = "files/item_axe.png",
                ."item_axeman" ="files/project_Axeman.png",
            },
        },

          .Improvements_256 = 
        {
            .Textures =
            {
                ."AxeImp" = "files/WoodCutter.png",
            },
        },
        
    },
};

The left side of the Textures data (e.g. item_axe, AxeImp) seems to be used for the AtlasID attribute on improvements, items, etc. It's worth noting that the Atlas group Improvements_256 does not add the yellow icon border -- you will have to add the border yourself if you wish to copy the style of the game's icon assets. A copy of the Axe Man mod is recommended for study to add art assets, at least until more official documentation is provided.

If you work within the modding folder of the game, be sure that the GameCoreData.zdata file is available inside your mod folder at the same level viewed when opening the folder. To test your mod changes, make sure the mod is 'checked' and active, and either click New Game or click the "Reload mod configuration" button in the modding window to reload your changes.

At the moment, a new game is required for all mod testing and changes made to the mod.

Attributes & Modifiers[edit | edit source]

Buffs have the "Attributes" attribute in their definition that defines a condition for the buff to apply, for example:

.Attributes = @"ATTR(AtrCityStatCheck(ReligionImprovementCount, '>=', 1.0))ATTR"

The above code would allow the buff to trigger (based on the TargetType and Scope values) only when the City has at least one Religion Improvement. For multiple conditions, see this example from one of the Republic Government Policies:

.Attributes = @"ATTR(AtrImprovementDomainCheck(Culture) or AtrImprovementDomainCheck(Government) or AtrImprovementDomainCheck(Science))ATTR"

This buff checks for improvements of Culture, Government, or Science domains. This particular buff (at time of writing) has a TargetType of BuffTargetType.Improvement and a Scope of BuffScope.All, targeting all Improvements you have or are building. For the actual effect, we look at the Modifiers attribute. For example:

.Modifiers = @"MODS(ModMul(Strength, 0.25))MODS"

This modifier will add a 25% multiplier to unit strength. Multipliers are additive, so this is adding 25% to the total bonus multiplier, not directly multiplying by 25%, which would be a reduction in strength instead. Negative values are allowed where you'd expect them. (You probably can't reduce the turn count...)

An aside: This syntax is also similar to that used for the Condition attribute on events, e.g. .Condition = "AtrActGoalWonCheck(goal_SpecificTriumphLibraryofCelsus)".

The table below lists all currently possible variables for use in conditions or modifiers, provided by one of the developers, with Description and Notes for wiki users to add:

Name Description Notes
Invalid
Act Spotted in Adviser Wisdom like so:

AtrNationStatCheck(Act, '<', 2.0)

Era Spotted in NarrativeEvents like so:

AtrNationStatCheck(Era, '=', 5.0)

Population Growth
PopulationTier Spotted in Buffs0 like so:

AtrCityStatCheck(PopulationTier, '<=', 4.0)

PopulationTierCap Housing
BonusPrestigeOnComplete e.g. Museum
PrestigeOnKill
TotalIncomingMoney
Item
Happiness
Education
Health
Prosperity
Wealth
Aesthetics Security
MinHappiness
MinEducation
MinHealth
MinProsperity
MinWealth
MinAesthetics Security
ParagonSpawnChance
ArtistPickChance
EngineerPickChance
StrategistPickChance
BusinessmanPickChance Entrepeneur?
MusicianPickChance
ProphetPickChance
ActivistPickChance
ScientistPickChance
WriterPickChance
ExplorerPickChance
BuildRate
HarvestRate
CraftRate
MasterpieceCreateRate
Production
Maintenance
TaxIncome
IncomeRate
GoldenAgeProgress
GoldenAgeDuration
GoldenAgeBonusPrestigeRate
RegionCount
CityCount
ReligionFollowerCount
ReligionSpreadStrength
ReligionSpreadDistance
ForeignReligionInfluence
ResearchAgreementResearch
ResearchCost
PopulationTierResearch
TotalIncomingResearch
MerchantCount
TradeAgreementCount
AllianceCount
ParagonCount
IsFortified Condition is checked as = 1.0
TradeMoney
Relationship
BaseRelationship
TribeRelationship
BaseTribeRelationship
BaseTribeNotHostileFlag Add +1.0 to make tribes non hostile
ArmyCapLand
ArmyCapAir
ArmyCapSea
CityCap
BonusExpOnTrained
BonusExpOnCombat
LevelUpStrength
Level
FormationBonus
Strength
TerrainStrengthMod Modifier to Strength based on terrain
SiegeDamage Damage to Cities
PillageDamage Damage to improvements
Defense
Speed Movement points
HomeCity
WorkerGain
BonusWorkersOnFoundCity
CannotCounterFlag
MaintenanceFlag
SightRange
ActionRange
WarWeariness
InflictWarWeariness
InflictWarWearinessOnKill
RecoverWarWearinessOnKill
BonusExpOnKill
PreventPillageFlag
BirthRate
DeathRate
ImmigrationRate
EmmigrationRate
HealRate
StartBonusHealth
SiegeDefense
FoodFertility
WoodFertility
StoneFertility
CoinFertility
Pollution
WarDeclarePrestigeCost
EventsGiven
ExtraLocalFood
IsOpenTerrainFlag
IsRoughTerrainFlag
RoadType
MilitaryImprovementCount
CommerceImprovementCount
GovernmentImprovementCount
ReligionImprovementCount
CultureImprovementCount
ScienceImprovementCount
IndustryImprovementCount
DistinctMilitaryImprovementCount
DistinctCommerceImprovementCount
DistinctGovernmentImprovementCount
DistinctReligionImprovementCount
DistinctCultureImprovementCount
DistinctScienceImprovementCount
DistinctIndustryImprovementCount
ArtistParagonCount
EngineerParagonCount
StrategistParagonCount
BusinessmanParagonCount
MusicianParagonCount
ProphetParagonCount
ActivistParagonCount
ScientistParagonCount
WriterParagonCount
ExplorerParagonCount
CityCountDiff
TurnsSinceLastParagonCompletedEvent
TurnsSinceLastMasterpieceCompletedEvent
TurnsSinceWarEvent
TurnsSinceSkirmishWarEvent
TurnsSinceRetaliationWarEvent
TurnsSinceDefenderWarEvent
TurnsSinceAttackerWarEvent
TurnsSinceLastWarVictoryEvent
TurnsSinceLastWarEndedEvent
TurnsSinceLastCombatEvent
TurnsSinceEnteredAllianceEvent
TurnsSinceEnteredResearchAgreementEvent
TurnsSinceTechnologyUnlockedEvent
InWarFlag
InAttackerWarFlag
InDefenderWarFlag
InRetaliationWarFlag
InSkirmishFlag
InWarWithAnyoneFlag
RegionDistanceToFriendlyArmy
CoastalRegionCount
GoldenAgeRemainingTurns
PositiveModifiers
NegativeModifiers
IsCapitalFlag
IsCityCenterFlag
IsOwnedFlag
TriumphFlag
AdjacentToImpassibleFlag
AdjacentToRiverFlag
CoastalLandFlag
HasRiverFlag
ReligionDominantFlag
ReligionFoundedFlag
CurrentTurn
PrestigeTier
UnlockedGovernmentCount
UnassignedExpertCount
OpenExpertSlotCount
UnassignedParagonCount
OpenParagonSlotCount
IsAtPopulationTierCapFlag
IsGrowthStagnantFlag
IsStarvingFlag
HasOpenBordersFlag
HasTradeAgreementFlag
HasResearchAgreementFlag
HasAllianceFlag
WarlikeScore
PeacefulScore
IsAtMaxCityCapFlag
IsCityCenterDefendedFlag
UnitsInReserveCount
LandArmyCount
SeaArmyCount
AirArmyCount
HasMetFlag
UnassignedMerchantCount
MilitaryStrength
MilitaryRatio
UnslottedMasterpieceCount
ReligionFollowersConvertedThisTurnCount
PercentForcesHealth
IdleCraftersCount
AvailableFlag

Guides[edit | edit source]