From 5511cbb16093eb6b77d104c3ecc01c832dc09ccb Mon Sep 17 00:00:00 2001 From: niefia <99533148+niefia@users.noreply.github.com> Date: Tue, 24 Sep 2024 21:05:44 +0100 Subject: [PATCH] Fixes for Currency update Know the currency update is still WIP, but just trying to patch out an error that breaks saving/loading due to no set_currency function in the currency. Also replaced coins collision shape it it was colliding weirdly with surface, seems fine with box --- COGITO/DemoScenes/COGITO_3_Lobby.tscn | 4 ++-- .../InventoryPD/CustomResources/cogito_currency.gd | 5 +++++ COGITO/PackedScenes/Pickups/pickup_coins.tscn | 14 ++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/COGITO/DemoScenes/COGITO_3_Lobby.tscn b/COGITO/DemoScenes/COGITO_3_Lobby.tscn index a2437713..f55f29db 100644 --- a/COGITO/DemoScenes/COGITO_3_Lobby.tscn +++ b/COGITO/DemoScenes/COGITO_3_Lobby.tscn @@ -7918,10 +7918,10 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.71305, 1.67676, -0.0526435 shape = SubResource("BoxShape3D_4k13h") [node name="Coins" parent="." instance=ExtResource("93_phwoo")] -transform = Transform3D(0.225393, 0, -0.974268, 0, 1, 0, 0.974268, 0, 0.225393, -1.03416, 0.843447, -11.2766) +transform = Transform3D(0.225393, 0, -0.974268, 0, 1, 0, 0.974268, 0, 0.225393, -1.03416, 0.88054, -11.2766) [node name="Coins2" parent="." instance=ExtResource("93_phwoo")] -transform = Transform3D(-0.821508, 0, -0.570197, 0, 1, 0, 0.570197, 0, -0.821508, -1.33015, 0.843447, -11.3396) +transform = Transform3D(-0.821508, 0, -0.570197, 0, 1, 0, 0.570197, 0, -0.821508, -1.33015, 0.86935, -11.3396) [connection signal="body_entered" from="QUESTS/Archive_QuestStarter" to="QUESTS/Archive_QuestStarter" method="_on_body_entered"] [connection signal="body_entered" from="QUESTS/Laptop_QuestStarter" to="QUESTS/Laptop_QuestStarter" method="_on_body_entered"] diff --git a/COGITO/InventoryPD/CustomResources/cogito_currency.gd b/COGITO/InventoryPD/CustomResources/cogito_currency.gd index e47c84e3..83411033 100644 --- a/COGITO/InventoryPD/CustomResources/cogito_currency.gd +++ b/COGITO/InventoryPD/CustomResources/cogito_currency.gd @@ -51,6 +51,11 @@ func set_attribute(_value_current:float, _value_max:float): value_max = _value_max +# Used when loading/setting a currency +func set_currency(_value_current:float, _value_max:float): + value_current = _value_current + value_max = _value_max + func add(amount): if is_locked: currency_changed.emit(currency_name,value_current,value_max,true) diff --git a/COGITO/PackedScenes/Pickups/pickup_coins.tscn b/COGITO/PackedScenes/Pickups/pickup_coins.tscn index 90944243..8b7d92c2 100644 --- a/COGITO/PackedScenes/Pickups/pickup_coins.tscn +++ b/COGITO/PackedScenes/Pickups/pickup_coins.tscn @@ -17,12 +17,10 @@ height = 0.01 radial_segments = 8 rings = 1 -[sub_resource type="CylinderShape3D" id="CylinderShape3D_4mxs4"] -margin = 0.01 -height = 0.05 -radius = 0.1 +[sub_resource type="BoxShape3D" id="BoxShape3D_k343l"] +size = Vector3(0.205469, 0.0422119, 0.170801) -[sub_resource type="Resource" id="Resource_pb4mu"] +[sub_resource type="Resource" id="Resource_iq4sy"] resource_local_to_scene = true script = ExtResource("4_wdnhm") inventory_item = ExtResource("3_q3la1") @@ -57,8 +55,8 @@ transform = Transform3D(0.906256, 0, -0.422729, 0, 1, 0, 0.422729, 0, 0.906256, mesh = SubResource("CylinderMesh_u08uv") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0529228, 0.0252476, 0.00999682) -shape = SubResource("CylinderShape3D_4mxs4") +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0501884, 0.0155918, 0.0245964) +shape = SubResource("BoxShape3D_k343l") [node name="PickupComponent" parent="." instance=ExtResource("2_028c2")] -slot_data = SubResource("Resource_pb4mu") +slot_data = SubResource("Resource_iq4sy")