Skip to content

Commit 6dd88d8

Browse files
ShadowShadow
authored andcommitted
Add project files.
1 parent 22a9876 commit 6dd88d8

7 files changed

Lines changed: 189 additions & 0 deletions

FriendlyFramesMod.VS.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<StationeersDirectory>C:\Program Files (x86)\Steam\steamapps\common\Stationeers\</StationeersDirectory> <!-- Change this to the path to your Stationeers directory -->
4+
</PropertyGroup>
5+
</Project>

FriendlyFramesMod.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using Assets.Scripts.Objects;
2+
using HarmonyLib;
3+
using BepInEx;
4+
5+
6+
namespace FriendlyFramesMod
7+
{
8+
[BepInPlugin("FriendlyFrames", "Friendly Frames", "0.0.1.0")]
9+
class FriendlyFramesMod : BaseUnityPlugin
10+
{
11+
private void Awake()
12+
{
13+
//READ THE README FIRST!
14+
15+
//Harmony harmony = new Harmony("FriendlyFramesMod");
16+
//harmony.PatchAll();
17+
UnityEngine.Debug.Log("FriendlyFramesMod Loaded -- Remember to recalculate rooms when you first use this mod!");
18+
Prefab.OnPrefabsLoaded += PatchPrefabs;
19+
}
20+
21+
22+
private void PatchPrefabs()
23+
{
24+
Structure.AllStructurePrefabs.ForEach(s =>
25+
{
26+
if (s.GetPrefabName().StartsWith("StructureFrame"))
27+
{
28+
29+
if (s.BuildStates.Count == 3)
30+
{
31+
UnityEngine.Debug.Log("Patching " + s.GetPrefabName() + " BlockGravity");
32+
s.BuildStates[1].BlockGravity = false;
33+
s.BuildStates[1].Tool.ToolExit = s.BuildStates[0].Tool.ToolExit;
34+
s.BuildStates[2].Tool.ToolExit = s.BuildStates[0].Tool.ToolExit;
35+
}
36+
}
37+
}
38+
);
39+
}
40+
}
41+
}

FriendlyFramesMod.csproj

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<Project Sdk="Microsoft.NET.Sdk" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5+
<TargetFramework>net48</TargetFramework>
6+
<OutputPath>bin\Debug</OutputPath>
7+
<ModName>FriendlyFramesMod</ModName>
8+
<UserDir>$(HOMEDRIVE)$(HOMEPATH)</UserDir>
9+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
10+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
11+
</PropertyGroup>
12+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
13+
<DebugSymbols>true</DebugSymbols>
14+
<DebugType>full</DebugType>
15+
<Optimize>false</Optimize>
16+
<DefineConstants>DEBUG;TRACE</DefineConstants>
17+
<ErrorReport>prompt</ErrorReport>
18+
<WarningLevel>4</WarningLevel>
19+
<Prefer32Bit>false</Prefer32Bit>
20+
</PropertyGroup>
21+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
22+
<DebugType>pdbonly</DebugType>
23+
<Optimize>true</Optimize>
24+
<DefineConstants>TRACE</DefineConstants>
25+
<ErrorReport>prompt</ErrorReport>
26+
<WarningLevel>4</WarningLevel>
27+
<Prefer32Bit>false</Prefer32Bit>
28+
</PropertyGroup>
29+
<Import Project="$(SolutionDir)FriendlyFramesMod.VS.props" />
30+
<ItemGroup>
31+
<Reference Include="Assembly-CSharp">
32+
<HintPath>$(StationeersDirectory)\rocketstation_Data\Managed\Assembly-CSharp.dll</HintPath>
33+
<Private>False</Private>
34+
</Reference>
35+
<Reference Include="UnityEngine">
36+
<HintPath>$(StationeersDirectory)\rocketstation_Data\Managed\UnityEngine.dll</HintPath>
37+
<Private>False</Private>
38+
</Reference>
39+
<Reference Include="UnityEngine.CoreModule">
40+
<HintPath>$(StationeersDirectory)\rocketstation_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
41+
<Private>False</Private>
42+
</Reference>
43+
<Reference Include="UnityEngine.PhysicsModule">
44+
<HintPath>$(StationeersDirectory)\rocketstation_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
45+
<Private>False</Private>
46+
</Reference>
47+
<Reference Include="0Harmony">
48+
<HintPath>$(StationeersDirectory)\BepInEx\core\0Harmony.dll</HintPath>
49+
<Private>False</Private>
50+
</Reference>
51+
<Reference Include="BepInEx">
52+
<HintPath>$(StationeersDirectory)\BepInEx\core\BepInEx.dll</HintPath>
53+
<Private>False</Private>
54+
</Reference>
55+
</ItemGroup>
56+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
57+
<ItemGroup>
58+
<_CopyItemsGameData Include="$(ProjectDir)\GameData\**\*.*" />
59+
<_CopyItemsAbout Include="$(ProjectDir)\About\**\*.*" />
60+
</ItemGroup>
61+
<Target Name="AfterBuild">
62+
<RemoveDir Directories="$(StationeersDirectory)\BepInEx\plugins\$(ModName)" />
63+
<Copy SourceFiles="$(ProjectDir)\$(ModName).info" DestinationFolder="$(StationeersDirectory)\BepInEx\plugins\$(ModName)" ContinueOnError="false" />
64+
<Copy SourceFiles="$(ProjectDir)\bin\Debug\$(ModName).dll" DestinationFolder="$(StationeersDirectory)\BepInEx\plugins\$(ModName)" ContinueOnError="true" />
65+
<Copy SourceFiles="$(ProjectDir)\bin\Debug\$(ModName).pdb" DestinationFolder="$(StationeersDirectory)\BepInEx\plugins\$(ModName)" ContinueOnError="true" Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
66+
</Target>
67+
</Project>

