User Tools

Site Tools


asset-override

This is an old revision of the document!


Asset Override

All game assets (and other mods assets) can be override by mods, partially or totally.

The mod:override function should be used for that purpose.

Overriding specific values

balancing.lua
myMod:override({
	Id = "DEFAULT_BALANCING",
	InitialFamilyCount = 1,
	MinimumHappinessForLeaving = 30
})

In this example, we only override the InitialFamilyCount and the MinimumHappinessForLeaving of Foundation default Balancing.

By doing so, you allow other mods to modify other values of the default balancing.

List OVERRIDE / APPEND

By default, overriding a property of type List will completely replace the list with your value(s):

villages.lua
-- Override default village list
myMod:override({
	Id = "VILLAGE_LIST_DEFAULT",
	TradingVillageList = {
		"VILLAGE_AVIGNON"
	}
})

In that example, the TradingVillageList will only contains the new village Avignon.

But you can decide to append values to the list instead of overriding:

villages.lua
-- Override default village list
myMod:override({
	Id = "VILLAGE_LIST_DEFAULT",
	TradingVillageList = {
		Action = "APPEND", -- Append the following value to the existing list
		"VILLAGE_AVIGNON"
	}
})

In that case, the TradingVillageList will contains all villages from the game and Avignon.

The list will also include all villages added by other active mods. (unless one of theme completely override the List after your mod append its villages).

  • Removing specific items from a list
asset-override.1559315748.txt.gz · Last modified: 2019/05/31 11:15 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki