Override Example 02 assets to work with Brothel naming

This commit is contained in:
Lucas 2020-04-12 20:21:53 +02:00
parent f71b4a3487
commit a7fb4d140d
8 changed files with 3422 additions and 84 deletions

Binary file not shown.

View file

@ -1,47 +1,26 @@
local BrothelSystemMod = foundation.createMod(); local BrothelSystemMod = foundation.createMod();
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel", "PREFAB_BROTHEL")
-- Monuments (brothel)
BrothelSystemMod:dofile("scripts/brothel/monument.lua")
-- Jobs -- Jobs
BrothelSystemMod:dofile("scripts/jobs.lua") BrothelSystemMod:dofile("scripts/jobs.lua")
BrothelSystemMod:register({
DataType = "BUILDING",
Id = "BROTHEL",
Name = "BROTHEL_NAME",
Description = "BROTHEL_DESC",
BuildingType = "GENERAL",
BuildingPartSetList = {
{
Name = "BROTHEL_NAME",
BuildingPartList = { "BROTHEL" }
}
}
})
BrothelSystemMod:register({
DataType = "BUILDING_PART",
Id = "BROTHEL",
Name = "BROTHEL_NAME",
Description = "BROTHEL_DESC",
Category = "GENERAL",
ConstructorData = {
DataType = "BUILDING_CONSTRUCTOR_DEFAULT",
CoreObjectPrefab = "PREFAB_BROTHEL"
}
})
Override default Labour estate -- Override default Labour estate
BrothelSystemMod:override({ BrothelSystemMod:override({
Id = "LABOUR", Id = "LABOUR",
EstateProgressList = { -- Add a new estate progress tier EstateProgressList = { -- Add a new estate progress tier
Action = "APPEND", Action = "APPEND",
{ {
DataType = "ESTATE_PROGRESS_TIER", DataType = "ESTATE_PROGRESS_TIER",
SplendorRequired = 10, SplendorRequired = 0,
VillagerStatusRequired = { Status = "SERF", Quantity = 20 }, VillagerStatusRequired = { Status = "SERF", Quantity = 0 },
UpgradeList = { UpgradeList = {
"UNLOCKABLE_MITHRIL_FACTORY" "UNLOCKABLE_BROTHEL"
} }
} }
} }

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<meta id="4ee90a2b-64e9-44f1-be58-7d9b8a34145f">
<meta id="d583b5b6-7965-4002-91f2-11f9e92f6bcf" type="group" folder="true" name="Materials">
<meta id="06e2c8ac-2419-4445-821d-776a25390f71" name="WoodBeam"/>
<meta id="c388e9d5-0e62-4fc2-97fc-089cc0c8d30d" name="Rock"/>
<meta id="c39d1200-3a06-47bb-82c9-c51e761372d9" name="Black"/>
<meta id="a0873084-6e77-44cc-a58c-3ba82d8679b6" name="Material.001"/>
<meta id="e2606d64-13e6-435d-bcde-f2eb38b7e836" name="RoofBlue"/>
<meta id="41393d1b-cb5a-4f0a-9599-d8db65eb6246" name="Glass"/>
</meta>
<meta id="29e7861c-d08d-4896-9748-8a3fb1c07bfa" type="group" folder="true" name="Meshes">
<meta id="4cc49cd7-601e-4927-8800-d4e0d4ae4245" name="Brothel.001_WoodBeam"/>
<meta id="a92e5aee-6fda-48ae-983f-2fa5a534d665" name="Brothel.001_Rock"/>
<meta id="83f5c7cd-b517-46b6-a93d-4363965966e3" name="Brothel.001_Black"/>
<meta id="79b66ebd-9c14-4d68-8701-5814c0bb16bf" name="Brothel.001_Material.001"/>
<meta id="48390ece-ef65-49d0-870b-4087f42c61d7" name="Brothel.001_RoofBlue"/>
<meta id="24b15dba-a3d7-4310-ac8f-4643ab5d1153" name="Brothel.001_Glass"/>
</meta>
<meta id="113657f6-0111-4cbd-8382-45138c59f7d7" name="Prefab">
<meta id="d66c3c25-574a-4512-bbd9-736d4d8ebbe6" name="Brothel">
<meta id="148f0fae-802c-492a-89c9-765e01ebf771" name="Brothel.001">
<meta id="1b62aff2-bfdc-4e25-9a53-b341733e07ca" name="Brothel.001_0"/>
<meta id="ad190a28-1613-449c-b82a-d3cc811a9e21" name="Brothel.001_1"/>
<meta id="b4984a2f-0663-4b5f-834e-e61b77621db6" name="Brothel.001_2"/>
<meta id="57e46f50-5bfb-4f2e-9d77-077777a796f0" name="Brothel.001_3"/>
<meta id="167b15a1-5b12-44b9-b12a-779266ef16e2" name="Brothel.001_4"/>
<meta id="f0feb28e-86fd-4146-8d88-7db6a47b6ff8" name="Brothel.001_5"/>
</meta>
</meta>
</meta>
</meta>
<importer type="GamCFbxImporterConfiguration">
<Md5Checksum value="ebdb1c51020c4c2cb0b3266aed761515"/>
<Scale value="0.01"/>
<PatchMeshOffset value="true"/>
<UniqueNodeName value="false"/>
<ImportAnimation value="false"/>
<FlipXAxis value="true"/>
<ForceNormalUp value="false"/>
<MergeDuplicateMeshes value="true"/>
<GenerateLod value="false"/>
<OverrideExistingLod value="false"/>
<NodeConfig type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList>
<Item type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList>
<Item type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList>
<Item type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList/>
<NodeName value="Brothel.001_0"/>
</Item>
<Item type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList/>
<NodeName value="Brothel.001_1"/>
</Item>
<Item type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList/>
<NodeName value="Brothel.001_2"/>
</Item>
<Item type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList/>
<NodeName value="Brothel.001_3"/>
</Item>
<Item type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList/>
<NodeName value="Brothel.001_4"/>
</Item>
<Item type="GenCFbxNodeConfig">
<LodConfig value="00000000-0000-0000-0000-000000000000"/>
<ChildList/>
<NodeName value="Brothel.001_5"/>
</Item>
</ChildList>
<NodeName value="Brothel.001"/>
</Item>
</ChildList>
<NodeName value="Brothel"/>
</Item>
</ChildList>
<NodeName value="Prefab"/>
</NodeConfig>
<MaterialList>
<Item type="GamCDataMaterialPair">
<MaterialGuid value="c39d1200-3a06-47bb-82c9-c51e761372d9"/>
<MaterialName value="Black"/>
</Item>
<Item type="GamCDataMaterialPair">
<MaterialGuid value="41393d1b-cb5a-4f0a-9599-d8db65eb6246"/>
<MaterialName value="Glass"/>
</Item>
<Item type="GamCDataMaterialPair">
<MaterialGuid value="a0873084-6e77-44cc-a58c-3ba82d8679b6"/>
<MaterialName value="Material.001"/>
</Item>
<Item type="GamCDataMaterialPair">
<MaterialGuid value="c388e9d5-0e62-4fc2-97fc-089cc0c8d30d"/>
<MaterialName value="Rock"/>
</Item>
<Item type="GamCDataMaterialPair">
<MaterialGuid value="e2606d64-13e6-435d-bcde-f2eb38b7e836"/>
<MaterialName value="RoofBlue"/>
</Item>
<Item type="GamCDataMaterialPair">
<MaterialGuid value="06e2c8ac-2419-4445-821d-776a25390f71"/>
<MaterialName value="WoodBeam"/>
</Item>
</MaterialList>
</importer>

View file

@ -0,0 +1,106 @@
local BrothelSystemMod = ...
------------------------------BROTHEL---------------------------------
-- Register core prefab nodes
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/RootPart", "BROTHEL_CORE_ROOT_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/TopPart", "BROTHEL_CORE_TOP_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/Tiling1Part", "BROTHEL_CORE_TILING1_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/Tiling2Part", "BROTHEL_CORE_TILING2_PREFAB")
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/Core/Tiling3Part", "BROTHEL_CORE_TILING3_PREFAB")
-- Register door prefab nodes
BrothelSystemMod:registerAssetId("models/brothel.fbx/Prefab/Brothel/DoorAPart", "BROTHEL_DOOR_A_PREFAB")
--------------------------------------------------------------------------
-- Create default building part registering function
function registerDefaultBuildingPart(_nodePrefix)
BrothelSystemMod:register({
DataType = "BUILDING_PART",
Id = _nodePrefix .. "_PART",
Mover = { DataType = "BUILDING_PART_MOVER" },
ConstructorData = { DataType = "BUILDING_CONSTRUCTOR_DEFAULT", CoreObjectPrefab = _nodePrefix .. "_PREFAB" }
})
end
local defaultNodePrefixList = {
"BROTHEL_CORE_TOP",
"BROTHEL_CORE_TILING1",
"BROTHEL_CORE_TILING2",
"BROTHEL_CORE_TILING3"
}
-- Register simple building part assets
for i, nodePrefix in ipairs(defaultNodePrefixList) do
registerDefaultBuildingPart(nodePrefix)
end
--------------------------------------------------------------------------
BrothelSystemMod:register({
DataType = "BUILDING_FUNCTION_WORKPLACE",
Id = "BROTHEL_CORE_FUNCTION",
WorkerCapacity = 4,
RelatedJob = { Job = "TRANSPORTER", Behavior = "WORK_BEHAVIOR" },
ResourceProduced = { -- Necessarily a list of 'RESOURCE_QUANTITY_PAIR', no need to specify the DataType
{ Resource = "BARREL", Quantity = 5 }
}
})
-- Register the brothel core part
BrothelSystemMod:register({
DataType = "BUILDING_PART",
Id = "BROTHEL",
Name = "BROTHEL_NAME",
Description = "BROTHEL_DESC",
Category = "CORE",
Mover = { DataType = "BUILDING_PART_MOVER_INSTANCE" },
ConstructorData = {
DataType = "BUILDING_CONSTRUCTOR_SCALER", -- Since there are different types of building constructor, 'DataType' is necessary here
CoreObjectPrefab = "BROTHEL_CORE_ROOT_PREFAB",
EndPart = "BROTHEL_CORE_TOP_PART",
FillerList = {
"BROTHEL_CORE_TILING1_PART",
"BROTHEL_CORE_TILING2_PART",
"BROTHEL_CORE_TILING3_PART"
},
BasementFillerList = {
"BROTHEL_CORE_TILING1_PART",
"BROTHEL_CORE_TILING2_PART",
"BROTHEL_CORE_TILING3_PART"
},
},
BuildingFunction = "BROTHEL_CORE_FUNCTION",
Cost = {
UpkeepCost = { -- List of RESOURCE_QUANTITY_PAIR
{ Resource = "GOLD", Quantity = 3 }
},
RessourcesNeeded = { -- List of RESOURCE_QUANTITY_PAIR
{ Resource = "WOOD", Quantity = 30 },
{ Resource = "STONE", Quantity = 20 }
}
}
})
-- Register the brothel door A part
BrothelSystemMod:register({
DataType = "BUILDING_PART",
Id = "BROTHEL_DOOR_A_PART",
Name = "BROTHEL_DOOR_A_NAME",
Description = "BROTHEL_DOOR_A_DESC",
Category = "DOOR",
Mover = { DataType = "BUILDING_PART_MOVER_INSTANCE" },
ConstructorData = {
DataType = "BUILDING_CONSTRUCTOR_DEFAULT",
CoreObjectPrefab = "BROTHEL_DOOR_A_PREFAB"
},
Cost = {
RessourcesNeeded = { -- List of RESOURCE_QUANTITY_PAIR
{ Resource = "WOOD", Quantity = 5 }
}
}
})

View file

@ -0,0 +1,56 @@
local BrothelSystemMod = ...
---------------------
-- Apply building asset processor
BrothelSystemMod:registerAssetProcessor("models/brothel.fbx", {
DataType = "BUILDING_ASSET_PROCESSOR"
})
-- Register all mithril factory building parts and their properties
BrothelSystemMod:dofile("scripts/brothel/building_parts.lua")
-- Register the brothel monument
BrothelSystemMod:register({
DataType = "MONUMENT",
Id = "BROTHEL",
Name = "BROTHEL_NAME",
Description = "BROTHEL_DESC",
BuildingType = BUILDING_TYPE.MONUMENT,
BuildingPartSetList = {
{
Name = "BROTHEL_CORE",
BuildingPartList = { "BROTHEL" }
},
{
Name = "ENTRANCE",
BuildingPartList = {
"BROTHEL_DOOR_A_PART"
}
}
},
RequiredPartList = {
-- Necessarily a list of 'MONUMENT_REQUIRED_PART_PAIR', no need to specify the DataType of each element of the list
{ Category = "CORE", Quantity = 1 },
{ Category = "DOOR", Quantity = 1 }
},
IsManuallyUnlocked = true,
IsDestructible = true,
IsEditable = true,
IsClearTrees = true
})
BrothelSystemMod:register({
DataType = "UNLOCKABLE_BUILDING",
Id = "UNLOCKABLE_BROTHEL",
Name = "UNLOCKABLE_BROTHEL_NAME",
Description = "UNLOCKABLE_BROTHEL_DESC",
EstateInfluenceCostList = {
{ Estate = "LABOUR", Quantity = 0 }
},
RelatedProp = "BROTHEL"
})
------------- LIMIT ------