User Tools

Site Tools


buildings

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
buildings [2018/10/18 18:11] – [Construction Steps] polymorphgamesbuildings [2021/10/21 13:28] (current) – removed maxime
Line 1: Line 1:
-====== Buildings ====== 
-Here is an example of how to declare a new fountain building. 
  
-Buildings are an ensemble of building parts. Simple buildings have only one part. 
- 
-===== Scripts ===== 
-Declare the building: 
-<code lua> 
-myMod:register({ 
- DataType = "BUILDING", 
- Id = "FOUNTAIN", 
- Name = "MY_MOD_FOUNTAIN", 
- Description = "MY_MOD_FOUNTAIN", 
- BuildingType = "DECORATION", 
- BuildingPartList = { "FOUNTAIN_PART" }, 
- --VillagerRequired = { Status = "NEWCOMER", Quantity = 9 } 
-}) 
-</code> 
- 
-Declare the building part: 
-<code lua> 
-myMod:register({ 
- DataType = "BUILDING_PART", 
- Id = "FOUNTAIN_PART", 
- Description = "", 
- ConstructorData = { 
- DataType = "DEFAULT_BUILDING_CONSTRUCTOR", 
- CoreObjectPrefab = "PREFAB_FOUNTAIN" 
- }, 
- BuildingZone = { 5, 5 }, 
- ConstructionVisual = "PREFAB_FOUNTAIN_CONSTRUCTION", 
- Cost = { 
- UpkeepCost = { 
- { Resource = "GOLD", Quantity = 5 } 
- }, 
- RessourcesNeeded = { 
- { Resource = "WOOD", Quantity = 5 }, 
- { Resource = "STONE", Quantity = 10 } 
- } 
- } 
-}) 
-</code> 
-===== Data ===== 
-TODO 
- 
-===== Link Data to Script ===== 
-TODO 
-<code lua> 
-myMod:registerAssetId("models/fountain.fbx/Prefab/Fountain", "PREFAB_FOUNTAIN") 
-myMod:registerAssetId("models/fountain.fbx/Prefab/Fountain_Construction_Steps", "PREFAB_FOUNTAIN_CONSTRUCTION") 
-</code> 
- 
-===== Text and Localization ===== 
-TODO 
- 
-===== Construction Steps ===== 
-Buildings are built step by step. The construction system is based on naming. 
- 
-You can specify a prefab to be used as construction visual. 
- 
-The system will parse the prefab and search for objects with a name starting with ''step_''. 
- 
-All nodes called ''step_0'' (or ''step_0_anythingelse'') will be visible as soon as the building is placed. 
- 
-The rest of the nodes (''step_X'' / ''step_X_anythingelse'') will become visible in order, during the construction. 
- 
-If more than one node have the same order number, they inner order will be randomized. For instance ''step_2_A'', ''step_2_B'' and ''step_2_C'' will be shown in a random order. But always after ''step_1'', and always before ''step_3''. 
- 
-Note that all children of a node starting with ''step_'' will be shown with there parent, no mater their name. 
buildings.1539900687.txt.gz · Last modified: 2018/10/18 18:11 by polymorphgames

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki