Skip to content

Commit

Permalink
Started working on 2 new mods, changed export to not open Godot windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hhyyrylainen committed Apr 28, 2022
1 parent 250e04e commit 6b09779
Show file tree
Hide file tree
Showing 27 changed files with 358 additions and 4 deletions.
13 changes: 13 additions & 0 deletions CellAutopilot/.idea/.idea.CellAutopilot/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions CellAutopilot/.idea/.idea.CellAutopilot/.idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions CellAutopilot/.idea/.idea.CellAutopilot/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions CellAutopilot/.idea/.idea.CellAutopilot/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions CellAutopilot/CellAutopilot.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CellAutopilot", "CellAutopilot\CellAutopilot.csproj", "{E13250F1-21B3-4C75-8638-760009AB116F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E13250F1-21B3-4C75-8638-760009AB116F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E13250F1-21B3-4C75-8638-760009AB116F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E13250F1-21B3-4C75-8638-760009AB116F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E13250F1-21B3-4C75-8638-760009AB116F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
13 changes: 13 additions & 0 deletions CellAutopilot/CellAutopilot/CellAutopilot.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Reference Include="Thrive">
<HintPath>..\..\..\Thrive\.mono\temp\bin\ExportRelease\Thrive.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
8 changes: 8 additions & 0 deletions CellAutopilot/CellAutopilot/PlayerMicrobeInputPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;

namespace CellAutopilot
{
public class PlayerMicrobeInputPatch
{
}
}
7 changes: 7 additions & 0 deletions CellAutopilot/PlayerMicrobeInputPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace CellAutopilot
{
public class PlayerMicrobeInputPatch
{

}
}
3 changes: 3 additions & 0 deletions CellAutopilot/cell_autopilot_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions CellAutopilot/thrive_mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"Name": "Cell Autopilot",
"InternalName": "CellAutopilot",
"Author": "Revolutionary Games Studio",
"Version": "1.0",
"Description": "Let the AI take control of your player cell",
"LongDescription": "",
"Icon": "cell_autopilot_icon.png",
"InfoUrl": "https://github.com/Revolutionary-Games/ThriveMods",
"License": "MIT+CC-SA-3.0",
"RecommendedThriveVersion": "0.5.8.1",
"MinimumThriveVersion": "0.5.8.1-alpha",
"MaximumThriveVersion": "",
"ModAssembly": "CellAutopilot.dll",
"UseAutoHarmony": true
}
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ We don't currently accept community mods into this repo, you need to put them el

- [Disco Nucleus](DiscoNucleus/): shows how to replace an existing asset in Thrive
- [Damage Numbers](DamageNumbers/): example mod for using C# in a mod
- [Random Part Challenge](RandomPartChallenge/): example mod for using Harmony manually in a C#
- [Cell Autopilot](CellAutopilot/): example mod for using Harmony in a C# standalone mod not using Godot at all


## Exporting
Expand All @@ -19,9 +21,11 @@ are referenced.

