User Tools

Site Tools


preview

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
preview [2019/10/02 16:01] polymorphgamespreview [2020/04/22 12:46] – removed vjraymon
Line 1: Line 1:
-====== 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 [[https://discord.gg/foundation|discord server]]. 
- 
-===== Generated Documentation ===== 
-  * [[preview:api|API]] 
-  * [[preview:assets|Assets]] 
-  * [[api:mod-functions|Mod Functions]] 
- 
-===== New Features ===== 
-  * [[#Building part function|Building part functions are now assets, declared individually.]] 
-  * [[preview:api:building_function|Core building part functions have also been exposed to the API.]] 
-  * [[#Resource type list|A resource can now have multiple resource types]] 
-  * [[preview:assets:behavior_tree|The market tender behavior is now available]] 
- 
-===== 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: 
-<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. 
- 
-Migration example: 
-<file lua> 
-mod:register({ 
-    DataType = "RESOURCE", 
-    ... 
- 
---  OLD 
---  ResourceType = "LUXURY_FOOD", 
- 
---  NEW 
-    ResourceTypeList = { 
-      "GRANARY", 
-      "TAVERN" 
-    } 
- 
-    ... 
-}) 
-</file> 

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki