diff --git a/.idea/.idea.Babushka/.idea/libraries/GdSdk.xml b/.idea/.idea.Babushka/.idea/libraries/GdSdk.xml
new file mode 100644
index 0000000..0059883
--- /dev/null
+++ b/.idea/.idea.Babushka/.idea/libraries/GdSdk.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.Babushka/.idea/libraries/GdSdk_Master.xml b/.idea/.idea.Babushka/.idea/libraries/GdSdk_Master.xml
deleted file mode 100644
index 8b941bb..0000000
--- a/.idea/.idea.Babushka/.idea/libraries/GdSdk_Master.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/prefabs/farm/base_field.tscn b/prefabs/farm/base_field.tscn
index cedce61..f000cf4 100644
--- a/prefabs/farm/base_field.tscn
+++ b/prefabs/farm/base_field.tscn
@@ -38,11 +38,15 @@ z_index = 1
scale = Vector2(1.3499999, 1.5)
texture = ExtResource("9_wx561")
-[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldSprite", "_maskSprite", "_outlineSprite", "PlantingInteraction", "PlantingPlaceholder", "FieldInteractionArea", "_fieldIndex", "_wateringParticles")]
+[node name="FieldBehaviour" type="Sprite2D" parent="." node_paths=PackedStringArray("_fieldIndex", "_fieldSprite", "_maskSprite", "_outlineSprite", "PlantingInteraction", "FieldInteractionArea", "PlantingPlaceholder", "_wateringParticles")]
visible = false
z_index = -1
scale = Vector2(0.9, 1)
script = ExtResource("1_qa01x")
+SaveId = "field"
+_fieldIndex = NodePath("..")
+_sceneKeyProvider = ExtResource("11_cjahb")
+FieldState = 0
_fieldSprite = NodePath("MaskedField/FieldTexture")
_maskSprite = NodePath("MaskedField")
_outlineSprite = NodePath("../OutlineSprite")
@@ -50,13 +54,10 @@ _maskOutlineTextures = Array[Texture2D]([ExtResource("9_wx561"), ExtResource("3_
_maskTexture = Array[Texture2D]([ExtResource("2_w8caw"), ExtResource("3_c014y"), ExtResource("4_teirr")])
Tilled = ExtResource("5_wx561")
Watered = ExtResource("6_7m4xq")
-FieldState = 0
PlantingInteraction = NodePath("InteractionArea")
+FieldInteractionArea = NodePath("InteractionArea")
PlantingPlaceholder = NodePath("PlantPlaceholder")
ItemRepository = ExtResource("7_w8caw")
-FieldInteractionArea = NodePath("InteractionArea")
-_sceneKeyProvider = ExtResource("11_cjahb")
-_fieldIndex = NodePath("..")
_wateringParticles = NodePath("../pouring water vfx")
_wateringEvent = ExtResource("14_57jmp")
diff --git a/prefabs/farm/plants/beet_plant.tscn b/prefabs/farm/plants/beet_plant.tscn
index 8bdd8ed..035f1fb 100644
--- a/prefabs/farm/plants/beet_plant.tscn
+++ b/prefabs/farm/plants/beet_plant.tscn
@@ -13,6 +13,7 @@ resource_local_to_scene = true
radius = 300.0
[node name="Beet" instance=ExtResource("1_2u3jr")]
+_prefabPath = "res://prefabs/farm/plants/beet_plant.tscn"
[node name="Seed1" parent="Seeds" index="0"]
texture = ExtResource("2_agmuy")
diff --git a/prefabs/farm/plants/tomato_plant.tscn b/prefabs/farm/plants/tomato_plant.tscn
index 5df96ea..190d616 100644
--- a/prefabs/farm/plants/tomato_plant.tscn
+++ b/prefabs/farm/plants/tomato_plant.tscn
@@ -12,6 +12,7 @@ resource_local_to_scene = true
radius = 300.0
[node name="TomatoPlant" instance=ExtResource("1_ooshk")]
+_prefabPath = "res://prefabs/farm/plants/tomato_plant.tscn"
[node name="Seed1" parent="Seeds" index="0"]
texture = ExtResource("2_gdicx")
diff --git a/project.godot b/project.godot
index 58a2bec..455bb40 100644
--- a/project.godot
+++ b/project.godot
@@ -214,6 +214,7 @@ folder_colors={
"res://logos/": "blue",
"res://prefabs/": "purple",
"res://resources/": "purple",
+"res://savegame/": "purple",
"res://scenes/": "purple",
"res://scripts/": "pink",
"res://shader/": "pink"
diff --git a/savegame/savegame.json b/savegame/savegame.json
new file mode 100644
index 0000000..f1cf059
--- /dev/null
+++ b/savegame/savegame.json
@@ -0,0 +1,37 @@
+{
+ "beetRootScene_field0": "{\n\t\"field_state\": 1,\n\t\"plant_data\": {\n\t\t\"plant_days_growing\": 0,\n\t\t\"plant_state\": 3,\n\t\t\"prefab_path\": \"res://prefabs/farm/plants/beet_plant.tscn\"\n\t}\n}",
+ "beetRootScene_field1": "{\n\t\"field_state\": 1,\n\t\"plant_data\": {\n\t\t\"plant_days_growing\": 0,\n\t\t\"plant_state\": 3,\n\t\t\"prefab_path\": \"res://prefabs/farm/plants/beet_plant.tscn\"\n\t}\n}",
+ "beetRootScene_field2": "{\n\t\"field_state\": 1,\n\t\"plant_data\": {\n\t\t\"plant_days_growing\": 0,\n\t\t\"plant_state\": 3,\n\t\t\"prefab_path\": \"res://prefabs/farm/plants/beet_plant.tscn\"\n\t}\n}",
+ "beetRootScene_field3": "{\n\t\"field_state\": 1,\n\t\"plant_data\": {\n\t\t\"plant_days_growing\": 0,\n\t\t\"plant_state\": 3,\n\t\t\"prefab_path\": \"res://prefabs/farm/plants/beet_plant.tscn\"\n\t}\n}",
+ "beetRootScene_field4": "{\n\t\"field_state\": 1,\n\t\"plant_data\": {\n\t\t\"plant_days_growing\": 0,\n\t\t\"plant_state\": 3,\n\t\t\"prefab_path\": \"res://prefabs/farm/plants/beet_plant.tscn\"\n\t}\n}",
+ "beetRootScene_field5": "{\n\t\"field_state\": 1,\n\t\"plant_data\": {\n\t\t\"plant_days_growing\": 0,\n\t\t\"plant_state\": 2,\n\t\t\"prefab_path\": \"res://prefabs/farm/plants/beet_plant.tscn\"\n\t}\n}",
+ "beetRootScene_field6": "{\n\t\"field_state\": 1,\n\t\"plant_data\": {\n\t\t\"plant_days_growing\": 0,\n\t\t\"plant_state\": 3,\n\t\t\"prefab_path\": \"res://prefabs/farm/plants/beet_plant.tscn\"\n\t}\n}",
+ "beetRootScene_field7": "{\n\t\"field_state\": 1,\n\t\"plant_data\": {\n\t\t\"plant_days_growing\": 0,\n\t\t\"plant_state\": 3,\n\t\t\"prefab_path\": \"res://prefabs/farm/plants/beet_plant.tscn\"\n\t}\n}",
+ "beetRootScene_field8": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field0": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field1": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field10": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field11": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field12": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field13": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field14": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field15": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field16": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field17": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field18": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field19": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field2": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field20": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field21": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field22": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field23": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field24": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field25": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field3": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field4": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field5": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field6": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field7": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field8": "{\n\t\"field_state\": 0\n}",
+ "farmOutside_field9": "{\n\t\"field_state\": 0\n}"
+}
\ No newline at end of file
diff --git a/scenes/Babushka_scene_outside_beets.tscn b/scenes/Babushka_scene_outside_beets.tscn
index 4d8cc2f..a259778 100644
--- a/scenes/Babushka_scene_outside_beets.tscn
+++ b/scenes/Babushka_scene_outside_beets.tscn
@@ -1757,7 +1757,7 @@ visible = true
_state = 2
_field = NodePath("../..")
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField/FieldActivator/InteractionArea/Area2D" index="0"]
@@ -1775,7 +1775,7 @@ visible = true
_state = 2
_field = NodePath("../..")
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField2" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField2" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField2/FieldActivator/InteractionArea/Area2D" index="0"]
@@ -1793,7 +1793,7 @@ visible = true
_state = 2
_field = NodePath("../..")
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField3" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField3" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField3/FieldActivator/InteractionArea/Area2D" index="0"]
@@ -1812,7 +1812,7 @@ FieldState = 3
_state = 2
_field = NodePath("../..")
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField4" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField4" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField4/FieldActivator/InteractionArea/Area2D" index="0"]
@@ -1831,7 +1831,7 @@ FieldState = 3
_state = 2
_field = NodePath("../..")
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField5" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField5" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField5/FieldActivator/InteractionArea/Area2D" index="0"]
@@ -1850,7 +1850,7 @@ FieldState = 3
_state = 1
_field = NodePath("../..")
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField6" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField6" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField6/FieldActivator/InteractionArea/Area2D" index="0"]
@@ -1869,7 +1869,7 @@ FieldState = 3
_state = 2
_field = NodePath("../..")
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField7" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField7" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField7/FieldActivator/InteractionArea/Area2D" index="0"]
@@ -1888,7 +1888,7 @@ FieldState = 3
_state = 2
_field = NodePath("../..")
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField8" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField8" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField8/FieldActivator/InteractionArea/Area2D" index="0"]
@@ -1902,7 +1902,7 @@ Payload = 8
[node name="FieldBehaviour" parent="YSorted/Farm visuals/FieldParent/BaseField9" index="1"]
visible = true
-[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField9" index="8"]
+[node name="FieldActivator" parent="YSorted/Farm visuals/FieldParent/BaseField9" index="7"]
visible = false
[node name="CollisionShape3D" parent="YSorted/Farm visuals/FieldParent/BaseField9/FieldActivator/InteractionArea/Area2D" index="0"]
diff --git a/scripts/CSharp/Common/Farming/FieldBehaviour2D.cs b/scripts/CSharp/Common/Farming/FieldBehaviour2D.cs
index 639d77d..6b8b68f 100644
--- a/scripts/CSharp/Common/Farming/FieldBehaviour2D.cs
+++ b/scripts/CSharp/Common/Farming/FieldBehaviour2D.cs
@@ -1,15 +1,27 @@
using System;
using Babushka.scripts.CSharp.Common.CharacterControls;
using Babushka.scripts.CSharp.Common.Inventory;
+using Babushka.scripts.CSharp.Common.Savegame;
using Babushka.scripts.CSharp.Low_Code.Events;
using Babushka.scripts.CSharp.Low_Code.Variables;
using Godot;
+using Godot.Collections;
namespace Babushka.scripts.CSharp.Common.Farming;
+///
+/// Defines the behaviour of the field, i.e. interactions, states and effects.
+///
[GlobalClass]
public partial class FieldBehaviour2D : Sprite2D
{
+ [ExportGroup("Persistence")]
+ [Export] public string SaveId = "";
+ [Export] private VariableNode _fieldIndex;
+ [Export] public VariableResource _sceneKeyProvider;
+ [Export] public FieldState FieldState = FieldState.Tilled;
+
+ [ExportGroup("Field Visuals")]
[Export] private Sprite2D _fieldSprite;
[Export] private Sprite2D _maskSprite;
[Export] private Sprite2D _outlineSprite;
@@ -17,25 +29,25 @@ public partial class FieldBehaviour2D : Sprite2D
[Export] private Texture2D[] _maskTexture;
[Export] private Texture2D Tilled;
[Export] private Texture2D Watered;
- [Export] public FieldState FieldState = FieldState.Tilled;
+
+ [ExportGroup("Field Interactions")]
[Export] public InteractionArea2D PlantingInteraction;
+ [Export] public InteractionArea2D FieldInteractionArea;
+
+ [ExportGroup("Configuration")]
[Export] public Node2D PlantingPlaceholder;
[Export] public ItemRepository ItemRepository;
- [Export] public InteractionArea2D FieldInteractionArea;
- [Export] public VariableResource _sceneKeyProvider;
- [Export] private VariableNode _fieldIndex;
[Export] private CpuParticles2D _wateringParticles;
[Export] private EventResource _wateringEvent;
-
- public Vector2 FieldPosition;
-
private bool _seedsActive;
private bool _wateringCanActive;
private bool _canPlant;
private bool _canWater;
+ private PlantBehaviour2D? _currentPlant;
+
[Signal] public delegate void PlantedEventHandler();
private void UpdateInteractionArea()
@@ -58,11 +70,16 @@ public partial class FieldBehaviour2D : Sprite2D
_wateringCanActive = activated;
UpdateInteractionArea();
}
-
+
public override void _Ready()
{
+
+ if(PlantingPlaceholder.GetChildCount() > 0)
+ _currentPlant = PlantingPlaceholder.GetChild(0);
UpdateFieldState(FieldState);
+
FieldService.Instance.TryAddEntry(_sceneKeyProvider.Payload.AsString(),_fieldIndex.Payload.AsInt32(), this);
+
int randomIndex = new Random().Next(0, _maskTexture.Length);
_maskSprite.Texture = _maskTexture[randomIndex];
_outlineSprite.Texture = _maskOutlineTextures[randomIndex];
@@ -97,6 +114,7 @@ public partial class FieldBehaviour2D : Sprite2D
break;
}
UpdateInteractionArea();
+ UpdateSaveData();
}
@@ -137,19 +155,19 @@ public partial class FieldBehaviour2D : Sprite2D
if (item == null || PlantingPlaceholder.GetChildCount() > 0 || item.amount == 0)
return success;
- string prefabPath = ItemRepository.TryGetPrefabPath(item.blueprint);
+ string plantPrefabPath = ItemRepository.TryGetPrefabPath(item.blueprint);
- if (prefabPath != null)
+ if (!string.IsNullOrEmpty(plantPrefabPath))
{
- PackedScene prefab = ResourceLoader.Load(prefabPath, nameof(PackedScene));
+ PackedScene prefab = ResourceLoader.Load(plantPrefabPath, nameof(PackedScene));
Node2D plant2d = prefab.Instantiate();
PlantingPlaceholder.AddChild(plant2d);
plant2d.GlobalPosition = PlantingPlaceholder.GlobalPosition;
- PlantBehaviour2D? plantBehaviour = plant2d as PlantBehaviour2D;
+ _currentPlant = plant2d as PlantBehaviour2D;
- if (plantBehaviour != null)
+ if (_currentPlant != null)
{
- plantBehaviour.Field = this;
+ _currentPlant.Field = this;
}
InventoryManager.Instance.playerInventory.RemoveItem(currentSlotIndex);
@@ -158,6 +176,34 @@ public partial class FieldBehaviour2D : Sprite2D
return success;
}
-
-}
\ No newline at end of file
+
+ public void UpdateSaveData()
+ {
+ var saveData = new SaveData();
+
+ saveData.SceneName = _sceneKeyProvider.Payload.AsString();
+ saveData.Id = SaveId + _fieldIndex.Payload.AsString();
+ var payloadData = new Dictionary
+ {
+ { "field_state", (int)FieldState }
+ };
+
+ if (_currentPlant != null)
+ {
+ payloadData.Add(
+ "plant_data", new Dictionary()
+ {
+ { "prefab_path", _currentPlant.PrefabPath },
+ { "plant_state", (int)_currentPlant.State },
+ { "plant_days_growing", _currentPlant.DaysGrowing }
+ }
+ );
+ }
+
+ saveData.JsonPayload = Json.Stringify(payloadData, indent: "\t");
+
+ SavegameService.AppendSave(saveData);
+ }
+
+}
diff --git a/scripts/CSharp/Common/Farming/FieldService.cs b/scripts/CSharp/Common/Farming/FieldService.cs
index 5bc1aee..3a6a395 100644
--- a/scripts/CSharp/Common/Farming/FieldService.cs
+++ b/scripts/CSharp/Common/Farming/FieldService.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using Babushka.scripts.CSharp.Common.Services;
using Godot;
namespace Babushka.scripts.CSharp.Common.Farming;
@@ -40,10 +41,6 @@ public partial class FieldService : Node
innerDict.fields.Add(fieldIndex, field);
return true;
}
- else
- {
- GD.PrintErr("Duplicate field at: " + fieldIndex);
- }
}
return false;
}
diff --git a/scripts/CSharp/Common/Farming/PlantBehaviour2D.cs b/scripts/CSharp/Common/Farming/PlantBehaviour2D.cs
index 9a87166..ab8e6cf 100644
--- a/scripts/CSharp/Common/Farming/PlantBehaviour2D.cs
+++ b/scripts/CSharp/Common/Farming/PlantBehaviour2D.cs
@@ -9,6 +9,7 @@ namespace Babushka.scripts.CSharp.Common.Farming;
///
public partial class PlantBehaviour2D : Node2D
{
+ [Export] private string _prefabPath;
[Export] private Sprite2D[] _seeds;
[Export] private Sprite2D[] _smallPlants;
[Export] private Sprite2D[] _bigPlants;
@@ -24,6 +25,12 @@ public partial class PlantBehaviour2D : Node2D
private bool _magicWordSaid = false;
private bool _calledOnReady = false;
+ public PlantState State => _state;
+
+ public int DaysGrowing { get; set; }
+
+ public string PrefabPath => _prefabPath;
+
///
/// public accessor for the field reference
///
@@ -35,7 +42,6 @@ public partial class PlantBehaviour2D : Node2D
public override void _Ready()
{
- GD.Print($"Ready: {Name}");
if (_state == PlantState.None)
{
_state = PlantState.Planted;
@@ -44,7 +50,6 @@ public partial class PlantBehaviour2D : Node2D
}
else
{
- GD.Print("plant state not none.");
_calledOnReady = true;
GrowPlant();
}
diff --git a/scripts/CSharp/Common/Savegame/SaveData.cs b/scripts/CSharp/Common/Savegame/SaveData.cs
new file mode 100644
index 0000000..4e00e30
--- /dev/null
+++ b/scripts/CSharp/Common/Savegame/SaveData.cs
@@ -0,0 +1,16 @@
+using System;
+
+namespace Babushka.scripts.CSharp.Common.Savegame;
+
+[Serializable]
+public class SaveData
+{
+ public string SceneName;
+ public string Id;
+ public string JsonPayload;
+
+ public string ToString()
+ {
+ return SceneName + " " + Id + " " + JsonPayload;
+ }
+}
\ No newline at end of file
diff --git a/scripts/CSharp/Common/Savegame/SaveData.cs.uid b/scripts/CSharp/Common/Savegame/SaveData.cs.uid
new file mode 100644
index 0000000..e46f0d7
--- /dev/null
+++ b/scripts/CSharp/Common/Savegame/SaveData.cs.uid
@@ -0,0 +1 @@
+uid://bkftl5mj33eah
diff --git a/scripts/CSharp/Common/Savegame/SavegameService.cs b/scripts/CSharp/Common/Savegame/SavegameService.cs
new file mode 100644
index 0000000..4a8c234
--- /dev/null
+++ b/scripts/CSharp/Common/Savegame/SavegameService.cs
@@ -0,0 +1,34 @@
+using Godot;
+using Godot.Collections;
+using FileAccess = Godot.FileAccess;
+
+namespace Babushka.scripts.CSharp.Common.Savegame;
+
+public static class SavegameService
+{
+ public static readonly string SavePath = "res://savegame/savegame.json";
+
+ public static Dictionary SaveDatas = new ();
+
+ public static void AppendSave(SaveData saveData)
+ {
+ string key = string.Concat(saveData.SceneName, "_", saveData.Id);
+
+ if (SaveDatas.TryGetValue(key, out var value))
+ {
+ SaveDatas[key] = saveData.JsonPayload;
+ }
+ else
+ {
+ SaveDatas.Add(key, saveData.JsonPayload);
+ }
+ }
+
+ public static void Save()
+ {
+ string json = Json.Stringify(SaveDatas, indent: "\t");
+ using var file = FileAccess.Open(SavePath, FileAccess.ModeFlags.Write);
+ file.StoreString(json);
+ GD.Print($"Game saved to {file}");
+ }
+}
\ No newline at end of file
diff --git a/scripts/CSharp/Common/Savegame/SavegameService.cs.uid b/scripts/CSharp/Common/Savegame/SavegameService.cs.uid
new file mode 100644
index 0000000..e793998
--- /dev/null
+++ b/scripts/CSharp/Common/Savegame/SavegameService.cs.uid
@@ -0,0 +1 @@
+uid://rm23q50boqe5
diff --git a/scripts/CSharp/Common/SceneTransition.cs b/scripts/CSharp/Common/SceneTransition.cs
index e6c5426..d36a488 100644
--- a/scripts/CSharp/Common/SceneTransition.cs
+++ b/scripts/CSharp/Common/SceneTransition.cs
@@ -1,4 +1,6 @@
+using Babushka.scripts.CSharp.Common.Savegame;
using Babushka.scripts.CSharp.Common.SceneManagement;
+using Babushka.scripts.CSharp.Common.Services;
using Godot;
namespace Babushka.scripts.CSharp.Common;
@@ -16,6 +18,7 @@ public partial class SceneTransition : Node
public void LoadSceneAtIndex(int index)
{
+ SavegameService.Save();
string sceneName = _sceneNamesToLoad[index];
SceneTransitionThreaded.Instance.ChangeSceneToFileThreaded(sceneName);
UnloadAfterDelay();
diff --git a/scripts/CSharp/Low Code/Variables/VariableNode.cs b/scripts/CSharp/Low Code/Variables/VariableNode.cs
index e165e9b..a979ee0 100644
--- a/scripts/CSharp/Low Code/Variables/VariableNode.cs
+++ b/scripts/CSharp/Low Code/Variables/VariableNode.cs
@@ -2,6 +2,9 @@ using Godot;
namespace Babushka.scripts.CSharp.Low_Code.Variables;
+///
+/// A Node type that carries a Variant payload.
+///
public partial class VariableNode : Node
{
[Export] public Variant Payload { get; set; }