There's a helper script provided (`export_all.rb`) that exports and
prepares folders for all mods in this repository. For how to get the
script working, please refer to
[Thrive setup instructions](https://github.com/Revolutionary-Games/Thrive/blob/master/doc/setup_instructions.md)
If you prefer you can also manually use Godot editor to export specific mods.
script working, please refer to [Thrive setup
instructions](https://github.com/Revolutionary-Games/Thrive/blob/master/doc/setup_instructions.md)
If you prefer you can also manually use Godot editor to export
specific mods. Some mods are C# only and just need C# build tools
without depending on Godot.


## Referencing Thrive
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions RandomPartChallenge/RandomPartChallenge.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Godot.NET.Sdk/3.3.0">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Reference Include="Thrive">
<HintPath>..\..\Thrive\.mono\temp\bin\ExportRelease\Thrive.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Lib.Harmony" Version="2.2.1" />
</ItemGroup>
</Project>
19 changes: 19 additions & 0 deletions RandomPartChallenge/RandomPartChallenge.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RandomPartChallenge", "RandomPartChallenge.csproj", "{FBD68060-A538-4860-94F8-943D8FB5945E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
ExportDebug|Any CPU = ExportDebug|Any CPU
ExportRelease|Any CPU = ExportRelease|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FBD68060-A538-4860-94F8-943D8FB5945E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FBD68060-A538-4860-94F8-943D8FB5945E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FBD68060-A538-4860-94F8-943D8FB5945E}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
{FBD68060-A538-4860-94F8-943D8FB5945E}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
{FBD68060-A538-4860-94F8-943D8FB5945E}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
{FBD68060-A538-4860-94F8-943D8FB5945E}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions RandomPartChallenge/RandomPartChallenge.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=revolutionarygamesstudio/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
15 changes: 15 additions & 0 deletions RandomPartChallenge/RandomPartChallenge/CellEditorPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using Godot;
using HarmonyLib;

[HarmonyPatch(typeof(CellEditorComponent))]
[HarmonyPatch(nameof(CellEditorComponent.OnEditorSpeciesSetup))]
internal class RandomPartCellEditorPatch
{
/*static AccessTools.FieldRef<SomeGameClass, bool> isRunningRef =
AccessTools.FieldRefAccess<SomeGameClass, bool>("isRunning");*/

static void Postfix()
{
GD.Print("Cell editor setup should have happened");
}
}
33 changes: 33 additions & 0 deletions RandomPartChallenge/RandomPartChallenge/RandomPartChallenge.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Godot;
using HarmonyLib;

public class RandomPartChallenge : IMod
{
private const string OurHarmonyId = "com.revolutionarygamesstudio.thrive.randomPartChallenge";

private Harmony? harmony;

public bool Initialize(IModInterface modInterface, ModInfo currentModInfo)
{
GD.Print("Patching with Harmony for RandomPartChallenge");
harmony = new Harmony(OurHarmonyId);
harmony.PatchAll();

return true;
}

public bool Unload()
{
if (harmony != null)
{
GD.Print("Un-patching changes of RandomPartChallenge");
harmony.UnpatchAll(OurHarmonyId);
}

return true;
}

public void CanAttachNodes(Node currentScene)
{
}
}
7 changes: 7 additions & 0 deletions RandomPartChallenge/default_env.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]

[sub_resource type="ProceduralSky" id=1]

[resource]
background_mode = 2
background_sky = SubResource( 1 )
24 changes: 24 additions & 0 deletions RandomPartChallenge/export_presets.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[preset.0]

name="Linux/X11"
platform="Linux/X11"
runnable=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="builds/RandomPartChallenge.x86_64"
script_export_mode=1
script_encryption_key=""

[preset.0.options]

custom_template/debug=""
custom_template/release=""
binary_format/64_bits=true
binary_format/embed_pck=false
texture_format/bptc=false
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
texture_format/no_bptc_fallbacks=true
22 changes: 22 additions & 0 deletions RandomPartChallenge/project.godot
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters

config_version=4

[application]

config/name="RandomPartChallenge"
config/icon="res://icon.png"

[physics]

common/enable_pause_aware_picking=true

[rendering]

environment/default_environment="res://default_env.tres"
3 changes: 3 additions & 0 deletions RandomPartChallenge/random_parts_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions RandomPartChallenge/random_parts_icon.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[remap]

importer="texture"
type="StreamTexture"
path="res://.import/random_parts_icon.png-46a9d46c5a013d83d8f13f5d4bdad867.stex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://random_parts_icon.png"
dest_files=[ "res://.import/random_parts_icon.png-46a9d46c5a013d83d8f13f5d4bdad867.stex" ]

[params]

compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
process/normal_map_invert_y=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
16 changes: 16 additions & 0 deletions RandomPartChallenge/thrive_mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"Name": "Random Part Challenge",
"InternalName": "RandomPartChallenge",
"Author": "Revolutionary Games Studio",
"Version": "1.0",
"Description": "Let random chance control which parts you get each editor cycle. Can you still Thrive?",
"LongDescription": "",
"Icon": "random_parts_icon.png",
"InfoUrl": "https://github.com/Revolutionary-Games/ThriveMods",
"License": "MIT+CC-SA-3.0",
"RecommendedThriveVersion": "0.5.8.1",
"MinimumThriveVersion": "0.5.8.1-alpha",
"MaximumThriveVersion": "",
"ModAssembly": "RandomPartChallenge.dll",
"AssemblyModClass": "RandomPartChallenge"
}
Loading

0 comments on commit 6b09779

Please sign in to comment.