User Tools

Site Tools


preview

This is an old revision of the document!


Preview Modding Documentation for Foundation 1.4

:!: Please do not upload mods for Foundation 1.4 to mod.io before the official release of those modding features, since it would make your mod visible to all players, and they won't be able to play it :!:

How to Access 1.4 Preview ?

Contact developer on our discord server.

Generated Documentation

New Features

Migration Notes

Building part function

For assets from type BUILDING_PART, the attribute BuildingFunction is now replaced with AssetBuildingFunction. Thus, the building function must now be declared as an asset of type BUILDING_FUNCTION.

Migration example for the Example 02 mod:

building_parts.lua
mod:register({
    DataType = "BUILDING_PART",
    ...
 
--  OLD
--  BuildingFunction = { 
--      DataType = "BUILDING_FUNCTION_WORKPLACE",
--      WorkerCapacity = 4,
--      RelatedJob = { Job = "MITHRIL_MINER", Behavior = "WORK_BEHAVIOR" },
--      ResourceProduced = {
--          { Resource = "MITHRIL_ORE", Quantity = 5 }
--      }
--  },
 
--  NEW
    BuildingFunction = "MITHRIL_MINE_FUNCTION",
 
    ...
})
 
-- ALSO NEW
mod:register({
    DataType = "BUILDING_FUNCTION_WORKPLACE",
    Id = "MITHRIL_MINE_FUNCTION",
    WorkerCapacity = 4,
    RelatedJob = { Job = "MITHRIL_MINER", Behavior = "WORK_BEHAVIOR" },
    ResourceProduced = {
        { Resource = "MITHRIL_ORE", Quantity = 5 }
    }
})

Resource type list

The enumeration RESOURCE_TYPE has been removed, and has been replaced by plain strings. This change means that modders can now define their own new types to work with their custom systems. The list of resource types has been moved to another page.

Another change is that resource, markets, granaries and warehouses can now have multiple resource types. This, combined with new customizable resource types, will be useful to customize where resources can be stocked and sold. This means that the property ResourceType from RESOURCE has been renamed to ResourceTypeList.

For example, before this change, the wine was a resource of type LUXURY_FOOD. Now, it has the types GRANARY and TAVERN. The granary is configured to only store resources of type GRANARY, and the tavern can only sell resources of type TAVERN. Thus, wine will only be stored in granaries, and sold in taverns. The luxury stall, with its types LUXURY and LUXURY_FOOD, will not be able to sell wine anymore.

Migration example:

mod:register({
    DataType = "RESOURCE",
    ...
 
--  OLD
--  ResourceType = "LUXURY_FOOD",
 
--  NEW
    ResourceTypeList = {
      "GRANARY",
      "TAVERN"
    }
 
    ...
})
preview.1570046470.txt.gz · Last modified: 2019/10/02 16:01 by polymorphgames

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki