Skip to content

Commit

Permalink
Remove prefab completely; and more cleanup!
Browse files Browse the repository at this point in the history
  • Loading branch information
FailSpy committed Mar 14, 2024
1 parent b763b8c commit 27a88c4
Show file tree
Hide file tree
Showing 11 changed files with 197 additions and 204 deletions.
Binary file modified COGITO/Animations/Wieldables/Wieldable_Flashlight.res
Binary file not shown.
Binary file modified COGITO/Animations/Wieldables/Wieldable_LaserRifle.res
Binary file not shown.
Binary file modified COGITO/Animations/Wieldables/Wieldable_Pickaxe.res
Binary file not shown.
Binary file modified COGITO/Animations/Wieldables/Wieldable_ToyPistol.res
Binary file not shown.
314 changes: 157 additions & 157 deletions COGITO/Assets/Shader/Material3DConversion.gd

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions COGITO/Assets/Shader/ViewmodelSpace.gd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
extends ShaderSpace
class_name ViewmodelSpace

var _viewmodel_clipping_disabled : bool = false
@export var disable_viewmodel_clipping : bool = false:
var _viewmodel_clipping_disabled : bool = true
@export var disable_viewmodel_clipping : bool = true:
get:
return _viewmodel_clipping_disabled
set(value):
Expand All @@ -12,8 +12,7 @@ var _viewmodel_clipping_disabled : bool = false
func _init():
injected_vars = '''
global uniform float viewmodel_fov = 75.0f;
instance uniform bool viewmodel_enabled = true;
'''
instance uniform bool viewmodel_enabled = true;'''

injected_vertex = '''
/* begin shader magic*/
Expand All @@ -31,4 +30,8 @@ func _init():
}
/* end shader magic */
'''


func convert_surfaces():
super()
if not _viewmodel_clipping_disabled:
set_instance_shader_parameter("viewmodel_enabled",_viewmodel_clipping_disabled)
6 changes: 0 additions & 6 deletions COGITO/Wieldables/ViewmodelBasePrefab.tscn

This file was deleted.

15 changes: 7 additions & 8 deletions COGITO/Wieldables/flashlight.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[ext_resource type="AudioStream" uid="uid://dsp8iwkwq2rlu" path="res://COGITO/Assets/Audio/Kenney/UiAudio/switch1.ogg" id="2_dm0bj"]
[ext_resource type="Resource" uid="uid://ckvdkigvwowm5" path="res://COGITO/InventoryPD/Items/Cogito_Flashlight.tres" id="3_2q6j0"]
[ext_resource type="AnimationLibrary" uid="uid://dtnyvbl2d4lxg" path="res://COGITO/Animations/Wieldables/Wieldable_Flashlight.res" id="4_sk1pk"]
[ext_resource type="PackedScene" uid="uid://bs7nt8mf1kqk7" path="res://COGITO/Wieldables/ViewmodelBasePrefab.tscn" id="5_4euo3"]
[ext_resource type="Script" path="res://COGITO/Assets/Shader/ViewmodelSpace.gd" id="5_kuso5"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_lbp4w"]
albedo_color = Color(0.0392157, 0.0431373, 0.0745098, 1)
Expand All @@ -23,7 +23,7 @@ script = ExtResource("1_pak3j")
drain_rate = 4.0
switch_sound = ExtResource("2_dm0bj")
item_reference = ExtResource("3_2q6j0")
wieldable_mesh = NodePath("ViewmodelBase/Flashlight_Mesh")
wieldable_mesh = NodePath("Flashlight_Mesh")
anim_equip = "Wieldable_Flashlight/equip"
anim_unequip = "Wieldable_Flashlight/unequip"
anim_action_primary = "Wieldable_Flashlight/action_primary"
Expand All @@ -44,24 +44,23 @@ libraries = {
"Wieldable_Flashlight": ExtResource("4_sk1pk")
}

[node name="ViewmodelBase" parent="." instance=ExtResource("5_4euo3")]

[node name="Flashlight_Mesh" type="Node3D" parent="ViewmodelBase"]
[node name="Flashlight_Mesh" type="Node3D" parent="."]
transform = Transform3D(0.876604, -0.477881, 0.0565254, 0.480703, 0.875017, -0.0571836, -0.0221337, 0.0772994, 0.996762, 0, 0.102331, 0)
script = ExtResource("5_kuso5")

[node name="CSGCylinder3D" type="CSGCylinder3D" parent="ViewmodelBase/Flashlight_Mesh"]
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Flashlight_Mesh"]
transform = Transform3D(-4.47035e-08, 1, 0, -1, -4.47035e-08, 0, 0, 2.84217e-14, 1, -0.0541318, 0, -2.98023e-08)
radius = 0.05
height = 0.3
material = SubResource("StandardMaterial3D_lbp4w")

[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="ViewmodelBase/Flashlight_Mesh"]
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Flashlight_Mesh"]
transform = Transform3D(-4.47035e-08, 1, 0, -1, -4.47035e-08, 0, 0, 2.84217e-14, 1, 0.145868, 0, 0)
radius = 0.06
height = 0.1
material = SubResource("StandardMaterial3D_lbp4w")

[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="ViewmodelBase/Flashlight_Mesh"]
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="Flashlight_Mesh"]
transform = Transform3D(-4.47035e-08, 1, 0, -1, -4.47035e-08, 0, 0, 2.84217e-14, 1, 0.196543, 0, -2.98023e-08)
radius = 0.05
height = 0.01
Expand Down
24 changes: 11 additions & 13 deletions COGITO/Wieldables/laser_rifle.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[ext_resource type="Resource" uid="uid://txiu5yxexevm" path="res://COGITO/InventoryPD/Items/Cogito_LaserRifle.tres" id="2_i0fx0"]
[ext_resource type="PackedScene" uid="uid://dnauxhdncgngx" path="res://COGITO/PrefabScenes/laser_ray.tscn" id="2_ic084"]
[ext_resource type="AnimationLibrary" uid="uid://c1du0rcgmr542" path="res://COGITO/Animations/Wieldables/Wieldable_LaserRifle.res" id="3_fjq23"]
[ext_resource type="PackedScene" uid="uid://bs7nt8mf1kqk7" path="res://COGITO/Wieldables/ViewmodelBasePrefab.tscn" id="5_ju25o"]
[ext_resource type="Script" path="res://COGITO/Assets/Shader/ViewmodelSpace.gd" id="5_fa3wp"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_g84md"]
resource_name = "metal"
Expand Down Expand Up @@ -227,7 +227,7 @@ length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ViewmodelBase/LaserRifleMesh/clipA:position:x")
tracks/0/path = NodePath("LaserRifleMesh/clipA:position:x")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
Expand All @@ -238,7 +238,7 @@ tracks/0/keys = {
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ViewmodelBase/LaserRifleMesh/clipA:position:y")
tracks/1/path = NodePath("LaserRifleMesh/clipA:position:y")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
Expand All @@ -249,7 +249,7 @@ tracks/1/keys = {
tracks/2/type = "bezier"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("ViewmodelBase/LaserRifleMesh/clipA:position:z")
tracks/2/path = NodePath("LaserRifleMesh/clipA:position:z")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
Expand All @@ -263,16 +263,15 @@ _data = {
"RESET": SubResource("Animation_unao5")
}

[node name="Laser Rifle" type="Node3D" node_paths=PackedStringArray("shader_space", "wieldable_mesh")]
[node name="Laser Rifle" type="Node3D" node_paths=PackedStringArray("wieldable_mesh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.329, -0.264, -0.535)
script = ExtResource("1_2rut3")
laser_ray_prefab = ExtResource("2_ic084")
ray_lifespan = 3.0
default_position = Vector3(0.329, -0.264, -0.535)
shader_space = NodePath("ViewmodelBase")
sound_primary_use = ExtResource("2_f7ale")
item_reference = ExtResource("2_i0fx0")
wieldable_mesh = NodePath("ViewmodelBase/LaserRifleMesh")
wieldable_mesh = NodePath("LaserRifleMesh")
anim_equip = "LaserRifle/equip"
anim_unequip = "LaserRifle/unequip"
anim_action_primary = "LaserRifle/shoot"
Expand All @@ -282,20 +281,19 @@ anim_reload = "LaserRifle/reload"
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0083878, 0, 0)
bus = &"SFX"

[node name="ViewmodelBase" parent="." instance=ExtResource("5_ju25o")]
[node name="LaserRifleMesh" type="Node3D" parent="."]
script = ExtResource("5_fa3wp")

[node name="LaserRifleMesh" type="Node3D" parent="ViewmodelBase"]

[node name="blasterA" type="MeshInstance3D" parent="ViewmodelBase/LaserRifleMesh"]
[node name="blasterA" type="MeshInstance3D" parent="LaserRifleMesh"]
transform = Transform3D(-0.8, 0, 1.20797e-07, 0, 0.8, 0, -1.20797e-07, 0, -0.8, 0, 0, 0)
mesh = SubResource("ArrayMesh_us24q")
skeleton = NodePath("")

[node name="Bullet_Point" type="Node3D" parent="ViewmodelBase/LaserRifleMesh"]
[node name="Bullet_Point" type="Node3D" parent="LaserRifleMesh"]
unique_name_in_owner = true
transform = Transform3D(1, 0, -1.81899e-12, 0, 1, 0, 0, 0, 1, 0.00251591, 0.0906586, -0.331559)

[node name="clipA" type="MeshInstance3D" parent="ViewmodelBase/LaserRifleMesh"]
[node name="clipA" type="MeshInstance3D" parent="LaserRifleMesh"]
transform = Transform3D(-1, -6.0536e-09, 1.3411e-07, -5.12227e-09, 1, 0, -1.49012e-07, 1.86265e-09, -1, 0, -0.1, -0.164193)
mesh = SubResource("ArrayMesh_7s5kr")
skeleton = NodePath("")
Expand Down
17 changes: 8 additions & 9 deletions COGITO/Wieldables/pickaxe.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[ext_resource type="Resource" uid="uid://bp6xhd3rkh7tl" path="res://COGITO/InventoryPD/Items/Cogito_Pickaxe.tres" id="2_1ju5q"]
[ext_resource type="AudioStream" uid="uid://ocm2blyfthyq" path="res://COGITO/Assets/Audio/Kenney/woosh1.ogg" id="2_hp6wh"]
[ext_resource type="AnimationLibrary" uid="uid://da3y5068fwwbq" path="res://COGITO/Animations/Wieldables/Wieldable_Pickaxe.res" id="3_cqo2g"]
[ext_resource type="PackedScene" uid="uid://bs7nt8mf1kqk7" path="res://COGITO/Wieldables/ViewmodelBasePrefab.tscn" id="4_exidd"]
[ext_resource type="Script" path="res://COGITO/Assets/Shader/ViewmodelSpace.gd" id="4_0jrxw"]

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_caeak"]
resource_name = "wood"
Expand Down Expand Up @@ -76,25 +76,24 @@ size = Vector3(0.2, 0.2, 0.2)
[node name="Pickaxe" type="Node3D" node_paths=PackedStringArray("damage_area", "wieldable_mesh")]
transform = Transform3D(-3.61999e-06, 0, 1, 0, 1, 0, -1, 0, -3.61999e-06, 0.325805, -0.279839, -0.531526)
script = ExtResource("1_hb7ed")
damage_area = NodePath("ViewmodelBase/PickaxeMesh/DamageArea")
damage_area = NodePath("PickaxeMesh/DamageArea")
swing_sound = ExtResource("2_hp6wh")
item_reference = ExtResource("2_1ju5q")
wieldable_mesh = NodePath("ViewmodelBase/PickaxeMesh")
wieldable_mesh = NodePath("PickaxeMesh")
anim_action_primary = "swing"

[node name="ViewmodelBase" parent="." instance=ExtResource("4_exidd")]
[node name="PickaxeMesh" type="Node3D" parent="."]
script = ExtResource("4_0jrxw")

[node name="PickaxeMesh" type="Node3D" parent="ViewmodelBase"]

[node name="toolPickaxe" type="MeshInstance3D" parent="ViewmodelBase/PickaxeMesh"]
[node name="toolPickaxe" type="MeshInstance3D" parent="PickaxeMesh"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0414924, -0.1011, 1.49012e-07)
mesh = SubResource("ArrayMesh_nn555")
skeleton = NodePath("")

[node name="DamageArea" type="Area3D" parent="ViewmodelBase/PickaxeMesh"]
[node name="DamageArea" type="Area3D" parent="PickaxeMesh"]
monitoring = false

[node name="CollisionShape3D" type="CollisionShape3D" parent="ViewmodelBase/PickaxeMesh/DamageArea"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="PickaxeMesh/DamageArea"]
transform = Transform3D(1, 0, -5.13865e-11, 0, 1, 0, 5.13865e-11, 0, 1, 0.304825, 0.538461, 0.00173935)
shape = SubResource("BoxShape3D_5dkwl")

Expand Down
12 changes: 6 additions & 6 deletions COGITO/Wieldables/toy_pistol.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
[ext_resource type="PackedScene" uid="uid://c1umit2vtv22v" path="res://COGITO/PrefabScenes/projectile_pistol.tscn" id="2_l6tt4"]
[ext_resource type="AudioStream" uid="uid://clsajk36s7luk" path="res://COGITO/Assets/Audio/Kenney/error_004.ogg" id="3_vdfq8"]
[ext_resource type="Resource" uid="uid://lc5uq2e6ldah" path="res://COGITO/InventoryPD/Items/Cogito_Pistol.tres" id="4_xoq73"]
[ext_resource type="Script" path="res://COGITO/Assets/Shader/ViewmodelSpace.gd" id="5_1h55s"]
[ext_resource type="AnimationLibrary" uid="uid://bbnpn3wqqoj7l" path="res://COGITO/Animations/Wieldables/Wieldable_ToyPistol.res" id="5_fkf6b"]
[ext_resource type="PackedScene" uid="uid://bs7nt8mf1kqk7" path="res://COGITO/Wieldables/ViewmodelBasePrefab.tscn" id="5_ulobf"]

[sub_resource type="PortableCompressedTexture2D" id="PortableCompressedTexture2D_r6lnb"]
_data = PackedByteArray(2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 115, 66, 19, 0, 77, 0, 72, 115, 204, 0, 0, 0, 209, 226, 4, 0, 0, 1, 0, 0, 1, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 0, 8, 0, 2, 0, 2, 0, 169, 0, 0, 0, 64, 0, 0, 0, 56, 181, 0, 0, 0, 1, 1, 4, 0, 4, 0, 1, 0, 1, 0, 233, 0, 0, 0, 16, 0, 0, 0, 200, 214, 0, 0, 0, 2, 1, 2, 0, 2, 0, 1, 0, 1, 0, 249, 0, 0, 0, 16, 0, 0, 0, 172, 110, 0, 0, 0, 3, 1, 1, 0, 1, 0, 1, 0, 1, 0, 9, 1, 0, 0, 16, 0, 0, 0, 6, 136, 183, 185, 185, 185, 25, 93, 107, 1, 0, 0, 0, 0, 0, 0, 0, 0, 183, 185, 185, 185, 25, 93, 107, 1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 93, 129, 224, 4, 29, 157, 85, 72, 68, 68, 68, 55, 222, 22, 247, 8, 108, 145, 99, 148, 156, 158, 85, 0, 0, 0, 0, 26, 15, 141, 171, 176, 20, 161, 81, 28, 158, 158, 94, 0, 0, 0, 0, 0, 0, 243, 230, 80, 193, 136, 65, 222, 222, 95, 223, 0, 0, 127, 119, 127, 119, 127, 119, 119, 247, 182, 86, 59, 182, 181, 2, 0, 0, 0, 0, 0, 0, 0, 0)
Expand Down Expand Up @@ -58,18 +58,18 @@ projectile_velocity = 50.0
default_position = Vector3(0.329, -0.264, -0.535)
sound_primary_use = ExtResource("3_vdfq8")
item_reference = ExtResource("4_xoq73")
wieldable_mesh = NodePath("ViewmodelBase/ToyPistol_mesh")
wieldable_mesh = NodePath("ToyPistol_mesh")
anim_equip = "ToyPistol/equip"
anim_unequip = "ToyPistol/unequip"
anim_action_primary = "ToyPistol/shoot"
anim_action_secondary = "ToyPistol/action_secondary"
anim_reload = "ToyPistol/reload"

[node name="ViewmodelBase" parent="." instance=ExtResource("5_ulobf")]
[node name="ToyPistol_mesh" type="Node3D" parent="."]
transform = Transform3D(1, 0, -2.27374e-13, 0, 1, 0, 0, 0, 1, 0, 0, 0)
script = ExtResource("5_1h55s")

[node name="ToyPistol_mesh" type="Node3D" parent="ViewmodelBase"]

[node name="pistol_mesh" type="MeshInstance3D" parent="ViewmodelBase/ToyPistol_mesh"]
[node name="pistol_mesh" type="MeshInstance3D" parent="ToyPistol_mesh"]
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 0, 0)
mesh = SubResource("ArrayMesh_gjvni")
skeleton = NodePath("")
Expand Down

0 comments on commit 27a88c4

Please sign in to comment.