FriendlyFramesMod.info

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"_name": "FriendlyFramesMod",
3+
"_author": "Example",
4+
"_description": "FriendlyFramesMod",
5+
"_version": "1",
6+
"_unityVersion": "2021.2.13f1",
7+
"_platforms": 1,
8+
"_content": 4,
9+
"_contentTypes": 2,
10+
"_isEnabled": true
11+
}

FriendlyFramesMod.sln

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.9.34607.119
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FriendlyFramesMod", "FriendlyFramesMod.csproj", "{5EE663D5-989D-4539-8335-30F277925822}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{5EE663D5-989D-4539-8335-30F277925822}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{5EE663D5-989D-4539-8335-30F277925822}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{5EE663D5-989D-4539-8335-30F277925822}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{5EE663D5-989D-4539-8335-30F277925822}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
EndGlobal

GameData/dont.remove

Whitespace-only changes.

README.MD

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Friendly Frames
2+
3+
This mod fixes two bugs in how frame structures are implemented and changes the un-build tool for frames to be the angle grinder.
4+
5+
## Bugs
6+
7+
In most scenarios these bugs might go unnoticed or will be benign. On Vulcan or Venus they can easily lead
8+
to the loss of a base. The first bug causes half-built frames (upgraded once from empty) to constantly
9+
exchange heat between the outside temperature and the room they are installed. This happens to all half-built
10+
frames, regardless of if they are bordering a wall or frame. Even a single half-built block in a moderate
11+
room can raise the temperature of a room catastrophically over a single day on Vulcan.
12+
13+
The second bug triggers when you un-build a fully-upgraded frame to a half-upgraded one. In addition to
14+
the sheet that was used for upgrading, it will also spawn a large grid block's worth of atmosphere from
15+
the outside. It may appear to players that the block is 'storing' the atmosphere in it when it becomes
16+
fully upgraded, but this is not the case. This happens even if the block was fully upgraded in an indoor
17+
atmosphere or in a vacuum. If you do this on Vulcan, you will, at best, end up with 2 deadly poisons
18+
in the room. If you do this during mid-day on Vulcan, the hot volatiles spawned will instantly cause
19+
a small explosion if the room contains oxygen.
20+
21+
Finally, as an added bonus, this mod changes the downgrade tool for frames from being the wrench to
22+
being the angle grinder. I know the game isn't supposed to be easy, but mis-clicking on a pipe and ending
23+
up venting my base to the outside is not part of the challenge I'm looking for.
24+
25+
## Installation
26+
27+
- First [install BepInEx](https://github.com/jixxed/StationeersMods) the same as how StationeersMod directs it.
28+
You do not need to install StationeersMod.
29+
- Unzip the release archive into the `BepInEx\plugins\` directory.
30+
- **IMPORTANT:** If loading up an old save for the first time switch into the F3 console and run the
31+
`recalculaterooms` command. This only needs to be done once.
32+
33+
## Dedicated Server & Multiplayer
34+
35+
This mod supports multiplayer and dedicated server. All clients and the server need to have it installed. Installation on a dedicated
36+
server is identical. The first time running it on a dedicated server, an administrator must perform a `serverrun recalculaterooms` command.
37+
I would recommend all clients disconnect and reconnect. Clients do not need to perform the `recalculaterooms` command.
38+
39+
## Building this mod
40+
41+
Update the file ending in `VS.props` to point the `<StationeersDirectory>` path to point to your
42+
Stationeers install directory. This will automatically re-install the mod in your `BepInEx\plugins\`
43+
directory each time you build the project. Then, open up the `.sln` file in Visual Studio.

0 commit comments

Comments
 (0)