User Tools

Site Tools


migration

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
migration [2019/09/26 16:52] maximemigration [2019/10/09 14:27] maxime
Line 1: Line 1:
 ====== Migration Notes ====== ====== Migration Notes ======
 +
 +===== Foundation 1.4.5.1009 =====
 +
 +==== 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:
 +<file lua 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 }
 +    }
 +})
 +</file>
 +
 +==== 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.
 +
 +The complete list of core resource types can be found: [[api:resource_type|https://www.polymorph.games/foundation/modding/api/resource_type]]
 +
 +Migration example:
 +<file lua>
 +mod:register({
 +    DataType = "RESOURCE",
 +    ...
 +
 +--  OLD
 +--  ResourceType = "LUXURY_FOOD",
 +
 +--  NEW
 +    ResourceTypeList = {
 +      "GRANARY",
 +      "TAVERN"
 +    }
 +
 +    ...
 +})
 +</file>
  
 ===== Foundation 1.3.1.0802 ===== ===== Foundation 1.3.1.0802 =====
migration.txt · Last modified: 2023/09/05 11:21 by mathieu

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki