├── .gitignore
├── Images
├── architecture.png
├── finding-installation-folder
│ ├── 01.png
│ ├── 02.png
│ ├── 03.png
│ └── 04.png
├── installing-a-mod
│ ├── 01.png
│ ├── 02.png
│ ├── 03.png
│ ├── 04.png
│ ├── 05.png
│ └── 06.png
├── installing-mod-loader
│ ├── 01.png
│ ├── 02.png
│ ├── 03.png
│ ├── 04.png
│ ├── 05.png
│ ├── 06.png
│ ├── 07.png
│ ├── 08.png
│ ├── 09.png
│ ├── 10.png
│ ├── 11.png
│ ├── 12.png
│ └── 13.png
└── item-configuration
│ ├── clothing-textures-01.png
│ ├── clothing_cheatsheet.png
│ ├── inspect-alt-01.png
│ ├── inspect-alt-02.png
│ ├── inspect-alt-03.png
│ ├── inspect-alt-04.png
│ ├── inspect-default-01.png
│ ├── inventory-icon-name.png
│ └── localization.png
├── JSON_Templates
├── ModAccelerantBehaviour_Template.json
├── ModBedComponent_Template.json
├── ModBodyHarvestComponent_Template.json
├── ModBurnableBehaviour_Template.json
├── ModCarryingCapacityBehaviour_Template.json
├── ModCharcoalComponent_Template.json
├── ModClothingComponent_Template.json
├── ModCollectibleComponent_Template.json
├── ModCookableComponent_Template.json
├── ModCookingPotComponent_Template.json
├── ModEvolveBehaviour_Template.json
├── ModFireStarterBehaviour_Template.json
├── ModFirstAidComponent_Template.json
├── ModFoodComponent_Template.json
├── ModGenericComponent_Template.json
├── ModGenericEquippableComponent_Template.json
├── ModHarvestableBehaviour_Template.json
├── ModLiquidComponent_Template.json
├── ModMillableBehaviour_Template.json
├── ModPowderComponent_Template.json
├── ModPurificationComponent_Template.json
├── ModRandomItemComponent_Template.json
├── ModRandomWeightedItemComponent_Template.json
├── ModRepairableBehaviour_Template.json
├── ModResearchComponent_Template.json
├── ModScentBehaviour_Template.json
├── ModSharpenableBehaviour_Template.json
├── ModStackableBehaviour_Template.json
├── ModTinderBehaviour_Template.json
└── ModToolComponent_Template.json
├── LICENSE
├── ModComponent.sln
├── ModComponent
├── API
│ ├── AlcoholComponent.cs
│ ├── Behaviours
│ │ ├── ModAccelerantBehaviour.cs
│ │ ├── ModBurnableBehaviour.cs
│ │ ├── ModCarryingCapacityBehaviour.cs
│ │ ├── ModEvolveBehaviour.cs
│ │ ├── ModFireMakingBaseBehaviour.cs
│ │ ├── ModFireStarterBehaviour.cs
│ │ ├── ModHarvestableBehaviour.cs
│ │ ├── ModMillableBehaviour.cs
│ │ ├── ModRepairableBehaviour.cs
│ │ ├── ModScentBehaviour.ScentCategory.cs
│ │ ├── ModScentBehaviour.cs
│ │ ├── ModSharpenableBehaviour.cs
│ │ ├── ModStackableBehaviour.cs
│ │ └── ModTinderBehaviour.cs
│ ├── Components
│ │ ├── ModBaseComponent.ItemCategory.cs
│ │ ├── ModBaseComponent.StartingCondition.cs
│ │ ├── ModBaseComponent.cs
│ │ ├── ModBaseEquippableComponent.cs
│ │ ├── ModBedComponent.cs
│ │ ├── ModBodyHarvestComponent.cs
│ │ ├── ModCharcoalComponent.cs
│ │ ├── ModClothingComponent.BodyRegion.cs
│ │ ├── ModClothingComponent.FootwearType.cs
│ │ ├── ModClothingComponent.Layer.cs
│ │ ├── ModClothingComponent.MovementSounds.cs
│ │ ├── ModClothingComponent.cs
│ │ ├── ModCollectibleComponent.Alignment.cs
│ │ ├── ModCollectibleComponent.cs
│ │ ├── ModCookableComponent.CookableType.cs
│ │ ├── ModCookableComponent.cs
│ │ ├── ModCookingPotComponent.cs
│ │ ├── ModExplosiveComponent.cs
│ │ ├── ModFirstAidComponent.FirstAidKind.cs
│ │ ├── ModFirstAidComponent.cs
│ │ ├── ModFoodComponent.cs
│ │ ├── ModGenericComponent.cs
│ │ ├── ModGenericEquippableComponent.cs
│ │ ├── ModLiquidComponent.LiquidKind.cs
│ │ ├── ModLiquidComponent.cs
│ │ ├── ModPowderComponent.ModPowderType.cs
│ │ ├── ModPowderComponent.cs
│ │ ├── ModPurificationComponent.cs
│ │ ├── ModRandomItemComponent.cs
│ │ ├── ModRandomWeightedItemComponent.cs
│ │ ├── ModResearchComponent.cs
│ │ ├── ModToolComponent.ToolKind.cs
│ │ ├── ModToolComponent.ToolUsage.cs
│ │ └── ModToolComponent.cs
│ ├── ModLootTable.cs
│ ├── ModSkillType.cs
│ ├── Modifications
│ │ ├── AddTag.cs
│ │ ├── AttachBehaviour.cs
│ │ ├── ChangeLayer.cs
│ │ └── PlayAkSound.cs
│ └── TinyJsonExtensions.cs
├── AssetLoader
│ ├── AtlasManager.cs
│ ├── AtlasUtils.cs
│ ├── ModAssetBundleManager.cs
│ ├── ModSoundBankManager.cs
│ └── SaveAtlas.cs
├── BuildInfo.cs
├── Implementation.cs
├── Logger.cs
├── Mapper
│ ├── AlternativeToolManager.cs
│ ├── AutoMapper.cs
│ ├── BehaviourMappers
│ │ ├── AccelerantMapper.cs
│ │ ├── BurnableMapper.cs
│ │ ├── CarryingCapacityMapper.cs
│ │ ├── EvolveMapper.cs
│ │ ├── FireStarterMapper.cs
│ │ ├── HarvestableMapper.cs
│ │ ├── MillableMapper.cs
│ │ ├── RepairableMapper.cs
│ │ ├── ScentMapper.cs
│ │ ├── SharpenableMapper.cs
│ │ ├── StackableMapper.cs
│ │ └── TinderMapper.cs
│ ├── BuffCauseTracker.cs
│ ├── ComponentJson.cs
│ ├── ComponentMappers
│ │ ├── BedMapper.cs
│ │ ├── BodyHarvestMapper.cs
│ │ ├── CharcoalMapper.cs
│ │ ├── ClothingMapper.cs
│ │ ├── CollectibleMapper.cs
│ │ ├── CookableMapper.cs
│ │ ├── CookingPotMapper.cs
│ │ ├── EquippableMapper.cs
│ │ ├── ExplosiveMapper.cs
│ │ ├── FirstAidMapper.cs
│ │ ├── FoodMapper.cs
│ │ ├── GenericEquippableMapper.cs
│ │ ├── InspectMapper.cs
│ │ ├── LiquidMapper.cs
│ │ ├── PowderMapper.cs
│ │ ├── PurificationMapper.cs
│ │ ├── ResearchMapper.cs
│ │ └── ToolMapper.cs
│ ├── ConsoleWaitlist.cs
│ ├── DefaultDrawLayers.cs
│ ├── FileType.cs
│ ├── GearEquipper.cs
│ ├── ItemMapper.cs
│ ├── ItemPackData.cs
│ ├── JsonHandler.cs
│ ├── PackManager.cs
│ └── ZipFileLoader.cs
├── ModComponent.csproj
├── Patches
│ ├── AlternativePowderPatches.cs
│ ├── AtlasPatches.cs
│ ├── EquippablePatches.cs
│ ├── FirestartingPatches.cs
│ ├── GameManagerPatch.cs
│ ├── ItemDescriptionPagePatch_Equippable.cs
│ ├── LiquidRandomizationPatches.cs
│ ├── ModClothingPatches.cs
│ ├── ResourcePatches.cs
│ └── SoundBankPatches.cs
├── Properties
│ └── AssemblyInfo.cs
├── SceneLoader
│ ├── Preloader.cs
│ └── Shaders
│ │ ├── ShaderList.cs
│ │ ├── ShaderSubstitutionManager.cs
│ │ ├── SubstituteShadersRecursive.cs
│ │ ├── SubstituteShadersSingle.cs
│ │ └── SubstituteShadersTerrain.cs
├── Settings.cs
└── Utils
│ ├── ActionPickerUtilities.ActionPickerData.cs
│ ├── ActionPickerUtilities.cs
│ ├── AssetBundleUtils.cs
│ ├── ComponentUtils.cs
│ ├── ConversionUtils.cs
│ ├── CopyFieldHandler.cs
│ ├── EnumUtils.cs
│ ├── EquipItemPopupUtils.cs
│ ├── FileUtils.cs
│ ├── ModUtils.cs
│ ├── NameUtils.cs
│ ├── PlayerGender.cs
│ ├── PlayerUtils.cs
│ ├── RandomUtils.cs
│ ├── TypeResolver.cs
│ └── UIUtils.cs
├── README.md
└── docs
├── 3D-Models.md
├── Accelerant-Behaviour-Documentation.md
├── Alcohol.md
├── Alternative-Actions.md
├── Architecture.md
├── Auto-Mapper.md
├── Basic-Information-about-Behaviours.md
├── Basic-Information-about-Components.md
├── Basic-Item-Configuration.md
├── Bed-Component-Documentation.md
├── Blueprints.md
├── Body-Harvest-Component-Documentation.md
├── Burnable-Behaviour-Documentation.md
├── Carrying-Capacity-Behaviour-Documentation.md
├── Charcoal-Component-Documentation.md
├── Clothing-Component-Documentation.md
├── Clothing-Item-Configuration.md
├── Collectible-Component-Documentation.md
├── Cookable-Component-Documentation.md
├── Cooking-Pot-Component-Documentation.md
├── Evolve-Behaviour-Documentation.md
├── Explosive-Component-Documentation.md
├── Features.md
├── Firestarter-Behaviour-Documentation.md
├── First-Aid-Component-Documentation.md
├── Food-Component-Documentation.md
├── For-Developers.md
├── Gear-Spawns.md
├── Generic-Component-Documentation.md
├── Generic-Equippable-Component-Documentation.md
├── Harvestable-Behaviour-Domentation.md
├── Item-Mod-Tutorial.md
├── Item-Names.md
├── Liquid-Component-Documentation.md
├── Localizations.md
├── Loot-Tables.md
├── Millable-Behaviour-Documentation.md
├── Powder-Component-Documentation.md
├── Purification-Component-Documentation.md
├── Random-Item-Component-Documentation.md
├── Random-Weighted-Item-Component-Documentation.md
├── Repairable-Behaviour-Documentation.md
├── Research-Component-Documentation.md
├── Scenes.md
├── Scent-Behaviour-Documentation.md
├── Setup-and-Basic-Configuration.md
├── Shader-Substitution.md
├── Sharpenable-Behaviour-Documentation.md
├── Skill-Type-List.md
├── Sound-Names.md
├── Stackable-Behaviour-Documentation.md
├── Tinder-Behaviour-Documentation.md
├── Tool-Component-Documentation.md
├── _config.yml
└── index.md
/.gitignore:
--------------------------------------------------------------------------------
1 | bin
2 | obj
3 | .vs
4 | *.csproj.user
5 | .idea
--------------------------------------------------------------------------------
/Images/architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/architecture.png
--------------------------------------------------------------------------------
/Images/finding-installation-folder/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/finding-installation-folder/01.png
--------------------------------------------------------------------------------
/Images/finding-installation-folder/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/finding-installation-folder/02.png
--------------------------------------------------------------------------------
/Images/finding-installation-folder/03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/finding-installation-folder/03.png
--------------------------------------------------------------------------------
/Images/finding-installation-folder/04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/finding-installation-folder/04.png
--------------------------------------------------------------------------------
/Images/installing-a-mod/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-a-mod/01.png
--------------------------------------------------------------------------------
/Images/installing-a-mod/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-a-mod/02.png
--------------------------------------------------------------------------------
/Images/installing-a-mod/03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-a-mod/03.png
--------------------------------------------------------------------------------
/Images/installing-a-mod/04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-a-mod/04.png
--------------------------------------------------------------------------------
/Images/installing-a-mod/05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-a-mod/05.png
--------------------------------------------------------------------------------
/Images/installing-a-mod/06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-a-mod/06.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/01.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/02.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/03.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/04.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/05.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/05.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/06.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/06.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/07.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/07.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/08.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/08.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/09.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/09.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/10.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/11.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/12.png
--------------------------------------------------------------------------------
/Images/installing-mod-loader/13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/installing-mod-loader/13.png
--------------------------------------------------------------------------------
/Images/item-configuration/clothing-textures-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/clothing-textures-01.png
--------------------------------------------------------------------------------
/Images/item-configuration/clothing_cheatsheet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/clothing_cheatsheet.png
--------------------------------------------------------------------------------
/Images/item-configuration/inspect-alt-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/inspect-alt-01.png
--------------------------------------------------------------------------------
/Images/item-configuration/inspect-alt-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/inspect-alt-02.png
--------------------------------------------------------------------------------
/Images/item-configuration/inspect-alt-03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/inspect-alt-03.png
--------------------------------------------------------------------------------
/Images/item-configuration/inspect-alt-04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/inspect-alt-04.png
--------------------------------------------------------------------------------
/Images/item-configuration/inspect-default-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/inspect-default-01.png
--------------------------------------------------------------------------------
/Images/item-configuration/inventory-icon-name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/inventory-icon-name.png
--------------------------------------------------------------------------------
/Images/item-configuration/localization.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ds5678/ModComponent/8980a585d64bff43a974b2e7780cd1d3af4ea4c3/Images/item-configuration/localization.png
--------------------------------------------------------------------------------
/JSON_Templates/ModAccelerantBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModAccelerantBehaviour": {
3 | "DestroyedOnUse" : true,
4 | "DurationOffset" : 0,
5 | "SuccessModifier" : 40
6 | }
7 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModBedComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModBedComponent" : {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0.5,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Random",
10 | "InventoryCategory" : "Tool",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "ConditionGainPerHour" : 1,
24 | "AdditionalConditionGainPerHour" : 0,
25 | "WarmthBonusCelsius" : 0,
26 | "DegradePerHour" : 0,
27 | "BearAttackModifier" : 0,
28 | "WolfAttackModifier" : 0,
29 | "OpenAudio" : "",
30 | "CloseAudio" : "",
31 | "PackedMesh" : "",
32 | "UsableMesh" : ""
33 | }
34 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModBodyHarvestComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModBodyHarvestComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0.1,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Material",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "CanCarry" : true,
24 | "HarvestAudio" : "",
25 | "GutPrefab" : "GEAR_Gut",
26 | "GutQuantity" : 1,
27 | "GutWeightKgPerUnit" : 0.15,
28 | "HidePrefab" : "GEAR_RabbitPelt",
29 | "HideQuantity" : 1,
30 | "HideWeightKgPerUnit" : 0.15,
31 | "MeatPrefab" : "GEAR_RawMeatRabbit",
32 | "MeatAvailableMinKG" : 0.1,
33 | "MeatAvailableMaxKG" : 0.5
34 | }
35 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModBurnableBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModBurnableBehaviour": {
3 | "BurningMinutes" : 5,
4 | "BurningMinutesBeforeAllowedToAdd" : 0,
5 | "SuccessModifier" : 60,
6 | "TempIncrease" : 0.5,
7 | "DurationOffset" : 0
8 | }
9 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModCarryingCapacityBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModCarryingCapacityBehaviour": {
3 | "MaxCarryCapacityKGBuff" : 5
4 | }
5 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModCharcoalComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModCharcoalComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Material",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "SurveyGameMinutes" : 15,
24 | "SurveyRealSeconds" : 3,
25 | "SurveySkillExtendedHours" : 1,
26 | "SurveyLoopAudio" : "Play_MapCharcoalWriting"
27 | }
28 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModCollectibleComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModCollectibleComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleNote",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleNoteDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Tool",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "HudMessageLocalizationId" : "GAMEPLAY_SampleNoteHudMessage",
24 | "NarrativeTextLocalizationId" : "GAMEPLAY_SampleNoteNarrativeText",
25 | "TextAlignment" : "Center"
26 | }
27 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModCookableComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModCookableComponent" : {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_HotCocoaBox",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_HotCocoaBoxDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0.32,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Random",
10 | "InventoryCategory" : "Food",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "Cooking" : true,
24 | "CookingMinutes" : 13,
25 | "CookingUnitsRequired" : 1,
26 | "CookingWaterRequired" : 0.25,
27 | "CookingResult" : "GEAR_HotCocoaCup",
28 | "BurntMinutes" : 30,
29 | "Type" : "Liquid",
30 | "CookingAudio" : "",
31 | "StartCookingAudio" : ""
32 | }
33 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModCookingPotComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModCookingPotComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0.1,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Tool",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "CanCookLiquid" : true,
24 | "CanCookGrub" : false,
25 | "CanCookMeat" : true,
26 | "Capacity" : 1,
27 | "Template" : "GEAR_CookingPot",
28 | "SnowMesh" : "fryingpan_snowmesh",
29 | "WaterMesh" : "fryingpan_watermesh"
30 | }
31 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModEvolveBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModEvolveBehaviour" : {
3 | "TargetItemName" : "GEAR_GutDried",
4 | "EvolveHours" : 120,
5 | "IndoorsOnly" : true
6 | }
7 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModFireStarterBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModFireStarterBehaviour" : {
3 | "DestroyedOnUse" : false,
4 | "DurationOffset" : 0,
5 | "NumberOfUses" : 100,
6 | "OnUseSoundEvent" : "",
7 | "RequiresSunLight" : true,
8 | "RuinedAfterUse" : false,
9 | "SecondsToIgniteTinder" : 1,
10 | "SecondsToIgniteTorch" : 1,
11 | "SuccessModifier" : 0
12 | }
13 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModFirstAidComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModFirstAidComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "InitialCondition" : "Perfect",
7 | "WeightKG": 0.1,
8 | "DaysToDecay" : 0,
9 | "MaxHP" : 100,
10 | "InventoryCategory" : "FirstAid",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "ProgressBarMessage" : "",
24 | "RemedyText" : "",
25 | "InstantHealing" : 0,
26 | "FirstAidType" : "Antibiotics",
27 | "TimeToUseSeconds" : 4,
28 | "UnitsPerUse" : 1,
29 | "UseAudio" : ""
30 | }
31 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModGenericComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModGenericComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0.1,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Material",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : ""
22 | }
23 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModGenericEquippableComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModGenericEquippableComponent" : {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "GAMEPLAY_SampleItemAction",
6 | "WeightKG": 0.5,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Random",
10 | "InventoryCategory" : "Tool",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "EquippedModelPrefab" : "",
24 | "ImplementationType" : "",
25 | "EquippingAudio" : ""
26 | }
27 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModHarvestableBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModHarvestableBehaviour": {
3 | "Audio" : "",
4 | "Minutes" : 10,
5 | "YieldCounts" : [1],
6 | "YieldNames" : ["GEAR_ScrapMetal"],
7 | "RequiredToolNames" : []
8 | }
9 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModLiquidComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModLiquidComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_MetalWaterBottle",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_MetalWaterBottleDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Food",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, -0.12, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "LiquidType" : "Water",
24 | "LiquidCapacityLiters" : 0.75,
25 | "RandomizedQuantity" : false,
26 | "LiquidLiters" : 0.75
27 | }
28 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModMillableBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModMillableBehaviour" : {
3 | "RepairDurationMinutes" : 15,
4 | "RepairRequiredGear" : ["GEAR_ScrapMetal","Gear_Cloth"],
5 | "RepairRequiredGearUnits" : [2,1],
6 | "CanRestoreFromWornOut" : false,
7 | "RecoveryDurationMinutes" : 60,
8 | "RestoreRequiredGear" : ["GEAR_ScrapMetal","Gear_Cloth"],
9 | "RestoreRequiredGearUnits" : [4,2],
10 | "Skill" : "None"
11 | }
12 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModPowderComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModPowderComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Tool",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "PowderType" : "Gunpowder",
24 | "CapacityKG" : 0.2,
25 | "ChanceFull" : 75
26 | }
27 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModPurificationComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModPurificationComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Material",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "LitersPurify" : 1,
24 | "ProgressBarDurationSeconds" : 5,
25 | "ProgressBarLocalizationID" : "GAMEPLAY_PurifyingWater",
26 | "PurifyAudio" : "Play_WaterPurification"
27 | }
28 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModRandomItemComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModRandomItemComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Material",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "ItemNames" : []
24 | }
25 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModRandomWeightedItemComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModRandomWeightedItemComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Material",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "ItemNames" : [],
24 | "ItemWeights" : []
25 | }
26 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModRepairableBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModRepairableBehaviour" : {
3 | "Audio" : "",
4 | "Minutes" : 10,
5 | "Condition" : 20,
6 | "RequiredTools" : ["GEAR_SimpleTools","GEAR_HighQualityTools"],
7 | "MaterialNames" : ["GEAR_ScrapMetal"],
8 | "MaterialCounts" : [1]
9 | }
10 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModResearchComponent_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModResearchComponent": {
3 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
4 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
5 | "InventoryActionLocalizationId" : "",
6 | "WeightKG": 0,
7 | "DaysToDecay" : 0,
8 | "MaxHP" : 100,
9 | "InitialCondition" : "Perfect",
10 | "InventoryCategory" : "Material",
11 | "PickUpAudio" : "",
12 | "PutBackAudio" : "",
13 | "StowAudio" : "Play_InventoryStow",
14 | "WornOutAudio" : "",
15 | "InspectOnPickup" : true,
16 | "InspectDistance" : 0.4,
17 | "InspectAngles" : [0, 0, 0],
18 | "InspectOffset" : [0, 0, 0],
19 | "InspectScale" : [1, 1, 1],
20 | "NormalModel" : "",
21 | "InspectModel" : "",
22 |
23 | "SkillType" : "Cooking",
24 | "TimeRequirementHours" : 5,
25 | "SkillPoints" : 10,
26 | "NoBenefitAtSkillLevel" : 4,
27 | "ReadAudio" : "Play_ResearchBook"
28 | }
29 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModScentBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModScentBehaviour" : {
3 | "ScentCategory" : "RAW_MEAT"
4 | }
5 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModSharpenableBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModSharpenableBehaviour" : {
3 | "Audio" : "",
4 | "MinutesMin" : 5,
5 | "MinutesMax" : 20,
6 | "ConditionMin" : 3.3,
7 | "ConditionMax" : 9.9,
8 | "Tools" : ["GEAR_SharpeningStone"]
9 | }
10 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModStackableBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModStackableBehaviour": {
3 | "SingleUnitTextId" : "GAMEPLAY_HotCocoaBoxStackSingle",
4 | "MultipleUnitTextId" : "GAMEPLAY_HotCocoaBoxStackMultiple",
5 | "StackSprite" : "",
6 | "UnitsPerItem" : 8,
7 | "ChanceFull" : 80
8 | }
9 | }
--------------------------------------------------------------------------------
/JSON_Templates/ModTinderBehaviour_Template.json:
--------------------------------------------------------------------------------
1 | {
2 | "ModTinderBehaviour": {
3 | "SuccessModifier" : 60,
4 | "DurationOffset" : 0
5 | }
6 | }
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2021 WulfMarius, ds5678
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4 |
5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6 |
7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/ModComponent.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.31005.135
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModComponent", "ModComponent\ModComponent.csproj", "{B809C688-2A3F-4573-821F-FB90EA433DAD}"
7 | EndProject
8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8050C64C-E317-4EE5-A693-DF9A8284B867}"
9 | ProjectSection(SolutionItems) = preProject
10 | .gitignore = .gitignore
11 | LICENSE = LICENSE
12 | README.md = README.md
13 | EndProjectSection
14 | EndProject
15 | Global
16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
17 | Debug|Any CPU = Debug|Any CPU
18 | Release|Any CPU = Release|Any CPU
19 | EndGlobalSection
20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
21 | {B809C688-2A3F-4573-821F-FB90EA433DAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22 | {B809C688-2A3F-4573-821F-FB90EA433DAD}.Debug|Any CPU.Build.0 = Debug|Any CPU
23 | {B809C688-2A3F-4573-821F-FB90EA433DAD}.Release|Any CPU.ActiveCfg = Release|Any CPU
24 | {B809C688-2A3F-4573-821F-FB90EA433DAD}.Release|Any CPU.Build.0 = Release|Any CPU
25 | EndGlobalSection
26 | GlobalSection(SolutionProperties) = preSolution
27 | HideSolutionNode = FALSE
28 | EndGlobalSection
29 | GlobalSection(ExtensibilityGlobals) = postSolution
30 | SolutionGuid = {80809B13-DF2D-43FC-80AD-1202500C4F98}
31 | EndGlobalSection
32 | EndGlobal
33 |
--------------------------------------------------------------------------------
/ModComponent/API/AlcoholComponent.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using UnityEngine;
3 |
4 | namespace ModComponent.API;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class AlcoholComponent : MonoBehaviour
8 | {
9 | public float AmountTotal;
10 | public float AmountRemaining;
11 | public float UptakeSeconds;
12 | public AlcoholComponent(IntPtr intPtr) : base(intPtr) { }
13 | }
14 |
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModAccelerantBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 |
4 | namespace ModComponent.API.Behaviours;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class ModAccelerantBehaviour : ModFireMakingBaseBehaviour
8 | {
9 | ///
10 | /// Is the item destroyed immediately after use?
11 | ///
12 | public bool DestroyedOnUse;
13 |
14 | public ModAccelerantBehaviour(System.IntPtr intPtr) : base(intPtr) { }
15 |
16 | [HideFromIl2Cpp]
17 | internal override void InitializeBehaviour(ProxyObject dict, string className = "ModAccelerantBehaviour")
18 | {
19 | base.InitializeBehaviour(dict, className);
20 | this.DestroyedOnUse = dict.GetVariant(className, "DestroyedOnUse");
21 | }
22 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModBurnableBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 |
4 | namespace ModComponent.API.Behaviours;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class ModBurnableBehaviour : ModFireMakingBaseBehaviour
8 | {
9 | ///
10 | /// Number of minutes this item adds to the remaining burn time of the fire.
11 | ///
12 | public int BurningMinutes;
13 |
14 | ///
15 | /// How long must a fire be burning before this item can be added?
16 | ///
17 | public float BurningMinutesBeforeAllowedToAdd;
18 |
19 | ///
20 | /// Temperature increase in °C when added to the fire.
21 | ///
22 | public float TempIncrease;
23 |
24 | public ModBurnableBehaviour(System.IntPtr intPtr) : base(intPtr) { }
25 |
26 | [HideFromIl2Cpp]
27 | internal override void InitializeBehaviour(ProxyObject dict, string className = "ModBurnableBehaviour")
28 | {
29 | base.InitializeBehaviour(dict, className);
30 | this.BurningMinutes = dict.GetVariant(className, "BurningMinutes");
31 | this.BurningMinutesBeforeAllowedToAdd = dict.GetVariant(className, "BurningMinutesBeforeAllowedToAdd");
32 | this.TempIncrease = dict.GetVariant(className, "TempIncrease");
33 | }
34 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModCarryingCapacityBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 | using UnityEngine;
4 |
5 | namespace ModComponent.API.Behaviours;
6 |
7 | [MelonLoader.RegisterTypeInIl2Cpp]
8 | public class ModCarryingCapacityBehaviour : MonoBehaviour
9 | {
10 | ///
11 | /// The maximum buff to the carrying capacity from this item.
12 | ///
13 | public float MaxCarryCapacityKGBuff;
14 |
15 | public ModCarryingCapacityBehaviour(System.IntPtr intPtr) : base(intPtr) { }
16 |
17 | [HideFromIl2Cpp]
18 | internal void InitializeBehaviour(ProxyObject dict, string className = "ModCarryingCapacityBehaviour")
19 | {
20 | this.MaxCarryCapacityKGBuff = dict.GetVariant(className, "MaxCarryCapacityKGBuff");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModEvolveBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 | using UnityEngine;
4 |
5 | namespace ModComponent.API.Behaviours;
6 |
7 | [MelonLoader.RegisterTypeInIl2Cpp]
8 | public class ModEvolveBehaviour : MonoBehaviour
9 | {
10 | ///
11 | /// Name of the item into which this item will. E.g. 'GEAR_GutDried'
12 | ///
13 | public string TargetItemName = string.Empty;
14 |
15 | ///
16 | /// Does this item only evolve when it is stored indoors?
17 | ///
18 | public bool IndoorsOnly;
19 |
20 | ///
21 | /// How many in-game hours does this item take to evolve from 0% to 100%?
22 | ///
23 | public int EvolveHours = 1;
24 |
25 | public ModEvolveBehaviour(System.IntPtr intPtr) : base(intPtr) { }
26 |
27 | [HideFromIl2Cpp]
28 | internal void InitializeBehaviour(ProxyObject dict, string className = "ModEvolveBehaviour")
29 | {
30 | this.TargetItemName = dict.GetVariant(className, "TargetItemName");
31 | this.EvolveHours = dict.GetVariant(className, "EvolveHours");
32 | this.IndoorsOnly = dict.GetVariant(className, "IndoorsOnly");
33 | }
34 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModFireMakingBaseBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 | using UnityEngine;
4 |
5 | namespace ModComponent.API.Behaviours;
6 |
7 | ///
8 | /// The base class for all modded components involved in making fires
9 | ///
10 | [MelonLoader.RegisterTypeInIl2Cpp]
11 | public abstract class ModFireMakingBaseBehaviour : MonoBehaviour
12 | {
13 | ///
14 | /// Does this item affect the chance for success? Represents percentage points.
15 | /// Positive values increase the chance, negative values reduce it.
16 | ///
17 | public float SuccessModifier;
18 |
19 | ///
20 | /// In-game seconds offset for fire starting duration from this accelerant.
21 | /// NOT scaled by fire starting skill. Positive values mean 'slower', negative values mean 'faster'.
22 | ///
23 | public float DurationOffset;
24 |
25 | public ModFireMakingBaseBehaviour(System.IntPtr intPtr) : base(intPtr) { }
26 |
27 | [HideFromIl2Cpp]
28 | internal virtual void InitializeBehaviour(ProxyObject dict, string className)
29 | {
30 | this.SuccessModifier = dict.GetVariant(className, "SuccessModifier");
31 | this.DurationOffset = dict.GetVariant(className, "DurationOffset");
32 | }
33 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModFireStarterBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 |
4 | namespace ModComponent.API.Behaviours;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class ModFireStarterBehaviour : ModFireMakingBaseBehaviour
8 | {
9 | ///
10 | /// How many in-game seconds this item will take to ignite tinder.
11 | ///
12 | public float SecondsToIgniteTinder;
13 |
14 | ///
15 | /// How many in-game seconds this item will take to ignite a torch.
16 | ///
17 | public float SecondsToIgniteTorch;
18 |
19 | ///
20 | /// How many times can this item be used?
21 | ///
22 | public float NumberOfUses;
23 |
24 | ///
25 | /// Does the item require sunlight to work?
26 | ///
27 | public bool RequiresSunLight;
28 |
29 | ///
30 | /// What sound to play during usage. Not used for accelerants.
31 | ///
32 | public string OnUseSoundEvent = string.Empty;
33 |
34 | ///
35 | /// Set the condition to 0% after the fire starting finished (either successful or not).
36 | ///
37 | public bool RuinedAfterUse;
38 |
39 | ///
40 | /// Is the item destroyed immediately after use?
41 | ///
42 | public bool DestroyedOnUse;
43 |
44 | public ModFireStarterBehaviour(System.IntPtr intPtr) : base(intPtr) { }
45 |
46 | [HideFromIl2Cpp]
47 | internal override void InitializeBehaviour(ProxyObject dict, string className = "ModFireStarterBehaviour")
48 | {
49 | base.InitializeBehaviour(dict, className);
50 | this.DestroyedOnUse = dict.GetVariant(className, "DestroyedOnUse");
51 | this.NumberOfUses = dict.GetVariant(className, "NumberOfUses");
52 | this.OnUseSoundEvent = dict.GetVariant(className, "OnUseSoundEvent");
53 | this.RequiresSunLight = dict.GetVariant(className, "RequiresSunLight");
54 | this.RuinedAfterUse = dict.GetVariant(className, "RuinedAfterUse");
55 | this.SecondsToIgniteTinder = dict.GetVariant(className, "SecondsToIgniteTinder");
56 | this.SecondsToIgniteTorch = dict.GetVariant(className, "SecondsToIgniteTorch");
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModHarvestableBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using System;
3 | using UnhollowerBaseLib.Attributes;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.API.Behaviours;
7 |
8 | [MelonLoader.RegisterTypeInIl2Cpp]
9 | public class ModHarvestableBehaviour : MonoBehaviour
10 | {
11 | ///
12 | /// The audio to play while harvesting
13 | ///
14 | public string Audio = string.Empty;
15 |
16 | ///
17 | /// How many in-game minutes does it take to harvest this item?
18 | ///
19 | public int Minutes;
20 |
21 | ///
22 | /// The names of the GearItems harvesting will yield
23 | ///
24 | public string[] YieldNames = Array.Empty();
25 |
26 | ///
27 | /// The number of the GearItems harvesting will yield
28 | ///
29 | public int[] YieldCounts = Array.Empty();
30 |
31 | ///
32 | /// The names of the ToolItems that can be used to harvest. Leave empty for harvesting by hand.
33 | ///
34 | public string[] RequiredToolNames = Array.Empty();
35 |
36 | public ModHarvestableBehaviour(IntPtr intPtr) : base(intPtr) { }
37 |
38 | [HideFromIl2Cpp]
39 | internal void InitializeBehaviour(ProxyObject dict, string className = "ModHarvestableBehaviour")
40 | {
41 | this.Audio = dict.GetVariant(className, "Audio");
42 | this.Minutes = dict.GetVariant(className, "Minutes");
43 | this.YieldCounts = dict.GetIntArray(className, "YieldCounts");
44 | this.YieldNames = dict.GetStringArray(className, "YieldNames");
45 | this.RequiredToolNames = dict.GetStringArray(className, "RequiredToolNames");
46 | }
47 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModRepairableBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using System;
3 | using UnhollowerBaseLib.Attributes;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.API.Behaviours;
7 |
8 | [MelonLoader.RegisterTypeInIl2Cpp]
9 | public class ModRepairableBehaviour : MonoBehaviour
10 | {
11 | ///
12 | /// The audio to play while repairing.
13 | ///
14 | public string Audio = string.Empty;
15 |
16 | ///
17 | /// How many in-game minutes does it take to repair this item?
18 | ///
19 | public int Minutes;
20 |
21 | ///
22 | /// How much condition does repairing restore?
23 | ///
24 | public int Condition;
25 |
26 | ///
27 | /// The name of the tools suitable for repair. At least one of those will be required for repairing.
28 | /// Leave empty, if this item should be repairable without tools.
29 | ///
30 | public string[] RequiredTools = Array.Empty();
31 |
32 | ///
33 | /// The name of the materials required for repair.
34 | ///
35 | public string[] MaterialNames = Array.Empty();
36 |
37 | ///
38 | /// The number of the materials required for repair.
39 | ///
40 | public int[] MaterialCounts = Array.Empty();
41 |
42 | public ModRepairableBehaviour(IntPtr intPtr) : base(intPtr) { }
43 |
44 | [HideFromIl2Cpp]
45 | internal void InitializeBehaviour(ProxyObject dict, string className = "ModRepairableBehaviour")
46 | {
47 | this.Audio = dict.GetVariant(className, "Audio");
48 | this.Minutes = dict.GetVariant(className, "Minutes");
49 | this.Condition = dict.GetVariant(className, "Condition");
50 | this.RequiredTools = dict.GetStringArray(className, "RequiredTools");
51 | this.MaterialNames = dict.GetStringArray(className, "MaterialNames");
52 | this.MaterialCounts = dict.GetIntArray(className, "MaterialCounts");
53 | }
54 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModScentBehaviour.ScentCategory.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Behaviours;
2 |
3 | public partial class ModScentBehaviour
4 | {
5 | public enum ScentCategory
6 | {
7 | RAW_MEAT,
8 | RAW_FISH,
9 | COOKED_MEAT,
10 | COOKED_FISH,
11 | GUTS,
12 | QUARTER,
13 | }
14 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModScentBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 | using UnityEngine;
4 |
5 | namespace ModComponent.API.Behaviours;
6 |
7 | [MelonLoader.RegisterTypeInIl2Cpp]
8 | public partial class ModScentBehaviour : MonoBehaviour
9 | {
10 | ///
11 | /// What type of smell does this item have? Affects wildlife detection radius and smell strength.
12 | ///
13 | public ScentCategory scentCategory = ScentCategory.RAW_MEAT;
14 |
15 | public ModScentBehaviour(System.IntPtr intPtr) : base(intPtr) { }
16 |
17 | [HideFromIl2Cpp]
18 | internal void InitializeBehaviour(ProxyObject dict, string className = "ModScentBehaviour")
19 | {
20 | this.scentCategory = dict.GetEnum(className, "ScentCategory");
21 | }
22 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModSharpenableBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using System;
3 | using UnhollowerBaseLib.Attributes;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.API.Behaviours;
7 |
8 | [MelonLoader.RegisterTypeInIl2Cpp]
9 | public class ModSharpenableBehaviour : MonoBehaviour
10 | {
11 | ///
12 | /// Which tools can be used to sharpen this item, e.g. 'GEAR_SharpeningStone'.
13 | /// Leave empty to make this sharpenable without tools.
14 | ///
15 | public string[] Tools = Array.Empty();
16 |
17 | ///
18 | /// How many in-game minutes does it take to sharpen this item at minimum skill.
19 | ///
20 | public int MinutesMin;
21 |
22 | ///
23 | /// How many in-game minutes does it take to sharpen this item at maximum skill.
24 | ///
25 | public int MinutesMax;
26 |
27 | ///
28 | /// How much condition is restored to this item at minimum skill.
29 | ///
30 | public float ConditionMin;
31 |
32 | ///
33 | /// How much condition is restored to this item at maximum skill.
34 | ///
35 | public float ConditionMax;
36 |
37 | ///
38 | /// The sound to play while sharpening. Leave empty for a sensible default.
39 | ///
40 | public string Audio = "";
41 |
42 | public ModSharpenableBehaviour(IntPtr intPtr) : base(intPtr) { }
43 |
44 | [HideFromIl2Cpp]
45 | internal void InitializeBehaviour(ProxyObject dict, string className = "ModSharpenableBehaviour")
46 | {
47 | this.Audio = dict.GetVariant(className, "Audio");
48 | this.MinutesMin = dict.GetVariant(className, "MinutesMin");
49 | this.MinutesMax = dict.GetVariant(className, "MinutesMax");
50 | this.ConditionMin = dict.GetVariant(className, "ConditionMin");
51 | this.ConditionMax = dict.GetVariant(className, "ConditionMax");
52 | this.Tools = dict.GetStringArray(className, "Tools");
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModStackableBehaviour.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using MelonLoader.TinyJSON;
4 | using ModComponent.Utils;
5 | using UnhollowerBaseLib.Attributes;
6 | using UnityEngine;
7 |
8 | namespace ModComponent.API.Behaviours;
9 |
10 | [MelonLoader.RegisterTypeInIl2Cpp]
11 | public class ModStackableBehaviour : MonoBehaviour
12 | {
13 | ///
14 | /// Localization key to be used for stacks with a singular item. E.g. '1 arrow'.
15 | ///
16 | public string SingleUnitTextID = "";
17 |
18 | ///
19 | /// Localization key to be used for stacks with multiple items. E.g. '2 arrows'.
20 | ///
21 | public string MultipleUnitTextID = "";
22 |
23 | ///
24 | /// An optional sprite name (from a UIAtlas) that will be add to the stack.
25 | ///
26 | public string StackSprite = "";
27 |
28 | ///
29 | /// The default number of units to make a full stack.
30 | ///
31 | public int UnitsPerItem = 1;
32 |
33 | ///
34 | /// Percent chance of the item having a full stack.
35 | ///
36 | public float ChanceFull = 100f;
37 |
38 | void Awake()
39 | {
40 | CopyFieldHandler.UpdateFieldValues(this);
41 | GearItem gearItem = this.GetComponent();
42 | StackableItem? stackable = gearItem?.GetComponent();
43 | if (stackable != null && gearItem != null && !gearItem.m_BeenInspected)
44 | {
45 | stackable.m_Units = stackable.m_UnitsPerItem == 1 || RandomUtils.RollChance(this.ChanceFull)
46 | ? stackable.m_UnitsPerItem
47 | : RandomUtils.Range(1, stackable.m_UnitsPerItem);
48 | }
49 | }
50 |
51 | public ModStackableBehaviour(System.IntPtr intPtr) : base(intPtr) { }
52 |
53 | [HideFromIl2Cpp]
54 | internal void InitializeBehaviour(ProxyObject dict, string className = "ModStackableBehaviour")
55 | {
56 | this.MultipleUnitTextID = dict.GetVariant(className, "MultipleUnitTextId");
57 | this.StackSprite = dict.GetVariant(className, "StackSprite");
58 | this.SingleUnitTextID = dict.GetVariant(className, "SingleUnitTextId");
59 | this.UnitsPerItem = dict.GetVariant(className, "UnitsPerItem");
60 | this.ChanceFull = dict.GetVariant(className, "ChanceFull");
61 | }
62 | }
--------------------------------------------------------------------------------
/ModComponent/API/Behaviours/ModTinderBehaviour.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 |
4 | namespace ModComponent.API.Behaviours;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class ModTinderBehaviour : ModFireMakingBaseBehaviour
8 | {
9 | public ModTinderBehaviour(System.IntPtr intPtr) : base(intPtr) { }
10 |
11 | [HideFromIl2Cpp]
12 | internal override void InitializeBehaviour(ProxyObject dict, string className = "ModTinderBehaviour")
13 | {
14 | base.InitializeBehaviour(dict, className);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModBaseComponent.ItemCategory.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public abstract partial class ModBaseComponent
4 | {
5 | public enum ItemCategory
6 | {
7 | Auto,
8 | Clothing,
9 | FirstAid,
10 | Firestarting,
11 | Food,
12 | Material,
13 | Tool
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModBaseComponent.StartingCondition.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public abstract partial class ModBaseComponent
4 | {
5 | public enum StartingCondition
6 | {
7 | Random,
8 | Perfect,
9 | High,
10 | Medium,
11 | Low
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModCharcoalComponent.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 |
4 | namespace ModComponent.API.Components;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class ModCharcoalComponent : ModBaseComponent
8 | {
9 | public float SurveyGameMinutes = 15;
10 | public float SurveyRealSeconds = 3;
11 | public float SurveySkillExtendedHours = 1;
12 | public string SurveyLoopAudio = "Play_MapCharcoalWriting";
13 | public ModCharcoalComponent(System.IntPtr intPtr) : base(intPtr) { }
14 |
15 | [HideFromIl2Cpp]
16 | internal override void InitializeComponent(ProxyObject dict, string className = "ModCharcoalComponent")
17 | {
18 | base.InitializeComponent(dict, className);
19 | this.SurveyGameMinutes = dict.GetVariant(className, "SurveyGameMinutes");
20 | this.SurveyRealSeconds = dict.GetVariant(className, "SurveyRealSeconds");
21 | this.SurveySkillExtendedHours = dict.GetVariant(className, "SurveySkillExtendedHours");
22 | this.SurveyLoopAudio = dict.GetVariant(className, "SurveyLoopAudio");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModClothingComponent.BodyRegion.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModClothingComponent
4 | {
5 | public enum BodyRegion
6 | {
7 | Head,
8 | Hands,
9 | Chest,
10 | Legs,
11 | Feet,
12 | Accessory,
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModClothingComponent.FootwearType.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModClothingComponent
4 | {
5 | public enum FootwearType
6 | {
7 | None,
8 | Boots,
9 | Deerskin,
10 | Shoes,
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModClothingComponent.Layer.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModClothingComponent
4 | {
5 | public enum Layer
6 | {
7 | Base,
8 | Mid,
9 | Top,
10 | Top2,
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModClothingComponent.MovementSounds.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModClothingComponent
4 | {
5 | public enum MovementSounds
6 | {
7 | None,
8 | HeavyNylon,
9 | LeatherHide,
10 | LightCotton,
11 | LightNylon,
12 | SoftCloth,
13 | Wool,
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModCollectibleComponent.Alignment.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModCollectibleComponent
4 | {
5 | public enum Alignment
6 | {
7 | Automatic,
8 | Left,
9 | Center,
10 | Right,
11 | Justified
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModCollectibleComponent.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 |
4 | namespace ModComponent.API.Components;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public partial class ModCollectibleComponent : ModBaseComponent
8 | {
9 | ///
10 | /// The localization id for the hud message displayed after this item is picked up.
11 | ///
12 | public string HudMessageLocalizationId = "";
13 |
14 | ///
15 | /// The localization id for the narrative content of the item.
16 | ///
17 | public string NarrativeTextLocalizationId = "";
18 |
19 | ///
20 | /// The alignment of the narrative text. Options are "Automatic", "Left", "Center", "Right", and "Justified"
21 | ///
22 | public Alignment TextAlignment = Alignment.Automatic;
23 |
24 | public ModCollectibleComponent(System.IntPtr intPtr) : base(intPtr) { }
25 |
26 | [HideFromIl2Cpp]
27 | internal override void InitializeComponent(ProxyObject dict, string className = "ModCollectibleComponent")
28 | {
29 | base.InitializeComponent(dict, className);
30 | this.HudMessageLocalizationId = dict.GetVariant(className, "HudMessageLocalizationId");
31 | this.NarrativeTextLocalizationId = dict.GetVariant(className, "NarrativeTextLocalizationId");
32 | this.TextAlignment = dict.GetEnum(className, "TextAlignment");
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModCookableComponent.CookableType.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModCookableComponent
4 | {
5 | public enum CookableType
6 | {
7 | Meat,
8 | Grub,
9 | Liquid,
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModCookingPotComponent.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using ModComponent.Utils;
3 | using System;
4 | using UnhollowerBaseLib.Attributes;
5 | using UnityEngine;
6 |
7 | namespace ModComponent.API.Components;
8 |
9 | [MelonLoader.RegisterTypeInIl2Cpp]
10 | public class ModCookingPotComponent : ModBaseComponent
11 | {
12 | ///
13 | /// Can the item cook liquids?
14 | ///
15 | public bool CanCookLiquid;
16 |
17 | ///
18 | /// Can the item cook grub?
19 | /// Cookable canned food counts as grub.
20 | ///
21 | public bool CanCookGrub;
22 |
23 | ///
24 | /// Can the item cook meat?
25 | ///
26 | public bool CanCookMeat;
27 |
28 | ///
29 | /// The total water capacity of the item.
30 | ///
31 | public float Capacity;
32 |
33 | ///
34 | /// Template item to be used in the mapping process.
35 | ///
36 | public string Template = "";
37 |
38 | public Mesh? SnowMesh;
39 | public Mesh? WaterMesh;
40 |
41 | void Awake()
42 | {
43 | CopyFieldHandler.UpdateFieldValues(this);
44 | }
45 |
46 | public ModCookingPotComponent(IntPtr intPtr) : base(intPtr) { }
47 |
48 | [HideFromIl2Cpp]
49 | internal override void InitializeComponent(ProxyObject dict, string className = "ModCookingPotComponent")
50 | {
51 | base.InitializeComponent(dict, className);
52 | this.CanCookLiquid = dict.GetVariant(className, "CanCookLiquid");
53 | this.CanCookGrub = dict.GetVariant(className, "CanCookGrub");
54 | this.CanCookMeat = dict.GetVariant(className, "CanCookMeat");
55 | this.Capacity = dict.GetVariant(className, "Capacity");
56 | this.Template = dict.GetVariant(className, "Template");
57 | this.SnowMesh = null;// GetChild(this.gameObject, dict.GetVariant(className,"SnowMesh")).GetComponent().mesh;
58 | this.WaterMesh = null; // GetChild(this.gameObject, dict.GetVariant(className,"WaterMesh")).GetComponent().mesh;
59 | }
60 | }
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModExplosiveComponent.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.Utils;
4 | using UnhollowerBaseLib.Attributes;
5 | using UnityEngine;
6 |
7 | namespace ModComponent.API.Components;
8 |
9 | [MelonLoader.RegisterTypeInIl2Cpp]
10 | internal class ModExplosiveComponent : ModBaseEquippableComponent
11 | {
12 | public float killPlayerRange = 5;
13 |
14 | public float explosionDelay = 5;
15 |
16 | public string explosionAudio = "";
17 |
18 | protected override void Awake()
19 | {
20 | CopyFieldHandler.UpdateFieldValues(this);
21 | base.Awake();
22 | }
23 |
24 | [HideFromIl2Cpp]
25 | internal void OnExplode()
26 | {
27 | GameAudioManager.Play3DSound(this.explosionAudio, this.gameObject);
28 | GameManager.GetConditionComponent().AddHealth(-1 * GetDamageToPlayer(), DamageSource.Unspecified);
29 | Destroy(this.gameObject);
30 | }
31 |
32 | [HideFromIl2Cpp]
33 | private float GetDamageToPlayer()
34 | {
35 | if (killPlayerRange == 0f)
36 | {
37 | return 0f;
38 | }
39 |
40 | float distance = Vector3.Distance(GameManager.GetVpFPSPlayer().transform.position, this.transform.position);
41 | if (distance <= 0)
42 | {
43 | return 100f;
44 | }
45 |
46 | return 100f * killPlayerRange * killPlayerRange / (distance * distance);
47 | }
48 |
49 | public ModExplosiveComponent(System.IntPtr intPtr) : base(intPtr) { }
50 | }
51 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModFirstAidComponent.FirstAidKind.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModFirstAidComponent
4 | {
5 | public enum FirstAidKind
6 | {
7 | Antibiotics,
8 | Bandage,
9 | Disinfectant,
10 | PainKiller,
11 | }
12 | }
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModFirstAidComponent.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using ModComponent.Utils;
3 | using System;
4 | using UnhollowerBaseLib.Attributes;
5 |
6 | namespace ModComponent.API.Components;
7 |
8 | [MelonLoader.RegisterTypeInIl2Cpp]
9 | public partial class ModFirstAidComponent : ModBaseComponent
10 | {
11 | ///
12 | /// Localization key to be used to show a description text while using the item.
13 | /// Should be something like 'Taking Antibiotics', 'Applying Bandage', etc.
14 | ///
15 | public string ProgressBarMessage = "";
16 |
17 | ///
18 | /// Localization key to be used to indicate what action is possible with this item.
19 | /// E.g 'Take Antibiotics', 'Apply Bandage'. This is probably not used.
20 | ///
21 | public string RemedyText = "";
22 |
23 | ///
24 | /// Amount of condition instantly restored after using this item.
25 | ///
26 | public int InstantHealing;
27 |
28 | ///
29 | /// What type of treatment does this item provide?
30 | ///
31 | public FirstAidKind FirstAidType = FirstAidKind.Antibiotics;
32 |
33 | ///
34 | /// Time in seconds to use this item.
35 | /// Most vanilla items use 2 or 3 seconds.
36 | ///
37 | public int TimeToUseSeconds = 3;
38 |
39 | ///
40 | /// How many items are required for one dose or application?
41 | ///
42 | public int UnitsPerUse = 1;
43 |
44 | ///
45 | /// Sound to play when using the item.
46 | ///
47 | public string UseAudio = "";
48 |
49 | void Awake()
50 | {
51 | CopyFieldHandler.UpdateFieldValues(this);
52 | }
53 |
54 | public ModFirstAidComponent(IntPtr intPtr) : base(intPtr) { }
55 |
56 | [HideFromIl2Cpp]
57 | internal override void InitializeComponent(ProxyObject dict, string className = "ModFirstAidComponent")
58 | {
59 | base.InitializeComponent(dict, className);
60 | this.ProgressBarMessage = dict.GetVariant(className, "ProgressBarMessage");
61 | this.RemedyText = dict.GetVariant(className, "RemedyText");
62 | this.InstantHealing = dict.GetVariant(className, "InstantHealing");
63 | this.FirstAidType = dict.GetEnum(className, "FirstAidType");
64 | this.TimeToUseSeconds = dict.GetVariant(className, "TimeToUseSeconds");
65 | this.UnitsPerUse = dict.GetVariant(className, "UnitsPerUse");
66 | this.UseAudio = dict.GetVariant(className, "UseAudio");
67 | }
68 | }
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModGenericComponent.cs:
--------------------------------------------------------------------------------
1 | using ModComponent.Utils;
2 | using System;
3 |
4 | namespace ModComponent.API.Components;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class ModGenericComponent : ModBaseComponent
8 | {
9 | void Awake()
10 | {
11 | CopyFieldHandler.UpdateFieldValues(this);
12 | }
13 |
14 | public ModGenericComponent(IntPtr intPtr) : base(intPtr) { }
15 | }
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModGenericEquippableComponent.cs:
--------------------------------------------------------------------------------
1 | using ModComponent.Utils;
2 |
3 | namespace ModComponent.API.Components;
4 |
5 | [MelonLoader.RegisterTypeInIl2Cpp]
6 | public class ModGenericEquippableComponent : ModBaseEquippableComponent
7 | {
8 | public ModGenericEquippableComponent(System.IntPtr intPtr) : base(intPtr) { }
9 |
10 | protected override void Awake()
11 | {
12 | CopyFieldHandler.UpdateFieldValues(this);
13 | base.Awake();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModLiquidComponent.LiquidKind.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModLiquidComponent
4 | {
5 | public enum LiquidKind
6 | {
7 | Water,
8 | Kerosene
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModLiquidComponent.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using ModComponent.Utils;
3 | using UnhollowerBaseLib.Attributes;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.API.Components;
7 |
8 | [MelonLoader.RegisterTypeInIl2Cpp]
9 | public partial class ModLiquidComponent : ModBaseComponent
10 | {
11 | ///
12 | /// The type of liquid this item contains.
13 | ///
14 | public LiquidKind LiquidType = LiquidKind.Water;
15 |
16 | ///
17 | /// The capacity of this container in liters
18 | ///
19 | public float LiquidCapacityLiters;
20 |
21 | ///
22 | /// If true, this container will have a random initial quantity.
23 | ///
24 | public bool RandomizeQuantity = false;
25 |
26 | ///
27 | /// If initial quantity not randomized, it will have this amount initially.
28 | ///
29 | public float LiquidLiters = 0f;
30 |
31 | void Awake()
32 | {
33 | CopyFieldHandler.UpdateFieldValues(this);
34 | }
35 |
36 | public ModLiquidComponent(System.IntPtr intPtr) : base(intPtr) { }
37 |
38 | [HideFromIl2Cpp]
39 | internal override void InitializeComponent(ProxyObject dict, string className = "ModLiquidComponent")
40 | {
41 | base.InitializeComponent(dict, className);
42 | this.LiquidType = dict.GetEnum(className, "LiquidType");
43 | this.LiquidCapacityLiters = dict.GetVariant(className, "LiquidCapacityLiters");
44 | this.RandomizeQuantity = dict.GetVariant(className, "RandomizedQuantity");
45 | this.LiquidLiters = Mathf.Clamp(dict.GetVariant(className, "LiquidLiters"), 0f, this.LiquidCapacityLiters); //overridden if Randomized
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModPowderComponent.ModPowderType.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 |
3 | namespace ModComponent.API.Components;
4 |
5 | public partial class ModPowderComponent
6 | {
7 | public enum ModPowderType
8 | {
9 | Gunpowder,
10 | Salt,
11 | Yeast
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModPurificationComponent.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 |
4 | namespace ModComponent.API.Components;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class ModPurificationComponent : ModBaseComponent
8 | {
9 | public float LitersPurify = 1f;
10 | public float ProgressBarDurationSeconds = 5f;
11 | public string ProgressBarLocalizationID = "GAMEPLAY_PurifyingWater";
12 | public string PurifyAudio = "Play_WaterPurification";
13 |
14 | public ModPurificationComponent(System.IntPtr intPtr) : base(intPtr) { }
15 |
16 | [HideFromIl2Cpp]
17 | internal override void InitializeComponent(ProxyObject dict, string className = "ModPurificationComponent")
18 | {
19 | base.InitializeComponent(dict, className);
20 | this.LitersPurify = dict.GetVariant(className, "LitersPurify");
21 | this.ProgressBarDurationSeconds = dict.GetVariant(className, "ProgressBarDurationSeconds");
22 | this.ProgressBarLocalizationID = dict.GetVariant(className, "ProgressBarLocalizationID");
23 | this.PurifyAudio = dict.GetVariant(className, "PurifyAudio");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModRandomItemComponent.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using MelonLoader.TinyJSON;
4 | using ModComponent.Utils;
5 | using UnhollowerBaseLib.Attributes;
6 | using UnityEngine;
7 |
8 | namespace ModComponent.API.Components;
9 |
10 | [MelonLoader.RegisterTypeInIl2Cpp]
11 | public class ModRandomItemComponent : ModBaseComponent
12 | {
13 | ///
14 | /// The names of the gear items that this could spawn.
15 | ///
16 | public string[] ItemNames = System.Array.Empty();
17 |
18 | public ModRandomItemComponent(System.IntPtr intPtr) : base(intPtr) { }
19 |
20 | void Awake()
21 | {
22 | CopyFieldHandler.UpdateFieldValues(this);
23 | }
24 | void Update()
25 | {
26 | if (Settings.instance.disableRandomItemSpawns)
27 | {
28 | return;
29 | }
30 |
31 | if (this.ItemNames == null || this.ItemNames.Length == 0)
32 | {
33 | Logger.LogWarning($"'{this.name}' had an invalid list of potential spawn items.");
34 | Destroy(this.gameObject);
35 | return;
36 | }
37 |
38 | int index = RandomUtils.Range(0, this.ItemNames.Length);
39 | GameObject? prefab = Resources.Load(this.ItemNames[index])?.Cast();
40 | if (prefab == null)
41 | {
42 | Logger.LogWarning($"Could not use '{this.name}' to spawn random item '{this.ItemNames[index]}'");
43 | Destroy(this.gameObject);
44 | return;
45 | }
46 |
47 | GameObject gear = Instantiate(prefab, this.transform.position, this.transform.rotation);
48 | gear.name = prefab.name;
49 | DisableObjectForXPMode? xpmode = gear?.GetComponent();
50 | if (xpmode != null)
51 | {
52 | Destroy(xpmode);
53 | }
54 |
55 | Destroy(this.gameObject);
56 | }
57 |
58 | [HideFromIl2Cpp]
59 | internal override void InitializeComponent(ProxyObject dict, string className = "ModRandomItemComponent")
60 | {
61 | base.InitializeComponent(dict, className);
62 | this.ItemNames = dict.GetStringArray(className, "ItemNames");
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModResearchComponent.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader.TinyJSON;
2 | using UnhollowerBaseLib.Attributes;
3 |
4 | namespace ModComponent.API.Components;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class ModResearchComponent : ModBaseComponent
8 | {
9 | public ModSkillType SkillType = ModSkillType.None;
10 | public int TimeRequirementHours = 5;
11 | public int SkillPoints = 10;
12 | public int NoBenefitAtSkillLevel = 4;
13 | public string ReadAudio = "Play_ResearchBook";
14 |
15 | public ModResearchComponent(System.IntPtr intPtr) : base(intPtr) { }
16 |
17 | [HideFromIl2Cpp]
18 | internal override void InitializeComponent(ProxyObject dict, string className = "ModResearchComponent")
19 | {
20 | base.InitializeComponent(dict, className);
21 | this.SkillType = dict.GetEnum(className, "SkillType");
22 | this.TimeRequirementHours = dict.GetVariant(className, "TimeRequirementHours");
23 | this.SkillPoints = dict.GetVariant(className, "SkillPoints");
24 | this.NoBenefitAtSkillLevel = dict.GetVariant(className, "NoBenefitAtSkillLevel");
25 | this.ReadAudio = dict.GetVariant(className, "ReadAudio");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModToolComponent.ToolKind.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModToolComponent
4 | {
5 | public enum ToolKind
6 | {
7 | None,
8 | HackSaw,
9 | Hatchet,
10 | Hammer,
11 | Knife,
12 | }
13 | }
--------------------------------------------------------------------------------
/ModComponent/API/Components/ModToolComponent.ToolUsage.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API.Components;
2 |
3 | public partial class ModToolComponent
4 | {
5 | public enum ToolUsage
6 | {
7 | All,
8 | CraftOnly,
9 | RepairOnly,
10 | }
11 | }
--------------------------------------------------------------------------------
/ModComponent/API/ModLootTable.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using Il2CppSystem.Collections.Generic;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.API;
7 |
8 | [MelonLoader.RegisterTypeInIl2Cpp]
9 | internal class ModLootTable : LootTable
10 | {
11 | string[] prefabNames = System.Array.Empty();
12 | int[] weights = System.Array.Empty();
13 |
14 | public ModLootTable(System.IntPtr intPtr) : base(intPtr) { }
15 |
16 | void Awake()
17 | {
18 | //Set variable values here
19 |
20 | int len = System.Math.Min(prefabNames.Length, weights.Length);
21 | m_Prefabs = new List();
22 | m_Weights = new List();
23 | for (int i = 0; i < len; i++)
24 | {
25 | GameObject? go = Resources.Load(prefabNames[i])?.TryCast();
26 | if (go == null || weights[i] <= 0)
27 | {
28 | continue;
29 | }
30 | else
31 | {
32 | m_Prefabs.Add(go);
33 | m_Weights.Add(weights[i]);
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ModComponent/API/ModSkillType.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.API;
2 |
3 | public enum ModSkillType
4 | {
5 | None = -1,
6 | Firestarting,
7 | CarcassHarvesting,
8 | IceFishing,
9 | Cooking,
10 | Rifle,
11 | Archery,
12 | ClothingRepair,
13 | ToolRepair,
14 | Revolver,
15 | Gunsmithing
16 | }
17 |
--------------------------------------------------------------------------------
/ModComponent/API/Modifications/AddTag.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace ModComponent.API.Modifications;
4 |
5 | [MelonLoader.RegisterTypeInIl2Cpp]
6 | public class AddTag : MonoBehaviour
7 | {
8 | public string Tag = "";
9 |
10 | public void Awake()
11 | {
12 | gameObject.tag = Tag;
13 | }
14 |
15 | public AddTag(System.IntPtr intPtr) : base(intPtr) { }
16 | }
--------------------------------------------------------------------------------
/ModComponent/API/Modifications/AttachBehaviour.cs:
--------------------------------------------------------------------------------
1 | using ModComponent.Utils;
2 | using UnityEngine;
3 |
4 | namespace ModComponent.API.Modifications;
5 |
6 | [MelonLoader.RegisterTypeInIl2Cpp]
7 | public class AttachBehaviour : MonoBehaviour
8 | {
9 | ///
10 | /// The name of the class to be attached.
11 | /// This class must extend `UnityEngine.MonoBehaviour`.
12 | /// If this is an assembly-qualified name (Namespace.TypeName,Assembly) it will be loaded from the given assembly.
13 | /// If the assembly is omitted (Namespace.TypeName), the type will be loaded from the first assembly that contains a type with the given name.
14 | ///
15 | public string BehaviourName = "";
16 |
17 | ///
18 | /// Should this throw an exception if the behaviour cannot be loaded or attached?
19 | ///
20 | public bool ThrowOnError = true;
21 |
22 | public void Start()
23 | {
24 | try
25 | {
26 | Il2CppSystem.Type? behaviourType = TypeResolver.ResolveIl2Cpp(BehaviourName, true);
27 | this.gameObject.AddComponent(behaviourType);
28 | }
29 | catch (System.Exception e)
30 | {
31 | Logger.LogError("Could not load behaviour '" + BehaviourName + "': " + e.Message);
32 |
33 | if (ThrowOnError)
34 | {
35 | throw e;
36 | }
37 | }
38 | }
39 |
40 | public AttachBehaviour(System.IntPtr intPtr) : base(intPtr) { }
41 | }
--------------------------------------------------------------------------------
/ModComponent/API/Modifications/ChangeLayer.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using MelonLoader.TinyJSON;
4 | using ModComponent.Utils;
5 | using System;
6 | using UnhollowerBaseLib.Attributes;
7 | using UnityEngine;
8 |
9 | namespace ModComponent.API.Modifications;
10 |
11 | [MelonLoader.RegisterTypeInIl2Cpp]
12 | public class ChangeLayer : MonoBehaviour
13 | {
14 | public int Layer;
15 | public bool Recursively;
16 |
17 | public void Start()
18 | {
19 | CopyFieldHandler.UpdateFieldValues(this);
20 | this.Invoke("SetLayer", 1);
21 | }
22 |
23 | internal void SetLayer()
24 | {
25 | vp_Layer.Set(this.gameObject, Layer, Recursively);
26 | Destroy(this);
27 | }
28 |
29 | public ChangeLayer(IntPtr intPtr) : base(intPtr) { }
30 |
31 | [HideFromIl2Cpp]
32 | internal void InitializeModification(ProxyObject dict, string className = "ChangeLayer")
33 | {
34 | this.Recursively = dict.GetVariant(className, "Recursively");
35 | this.Layer = dict.GetVariant(className, "Layer");
36 | }
37 | }
--------------------------------------------------------------------------------
/ModComponent/API/Modifications/PlayAkSound.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using UnityEngine;
4 |
5 | namespace ModComponent.API.Modifications;
6 |
7 | [MelonLoader.RegisterTypeInIl2Cpp]
8 | public class PlayAkSound : MonoBehaviour
9 | {
10 | ///
11 | /// The name of the sound (the wwise event loaded from a sound bank with AssetLoader) to be played when this item is enabled or triggered.
12 | ///
13 | public string SoundName = "";
14 |
15 | public bool PlayOnEnable;
16 |
17 | public void OnEnable()
18 | {
19 | if (PlayOnEnable)
20 | {
21 | PlaySound();
22 | }
23 | }
24 |
25 | public void PlaySound() => GameAudioManager.Play3DSound(this.SoundName, this.gameObject);
26 |
27 | public PlayAkSound(System.IntPtr intPtr) : base(intPtr) { }
28 | }
29 |
--------------------------------------------------------------------------------
/ModComponent/AssetLoader/AtlasManager.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using System.Collections.Generic;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.AssetLoader;
7 |
8 | internal static class AtlasManager
9 | {
10 | private static Dictionary knownSpriteAtlases = new Dictionary();
11 |
12 | public static void LoadUiAtlas(Object asset)
13 | {
14 | GameObject? gameObject = asset.TryCast();
15 | if (gameObject == null)
16 | {
17 | Logger.Log($"Asset called '{asset.name}' is not a GameObject as expected.");
18 | return;
19 | }
20 |
21 | UIAtlas? uiAtlas = gameObject.GetComponent();
22 | if (uiAtlas == null)
23 | {
24 | Logger.Log($"Asset called '{asset.name}' does not contain a UIAtlast as expected.");
25 | return;
26 | }
27 |
28 | Logger.Log($"Processing asset '{asset.name}' as UIAtlas.");
29 |
30 | string[] sprites = uiAtlas.GetListOfSprites().ToArray();
31 | foreach (string eachSprite in sprites)
32 | {
33 | if (knownSpriteAtlases.ContainsKey(eachSprite))
34 | {
35 | Logger.Log($"Replacing definition of sprite '{eachSprite}' from atlas '{knownSpriteAtlases[eachSprite].name}' to '{uiAtlas.name}'.");
36 | knownSpriteAtlases[eachSprite] = uiAtlas;
37 | }
38 | else
39 | {
40 | knownSpriteAtlases.Add(eachSprite, uiAtlas);
41 | }
42 | }
43 | }
44 |
45 | internal static UIAtlas GetSpriteAtlas(string spriteName)
46 | {
47 | knownSpriteAtlases.TryGetValue(spriteName, out UIAtlas? result);
48 | return result;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/ModComponent/AssetLoader/AtlasUtils.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 |
4 | namespace ModComponent.AssetLoader;
5 |
6 | internal static class AtlasUtils
7 | {
8 | internal static UIAtlas? GetRequiredAtlas(UISprite sprite, string value)
9 | {
10 | if (string.IsNullOrEmpty(value))
11 | {
12 | return sprite.atlas;
13 | }
14 |
15 | UIAtlas? atlas = AtlasManager.GetSpriteAtlas(value);
16 | if (atlas != null)
17 | {
18 | return atlas;
19 | }
20 |
21 | SaveAtlas? restoreAtlas = sprite.gameObject.GetComponent();
22 | if (restoreAtlas != null)
23 | {
24 | return restoreAtlas.original;
25 | }
26 |
27 | return sprite.atlas;
28 | }
29 |
30 | internal static void SaveOriginalAtlas(UISprite sprite)
31 | {
32 | SaveAtlas? restoreAtlas = sprite.gameObject.GetComponent();
33 | if (restoreAtlas == null)
34 | {
35 | restoreAtlas = sprite.gameObject.AddComponent();
36 | restoreAtlas.original = sprite.atlas;
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/ModComponent/AssetLoader/SaveAtlas.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using System;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.AssetLoader;
7 |
8 | [MelonLoader.RegisterTypeInIl2Cpp]
9 | internal class SaveAtlas : MonoBehaviour
10 | {
11 | public UIAtlas? original;
12 |
13 | public SaveAtlas(IntPtr intPtr) : base(intPtr) { }
14 | }
15 |
--------------------------------------------------------------------------------
/ModComponent/BuildInfo.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent;
2 |
3 | public static class BuildInfo
4 | {
5 | public const string Name = "ModComponent"; // Name of the Mod. (MUST BE SET)
6 | public const string Description = "A utility mod for custom item creation."; // Description for the Mod. (Set as null if none)
7 | public const string Author = "ds5678"; // Author of the Mod. (MUST BE SET)
8 | public const string Company = null; // Company that made the Mod. (Set as null if none)
9 | public const string Version = "5.1.4"; // Version of the Mod. (MUST BE SET)
10 | public const string DownloadLink = null; // Download Link for the Mod. (Set as null if none)
11 | }
12 |
--------------------------------------------------------------------------------
/ModComponent/Implementation.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader;
2 | using ModComponent.Mapper;
3 |
4 | namespace ModComponent;
5 |
6 | internal class Implementation : MelonMod
7 | {
8 | #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
9 | internal static Implementation instance;
10 | #pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable.
11 |
12 | public Implementation()
13 | {
14 | instance = this;
15 | }
16 |
17 | public override void OnInitializeMelon()
18 | {
19 | Logger.LogDebug("Debug Compilation");
20 | Logger.LogNotDebug("Release Compilation");
21 |
22 | Settings.instance.AddToModSettings("ModComponent");
23 |
24 | ZipFileLoader.Initialize();
25 |
26 | AutoMapper.LoadPendingAssetBundles();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/AlternativeToolManager.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 | using System.Collections.Generic;
5 | using UnityEngine;
6 |
7 | namespace ModComponent.Mapper;
8 |
9 | internal static class AlternativeToolManager
10 | {
11 | private static List toolList = new();
12 | private static List templateNameList = new();
13 |
14 | internal static void AddToList(ModToolComponent alternateTool, string templateName)
15 | {
16 | toolList.Add(alternateTool);
17 | templateNameList.Add(templateName);
18 | }
19 |
20 | private static void Clear()
21 | {
22 | toolList = new();
23 | templateNameList = new();
24 | }
25 |
26 | internal static void ProcessList()
27 | {
28 | for (int i = 0; i < toolList.Count; i++)
29 | {
30 | AddAlternativeTool(toolList[i], templateNameList[i]);
31 | }
32 | Clear();
33 | }
34 |
35 | private static void AddAlternativeTool(ModToolComponent modToolComponent, string templateName)
36 | {
37 | GameObject original = Resources.Load(templateName).Cast();
38 | if (original == null)
39 | {
40 | return;
41 | }
42 |
43 | AlternateTools alternateTools = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(original);
44 | List list = new();
45 | if (alternateTools.m_AlternateToolsList != null)
46 | {
47 | list.AddRange(alternateTools.m_AlternateToolsList);
48 | }
49 | list.Add(modToolComponent.gameObject);
50 | alternateTools.m_AlternateToolsList = list.ToArray();
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/AccelerantMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using UnityEngine;
7 |
8 | namespace ModComponent.Mapper.BehaviourMappers;
9 |
10 | internal static class AccelerantMapper
11 | {
12 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
13 | public static void Configure(GameObject prefab)
14 | {
15 | ModAccelerantBehaviour modAccelerantComponent = ComponentUtils.GetComponentSafe(prefab);
16 | if (modAccelerantComponent == null)
17 | {
18 | return;
19 | }
20 |
21 | FireStarterItem fireStarterItem = ComponentUtils.GetOrCreateComponent(modAccelerantComponent);
22 |
23 | fireStarterItem.m_IsAccelerant = true;
24 | fireStarterItem.m_FireStartDurationModifier = modAccelerantComponent.DurationOffset;
25 | fireStarterItem.m_FireStartSkillModifier = modAccelerantComponent.SuccessModifier;
26 | fireStarterItem.m_ConsumeOnUse = modAccelerantComponent.DestroyedOnUse;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/BurnableMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using UnityEngine;
7 |
8 | namespace ModComponent.Mapper.BehaviourMappers;
9 |
10 | internal static class BurnableMapper
11 | {
12 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
13 | public static void Configure(GameObject prefab)
14 | {
15 | ModBurnableBehaviour modBurnableComponent = ComponentUtils.GetComponentSafe(prefab);
16 | if (modBurnableComponent == null)
17 | {
18 | return;
19 | }
20 |
21 | FuelSourceItem fuelSourceItem = ComponentUtils.GetOrCreateComponent(modBurnableComponent);
22 | fuelSourceItem.m_BurnDurationHours = modBurnableComponent.BurningMinutes / 60f;
23 | fuelSourceItem.m_FireAgeMinutesBeforeAdding = modBurnableComponent.BurningMinutesBeforeAllowedToAdd;
24 | fuelSourceItem.m_FireStartSkillModifier = modBurnableComponent.SuccessModifier;
25 | fuelSourceItem.m_HeatIncrease = modBurnableComponent.TempIncrease;
26 | fuelSourceItem.m_HeatInnerRadius = 2.5f;
27 | fuelSourceItem.m_HeatOuterRadius = 6f;
28 | fuelSourceItem.m_FireStartDurationModifier = modBurnableComponent.DurationOffset;
29 | fuelSourceItem.m_IsWet = false;
30 | fuelSourceItem.m_IsTinder = false;
31 | fuelSourceItem.m_IsBurntInFireTracked = false;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/CarryingCapacityMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using UnityEngine;
7 |
8 | namespace ModComponent.Mapper.BehaviourMappers;
9 |
10 | internal static class CarryingCapacityMapper
11 | {
12 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
13 | public static void Configure(GameObject prefab)
14 | {
15 | ModCarryingCapacityBehaviour capacityComponent = ComponentUtils.GetComponentSafe(prefab);
16 | if (capacityComponent == null)
17 | {
18 | return;
19 | }
20 |
21 | CarryingCapacityBuff capacityBuff = ComponentUtils.GetOrCreateComponent(capacityComponent);
22 |
23 | capacityBuff.m_IsWorn = ComponentUtils.GetComponentSafe(capacityComponent) != null
24 | || ComponentUtils.GetComponentSafe(capacityComponent) != null;
25 |
26 | capacityBuff.m_CarryingCapacityBuffValues = new CarryingCapacityBuff.BuffValues()
27 | {
28 | m_MaxCarryCapacityKGBuff = capacityComponent.MaxCarryCapacityKGBuff
29 | };
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/EvolveMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using UnityEngine;
7 |
8 | namespace ModComponent.Mapper.BehaviourMappers;
9 |
10 | internal static class EvolveMapper
11 | {
12 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
13 | internal static void Configure(GameObject prefab)
14 | {
15 | ModEvolveBehaviour modEvolveComponent = ComponentUtils.GetComponentSafe(prefab);
16 | if (modEvolveComponent == null)
17 | {
18 | return;
19 | }
20 |
21 | EvolveItem evolveItem = ComponentUtils.GetOrCreateComponent(modEvolveComponent);
22 | evolveItem.m_ForceNoAutoEvolve = false;
23 | evolveItem.m_GearItemToBecome = GetTargetItem(modEvolveComponent.TargetItemName, modEvolveComponent.name);
24 | evolveItem.m_RequireIndoors = modEvolveComponent.IndoorsOnly;
25 | evolveItem.m_StartEvolvePercent = 0;
26 | evolveItem.m_TimeToEvolveGameDays = Mathf.Clamp(modEvolveComponent.EvolveHours / 24f, 0.01f, 1000);
27 | }
28 |
29 | private static GearItem GetTargetItem(string targetItemName, string reference)
30 | {
31 | GameObject? targetItem = Resources.Load(targetItemName)?.Cast();
32 | if (targetItem != null && ComponentUtils.GetModComponent(targetItem) != null)
33 | {
34 | // if this a modded item, map it now (no harm if it was already mapped earlier)
35 | ItemMapper.Map(targetItem);
36 | }
37 |
38 | return ModUtils.GetItem(targetItemName, reference);
39 | }
40 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/FireStarterMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 |
6 | namespace ModComponent.Mapper.BehaviourMappers;
7 |
8 | internal static class FireStarterMapper
9 | {
10 | internal static void Configure(ModBaseComponent modComponent)
11 | {
12 | ModFireStarterBehaviour modFireStarterComponent = ModComponent.Utils.ComponentUtils.GetComponentSafe(modComponent);
13 | if (modFireStarterComponent == null)
14 | {
15 | return;
16 | }
17 |
18 | FireStarterItem fireStarterItem = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modFireStarterComponent);
19 |
20 | fireStarterItem.m_SecondsToIgniteTinder = modFireStarterComponent.SecondsToIgniteTinder;
21 | fireStarterItem.m_SecondsToIgniteTorch = modFireStarterComponent.SecondsToIgniteTorch;
22 |
23 | fireStarterItem.m_FireStartSkillModifier = modFireStarterComponent.SuccessModifier;
24 |
25 | fireStarterItem.m_ConditionDegradeOnUse = ItemMapper.GetDecayPerStep(modFireStarterComponent.NumberOfUses, modComponent.MaxHP);
26 | fireStarterItem.m_ConsumeOnUse = modFireStarterComponent.DestroyedOnUse;
27 | fireStarterItem.m_RequiresSunLight = modFireStarterComponent.RequiresSunLight;
28 | fireStarterItem.m_OnUseSoundEvent = modFireStarterComponent.OnUseSoundEvent;
29 | }
30 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/HarvestableMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using System;
7 | using UnityEngine;
8 |
9 | namespace ModComponent.Mapper.BehaviourMappers;
10 |
11 | internal static class HarvestableMapper
12 | {
13 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
14 | internal static void Configure(GameObject prefab)
15 | {
16 | ModHarvestableBehaviour modHarvestableComponent = ComponentUtils.GetComponentSafe(prefab);
17 | if (modHarvestableComponent == null)
18 | {
19 | return;
20 | }
21 |
22 | Harvest harvest = ComponentUtils.GetOrCreateComponent(modHarvestableComponent);
23 | harvest.m_Audio = modHarvestableComponent.Audio;
24 | harvest.m_DurationMinutes = modHarvestableComponent.Minutes;
25 |
26 | if (modHarvestableComponent.YieldNames.Length != modHarvestableComponent.YieldCounts.Length)
27 | {
28 | throw new ArgumentException("YieldNames and YieldCounts do not have the same length on gear item '" + modHarvestableComponent.name + "'.");
29 | }
30 |
31 | harvest.m_YieldGear = ModUtils.GetItems(modHarvestableComponent.YieldNames, modHarvestableComponent.name);
32 | harvest.m_YieldGearUnits = modHarvestableComponent.YieldCounts;
33 |
34 | harvest.m_AppliedSkillType = SkillType.None;
35 | harvest.m_RequiredTools = ModUtils.GetItems(modHarvestableComponent.RequiredToolNames, modHarvestableComponent.name);
36 | harvest.m_GunpowderYield = 0f;
37 | }
38 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/MillableMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using System;
7 | using UnityEngine;
8 |
9 | namespace ModComponent.Mapper.BehaviourMappers;
10 |
11 | internal static class MillableMapper
12 | {
13 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
14 | internal static void Configure(GameObject prefab)
15 | {
16 | ModMillableBehaviour modMillable = ComponentUtils.GetComponentSafe(prefab);
17 | if (modMillable == null)
18 | {
19 | return;
20 | }
21 |
22 | Millable millable = ComponentUtils.GetOrCreateComponent(modMillable);
23 | millable.m_CanRestoreFromWornOut = modMillable.CanRestoreFromWornOut;
24 | millable.m_RecoveryDurationMinutes = modMillable.RecoveryDurationMinutes;
25 | millable.m_RepairDurationMinutes = modMillable.RepairDurationMinutes;
26 | millable.m_Skill = EnumUtils.TranslateEnumValue(modMillable.Skill);
27 | if (modMillable.RepairRequiredGear.Length != modMillable.RepairRequiredGearUnits.Length)
28 | {
29 | throw new ArgumentException("RepairRequiredGear and RepairRequiredGearUnits do not have the same length on gear item '" + modMillable.name + "'.");
30 | }
31 | millable.m_RepairRequiredGear = ModUtils.GetItems(modMillable.RepairRequiredGear, modMillable.name);
32 | millable.m_RepairRequiredGearUnits = modMillable.RepairRequiredGearUnits;
33 | if (modMillable.RestoreRequiredGear.Length != modMillable.RestoreRequiredGearUnits.Length)
34 | {
35 | throw new ArgumentException("RestoreRequiredGear and RestoreRequiredGearUnits do not have the same length on gear item '" + modMillable.name + "'.");
36 | }
37 | millable.m_RestoreRequiredGear = ModUtils.GetItems(modMillable.RestoreRequiredGear, modMillable.name);
38 | millable.m_RestoreRequiredGearUnits = modMillable.RestoreRequiredGearUnits;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/RepairableMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using System;
7 | using UnityEngine;
8 |
9 | namespace ModComponent.Mapper.BehaviourMappers;
10 |
11 | internal static class RepairableMapper
12 | {
13 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
14 | internal static void Configure(GameObject prefab)
15 | {
16 | ModRepairableBehaviour modRepairableComponent = ComponentUtils.GetComponentSafe(prefab);
17 | if (modRepairableComponent == null)
18 | {
19 | return;
20 | }
21 |
22 | Repairable repairable = ComponentUtils.GetOrCreateComponent(modRepairableComponent);
23 | repairable.m_RepairAudio = modRepairableComponent.Audio;
24 | repairable.m_DurationMinutes = modRepairableComponent.Minutes;
25 | repairable.m_ConditionIncrease = modRepairableComponent.Condition;
26 |
27 | if (modRepairableComponent.MaterialNames.Length != modRepairableComponent.MaterialCounts.Length)
28 | {
29 | throw new ArgumentException("MaterialNames and MaterialCounts do not have the same length on gear item '" + modRepairableComponent.name + "'.");
30 | }
31 |
32 | repairable.m_RequiredGear = ModUtils.GetItems(modRepairableComponent.MaterialNames, modRepairableComponent.name);
33 | repairable.m_RequiredGearUnits = modRepairableComponent.MaterialCounts;
34 |
35 | repairable.m_RepairToolChoices = ModUtils.GetItems(modRepairableComponent.RequiredTools, modRepairableComponent.name);
36 | repairable.m_RequiresToolToRepair = repairable.m_RepairToolChoices.Length > 0;
37 | }
38 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/ScentMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using UnityEngine;
7 |
8 | namespace ModComponent.Mapper.BehaviourMappers;
9 |
10 | internal static class ScentMapper
11 | {
12 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
13 | internal static void Configure(GameObject prefab)
14 | {
15 | ModScentBehaviour modScentComponent = ComponentUtils.GetComponentSafe(prefab);
16 | if (modScentComponent == null)
17 | {
18 | return;
19 | }
20 |
21 | Scent scent = ComponentUtils.GetOrCreateComponent(modScentComponent);
22 | scent.m_ScentCategory = EnumUtils.TranslateEnumValue(modScentComponent.scentCategory);
23 | }
24 |
25 | internal static float GetScentIntensity(ModBaseComponent modComponent) => GetScentIntensity(ComponentUtils.GetGameObject(modComponent));
26 | internal static float GetScentIntensity(GameObject prefab)
27 | {
28 | Scent scent = ComponentUtils.GetComponentSafe(prefab);
29 | if (scent == null)
30 | {
31 | return 0f;
32 | }
33 |
34 | return scent.m_ScentCategory switch
35 | {
36 | ScentRangeCategory.COOKED_MEAT => 5f,
37 | ScentRangeCategory.COOKED_FISH => 5f,
38 | ScentRangeCategory.GUTS => 20f,
39 | ScentRangeCategory.QUARTER => 50f,
40 | ScentRangeCategory.RAW_MEAT => 15f,
41 | ScentRangeCategory.RAW_FISH => 15f,
42 | _ => 0f,
43 | };
44 | }
45 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/SharpenableMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using System.Linq;
7 | using UnityEngine;
8 |
9 | namespace ModComponent.Mapper.BehaviourMappers;
10 |
11 | internal static class SharpenableMapper
12 | {
13 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
14 | public static void Configure(GameObject prefab)
15 | {
16 | ModSharpenableBehaviour modSharpenableComponent = ComponentUtils.GetComponentSafe(prefab);
17 | if (modSharpenableComponent == null)
18 | {
19 | return;
20 | }
21 |
22 | Sharpenable sharpenable = ComponentUtils.GetOrCreateComponent(modSharpenableComponent);
23 |
24 | sharpenable.m_ConditionIncreaseMax = modSharpenableComponent.ConditionMax;
25 | sharpenable.m_ConditionIncreaseMin = modSharpenableComponent.ConditionMin;
26 | sharpenable.m_DurationMinutesMax = modSharpenableComponent.MinutesMax;
27 | sharpenable.m_DurationMinutesMin = modSharpenableComponent.MinutesMin;
28 |
29 | sharpenable.m_SharpenToolChoices = ModUtils.GetItems(modSharpenableComponent.Tools, prefab.name + ": Tools");
30 | sharpenable.m_RequiresToolToSharpen = sharpenable.m_SharpenToolChoices.Count() > 0;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/StackableMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using System;
7 |
8 | namespace ModComponent.Mapper.BehaviourMappers;
9 |
10 | internal static class StackableMapper
11 | {
12 | public static void Configure(ModBaseComponent modComponent)
13 | {
14 | ModStackableBehaviour modStackableComponent = ModComponent.Utils.ComponentUtils.GetComponentSafe(modComponent);
15 | if (modStackableComponent == null)
16 | {
17 | return;
18 | }
19 |
20 | StackableItem stackableItem = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modStackableComponent);
21 |
22 | stackableItem.m_LocalizedMultipleUnitText = new LocalizedString { m_LocalizationID = modStackableComponent.MultipleUnitTextID };
23 |
24 | stackableItem.m_LocalizedSingleUnitText = string.IsNullOrWhiteSpace(modStackableComponent.SingleUnitTextID)
25 | ? NameUtils.CreateLocalizedString(modComponent.DisplayNameLocalizationId)
26 | : NameUtils.CreateLocalizedString(modStackableComponent.SingleUnitTextID);
27 |
28 | stackableItem.m_StackSpriteName = modStackableComponent.StackSprite;
29 |
30 | stackableItem.m_ShareStackWithGear = Array.Empty();
31 | stackableItem.m_Units = modStackableComponent.UnitsPerItem;
32 | stackableItem.m_UnitsPerItem = modStackableComponent.UnitsPerItem;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/BehaviourMappers/TinderMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Behaviours;
4 | using ModComponent.API.Components;
5 | using ModComponent.Utils;
6 | using UnityEngine;
7 |
8 | namespace ModComponent.Mapper.BehaviourMappers;
9 |
10 | internal static class TinderMapper
11 | {
12 | internal static void Configure(ModBaseComponent modComponent) => Configure(ComponentUtils.GetGameObject(modComponent));
13 | public static void Configure(GameObject prefab)
14 | {
15 | ModTinderBehaviour modBurnableComponent = ComponentUtils.GetComponentSafe(prefab);
16 | if (modBurnableComponent == null)
17 | {
18 | return;
19 | }
20 |
21 | FuelSourceItem fuelSourceItem = ComponentUtils.GetOrCreateComponent(modBurnableComponent);
22 | fuelSourceItem.m_BurnDurationHours = 0.02f;
23 | fuelSourceItem.m_FireAgeMinutesBeforeAdding = 0;
24 | fuelSourceItem.m_FireStartSkillModifier = modBurnableComponent.SuccessModifier;
25 | fuelSourceItem.m_HeatIncrease = 5;
26 | fuelSourceItem.m_HeatInnerRadius = 2.5f;
27 | fuelSourceItem.m_HeatOuterRadius = 6f;
28 | fuelSourceItem.m_FireStartDurationModifier = modBurnableComponent.DurationOffset;
29 | fuelSourceItem.m_IsWet = false;
30 | fuelSourceItem.m_IsTinder = true;
31 | fuelSourceItem.m_IsBurntInFireTracked = false;
32 | }
33 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/BuffCauseTracker.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using System.Collections.Generic;
5 |
6 | namespace ModComponent.Mapper;
7 |
8 | internal static class BuffCauseTracker
9 | {
10 | private static Dictionary causes = new Dictionary();
11 |
12 | public static void SetCause(AfflictionType buff, string cause)
13 | {
14 | if (causes.ContainsKey(buff))
15 | {
16 | causes[buff] = cause;
17 | }
18 | else
19 | {
20 | causes.Add(buff, cause);
21 | }
22 | }
23 |
24 | public static string GetCause(AfflictionType buff)
25 | {
26 | causes.TryGetValue(buff, out string result);
27 | return result;
28 | }
29 | }
30 |
31 | [HarmonyPatch(typeof(FatigueBuff), nameof(FatigueBuff.Apply))]//Exists
32 | internal static class FagtigueBuffApplyPatch
33 | {
34 | public static void Postfix(FatigueBuff __instance)
35 | {
36 | GearItem gearItem = Utils.ComponentUtils.GetComponentSafe(__instance);
37 | if (gearItem == null)
38 | {
39 | return;
40 | }
41 | else
42 | {
43 | BuffCauseTracker.SetCause(AfflictionType.ReducedFatigue, gearItem.m_LocalizedDisplayName.Text());
44 | }
45 | }
46 | }
47 |
48 | [HarmonyPatch(typeof(AfflictionButton), nameof(AfflictionButton.SetCauseAndEffect))]//positive caller count
49 | internal static class AfflictionButtonSetCauseAndEffectPatch
50 | {
51 | public static void Prefix(ref string causeStr, AfflictionType affType)
52 | {
53 | string trackedCause = BuffCauseTracker.GetCause(affType);
54 | if (!string.IsNullOrEmpty(trackedCause))
55 | {
56 | causeStr = trackedCause;
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/BedMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 | using ModComponent.Utils;
5 | using UnityEngine;
6 |
7 | namespace ModComponent.Mapper.ComponentMappers;
8 |
9 | internal static class BedMapper
10 | {
11 | internal static void Configure(ModBaseComponent modComponent)
12 | {
13 | ModBedComponent modBedComponent = modComponent.TryCast();
14 | if (modBedComponent == null)
15 | {
16 | return;
17 | }
18 |
19 | Bed bed = ComponentUtils.GetOrCreateComponent(modBedComponent);
20 |
21 | bed.m_LocalizedDisplayName = NameUtils.CreateLocalizedString(modComponent.DisplayNameLocalizationId);
22 | bed.m_ConditionPercentGainPerHour = modBedComponent.ConditionGainPerHour;
23 | bed.m_UinterruptedRestPercentGainPerHour = modBedComponent.AdditionalConditionGainPerHour;
24 | bed.m_WarmthBonusCelsius = modBedComponent.WarmthBonusCelsius;
25 |
26 | bed.m_PercentChanceReduceBearAttackWhenSleeping = modBedComponent.BearAttackModifier;
27 | bed.m_PercentChanceReduceWolfAttackWhenSleeping = modBedComponent.WolfAttackModifier;
28 |
29 | bed.m_OpenAudio = ModUtils.DefaultIfEmpty(modBedComponent.OpenAudio, "PLAY_SNDGENSLEEPINGBAGCLOSE");
30 | bed.m_CloseAudio = ModUtils.DefaultIfEmpty(modBedComponent.CloseAudio, "PLAY_SNDGENSLEEPINGBAGOPEN");
31 |
32 | bed.m_BedRollMesh = modBedComponent.PackedMesh ?? modBedComponent.gameObject;
33 | bed.m_BedRollMesh.layer = vp_Layer.Gear;
34 | bed.m_BedRollPlacedMesh = modBedComponent.UsableMesh ?? modBedComponent.gameObject;
35 | bed.m_BedRollPlacedMesh.layer = vp_Layer.Gear;
36 | bed.SetState(BedRollState.Rolled);
37 |
38 | DegradeOnUse degradeOnUse = ComponentUtils.GetOrCreateComponent(modBedComponent);
39 | degradeOnUse.m_DegradeHP = Mathf.Max(degradeOnUse.m_DegradeHP, modBedComponent.DegradePerHour);
40 |
41 | //PlaceableItem placeableItem = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modBedComponent);
42 | ComponentUtils.GetOrCreateComponent(modBedComponent);
43 | //placeableItem.m_Range = 4;
44 | //m_prefab_name ???
45 | }
46 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/CharcoalMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 |
5 | namespace ModComponent.Mapper.ComponentMappers;
6 |
7 | internal static class CharcoalMapper
8 | {
9 | internal static void Configure(ModBaseComponent modComponent)
10 | {
11 | ModCharcoalComponent modCharcoal = modComponent.TryCast();
12 | if (modCharcoal == null)
13 | {
14 | return;
15 | }
16 |
17 | CharcoalItem charcoalItem = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modCharcoal);
18 | charcoalItem.m_SurveyGameMinutes = modCharcoal.SurveyGameMinutes;
19 | charcoalItem.m_SurveyLoopAudio = modCharcoal.SurveyLoopAudio;
20 | charcoalItem.m_SurveyRealSeconds = modCharcoal.SurveyRealSeconds;
21 | charcoalItem.m_SurveySkillExtendedHours = modCharcoal.SurveySkillExtendedHours;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/CollectibleMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 |
5 | namespace ModComponent.Mapper.ComponentMappers;
6 |
7 | internal static class CollectibleMapper
8 | {
9 | internal static void Configure(ModBaseComponent modComponent)
10 | {
11 | ModCollectibleComponent modCollectible = modComponent.TryCast();
12 | if (modCollectible == null)
13 | {
14 | return;
15 | }
16 |
17 | NarrativeCollectibleItem narrativeCollectible = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modCollectible);
18 | narrativeCollectible.m_HudMessageOnPickup = new LocalizedString() { m_LocalizationID = modCollectible.HudMessageLocalizationId };
19 | narrativeCollectible.m_JournalEntryNumber = 0;
20 | narrativeCollectible.m_NarrativeTextLocID = modCollectible.NarrativeTextLocalizationId;
21 | narrativeCollectible.m_ShowDuringInspect = true;
22 | narrativeCollectible.m_TextAlignment = ModComponent.Utils.EnumUtils.TranslateEnumValue(modCollectible.TextAlignment);
23 | narrativeCollectible.m_Type = NarrativeCollectibleItem.CollectibleType.Note;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/EquippableMapper.cs:
--------------------------------------------------------------------------------
1 | using ModComponent.API.Components;
2 |
3 | namespace ModComponent.Mapper.ComponentMappers;
4 |
5 | internal static class EquippableMapper
6 | {
7 | internal static void Configure(ModBaseComponent modComponent)
8 | {
9 | ModBaseEquippableComponent? equippableModComponent = modComponent.TryCast();
10 | if (equippableModComponent == null)
11 | {
12 | return;
13 | }
14 |
15 | if (string.IsNullOrEmpty(equippableModComponent.InventoryActionLocalizationId)
16 | && !string.IsNullOrEmpty(equippableModComponent.ImplementationType)
17 | && !string.IsNullOrEmpty(equippableModComponent.EquippedModelPrefabName))
18 | {
19 | equippableModComponent.InventoryActionLocalizationId = "GAMEPLAY_Equip";
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/ExplosiveMapper.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.Mapper.ComponentMappers;
2 |
3 | internal static class ExplosiveMapper
4 | {
5 | }
6 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/FirstAidMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 |
5 | namespace ModComponent.Mapper.ComponentMappers;
6 |
7 | internal static class FirstAidMapper
8 | {
9 | internal static void Configure(ModBaseComponent modComponent)
10 | {
11 | ModFirstAidComponent modFirstAidComponent = modComponent.TryCast();
12 | if (modFirstAidComponent == null)
13 | {
14 | return;
15 | }
16 |
17 | FirstAidItem firstAidItem = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modFirstAidComponent);
18 |
19 | // not used
20 | firstAidItem.m_AppliesSutures = false;
21 | firstAidItem.m_StabalizesSprains = false;
22 |
23 | switch (modFirstAidComponent.FirstAidType)
24 | {
25 | case ModFirstAidComponent.FirstAidKind.Antibiotics:
26 | firstAidItem.m_ProvidesAntibiotics = true;
27 | break;
28 |
29 | case ModFirstAidComponent.FirstAidKind.Bandage:
30 | firstAidItem.m_AppliesBandage = true;
31 | break;
32 |
33 | case ModFirstAidComponent.FirstAidKind.Disinfectant:
34 | firstAidItem.m_CleansWounds = true;
35 | break;
36 |
37 | case ModFirstAidComponent.FirstAidKind.PainKiller:
38 | firstAidItem.m_KillsPain = true;
39 | break;
40 | }
41 |
42 | firstAidItem.m_HPIncrease = modFirstAidComponent.InstantHealing;
43 | firstAidItem.m_TimeToUseSeconds = modFirstAidComponent.TimeToUseSeconds;
44 | firstAidItem.m_UnitsPerUse = modFirstAidComponent.UnitsPerUse;
45 | firstAidItem.m_UseAudio = modFirstAidComponent.UseAudio;
46 | }
47 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/GenericEquippableMapper.cs:
--------------------------------------------------------------------------------
1 | using ModComponent.API.Components;
2 |
3 | namespace ModComponent.Mapper.ComponentMappers;
4 |
5 | internal static class GenericEquippableMapper
6 | {
7 | internal static void Configure(ModBaseComponent modComponent)
8 | {
9 | //Currently needs nothing configured
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/InspectMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 |
5 | namespace ModComponent.Mapper.ComponentMappers;
6 |
7 | internal static class InspectMapper
8 | {
9 | internal static void Configure(ModBaseComponent modComponent)
10 | {
11 | if (!modComponent.InspectOnPickup)
12 | {
13 | return;
14 | }
15 |
16 | Inspect inspect = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modComponent);
17 | inspect.m_DistanceFromCamera = modComponent.InspectDistance;
18 | inspect.m_Scale = modComponent.InspectScale;
19 | inspect.m_Angles = modComponent.InspectAngles;
20 | inspect.m_Offset = modComponent.InspectOffset;
21 |
22 | if (modComponent.InspectModel != null && modComponent.NormalModel != null)
23 | {
24 | inspect.m_NormalMesh = modComponent.NormalModel;
25 | inspect.m_NormalMesh.SetActive(true);
26 |
27 | inspect.m_InspectModeMesh = modComponent.InspectModel;
28 | inspect.m_InspectModeMesh.SetActive(false);
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/LiquidMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 |
5 | namespace ModComponent.Mapper.ComponentMappers;
6 |
7 | internal static class LiquidMapper
8 | {
9 | internal static void Configure(ModBaseComponent modComponent)
10 | {
11 | ModLiquidComponent? modLiquidComponent = modComponent.TryCast();
12 | if (modLiquidComponent == null)
13 | {
14 | return;
15 | }
16 |
17 | LiquidItem liquidItem = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modComponent);
18 | liquidItem.m_LiquidCapacityLiters = modLiquidComponent.LiquidCapacityLiters;
19 | liquidItem.m_LiquidType = ModComponent.Utils.EnumUtils.TranslateEnumValue(modLiquidComponent.LiquidType);
20 | liquidItem.m_RandomizeQuantity = modLiquidComponent.RandomizeQuantity;
21 | liquidItem.m_LiquidLiters = modLiquidComponent.LiquidLiters;
22 | liquidItem.m_DrinkingAudio = "Play_DrinkWater";
23 | liquidItem.m_TimeToDrinkSeconds = 4;
24 | liquidItem.m_LiquidQuality = LiquidQuality.Potable;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/PowderMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 | using ModComponent.Utils;
5 |
6 | namespace ModComponent.Mapper.ComponentMappers;
7 |
8 | internal static class PowderMapper
9 | {
10 | internal static void Configure(ModBaseComponent modComponent)
11 | {
12 | ModPowderComponent? modPowderComponent = modComponent.TryCast();
13 | if (modPowderComponent == null)
14 | {
15 | return;
16 | }
17 |
18 | PowderItem powderItem = ComponentUtils.GetOrCreateComponent(modComponent);
19 | powderItem.m_Type = ModPowderComponent.GetPowderType(modPowderComponent.PowderType);
20 | powderItem.m_WeightLimitKG = modPowderComponent.CapacityKG;
21 | powderItem.m_WeightKG = modPowderComponent.CapacityKG;
22 | }
23 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/PurificationMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 |
5 | namespace ModComponent.Mapper.ComponentMappers;
6 |
7 | internal static class PurificationMapper
8 | {
9 | internal static void Configure(ModBaseComponent modComponent)
10 | {
11 | ModPurificationComponent? modPurification = modComponent.TryCast();
12 | if (modPurification == null)
13 | {
14 | return;
15 | }
16 |
17 | PurifyWater purificationItem = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modPurification);
18 | purificationItem.m_LocalizedProgressBarMessage = new LocalizedString() { m_LocalizationID = modPurification.ProgressBarLocalizationID };
19 | purificationItem.m_ProgressBarDurationSeconds = modPurification.ProgressBarDurationSeconds;
20 | purificationItem.m_PurifyAudio = modPurification.PurifyAudio;
21 | purificationItem.m_LitersPurify = modPurification.LitersPurify;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ComponentMappers/ResearchMapper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 |
5 | namespace ModComponent.Mapper.ComponentMappers;
6 |
7 | internal static class ResearchMapper
8 | {
9 | internal static void Configure(ModBaseComponent modComponent)
10 | {
11 | ModResearchComponent? modResearch = modComponent.TryCast();
12 | if (modResearch == null)
13 | {
14 | return;
15 | }
16 |
17 | ResearchItem researchItem = ModComponent.Utils.ComponentUtils.GetOrCreateComponent(modResearch);
18 | researchItem.m_ReadAudio = modResearch.ReadAudio;
19 | researchItem.m_SkillPoints = modResearch.SkillPoints;
20 | researchItem.m_NoBenefitAtSkillLevel = modResearch.NoBenefitAtSkillLevel;
21 | researchItem.m_SkillType = ModComponent.Utils.EnumUtils.TranslateEnumValue(modResearch.SkillType);
22 | researchItem.m_TimeRequirementHours = modResearch.TimeRequirementHours;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/ConsoleWaitlist.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using System.Collections.Generic;
5 |
6 | namespace ModComponent.Mapper;
7 |
8 | internal static class ConsoleWaitlist
9 | {
10 | private static List commandWaitlist = new List(0);
11 |
12 | public static void AddToWaitlist(string displayName, string prefabName)
13 | {
14 | commandWaitlist.Add(new ModConsoleName(displayName, prefabName));
15 | }
16 |
17 | public static bool IsConsoleManagerInitialized() => ConsoleManager.m_Initialized;
18 |
19 | public static void TryUpdateWaitlist()
20 | {
21 | if (commandWaitlist.Count > 0 && IsConsoleManagerInitialized())
22 | {
23 | foreach (ModConsoleName modConsoleName in commandWaitlist)
24 | {
25 | RegisterConsoleGearName(modConsoleName.displayName, modConsoleName.prefabName);
26 | }
27 | commandWaitlist.Clear();
28 | Logger.Log("Console Commands added. The waitlist is empty.");
29 | }
30 | }
31 |
32 | internal static void MaybeRegisterConsoleGearName(string displayName, string prefabName)
33 | {
34 | if (IsConsoleManagerInitialized())
35 | {
36 | RegisterConsoleGearName(displayName, prefabName);
37 | }
38 | else
39 | {
40 | AddToWaitlist(displayName, prefabName);
41 | }
42 | }
43 |
44 | private static void RegisterConsoleGearName(string displayName, string prefabName)
45 | {
46 | ConsoleManager.AddCustomGearName(displayName.ToLower(), prefabName.ToLower());
47 | }
48 |
49 | [HarmonyPatch(typeof(ConsoleManager), nameof(ConsoleManager.Initialize))]
50 | internal static class UpdateConsoleCommands
51 | {
52 | private static void Postfix()
53 | {
54 | TryUpdateWaitlist();
55 | }
56 | }
57 |
58 | internal struct ModConsoleName
59 | {
60 | public readonly string displayName;
61 | public readonly string prefabName;
62 | public ModConsoleName(string displayName, string prefabName)
63 | {
64 | this.displayName = displayName;
65 | this.prefabName = prefabName;
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/DefaultDrawLayers.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 |
4 | namespace ModComponent.Mapper;
5 |
6 | internal static class DefaultDrawLayers
7 | {
8 | public static int GetDefaultDrawLayer(ClothingRegion clothingRegion, ClothingLayer clothingLayer)
9 | {
10 | return clothingRegion switch
11 | {
12 | ClothingRegion.Head => GetDefaultHeadDrawLayer(clothingLayer),
13 | ClothingRegion.Accessory => 40,
14 | ClothingRegion.Hands => 25,
15 | ClothingRegion.Chest => GetDefaultChestDrawLayer(clothingLayer),
16 | ClothingRegion.Legs => GetDefaultLegsDrawLayer(clothingLayer),
17 | ClothingRegion.Feet => GetDefaultFeetDrawLayer(clothingLayer),
18 | _ => 60,
19 | };
20 | }
21 |
22 | public static int GetDefaultHeadDrawLayer(ClothingLayer clothingLayer)
23 | {
24 | return clothingLayer switch
25 | {
26 | ClothingLayer.Base => 41,
27 | ClothingLayer.Mid => 42,
28 | _ => 60,
29 | };
30 | }
31 |
32 | public static int GetDefaultChestDrawLayer(ClothingLayer clothingLayer)
33 | {
34 | return clothingLayer switch
35 | {
36 | ClothingLayer.Base => 21,
37 | ClothingLayer.Mid => 22,
38 | ClothingLayer.Top => 26,
39 | ClothingLayer.Top2 => 27,
40 | _ => 60,
41 | };
42 | }
43 |
44 | public static int GetDefaultLegsDrawLayer(ClothingLayer clothingLayer)
45 | {
46 | return clothingLayer switch
47 | {
48 | ClothingLayer.Base => 1,
49 | ClothingLayer.Mid => 2,
50 | ClothingLayer.Top => 15,
51 | ClothingLayer.Top2 => 16,
52 | _ => 60,
53 | };
54 | }
55 |
56 | public static int GetDefaultFeetDrawLayer(ClothingLayer clothingLayer)
57 | {
58 | return clothingLayer switch
59 | {
60 | ClothingLayer.Base => 5,
61 | ClothingLayer.Mid => 6,
62 | ClothingLayer.Top => 13,
63 | _ => 60,
64 | };
65 | }
66 |
67 | public static int MaybeGetDefaultDrawLayer(int drawLayer, ClothingRegion clothingRegion, ClothingLayer clothingLayer)
68 | {
69 | return drawLayer > 0
70 | ? drawLayer
71 | : GetDefaultDrawLayer(clothingRegion, clothingLayer);
72 | }
73 | }
--------------------------------------------------------------------------------
/ModComponent/Mapper/FileType.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.Mapper;
2 |
3 | internal enum FileType
4 | {
5 | json,
6 | unity3d,
7 | txt,
8 | dll,
9 | bnk,
10 | other
11 | }
12 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/GearEquipper.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using ModComponent.API.Components;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.Mapper;
7 |
8 | internal static class GearEquipper
9 | {
10 | public static void Equip(ModBaseEquippableComponent equippable)
11 | {
12 | if (equippable == null)
13 | {
14 | return;
15 | }
16 |
17 | GameObject? equippedModelPrefab = Resources.Load(equippable.EquippedModelPrefabName)?.Cast();
18 | if (equippedModelPrefab != null)
19 | {
20 | equippable.EquippedModel = Object.Instantiate(equippedModelPrefab, GameManager.GetWeaponCamera().transform);
21 | equippable.EquippedModel.layer = vp_Layer.Weapon;
22 | }
23 | else
24 | {
25 | Logger.Log($"The equippedModelPrefab for '{equippable.EquippedModelPrefabName}' was null.");
26 | }
27 |
28 | equippable.OnEquipped?.Invoke();
29 |
30 | InterfaceManager.QuitCurrentScreens();
31 | ModComponent.Utils.ModUtils.PlayAudio(equippable.EquippingAudio);
32 | }
33 |
34 | public static void Unequip(ModBaseEquippableComponent modComponent)
35 | {
36 | if (modComponent == null)
37 | {
38 | return;
39 | }
40 | else
41 | {
42 | GameManager.GetPlayerManagerComponent().UnequipItemInHandsSkipAnimation();
43 | }
44 | }
45 |
46 | internal static void OnUnequipped(ModBaseEquippableComponent modComponent)
47 | {
48 | if (modComponent == null)
49 | {
50 | return;
51 | }
52 |
53 | if (modComponent.EquippedModel != null)
54 | {
55 | Object.Destroy(modComponent.EquippedModel);
56 | modComponent.EquippedModel = null;
57 | }
58 |
59 | modComponent.OnUnequipped?.Invoke();
60 | ModComponent.Utils.ModUtils.PlayAudio(modComponent.StowAudio);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/JsonHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace ModComponent.Mapper;
4 |
5 | internal static class JsonHandler
6 | {
7 | private static readonly Dictionary itemJsons = new();
8 |
9 | public static void RegisterJsonText(string itemName, string text)
10 | {
11 | if (string.IsNullOrEmpty(text))
12 | {
13 | return;
14 | }
15 |
16 | if (itemJsons.ContainsKey(itemName))
17 | {
18 | Logger.Log($"Overwriting data for {itemName}");
19 | itemJsons[itemName] = text;
20 | }
21 | else
22 | {
23 | itemJsons.Add(itemName, text);
24 | }
25 | }
26 |
27 | public static string GetJsonText(string itemName)
28 | {
29 | return itemJsons.TryGetValue(itemName.ToLower(), out string jsonData)
30 | ? jsonData
31 | : throw new System.Exception($"Could not find json file for {itemName}");
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/ModComponent/Mapper/PackManager.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.Mapper;
2 |
3 | internal static class PackManager
4 | {
5 | internal static void SetItemPackNotWorking(string pathToZipFile, string errorMessage)
6 | {
7 | Logger.LogItemPackError(System.IO.Path.GetFileNameWithoutExtension(pathToZipFile), errorMessage);
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/ModComponent/ModComponent.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net472
4 | Latest
5 | enable
6 | false
7 | none
8 |
9 |
10 |
11 | E:\Games\TLD400
12 | $(TheLongDarkPath)\MelonLoader
13 | $(MelonLoaderPath)\Managed
14 | $(TheLongDarkPath)\Mods
15 |
16 |
17 |
18 |
19 | Hinterland
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | $(AssemblySearchPaths);
37 | $(MelonLoaderPath);
38 | $(ManagedPath);
39 | $(ModsPath);
40 |
41 |
42 |
43 |
44 |
45 | False
46 |
47 |
48 |
49 |
50 |
51 | all
52 | runtime; build; native; contentfiles; analyzers; buildtransitive
53 |
54 |
55 | all
56 | runtime; build; native; contentfiles; analyzers; buildtransitive
57 |
58 |
59 |
--------------------------------------------------------------------------------
/ModComponent/Patches/AlternativePowderPatches.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using ModComponent.API.Components;
5 |
6 | namespace ModComponent.Patches;
7 |
8 | internal static class AlternativePowderPatches
9 | {
10 | [HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.AddPowderToInventory))]
11 | private static class PlayerManager_AddPowderToInventory
12 | {
13 | const string saltPrefabName = "GEAR_ModSalt";
14 | const string yeastPrefabName = "GEAR_ModYeast";
15 |
16 | private static bool Prefix(PlayerManager __instance, float amount, GearPowderType type)
17 | {
18 | ModPowderComponent.ModPowderType modPowderType = ModPowderComponent.GetPowderType(type);
19 | if (modPowderType == ModPowderComponent.ModPowderType.Gunpowder)
20 | {
21 | return true;
22 | }
23 |
24 | float num = amount;
25 | foreach (GearItemObject gearItemObject in GameManager.GetInventoryComponent().m_Items)
26 | {
27 | GearItem gearItem = gearItemObject;
28 | if (gearItem && gearItem.m_PowderItem && gearItem.m_PowderItem.m_Type == type)
29 | {
30 | num = gearItem.m_PowderItem.Add(num);
31 | }
32 | }
33 |
34 | string? prefabName = null;
35 | if (modPowderType == ModPowderComponent.ModPowderType.Salt)
36 | {
37 | prefabName = saltPrefabName;
38 | }
39 | else if (modPowderType == ModPowderComponent.ModPowderType.Yeast)
40 | {
41 | prefabName = yeastPrefabName;
42 | }
43 |
44 | if (!Hinterland::Utils.IsZero(num, 0.0001f) && !string.IsNullOrEmpty(prefabName))
45 | {
46 | while (num > 0f)
47 | {
48 | GearItem gearItem2 = __instance.InstantiateItemInPlayerInventory(prefabName, 1);
49 | if (gearItem2 && gearItem2.m_PowderItem && gearItem2.m_PowderItem.m_Type == type)
50 | {
51 | gearItem2.m_PowderItem.m_WeightKG = 0f;
52 | num = gearItem2.m_PowderItem.Add(num);
53 | }
54 | else
55 | {
56 | if (gearItem2)
57 | {
58 | GameManager.GetInventoryComponent().DestroyGear(gearItem2.gameObject);
59 | }
60 | return false;
61 | }
62 | }
63 | }
64 | return false;
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/ModComponent/Patches/AtlasPatches.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using ModComponent.AssetLoader;
5 |
6 | namespace ModComponent.Patches;
7 |
8 | [HarmonyPatch(typeof(UISprite), nameof(UISprite.SetAtlasSprite))]
9 | internal static class UISprite_set_spriteName
10 | {
11 | internal static void Postfix(UISprite __instance)
12 | {
13 | UIAtlas? atlas = AtlasUtils.GetRequiredAtlas(__instance, __instance.mSpriteName);
14 | if (__instance.atlas == atlas)
15 | {
16 | return;
17 | }
18 |
19 | AtlasUtils.SaveOriginalAtlas(__instance);
20 | __instance.atlas = atlas;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/ModComponent/Patches/FirestartingPatches.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using ModComponent.API.Behaviours;
5 |
6 | namespace ModComponent.Patches;
7 |
8 | [HarmonyPatch(typeof(FireManager), nameof(FireManager.PlayerStartFire))]//Exists
9 | internal static class FireManager_PlayerStartFire
10 | {
11 | internal static void Postfix(FireStarterItem starter, bool __result)
12 | {
13 | if (!__result)
14 | {
15 | return;
16 | }
17 |
18 | ModFireStarterBehaviour modFireStarterComponent = ModComponent.Utils.ComponentUtils.GetComponentSafe(starter);
19 | if (modFireStarterComponent == null || !modFireStarterComponent.RuinedAfterUse)
20 | {
21 | return;
22 | }
23 |
24 | GearItem gearItem = starter.GetComponent();
25 | if (gearItem != null)
26 | {
27 | gearItem.BreakOnUse();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/ModComponent/Patches/GameManagerPatch.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using ModComponent.Mapper;
5 |
6 | namespace ModComponent.Patches;
7 |
8 | [HarmonyPatch(typeof(GameManager), nameof(GameManager.Awake))]
9 | internal static class GameManager_Awake
10 | {
11 | private static void Postfix()
12 | {
13 | //
14 | //Need to be called after GameManager is initialized
15 | //
16 |
17 | AlternativeToolManager.ProcessList();
18 | }
19 | }
--------------------------------------------------------------------------------
/ModComponent/Patches/ItemDescriptionPagePatch_Equippable.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using ModComponent.API.Components;
5 |
6 | namespace ModComponent.Patches;
7 |
8 | [HarmonyPatch(typeof(ItemDescriptionPage), nameof(ItemDescriptionPage.GetEquipButtonLocalizationId))]//positive caller count
9 | internal static class ItemDescriptionPageGetEquipButtonLocalizationIdPatch
10 | {
11 | public static void Postfix(GearItem gi, ref string __result)
12 | {
13 | if (!string.IsNullOrEmpty(__result))
14 | {
15 | return;
16 | }
17 |
18 | ModBaseComponent modComponent = ModComponent.Utils.ComponentUtils.GetModComponent(gi);
19 | if (modComponent != null)
20 | {
21 | //Strangely, this is what allows items to be equipped
22 | __result = modComponent.InventoryActionLocalizationId;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ModComponent/Patches/LiquidRandomizationPatches.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 |
5 | namespace ModComponent.Patches;
6 |
7 | internal class LiquidItemPatch
8 | {
9 | //make water containers able to have randomized initial quantities
10 | [HarmonyPatch(typeof(LiquidItem), nameof(LiquidItem.Awake))]
11 | internal static class LiquidItem_Awake
12 | {
13 | private static void Postfix(LiquidItem __instance)
14 | {
15 | if (!Settings.instance.randomPlasticWaterBottles && (__instance.name == "GEAR_Water500ml" || __instance.name == "GEAR_Water1000ml"))
16 | {
17 | return;
18 | }
19 |
20 | if (__instance.m_RandomizeQuantity && __instance.m_LiquidType == GearLiquidTypeEnum.Water)
21 | {
22 | __instance.m_LiquidLiters = ModComponent.Utils.RandomUtils.Range(__instance.m_LiquidCapacityLiters / 8f, __instance.m_LiquidCapacityLiters);
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/ModComponent/Patches/ModClothingPatches.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using ModComponent.API.Components;
5 | using ModComponent.Mapper;
6 |
7 | namespace ModComponent.Patches;
8 |
9 | [HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.PutOnClothingItem))]//not inlined
10 | internal static class PlayerManager_PutOnClothingItem
11 | {
12 | private static void Prefix(PlayerManager __instance, GearItem gi, ClothingLayer layerToPutOn)
13 | {
14 | if (gi?.m_ClothingItem == null || layerToPutOn == ClothingLayer.NumLayers)
15 | {
16 | return;
17 | }
18 |
19 | ClothingRegion region = gi.m_ClothingItem.m_Region;
20 | GearItem itemInSlot = __instance.GetClothingInSlot(region, layerToPutOn);
21 | if (itemInSlot)
22 | {
23 | __instance.TakeOffClothingItem(itemInSlot);
24 | }
25 | }
26 | private static void Postfix(GearItem gi)
27 | {
28 | ModClothingComponent modClothingComponent = ModComponent.Utils.ComponentUtils.GetComponentSafe(gi);
29 | modClothingComponent?.OnPutOn?.Invoke();
30 | }
31 | }
32 |
33 | [HarmonyPatch(typeof(PlayerManager), nameof(PlayerManager.TakeOffClothingItem))]//Not inlined
34 | internal static class PlayerManager_TakeOffClothingItem
35 | {
36 | internal static void Postfix(GearItem gi)
37 | {
38 | ModClothingComponent modClothingComponent = ModComponent.Utils.ComponentUtils.GetComponentSafe(gi);
39 | modClothingComponent?.OnTakeOff?.Invoke();
40 | }
41 | }
42 |
43 | [HarmonyPatch(typeof(ClothingSlot), nameof(ClothingSlot.CheckForChangeLayer))]
44 | internal static class ClothingSlot_CheckForChangeLayer
45 | {
46 | private static bool Prefix(ClothingSlot __instance)
47 | {
48 | int defaultDrawLayer = DefaultDrawLayers.GetDefaultDrawLayer(__instance.m_ClothingRegion, __instance.m_ClothingLayer);
49 |
50 | ModClothingComponent clothingComponent = ModComponent.Utils.ComponentUtils.GetComponentSafe(__instance.m_GearItem);
51 | if (clothingComponent == null)
52 | {
53 | if (__instance.m_GearItem != null)
54 | {
55 | __instance.UpdatePaperDollTextureLayer(defaultDrawLayer);
56 | }
57 | return true;
58 | }
59 |
60 | int actualDrawLayer = clothingComponent.DrawLayer > 0 ? clothingComponent.DrawLayer : defaultDrawLayer;
61 | __instance.UpdatePaperDollTextureLayer(actualDrawLayer);
62 | return false;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/ModComponent/Patches/SoundBankPatches.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using ModComponent.AssetLoader;
5 |
6 | namespace ModComponent.Patches;
7 |
8 | [HarmonyPatch(typeof(GameAudioManager), nameof(GameAudioManager.Start))]
9 | internal static class GameAudioManager_LoadSoundBanksPath
10 | {
11 | internal static void Postfix()
12 | {
13 | ModSoundBankManager.RegisterPendingSoundBanks();
14 | }
15 | }
--------------------------------------------------------------------------------
/ModComponent/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using MelonLoader;
2 | using ModComponent;
3 | using System.Reflection;
4 | using System.Runtime.InteropServices;
5 | using BuildInfo = ModComponent.BuildInfo;
6 |
7 | [assembly: ComVisible(false)]
8 | [assembly: Guid("b809c688-2a3f-4573-821f-fb90ea433dad")]
9 |
10 | [assembly: AssemblyTitle(BuildInfo.Name)]
11 | [assembly: AssemblyDescription(BuildInfo.Description)]
12 | [assembly: AssemblyCompany(BuildInfo.Company)]
13 | [assembly: AssemblyProduct(BuildInfo.Name)]
14 | [assembly: AssemblyCopyright("Created by " + BuildInfo.Author)]
15 | [assembly: AssemblyTrademark(BuildInfo.Company)]
16 | [assembly: AssemblyCulture("")]
17 |
18 | [assembly: AssemblyVersion(BuildInfo.Version)]
19 | [assembly: AssemblyFileVersion(BuildInfo.Version)]
20 | [assembly: MelonInfo(typeof(Implementation), BuildInfo.Name, BuildInfo.Version, BuildInfo.Author, BuildInfo.DownloadLink)]
21 | [assembly: MelonGame("Hinterland", "TheLongDark")]
22 |
--------------------------------------------------------------------------------
/ModComponent/SceneLoader/Preloader.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using HarmonyLib;
3 | using Hinterland;
4 | using ModComponent.Utils;
5 | using UnityEngine;
6 |
7 | namespace ModComponent.SceneLoader;
8 |
9 | public static class Preloader
10 | {
11 | private static bool initialized = false;
12 | internal static GameObject? gameManagerObjectPrefab;
13 |
14 | private static void Initialize(GameManager gameManager)
15 | {
16 | if (initialized || gameManager == null)
17 | {
18 | return;
19 | }
20 | else
21 | {
22 | gameManagerObjectPrefab = new GameObject();
23 | Object.DontDestroyOnLoad(gameManagerObjectPrefab);
24 | gameManagerObjectPrefab.SetActive(false);
25 | gameManagerObjectPrefab.name = gameManager.name;
26 |
27 | CopyFieldHandler.CopyFieldsIl2Cpp(gameManagerObjectPrefab.AddComponent(), gameManager);
28 | initialized = true;
29 | }
30 | }
31 |
32 | public static void InstantiateGameManager()
33 | {
34 | if (gameManagerObjectPrefab == null)
35 | {
36 | Logger.LogError("gameManagerObjectPrefab == null!");
37 | }
38 | else
39 | {
40 | Logger.Log("instantiate");
41 | Object.Instantiate(gameManagerObjectPrefab).SetActive(true);
42 | }
43 | }
44 |
45 | [HarmonyPatch(typeof(GameManager), nameof(GameManager.Awake))]
46 | internal static class GameManager_Awake
47 | {
48 | private static void Postfix(GameManager __instance)
49 | {
50 | if (GameManager.m_ActiveScene == "MainMenu")
51 | {
52 | Initialize(__instance);
53 | }
54 | if (gameManagerObjectPrefab == null)
55 | {
56 | Logger.LogError("The GameManager prefab was destroyed!!!!!!!!!!!!");
57 | }
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/ModComponent/SceneLoader/Shaders/ShaderList.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace ModComponent.SceneLoader.Shaders;
4 |
5 | internal static class ShaderList
6 | {
7 | ///
8 | /// Dummy : Actual
9 | ///
10 | public static Dictionary DummyShaderReplacements { get; private set; } = new Dictionary
11 | {
12 |
13 | };
14 | }
15 |
--------------------------------------------------------------------------------
/ModComponent/SceneLoader/Shaders/SubstituteShadersRecursive.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace ModComponent.SceneLoader.Shaders;
4 |
5 | [MelonLoader.RegisterTypeInIl2Cpp]
6 | internal sealed class SubstituteShadersRecursive : MonoBehaviour
7 | {
8 | public SubstituteShadersRecursive(System.IntPtr intPtr) : base(intPtr) { }
9 |
10 | void Awake()
11 | {
12 | ShaderSubstitutionManager.ReplaceDummyShaders(this.gameObject, true);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ModComponent/SceneLoader/Shaders/SubstituteShadersSingle.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace ModComponent.SceneLoader.Shaders;
4 |
5 | [MelonLoader.RegisterTypeInIl2Cpp]
6 | internal sealed class SubstituteShadersSingle : MonoBehaviour
7 | {
8 | public SubstituteShadersSingle(System.IntPtr intPtr) : base(intPtr) { }
9 |
10 | void Awake()
11 | {
12 | ShaderSubstitutionManager.ReplaceDummyShaders(this.gameObject, false);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/ModComponent/SceneLoader/Shaders/SubstituteShadersTerrain.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace ModComponent.SceneLoader.Shaders;
4 |
5 | [MelonLoader.RegisterTypeInIl2Cpp]
6 | internal sealed class SubstituteShadersTerrain : MonoBehaviour
7 | {
8 | public SubstituteShadersTerrain(System.IntPtr intPtr) : base(intPtr) { }
9 |
10 | void Awake()
11 | {
12 | Terrain terrain = this.GetComponent();
13 | if (terrain != null)
14 | {
15 | ShaderSubstitutionManager.ReplaceDummyShaders(terrain);
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/ModComponent/Settings.cs:
--------------------------------------------------------------------------------
1 | using ModSettings;
2 |
3 | namespace ModComponent;
4 |
5 | internal class Settings : JsonModSettings
6 | {
7 | internal static Settings instance = new Settings();
8 |
9 | [Name("Random Plastic Water Bottles")]
10 | [Description("If yes, plastic water bottles will have a random amount of water when you find them.")]
11 | public bool randomPlasticWaterBottles = false;
12 |
13 | [Name("Disable Random Item Spawns")]
14 | [Description("Set this to No. It's for new spawn point creation.")]
15 | public bool disableRandomItemSpawns = false;
16 | }
17 |
--------------------------------------------------------------------------------
/ModComponent/Utils/ActionPickerUtilities.ActionPickerData.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using System;
4 |
5 | namespace ModComponent.Utils;
6 |
7 | internal static partial class ActionPickerUtilities
8 | {
9 | public struct ActionPickerData
10 | {
11 | string SpriteName;
12 | string LocID;
13 | Action Callback;
14 | public ActionPickerData(string spriteName, string locId, Action callback)
15 | {
16 | SpriteName = spriteName;
17 | LocID = locId;
18 | Callback = callback;
19 | }
20 | public static implicit operator Panel_ActionPicker.ActionPickerItemData(ActionPickerData data)
21 | {
22 | return new Panel_ActionPicker.ActionPickerItemData(data.SpriteName, data.LocID, data.Callback);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ModComponent/Utils/ActionPickerUtilities.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using System.Collections.Generic;
4 | using UnityEngine;
5 |
6 | namespace ModComponent.Utils;
7 |
8 | internal static partial class ActionPickerUtilities
9 | {
10 | public static void ShowCustomActionPicker(GameObject objectInteractedWith, List actionList)
11 | {
12 | Panel_ActionPicker panel = InterfaceManager.m_Panel_ActionPicker;
13 | if (panel == null || InterfaceManager.IsOverlayActiveCached())
14 | {
15 | return;
16 | }
17 |
18 | if (panel.m_ActionPickerItemDataList == null)
19 | {
20 | panel.m_ActionPickerItemDataList = new Il2CppSystem.Collections.Generic.List();
21 | }
22 | else
23 | {
24 | panel.m_ActionPickerItemDataList.Clear();
25 | }
26 |
27 | foreach (ActionPickerData element in actionList)
28 | {
29 | panel.m_ActionPickerItemDataList.Add(element);
30 | }
31 |
32 | InterfaceManager.m_Panel_ActionPicker.m_ObjectInteractedWith = objectInteractedWith;
33 | InterfaceManager.m_Panel_ActionPicker.EnableWithCurrentList();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/ModComponent/Utils/AssetBundleUtils.cs:
--------------------------------------------------------------------------------
1 | using Il2CppSystem;
2 | using UnityEngine;
3 |
4 | namespace ModComponent.Utils;
5 |
6 | ///
7 | /// Alternative asset loading methods to avoid triggering the AssetLoader patches
8 | ///
9 | public static class AssetBundleUtils
10 | {
11 | ///
12 | /// Loads an asset without triggering the AssetLoader patches
13 | ///
14 | public static UnityEngine.Object LoadAsset(AssetBundle assetBundle, string name)
15 | {
16 | return LoadAsset(assetBundle, name, UnhollowerRuntimeLib.Il2CppType.Of());
17 | }
18 | ///
19 | /// Loads an asset without triggering the AssetLoader patches
20 | ///
21 | public static T? LoadAsset(AssetBundle assetBundle, string name) where T : UnityEngine.Object
22 | {
23 | return LoadAsset(assetBundle, name, UnhollowerRuntimeLib.Il2CppType.Of())?.TryCast();
24 | }
25 | ///
26 | /// Loads an asset without triggering the AssetLoader patches
27 | ///
28 | public static UnityEngine.Object LoadAsset(AssetBundle assetBundle, string name, Type type)
29 | {
30 | if (assetBundle == null)
31 | {
32 | throw new System.NullReferenceException("The asset bundle cannot be null.");
33 | }
34 | if (name == null)
35 | {
36 | throw new System.NullReferenceException("The input asset name cannot be null.");
37 | }
38 | if (name.Length == 0)
39 | {
40 | throw new System.ArgumentException("The input asset name cannot be empty.");
41 | }
42 | if (type == null)
43 | {
44 | throw new System.NullReferenceException("The input type cannot be null.");
45 | }
46 | return assetBundle.LoadAsset_Internal(name, type);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/ModComponent/Utils/ConversionUtils.cs:
--------------------------------------------------------------------------------
1 | using Il2Cpp = Il2CppSystem.Collections.Generic;
2 | using Standard = System.Collections.Generic;
3 |
4 | namespace ModComponent.Utils;
5 |
6 | internal static class ConversionUtils
7 | {
8 | internal static Standard.List Convert(Il2Cpp.List list)
9 | {
10 | Standard.List result = new Standard.List(list.Count);
11 | foreach (T? element in list)
12 | {
13 | result.Add(element);
14 | }
15 |
16 | return result;
17 | }
18 | internal static Il2Cpp.List Convert(Standard.List list)
19 | {
20 | Il2Cpp.List result = new Il2Cpp.List(list.Count);
21 | foreach (T? element in list)
22 | {
23 | result.Add(element);
24 | }
25 |
26 | return result;
27 | }
28 | internal static Il2Cpp.List Convert(T[] array)
29 | {
30 | Il2Cpp.List result = new Il2Cpp.List(array.Length);
31 | foreach (T? element in array)
32 | {
33 | result.Add(element);
34 | }
35 |
36 | return result;
37 | }
38 | internal static Standard.List Convert(Il2Cpp.IEnumerable enumerable)
39 | {
40 | Il2Cpp.List temp = new Il2Cpp.List(enumerable);
41 | Standard.List result = new Standard.List(temp.Count);
42 | foreach (T? element in temp)
43 | {
44 | result.Add(element);
45 | }
46 |
47 | return result;
48 | }
49 |
50 | internal static T[] ToArray(Standard.List list) => list.ToArray();
51 | internal static T[] ToArray(Il2Cpp.List list)
52 | {
53 | T[] result = new T[list.Count];
54 | for (int i = 0; i < list.Count; i++)
55 | {
56 | result[i] = list[i];
57 | }
58 |
59 | return result;
60 | }
61 | internal static T[] ToArray(Il2Cpp.IEnumerable enumerable) => ToArray(new Il2Cpp.List(enumerable));
62 | }
63 |
--------------------------------------------------------------------------------
/ModComponent/Utils/CopyFieldHandler.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using static ModComponent.Utils.NameUtils;
3 |
4 | namespace ModComponent.Utils;
5 |
6 | public static class CopyFieldHandler
7 | {
8 | public static void UpdateFieldValues(T componentToUpdate) where T : Component
9 | {
10 | string? gearName = NormalizeName(componentToUpdate.name);
11 | GameObject? prefab = Resources.Load(gearName)?.TryCast();
12 | if (prefab == null)
13 | {
14 | Logger.Log("While copying fields for '{0}', the prefab was null.");
15 | }
16 | else
17 | {
18 | T prefabComponent = prefab.GetComponent();
19 | if (prefabComponent != null)
20 | {
21 | CopyFieldsMono(componentToUpdate, prefabComponent);
22 | }
23 | }
24 | }
25 |
26 | internal static void CopyFieldsMono(T copyTo, T copyFrom)
27 | {
28 | System.Type typeOfT = typeof(T);
29 | System.Reflection.FieldInfo[] fieldInfos = typeOfT.GetFields();
30 | foreach (System.Reflection.FieldInfo fieldInfo in fieldInfos)
31 | {
32 | if (fieldInfo.IsInitOnly || fieldInfo.IsLiteral)
33 | {
34 | continue;
35 | }
36 |
37 | fieldInfo.SetValue(copyTo, fieldInfo.GetValue(copyFrom));
38 | }
39 | if (fieldInfos.Length == 0)
40 | {
41 | Logger.LogWarning("There were no fields to copy!");
42 | }
43 | }
44 |
45 | internal static void CopyFieldsIl2Cpp(T copyTo, T copyFrom) where T : Il2CppSystem.Object
46 | {
47 | Il2CppSystem.Type typeOfT = UnhollowerRuntimeLib.Il2CppType.Of();
48 | Il2CppSystem.Reflection.FieldInfo[] fieldInfos = typeOfT.GetFields();
49 | foreach (Il2CppSystem.Reflection.FieldInfo fieldInfo in fieldInfos)
50 | {
51 | if (fieldInfo.IsInitOnly || fieldInfo.IsLiteral)
52 | {
53 | continue;
54 | }
55 |
56 | fieldInfo.SetValue(copyTo, fieldInfo.GetValue(copyFrom));
57 | }
58 | if (fieldInfos.Length == 0)
59 | {
60 | Logger.LogWarning("There were no fields to copy!");
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/ModComponent/Utils/EnumUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace ModComponent.Utils;
5 |
6 | public static class EnumUtils
7 | {
8 | public static T ParseEnum(string text) where T : Enum
9 | {
10 | return (T)Enum.Parse(typeof(T), text, true);
11 | }
12 |
13 | public static T TranslateEnumValue(E value) where T : Enum where E : Enum
14 | {
15 | return (T)Enum.Parse(typeof(T), Enum.GetName(typeof(E), value));
16 | }
17 |
18 | public static T GetMaxValue() where T : Enum
19 | {
20 | return Enum.GetValues(typeof(T)).Cast().Max();
21 | }
22 |
23 | public static T GetMinValue() where T : Enum
24 | {
25 | return Enum.GetValues(typeof(T)).Cast().Min();
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ModComponent/Utils/EquipItemPopupUtils.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using System;
4 |
5 | namespace ModComponent.Utils;
6 |
7 | public static class EquipItemPopupUtils
8 | {
9 | public static void ShowItemPopups(String primaryAction, String secondaryAction, bool showAmmo, bool showReload, bool showHolster)
10 | {
11 | EquipItemPopup equipItemPopup = InterfaceManager.m_Panel_HUD.m_EquipItemPopup;
12 | ShowItemIcons(equipItemPopup, primaryAction, secondaryAction, showAmmo);
13 | equipItemPopup.OnOverlappingDecalChange(true);
14 |
15 | if (Hinterland::Utils.IsGamepadActive())
16 | {
17 | //Logger.Log("Gamepad active");
18 | equipItemPopup.m_ButtonPromptFire.ShowPromptForKey(primaryAction, "Fire");
19 | MaybeRepositionFireButtonPrompt(equipItemPopup, secondaryAction);
20 | equipItemPopup.m_ButtonPromptAltFire.ShowPromptForKey(secondaryAction, "AltFire");
21 | MaybeRepositionAltFireButtonPrompt(equipItemPopup, primaryAction);
22 | }
23 | else
24 | {
25 | //Logger.Log("Gamepad not active");
26 | equipItemPopup.m_ButtonPromptFire.ShowPromptForKey(secondaryAction, "AltFire");
27 | MaybeRepositionFireButtonPrompt(equipItemPopup, primaryAction);
28 | equipItemPopup.m_ButtonPromptAltFire.ShowPromptForKey(primaryAction, "Interact");
29 | MaybeRepositionAltFireButtonPrompt(equipItemPopup, secondaryAction);
30 | }
31 |
32 | string reloadText = showReload ? Localization.Get("GAMEPLAY_Reload") : string.Empty;
33 | equipItemPopup.m_ButtonPromptReload.ShowPromptForKey(reloadText, "Reload");
34 |
35 | string holsterText = showHolster ? Localization.Get("GAMEPLAY_HolsterPrompt") : string.Empty;
36 | equipItemPopup.m_ButtonPromptHolster.ShowPromptForKey(holsterText, "Holster");
37 | }
38 |
39 | internal static void MaybeRepositionAltFireButtonPrompt(EquipItemPopup equipItemPopup, String otherAction)
40 | {
41 | equipItemPopup.MaybeRepositionAltFireButtonPrompt(otherAction);
42 | }
43 |
44 | internal static void MaybeRepositionFireButtonPrompt(EquipItemPopup equipItemPopup, String otherAction)
45 | {
46 | equipItemPopup.MaybeRepositionFireButtonPrompt(otherAction);
47 | }
48 |
49 | internal static void ShowItemIcons(EquipItemPopup equipItemPopup, String primaryAction, String secondaryAction, bool showAmmo)
50 | {
51 | equipItemPopup.ShowItemIcons(primaryAction, secondaryAction, showAmmo);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/ModComponent/Utils/FileUtils.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace ModComponent.Utils;
5 |
6 | public static class FileUtils
7 | {
8 | public static string GetModsFolderPath()
9 | {
10 | return Path.Combine(MelonLoader.MelonUtils.GameDirectory, @"Mods");
11 | }
12 |
13 | public static string GetModComponentZipsFolderPath()
14 | {
15 | return Path.Combine(MelonLoader.MelonUtils.GameDirectory, @"Mods", @"ModComponentZips");
16 | }
17 |
18 | internal static string GetRelativePath(string file, string directory)
19 | {
20 | if (file.StartsWith(directory))
21 | {
22 | return file.Substring(directory.Length + 1);
23 | }
24 |
25 | throw new ArgumentException("Could not determine relative path of '" + file + "' to '" + directory + "'.");
26 | }
27 |
28 | internal static string GetPathRelativeToModsFolder(string fullPath)
29 | {
30 | return GetRelativePath(fullPath, GetModsFolderPath());
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ModComponent/Utils/NameUtils.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 |
4 | namespace ModComponent.Utils;
5 |
6 | public static class NameUtils
7 | {
8 | public static LocalizedString CreateLocalizedString(string key)
9 | {
10 | return new LocalizedString() { m_LocalizationID = key };
11 | }
12 |
13 | public static LocalizedString[] CreateLocalizedStrings(params string[] keys)
14 | {
15 | LocalizedString[] result = new LocalizedString[keys.Length];
16 |
17 | for (int i = 0; i < result.Length; i++)
18 | {
19 | result[i] = CreateLocalizedString(keys[i]);
20 | }
21 |
22 | return result;
23 | }
24 |
25 | internal static string AddCraftingIconPrefix(string name)
26 | {
27 | return "ico_CraftItem__" + name;
28 | }
29 |
30 | internal static string RemoveCraftingIconPrefix(string iconFileName)
31 | {
32 | return iconFileName.Replace("ico_CraftItem__", "");
33 | }
34 |
35 | internal static string AddGearPrefix(string name)
36 | {
37 | return "GEAR_" + name;
38 | }
39 |
40 | ///
41 | /// Returns a string with the 'GEAR_' prefix removed.
42 | ///
43 | /// The gear's name, ie 'GEAR_SampleItem'
44 | internal static string RemoveGearPrefix(string gearName)
45 | {
46 | return gearName.Replace("GEAR_", "");
47 | }
48 |
49 | ///
50 | /// Removes "(Clone)" from the name and trims any whitespace
51 | ///
52 | ///
53 | /// Returns a new string without "(Clone)" or the whitespace
54 | public static string? NormalizeName(string name)
55 | {
56 | if (name == null)
57 | {
58 | return null;
59 | }
60 | else
61 | {
62 | return name.Replace("(Clone)", "").Trim();
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/ModComponent/Utils/PlayerGender.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 |
3 | namespace ModComponent.Utils;
4 |
5 | public enum PlayerGender
6 | {
7 | Female,
8 | Male,
9 | Unknown
10 | }
11 |
--------------------------------------------------------------------------------
/ModComponent/Utils/PlayerUtils.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 |
4 | namespace ModComponent.Utils;
5 |
6 | public static class PlayerUtils
7 | {
8 | public static void FreezePlayer()
9 | {
10 | GameManager.GetPlayerManagerComponent().m_FreezeMovement = true;
11 | }
12 |
13 | public static void UnfreezePlayer()
14 | {
15 | GameManager.GetPlayerManagerComponent().m_FreezeMovement = false;
16 | }
17 |
18 | public static PlayerGender GetPlayerGender()
19 | {
20 | if (GameManager.GetPlayerManagerComponent() == null)
21 | {
22 | return PlayerGender.Unknown;
23 | }
24 |
25 | if (InterfaceManager.m_Panel_OptionsMenu?.m_State == null)
26 | {
27 | return PlayerGender.Unknown;
28 | }
29 |
30 | if (GameManager.GetPlayerManagerComponent().m_VoicePersona != InterfaceManager.m_Panel_OptionsMenu.m_State.m_VoicePersona)
31 | {
32 | return PlayerGender.Unknown;
33 | }
34 |
35 | if (InterfaceManager.m_Panel_OptionsMenu.m_State.m_VoicePersona == VoicePersona.Female)
36 | {
37 | return PlayerGender.Female;
38 | }
39 | else
40 | {
41 | return PlayerGender.Male;
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/ModComponent/Utils/TypeResolver.cs:
--------------------------------------------------------------------------------
1 | namespace ModComponent.Utils;
2 |
3 | internal class TypeResolver
4 | {
5 | public static System.Type? Resolve(string name, bool throwErrorOnFailure)
6 | {
7 | System.Type result = System.Type.GetType(name, false);
8 | if (result != null)
9 | {
10 | return result;
11 | }
12 |
13 | System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
14 | foreach (System.Reflection.Assembly eachAssembly in assemblies)
15 | {
16 | result = eachAssembly.GetType(name, false);
17 | if (result != null)
18 | {
19 | return result;
20 | }
21 | }
22 |
23 | if (throwErrorOnFailure)
24 | {
25 | throw new System.ArgumentException("Could not resolve type '" + name + "'. Are you missing an assembly?");
26 | }
27 | else
28 | {
29 | return null;
30 | }
31 | }
32 | public static Il2CppSystem.Type? ResolveIl2Cpp(string name, bool throwErrorOnFailure)
33 | {
34 | System.Type result = System.Type.GetType(name, false);
35 | if (result != null)
36 | {
37 | return UnhollowerRuntimeLib.Il2CppType.From(result, false);
38 | }
39 |
40 | System.Reflection.Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies();
41 | foreach (System.Reflection.Assembly eachAssembly in assemblies)
42 | {
43 | result = eachAssembly.GetType(name, false);
44 | if (result != null)
45 | {
46 | return UnhollowerRuntimeLib.Il2CppType.From(result, false);
47 | }
48 | }
49 |
50 | if (throwErrorOnFailure)
51 | {
52 | throw new System.ArgumentException("Could not resolve type '" + name + "'. Are you missing an assembly?");
53 | }
54 | else
55 | {
56 | return null;
57 | }
58 | }
59 | public static bool InheritsFromMonobehaviour(Il2CppSystem.Type type)
60 | {
61 | if (type == null)
62 | {
63 | return false;
64 | }
65 | else
66 | {
67 | return type.IsSubclassOf(UnhollowerRuntimeLib.Il2CppType.Of());
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/ModComponent/Utils/UIUtils.cs:
--------------------------------------------------------------------------------
1 | extern alias Hinterland;
2 | using Hinterland;
3 | using UnityEngine;
4 |
5 | namespace ModComponent.Utils;
6 |
7 | public static class UIUtils
8 | {
9 | public static UITexture CreateOverlay(Texture2D texture)
10 | {
11 | UIRoot root = UIRoot.list[0];
12 | UIPanel panel = NGUITools.AddChild(root.gameObject);
13 |
14 | UITexture result = NGUITools.AddChild(panel.gameObject);
15 | result.mainTexture = texture;
16 |
17 | Vector2 windowSize = panel.GetWindowSize();
18 | result.width = (int)windowSize.x;
19 | result.height = (int)windowSize.y;
20 |
21 | return result;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/docs/3D-Models.md:
--------------------------------------------------------------------------------
1 | In order to add a new item to the game, that item needs a 3D model, so you need to either make or obtain one for your item.
2 |
3 | # Making a 3D model
4 |
5 | This isn't something I can or want to explain. There are lots of better resources than me on the internet. However, I would recommend that you use [Blender](https://www.blender.org/) for your project, especially if you're new to 3D modeling. It's free and has every feature you could possibly need. In addition, it has a very large community supporting it, so you can find numerous tutorials on using Blender from community experts. One such resource is [Blender Guru](https://www.youtube.com/user/AndrewPPrice/videos).
6 |
7 | # Obtaining a 3D model
8 |
9 | The only alternative to making a 3D model is to obtain it from one of the many archives online. These archives often offer both free and paid models. Some free models will have licenses that make them unusable for our purposes. If a desirable free model with a good license cannot be found, most paid models offer very favorable licenses.
10 |
11 | ## File type
12 |
13 | Unity supports a wide variety of file types, but I would recommend you get a `.blend` file if it's available. That gives you the most customizability. In fact, I personally import all my models (with other formats) into a blender project before I insert them into Unity. Some other popular formats are `.obj` and `.fbx`.
14 |
15 | ## Polygon Count
16 |
17 | In general, you want your model to have as few polygons as possible. This improves performance especially on lower quality hardware. People don't want to use your item if it drops their framerate significantly. Some features in Blender that I really like are Decimate Geometry and Shade Smooth.
18 |
19 | ## Beauty
20 |
21 | You want your item to be good-looking and look like it belongs in The Long Dark.
22 |
23 | ## License
24 |
25 | I touched on this above, but your item needs its model to have a favorable license if you're going to distribute it. If this is just for personal use, then nobody will ever know/care. However, if you have any plans to distribute, the model needs a license that allows your distribution. Most model archives clearly list the model's license on its page. Some licenses which cannot be used for modding include Editorial Use licenses and Brand Use licenses.
26 |
27 | ## Some good model archives
28 |
29 | [CGtrader](https://www.cgtrader.com/free-3d-models)
30 |
31 | [Turbosquid](https://www.turbosquid.com/Search/3D-Models/free)
32 |
33 | [Free3D](https://free3d.com/)
--------------------------------------------------------------------------------
/docs/Accelerant-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | > Not compatible with Burnable, FireStarter, or Tinder Behaviour
2 |
3 | # Template
4 | ```
5 | {
6 | "ModAccelerantBehaviour": {
7 | "DestroyedOnUse" : true,
8 | "DurationOffset" : 0,
9 | "SuccessModifier" : 40
10 | }
11 | }
12 | ```
13 |
14 | # Parameters
15 |
16 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
17 |
18 | ## DestroyedOnUse
19 | *bool*
20 | Is the item destroyed immediately after use?
21 |
22 | ## DurationOffset
23 | *float*
24 | In-game seconds offset for fire starting duration from this accelerant. NOT scaled by fire starting skill. Positive values mean 'slower', negative values mean 'faster'.
25 |
26 | ## SuccessModifier
27 | *float*
28 | Does this item affect the chance for success? Represents percentage points. Positive values increase the chance, negative values reduce it.
--------------------------------------------------------------------------------
/docs/Alcohol.md:
--------------------------------------------------------------------------------
1 | ModComponent introduces Alcohol as a game mechanic via [AlcoholMod](https://github.com/ds5678/AlcoholMod).
2 |
3 | Food/drink items can contain alcohol (expressed as a percentage of their weight) and when consumed, that alcohol is consumed as well.
4 |
5 | ModComponent tracks how much alhocol has been consumed and how fast it should be absorbed by the player character's "body". The speed is influenced by the food/drink item itself and the currently stored calories (less calories mean faster uptake). At the same time, the body is constantly breaking down alcohol, resulting in a simulated blood alcohol concentration.
6 |
7 | ## Effects
8 |
9 | ModComponent tries to simulate some of the real-life effects of alcohol:
10 |
11 | * Alcohol allows more of your warm blood to reach your skin. This **helps preventing frostbite** but also results in an **increased risk for hypothermia**.
12 |
13 | * Alcohol causes your body to lose more water, causing **faster dehydration**.
14 |
15 | * Alcohol causes **increased fatigue**
16 |
17 | * Starting at about 0.05%/0.5‰ blood alcohol concentration: **blurry vision**.
18 |
19 | * Starting at about 0.1%/1‰ blood alcohol concentration: **staggering**.
20 |
21 | * Effects reach their maximum levels at 0.25%/2.5‰ blood alcohol concentration.
22 |
23 | ## Console Commands
24 |
25 | * `set_alcohol_permille`
26 | * `set_alcohol_percent`
27 | * `get_alcohol_permille`
28 | * `get_alcohol_percent`
--------------------------------------------------------------------------------
/docs/Alternative-Actions.md:
--------------------------------------------------------------------------------
1 | # About
2 | This feature allows mod developers to add mouse click actions to any interactable object.
3 |
4 | It is available through the [AlternativeActionUtililities](https://github.com/ds5678/AlternativeActionUtilities) mod.
5 |
6 | # Primary Action
7 | The primary action key is typically the left mouse button. Hinterland uses this for almost everything. All alternative primary actions will run before the Hinterland default action.
8 |
9 | # Secondary Action
10 | The secondary action key is typically the right mouse button. Hinterland usually uses this for entering and exiting placement mode. All alternative secondary actions will run before the Hinterland default action.
11 |
12 | # Tertiary Action
13 | The tertiary action button is an addition from ModComponent. As a result, it has no default functionality from Hinterland on anything. The key for this action is set in the mod settings for ModComponent and is the middle mouse button by default.
14 |
15 | # Example
16 |
17 | The [Infinity Fires](https://github.com/ds5678/InfinityFires) mod relies heavily on this feature.
--------------------------------------------------------------------------------
/docs/Architecture.md:
--------------------------------------------------------------------------------
1 | ModComponent consist of the two modules API and Mapper.
2 |
3 | * ModComponentAPI provides the API for modders to create new items with the Unity Editor. This module is completely independent from Hinterland's code and thus unaffected by any changes done with future updates to the game.
4 | * ModComponentMapper integrates new items into the game and ensures that they will be handled properly. This module depends on Hinterland's code and maps (as in "translates") items from ModComponentAPI to Hinterland's API
5 |
6 | This separation is necessary because
7 | * the Unity Editor will not properly load Hinterland's API (in fact the DLL from any other Unity game will not work)
8 | * I will not extract and publish Hinterland's code - it's theirs and not mine
9 |
10 | 
--------------------------------------------------------------------------------
/docs/Auto-Mapper.md:
--------------------------------------------------------------------------------
1 | If a mod uses only pre-existing game mechanics (like [Food-Pack](https://github.com/ds5678/Food-Pack)), it can be created without writing a single line of code. Writing code will only be required for creating new game mechanics.
2 |
3 | # Boot Strapping
4 |
5 | The `AutoMapper` will scan the file `someItemPackName.modcomponent/auto-mapped` (recursively) and try to handle all internal files encountered.
6 |
7 | The following file extensions are supported:
8 |
9 | * `.unity3d`: This will be treated as an asset bundle and loaded accordingly.
10 | The assets in the bundle will be mapped and made available.
11 | * `.json` : This will be treated as the details for an item inside an asset. If an item does not have a corresponding json file (or the json is incorrectly named), it will cause an error.
12 | * `.bnk`: This will be treated as a sound bank and loaded accordingly.
13 | The sounds (event names) in bank will be made available.
14 | * `.dll`: This will be treated as an assembly and loaded accordingly.
15 | The classes in the assembly will NOT be loaded or inspected for further bootstrapping. If you need bootstrapping from your assembly (e.g. harmony) put it directly in the "mods" directory, so MelonLoader will handle it.
16 |
17 | All other files in `auto-mapped` will be ignored!
--------------------------------------------------------------------------------
/docs/Body-Harvest-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModBodyHarvestComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0.1,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Material",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "CanCarry" : true,
26 | "HarvestAudio" : "",
27 | "GutPrefab" : "GEAR_Gut",
28 | "GutQuantity" : 1,
29 | "GutWeightKgPerUnit" : 0.15,
30 | "HidePrefab" : "GEAR_RabbitPelt",
31 | "HideQuantity" : 1,
32 | "HideWeightKgPerUnit" : 0.15,
33 | "MeatPrefab" : "GEAR_RawMeatRabbit",
34 | "MeatAvailableMinKG" : 0.1,
35 | "MeatAvailableMaxKG" : 0.5
36 | }
37 | }
38 | ```
39 |
40 | # Parameters
41 |
42 | This component, like the others, uses all the parameters from the [[Generic Component Documentation]].
--------------------------------------------------------------------------------
/docs/Burnable-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | > Not compatible with Accelerant, FireStarter, or Tinder Behaviour
2 |
3 | # Template
4 | ```
5 | {
6 | "ModBurnableBehaviour": {
7 | "BurningMinutes" : 18,
8 | "BurningMinutesBeforeAllowedToAdd" : 0,
9 | "SuccessModifier" : 35,
10 | "TempIncrease" : 2,
11 | "DurationOffset" : 0
12 | }
13 | }
14 | ```
15 |
16 | # Parameters
17 |
18 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
19 |
20 | ## BurningMinutes
21 | *int*
22 | Number of minutes this item adds to the remaining burn time of the fire.
23 |
24 | ## BurningMinutesBeforeAllowedToAdd
25 | *float*
26 | How long must a fire be burning before this item can be added?
27 |
28 | ## SuccessModifier
29 | *float*
30 | Does this item affect the chance for successfully starting a fire? Represents percentage points. Positive values increase the chance, negative values reduce it.
31 |
32 | ## TempIncrease
33 | *float*
34 | Temperature increase in °C when added to the fire.
35 |
36 | ## DurationOffset
37 | *float*
38 | In-game seconds offset for fire starting duration from this accelerant. NOT scaled by fire starting skill. Positive values mean 'slower', negative values mean 'faster'.
39 |
--------------------------------------------------------------------------------
/docs/Carrying-Capacity-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModCarryingCapacityBehaviour": {
5 | "MaxCarryCapacityKGBuff" : 5
6 | }
7 | }
8 | ```
9 |
10 | # Parameters
11 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
12 |
13 | ## MaxCarryCapacityKGBuff
14 | *float*
15 | The maximum buff to the carrying capacity from this item.
16 |
--------------------------------------------------------------------------------
/docs/Charcoal-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModCharcoalComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Material",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "SurveyGameMinutes" : 15,
26 | "SurveyRealSeconds" : 3,
27 | "SurveySkillExtendedHours" : 1,
28 | "SurveyLoopAudio" : "Play_MapCharcoalWriting"
29 | }
30 | }
31 | ```
32 |
33 | # Parameters
34 |
--------------------------------------------------------------------------------
/docs/Clothing-Item-Configuration.md:
--------------------------------------------------------------------------------
1 | Configures items that can be worn.
2 |
3 | Uses all properties of [[Basic Items|Basic Item Configuration]]
4 |
5 | ## Cheat Sheet
6 |
7 | [
](https://raw.githubusercontent.com/ds5678/ModComponent/master/Images/item-configuration/clothing_cheatsheet.png)
8 |
9 | The words are the Layer and Region of that slot. The number is the default draw layer for that layer and region.
10 |
11 | ## Region
12 | Where the item can be worn
13 |
14 | `Head`, `Chest`, `Hands`, `Legs`, `Feet`, `Accessory`
15 |
16 | ## Layer
17 |
18 | Most regions offer multiple "slots" on the clothing screen.
19 | Each of these slots represents a `Layer`. The layers are `Base`, `Mid`, `Top`, `Top2`.
20 |
21 | Examples:
22 |
23 | * Boots are `Feet`, `Top`
24 | * Gloves are `Hands`, `Base`
25 | * Jackets are `Chest`, `Top` and `Top2`
26 | * Hats are `Head`, `Base` and `Mid`
27 |
28 | ## Textures
29 |
30 | The representation on the clothing screen is done with additional textures (images) and not derived from their 3D models!
31 |
32 | There are different textures for the female and male clothing model and for damaged and undamage items.
33 | This means there must be 4 additional textures for each clothing item.
34 | The 4 textures must share a basename and be organized in a specific folder structure:
35 |
36 | | Path | Texture Type |
37 | | --------------| :-----: |
38 | | `ClothingPaperDoll/Male/[main_basename]_HMM_.png` | (male + undamaged) |
39 | | `ClothingPaperDoll/Male/[main_basename]_HMM__dmg.png` | (male + damaged) |
40 | | `ClothingPaperDoll/Female/[main_basename]_HMF_.png` | (female + undamaged) |
41 | | `ClothingPaperDoll/Female/[main_basename]_HMF__dmg.png` | (female + damaged) |
42 |
43 | The field `MainTexture` in the item's json file is to be set to `[main_basename]_HMM_`.
44 |
45 | Two additional **grayscale** textures (one for female, one for male) determine how to blend between the undamaged and damaged textures.
46 | The darker a blend area the less damage is required to render the damaged texture instead of the undamaged one.
47 | White areas will always render the undamaged texture, black areas will always render the damaged area.
48 |
49 |
50 | * ClothingPaperDoll/Male/[blend_basename]\_M\_.png *(male)*
51 | * ClothingPaperDoll/Female/[blend_basename]\_F\_.png *(female)*
52 |
53 | The field `BlendTexture` in the item's json file is to be set to `[blend_basename]_M_`
--------------------------------------------------------------------------------
/docs/Collectible-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModCollectibleComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleNote",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleNoteDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Tool",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "HudMessageLocalizationId" : "GAMEPLAY_SampleNoteHudMessage",
26 | "NarrativeTextLocalizationId" : "GAMEPLAY_SampleNoteNarrativeText",
27 | "TextAlignment" : "Center"
28 | }
29 | }
30 | ```
31 |
32 | # Parameters
33 |
34 | This component, like the others, uses all the parameters from the [[Generic Component Documentation]].
35 |
36 | ## HudMessageLocalizationId
37 | *string*
38 | The localization id for the hud message displayed after this item is picked up.
39 |
40 | ## NarrativeTextLocalizationId
41 | *string*
42 | The localization id for the narrative content of the item.
43 |
44 | ## TextAlignment
45 | `Automatic`, `Left`, `Center`, `Right`, and `Justified`
46 | The alignment of the narrative text.
--------------------------------------------------------------------------------
/docs/Cooking-Pot-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | The cooking pot component is still in development. This page will be updated when it's finished.
--------------------------------------------------------------------------------
/docs/Evolve-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | > Disclaimer: Not tested
2 |
3 | # Template
4 | ```
5 | {
6 | "ModEvolveBehaviour" : {
7 | "TargetItemName" : "GEAR_GutDried",
8 | "EvolveHours" : 120,
9 | "IndoorsOnly" : true
10 | }
11 | }
12 | ```
13 |
14 | # Parameters
15 |
16 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
17 |
18 | ## TargetItemName
19 | *string*
20 | Name of the item into which this item will. E.g. 'GEAR_GutDried'
21 |
22 | ## EvolveHours
23 | *int*
24 | How many in-game hours does this item take to evolve from 0% to 100%?
25 |
26 | ## IndoorsOnly
27 | *bool*
28 | Does this item only evolve when it is stored indoors?
--------------------------------------------------------------------------------
/docs/Explosive-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | The explosive component is still in development. This page will be updated when it's finished.
--------------------------------------------------------------------------------
/docs/Firestarter-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | > Not compatible with Accelerant, Burnable, or Tinder Behaviour
2 |
3 | # Template
4 | ```
5 | {
6 | "ModFireStarterBehaviour" : {
7 | "DestroyedOnUse" : false,
8 | "NumberOfUses" : 100,
9 | "OnUseSoundEvent" : "",
10 | "RequiresSunLight" : false,
11 | "RuinedAfterUse" : false,
12 | "SecondsToIgniteTinder" : 1,
13 | "SecondsToIgniteTorch" : 1,
14 | "SuccessModifier" : 0
15 | }
16 | }
17 | ```
18 |
19 | # Parameters
20 |
21 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
22 |
23 | ## DestroyedOnUse
24 | *bool*
25 | Is the item destroyed immediately after use?
26 |
27 | ## NumberOfUses
28 | *float*
29 | How many times can this item be used?
30 |
31 | ## OnUseSoundEvent
32 | *string*
33 | What sound to play during usage.
34 |
35 | ## RequiresSunLight
36 | *bool*
37 | Does the item require sunlight to work?
38 |
39 | ## RuinedAfterUse
40 | *bool*
41 | Set the condition to 0% after the fire starting finished (either successful or not).
42 |
43 | ## SecondsToIgniteTinder
44 | *float*
45 | How many in-game seconds this item will take to ignite tinder.
46 |
47 | ## SecondsToIgniteTorch
48 | *float*
49 | How many in-game seconds this item will take to ignite a torch.
50 |
51 | ## SuccessModifier
52 | *float*
53 | Does this item affect the chance for success? Represents percentage points. Positive values increase the chance, negative values reduce it.
--------------------------------------------------------------------------------
/docs/For-Developers.md:
--------------------------------------------------------------------------------
1 | ModComponent is intended to be used for creating mods that introduce new items.
2 |
3 | This page is supposed to contain information about how the get started, answer development related questions and show examples.
4 |
5 | # Unity
6 | Asset Bundles can be created with Unity 2019.4.19 (free).
7 |
8 | Existing item mods make the best examples when starting out.
9 |
10 | # Wwise
11 | SoundBanks can be created with WWise 2018.1.11
12 | > This exact version is required. You will get a wrong version error otherwise. (Needs verified for recent versions of the game. Might have increased.)
13 |
14 | Registration is required and the non-commercial version is limited to 200 audio files per SoundBank, but using multiple SoundBanks should be possible.
15 |
16 | I found this [tutorial](https://www.audiokinetic.com/courses/wwise101/?source=wwise101&id=quick_start_from_silence_to_sound#read) from Audiokinetic very helpful.
17 |
18 | Audiokinetic also provides some great (although lengthy) tutorials on youtube, e.g.
19 |
20 |
21 | # Architecture
22 |
23 | A rough description of the architecture and the motivation / reasoning behind it.
24 | It isn't necessary to understand it, but it might help to get the big picture.
25 |
26 | [Architecture](Architecture.md)
27 |
28 | # Auto Mapper
29 |
30 | Eliminates the need to write glue code for mapping items.
31 |
32 | [Auto Mapper](Auto-Mapper.md)
33 |
34 | # Item Mod Tutorial
35 |
36 | A tutorial for creating your own item mod with ModComponent
37 |
38 | > Outdated
39 |
40 | [Item Mod Tutorial](Item-Mod-Tutorial.md)
--------------------------------------------------------------------------------
/docs/Generic-Equippable-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModGenericEquippableComponent" : {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
7 | "InventoryActionLocalizationId" : "GAMEPLAY_SampleItemAction",
8 | "WeightKG": 0.5,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Random",
12 | "InventoryCategory" : "Tool",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "EquippedModelPrefab" : "",
26 | "ImplementationType" : "",
27 | "EquippingAudio" : ""
28 | }
29 | }
30 | ```
31 |
32 | # Parameters
33 |
34 | This component, like the others, uses all the parameters from the [[Generic Component Documentation]].
35 |
36 | ## EquippedModelPrefab
37 | *string*
38 | The GameObject to be used for representing the item while it is equipped.
39 | The position, rotation and scale of this prefab will be used for rendering.
40 | Use the 'Weapon Camera' to tune the values.
41 |
42 | ## ImplementationType
43 | *string*
44 | The name of the type implementing the specific game logic of this item.
45 | If this is an assembly-qualified name (Namespace.TypeName,Assembly) it will be loaded from the given assembly.
46 | If the assembly is omitted (Namespace.TypeName), the type will be loaded from the first assembly that contains a type with the given name.
47 | Leave empty if this item needs no special game logic.
48 |
49 | ## EquippingAudio
50 | *string*
51 | The audio that plays when this item is equipped.
--------------------------------------------------------------------------------
/docs/Harvestable-Behaviour-Domentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModHarvestableBehaviour": {
5 | "Audio" : "",
6 | "Minutes" : 10,
7 | "YieldCounts" : [1],
8 | "YieldNames" : ["GEAR_ScrapMetal"],
9 | "RequiredToolNames" : []
10 | }
11 | }
12 | ```
13 |
14 | # Parameters
15 |
16 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
17 |
18 | ## Audio
19 | *string*
20 | The audio to play while harvesting.
21 |
22 | ## Minutes
23 | *int*
24 | How many in-game minutes does it take to harvest this item?
25 |
26 | ## YieldCounts
27 | *Array of int numbers*
28 | The numbers of each Gear Item that harvesting will yield.
29 |
30 | ## YieldNames
31 | *Array of string text*
32 | The names of the Gear Items that harvesting will yield.
33 |
34 | ## RequiredToolNames
35 | *Array of string text*
36 | The names of the ToolItems that can be used to harvest. Leave empty for harvesting by hand.
--------------------------------------------------------------------------------
/docs/Liquid-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModLiquidComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_MetalWaterBottle",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_MetalWaterBottleDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Food",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, -0.12, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "LiquidType" : "Water",
26 | "LiquidCapacityLiters" : 0.75,
27 | "RandomizedQuantity" : false,
28 | "LiquidLiters" : 0.75
29 | }
30 | }
31 | ```
32 |
33 | # Parameters
34 |
35 | This component, like the others, uses all the parameters from the [[Generic Component Documentation]].
36 |
37 | ## LiquidType
38 | `Water` or `Kerosene`
39 | What type of liquid does this container hold?
40 |
41 | ## LiquidCapacityLiters
42 | *float*
43 | The maximum capacity (in liters) of the container.
44 |
45 | ## RandomizedQuantity
46 | *bool*
47 | Should the amount be randomized?
48 |
49 | ## LiquidLiters
50 | *float*
51 | The initial amount of liquid this container contains. Does nothing if the quantity is randomized.
--------------------------------------------------------------------------------
/docs/Localizations.md:
--------------------------------------------------------------------------------
1 | `English`
2 |
3 | `German`
4 |
5 | `Russian`
6 |
7 | `French (France)`
8 |
9 | `Japanese`
10 |
11 | `Korean`
12 |
13 | `Simplified Chinese`
14 |
15 | `Swedish`
16 |
17 | `Traditional Chinese`
18 |
19 | `Turkish`
20 |
21 | `Norwegian`
22 |
23 | `Spanish (Spain)`
24 |
25 | `Portuguese (Portugal)`
26 |
27 | `Portuguese (Brazil)`
28 |
29 | `Dutch`
30 |
31 | `Finnish`
32 |
33 | `Italian`
34 |
35 | `Polish`
36 |
37 | `Ukrainian`
--------------------------------------------------------------------------------
/docs/Loot-Tables.md:
--------------------------------------------------------------------------------
1 | The following is a list of all loot tables, that can be used for configuring [Gear Spawns](Gear-Spawns.md) (as of 1.94)
2 |
3 | * BackPack
4 | * BathroomCabinet
5 | * Cabinet
6 | * CargoClothingA
7 | * CargoClothingB
8 | * CargoClothingC
9 | * CargoClothingRareA
10 | * CargoClothingRareB
11 | * CargoClothingRareC
12 | * CargoDrinkA
13 | * CargoDrinkB
14 | * CargoDrinkC
15 | * CargoFire
16 | * CargoFoodA
17 | * CargoFoodB
18 | * CargoFoodC
19 | * CargoFoodRareA
20 | * CargoFoodRareB
21 | * CargoFoodRareC
22 | * CargoMaterialsA
23 | * CargoMaterialsB
24 | * CargoMaterialsRareA
25 | * CargoMaterialsRareB
26 | * CargoMaterialsRareC
27 | * CargoMedical
28 | * CargoMedicalRare
29 | * CargoMiscA
30 | * CargoMiscB
31 | * CargoMiscC
32 | * CargoMiscRareA
33 | * CargoMiscRareB
34 | * CargoMiscRareC
35 | * CargoRifle
36 | * CargoShoes
37 | * CargoTools
38 | * CashRegister
39 | * Dresser
40 | * EndTable_bedroom
41 | * FileCabinet
42 | * FirstAidKit
43 | * FishingDrawer
44 | * FishingSaltWater
45 | * FishingFreshWater
46 | * ForestryCrate
47 | * Freezer
48 | * Fridge
49 | * GenericCabinet
50 | * HumanCorpse
51 | * HumanCorpseRare
52 | * KitchenCupboard
53 | * Laundry
54 | * Locker
55 | * LockerLocked
56 | * MetalBox
57 | * Oven
58 | * PlasticBox
59 | * RifleSupplies
60 | * Safe
61 | * Stones
62 | * Suitcase
63 | * TideLine
64 | * ToolChest_sml
65 | * ToolChest
66 | * ToolChestDrawer
67 | * VehicleGloveBox
68 | * VehicleTrunk
69 | * VehicleTrunkLocked
70 | * Wardrobe_regular
71 | * Workbench
72 |
--------------------------------------------------------------------------------
/docs/Millable-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModMillableBehaviour" : {
5 | "RepairDurationMinutes" : 15,
6 | "RepairRequiredGear" : ["GEAR_ScrapMetal"],
7 | "RepairRequiredGearUnits" : [2],
8 | "CanRestoreFromWornOut" : false,
9 | "RecoveryDurationMinutes" : 60,
10 | "RestoreRequiredGear" : ["GEAR_ScrapMetal","Gear_Cloth"],
11 | "RestoreRequiredGearUnits" : [4,2],
12 | "Skill" : "None"
13 | }
14 | }
15 | ```
16 |
17 | # Parameters
18 |
19 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
20 |
21 | ## RepairDurationMinutes
22 | *int*
23 | The number of minutes required to repair the item.
24 |
25 | ## RepairRequiredGear
26 | *Array of string text*
27 | The Gear Items required for repairing the item.
28 |
29 | ## RepairRequiredGearUnits
30 | *Array of int numbers*
31 | The numbers of each Gear Item required for repairing the item.
32 |
33 | ## CanRestoreFromWornOut
34 | *bool*
35 | Can the item be restored from a ruined state?
36 |
37 | ## RecoveryDurationMinutes
38 | *int*
39 | The number of minutes required to restore the item.
40 |
41 | ## RestoreRequiredGear
42 | *Array of string text*
43 | The Gear Items required for restoring the item.
44 |
45 | ## RestoreRequiredGearUnits
46 | *Array of int numbers*
47 | The numbers of each Gear Item required for restoring the item.
48 |
49 | ## Skill
50 | *[[Skill Type|Skill Type List]]*
51 | The skill associated with repairing/restoring this item.
--------------------------------------------------------------------------------
/docs/Powder-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModPowderComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Tool",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "PowderType" : "Gunpowder",
26 | "CapacityKG" : 0.2,
27 | "ChanceFull" : 75
28 | }
29 | }
30 | ```
31 |
32 | # Parameters
33 |
34 | This component, like the others, uses all the parameters from the [[Generic Component Documentation]].
35 |
36 | ## PowderType
37 | `Gunpowder`
38 | The type of powder this container holds. `Gunpowder` is the only option right now.
39 |
40 | ## CapacityKG
41 | *float*
42 | The maximum weight this container can hold.
43 |
44 | ## ChanceFull
45 | *float*
46 | The percent probability that this container will be found full.
--------------------------------------------------------------------------------
/docs/Purification-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModPurificationComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Material",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "LitersPurify" : 1,
26 | "ProgressBarDurationSeconds" : 5,
27 | "ProgressBarLocalizationID" : "GAMEPLAY_PurifyingWater",
28 | "PurifyAudio" : "Play_WaterPurification"
29 | }
30 | }
31 | ```
32 |
33 | # Parameters
34 |
--------------------------------------------------------------------------------
/docs/Random-Item-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModRandomItemComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Material",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "ItemNames" : []
26 | }
27 | }
28 | ```
29 |
30 | # Parameters
31 |
32 | This component, like the others, uses all the parameters from the [[Generic Component Documentation]].
33 |
34 | ## ItemNames
35 | *array of string text*
36 | The names of the gear items that this could spawn.
37 |
--------------------------------------------------------------------------------
/docs/Random-Weighted-Item-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModRandomWeightedItemComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Material",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "ItemNames" : [],
26 | "ItemWeights" : []
27 | }
28 | }
29 | ```
30 |
31 | # Parameters
32 |
33 | This component, like the others, uses all the parameters from the [[Generic Component Documentation]].
34 |
35 | ## ItemNames
36 | *array of string text*
37 | The names of the gear items that this could spawn. Must be the same length as `ItemWeights`
38 |
39 | ## ItemWeights
40 | *array of int numbers*
41 | The integer weights of the gear items that this could spawn. Must be the same length as `ItemNames`
--------------------------------------------------------------------------------
/docs/Repairable-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModRepairableBehaviour" : {
5 | "Audio" : "",
6 | "Minutes" : 10,
7 | "Condition" : 20,
8 | "RequiredTools" : ["GEAR_SimpleTools","GEAR_HighQualityTools"],
9 | "MaterialNames" : ["GEAR_ScrapMetal"],
10 | "MaterialCounts" : [1]
11 | }
12 | }
13 | ```
14 |
15 | # Parameters
16 |
17 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
18 |
19 | ## Audio
20 | *string*
21 | The audio to play while repairing
22 |
23 | ## Minutes
24 | *int*
25 | How many in-game minutes does it take to repair this item?
26 |
27 | ## Condition
28 | *int*
29 | How much condition does repairing restore?
30 |
31 | ## RequiredTools
32 | *Array of string text*
33 | The name of the tools suitable for repair. At least one of those will be required for repairing. Leave empty, if this item should be repairable without tools.
34 |
35 | ## MaterialNames
36 | *Array of string text*
37 | The names of the materials required for repair
38 |
39 | ## MaterialCounts
40 | *Array of int numbers*
41 | The number of the materials required for repair
--------------------------------------------------------------------------------
/docs/Research-Component-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModResearchComponent": {
5 | "DisplayNameLocalizationId" : "GAMEPLAY_SampleItem",
6 | "DescriptionLocalizatonId" : "GAMEPLAY_SampleItemDescription",
7 | "InventoryActionLocalizationId" : "",
8 | "WeightKG": 0,
9 | "DaysToDecay" : 0,
10 | "MaxHP" : 100,
11 | "InitialCondition" : "Perfect",
12 | "InventoryCategory" : "Material",
13 | "PickUpAudio" : "",
14 | "PutBackAudio" : "",
15 | "StowAudio" : "Play_InventoryStow",
16 | "WornOutAudio" : "",
17 | "InspectOnPickup" : true,
18 | "InspectDistance" : 0.4,
19 | "InspectAngles" : [0, 0, 0],
20 | "InspectOffset" : [0, 0, 0],
21 | "InspectScale" : [1, 1, 1],
22 | "NormalModel" : "",
23 | "InspectModel" : "",
24 |
25 | "SkillType" : "Cooking",
26 | "TimeRequirementHours" : 5,
27 | "SkillPoints" : 10,
28 | "NoBenefitAtSkillLevel" : 4,
29 | "ReadAudio" : "Play_ResearchBook"
30 | }
31 | }
32 | ```
33 |
34 | # Parameters
35 |
36 | ## SkillType
37 | [Skill Type List](Skill-Type-List.md)
38 |
39 | ## TimeRequirementHours
40 |
41 | ## SkillPoints
42 |
43 | ## NoBenefitAtSkillLevel
44 |
45 | ## ReadAudio
46 |
--------------------------------------------------------------------------------
/docs/Scent-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | > Disclaimer: Not tested
2 |
3 | # Template
4 | ```
5 | {
6 | "ModScentBehaviour" : {
7 | "ScentCategory" : "RAW_MEAT"
8 | }
9 | }
10 | ```
11 |
12 | # Parameters
13 |
14 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
15 |
16 | ## ScentCategory
17 | `RAW_MEAT`, `RAW_FISH`, `COOKED_MEAT`, `COOKED_FISH`, `GUTS`, or `QUARTER`
18 | What type of smell does this item have? Affects wildlife detection radius and smell strength.
--------------------------------------------------------------------------------
/docs/Shader-Substitution.md:
--------------------------------------------------------------------------------
1 | # Shader Substitution
2 |
3 | ModComponent has built-in for substituting dummy shaders for Hinterland shaders. You can include these 2 files in your Unity projects to fix shaders at runtime.
4 |
5 | Recursive substitution affects a game object and all its children:
6 |
7 | ```cs
8 | using UnityEngine;
9 |
10 | namespace ModComponent.SceneLoader.Shaders
11 | {
12 | public class SubstituteShadersRecursive : MonoBehaviour
13 | {
14 | }
15 | }
16 | ```
17 |
18 | Single substitution affects only that game object:
19 |
20 | ```cs
21 | using UnityEngine;
22 |
23 | namespace ModComponent.SceneLoader.Shaders
24 | {
25 | public class SubstituteShadersSingle : MonoBehaviour
26 | {
27 | }
28 | }
29 | ```
30 |
31 | Note that the ripped project shaders have to be prefixed with `Dummy`. For example, `Dummy_LongDark/Diffuse` gets switched to `_LongDark/Diffuse` at runtime. This is to prevent conflicts in `Shader.Find()`.
--------------------------------------------------------------------------------
/docs/Sharpenable-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | > Disclaimer: Not tested
2 |
3 | # Template
4 | ```
5 | {
6 | "ModSharpenableBehaviour" : {
7 | "Audio" : "",
8 | "MinutesMin" : 5,
9 | "MinutesMax" : 20,
10 | "ConditionMin" : 3.3,
11 | "ConditionMax" : 9.9,
12 | "Tools" : ["GEAR_SharpeningStone"]
13 | }
14 | }
15 | ```
16 |
17 | # Parameters
18 |
19 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
20 |
21 | ## Audio
22 | *string*
23 | The sound to play while sharpening. Leave empty for a sensible default.
24 |
25 | ## MinutesMin
26 | *int*
27 | How many in-game minutes does it take to sharpen this item at minimum skill.
28 |
29 | ## MinutesMax
30 | *int*
31 | How many in-game minutes does it take to sharpen this item at maximum skill.
32 |
33 | ## ConditionMin
34 | *float*
35 | How much condition is restored to this item at minimum skill.
36 |
37 | ## ConditionMax
38 | *float*
39 | How much condition is restored to this item at maximum skill.
40 |
41 | ## Tools
42 | *Array of string text*
43 | Which tools can be used to sharpen this item, e.g. 'GEAR_SharpeningStone'. Leave empty to make this sharpenable without tools.
44 |
--------------------------------------------------------------------------------
/docs/Skill-Type-List.md:
--------------------------------------------------------------------------------
1 | * `None`
2 | * `Firestarting`
3 | * `CarcassHarvesting`
4 | * `IceFishing`
5 | * `Cooking`
6 | * `Rifle`
7 | * `Archery`
8 | * `ClothingRepair`
9 | * `ToolRepair`
10 | * `Revolver`
11 | * `Gunsmithing`
--------------------------------------------------------------------------------
/docs/Stackable-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | # Template
2 | ```
3 | {
4 | "ModStackableBehaviour": {
5 | "SingleUnitTextId" : "GAMEPLAY_HotCocoaBoxStackSingle",
6 | "MultipleUnitTextId" : "GAMEPLAY_HotCocoaBoxStackMultiple",
7 | "StackSprite" : "",
8 | "UnitsPerItem" : 8,
9 | "ChanceFull" : 80
10 | }
11 | }
12 | ```
13 |
14 | # Parameters
15 |
16 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
17 |
18 | ## SingleUnitTextId
19 | *string*
20 | Localization key to be used for stacks with only one item. E.g. '2 arrows'.
21 |
22 | ## MultipleUnitTextId
23 | *string*
24 | Localization key to be used for stacks with multiple items. E.g. '2 arrows'.
25 |
26 | ## StackSprite
27 | *string*
28 | An optional sprite name (from a UIAtlas) that will be add to the stack. Not tested
29 |
30 | ## UnitsPerItem
31 | *int*
32 | The default number of units to make a full stack. For example, Coffee tins and Herbal Tea boxes each have 5 units.
33 |
34 | ## ChanceFull
35 | *float*
36 | Percent chance of the item having a full stack.
--------------------------------------------------------------------------------
/docs/Tinder-Behaviour-Documentation.md:
--------------------------------------------------------------------------------
1 | > Not compatible with Accelerant, Burnable, or FireStarter Behaviour
2 |
3 | # Template
4 | ```
5 | {
6 | "ModTinderBehaviour": {
7 | "DurationOffset" : 0,
8 | "SuccessModifier" : 40
9 | }
10 | }
11 | ```
12 |
13 | # Parameters
14 |
15 | > Note: cannot be used without a [Component](Basic-Information-about-Components.md).
16 |
17 | ## DurationOffset
18 | *float*
19 | In-game seconds offset for fire starting duration from this accelerant. NOT scaled by fire starting skill. Positive values mean 'slower', negative values mean 'faster'.
20 |
21 | ## SuccessModifier
22 | *float*
23 | Does this item affect the chance for success? Represents percentage points. Positive values increase the chance, negative values reduce it.
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-hacker
--------------------------------------------------------------------------------