Skip to content

Commit 3dcff49

Browse files
committed
CharacterRandomizer: Change hair and cloth colors too
1 parent 81b667f commit 3dcff49

6 files changed

Lines changed: 220 additions & 116 deletions

File tree

scenes/game_elements/characters/components/character_randomizer.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var _previous_look_at_side: Enums.LookAtSide = Enums.LookAtSide.UNSPECIFIED
5757
func apply_character_randomizations() -> void:
5858
_random_number_generator.seed = character_seed
5959

60-
cel_shading_recolor.set_random_skin_color(_random_number_generator)
60+
cel_shading_recolor.randomize(_random_number_generator)
6161

6262
for n in random_texture_nodes:
6363
n.randomize_texture(_random_number_generator)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[gd_resource type="ColorPalette" format=3 uid="uid://p0khxv74o8at"]
2+
3+
[resource]
4+
colors = PackedColorArray(0.627451, 1, 0.627451, 1, 0, 1, 0, 1, 0, 0.627451, 0, 1, 0.7764706, 0.5058824, 0.23137255, 1, 0.6862745, 0.3647059, 0.13725491, 1, 0.48235294, 0.23921569, 0.07058824, 1, 0.46666667, 0.5019608, 0.39215687, 1, 0.3882353, 0.41568628, 0.3372549, 1, 0.25882354, 0.29411766, 0.24705882, 1)

scenes/game_elements/characters/npcs/townie.tscn

Lines changed: 55 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -23,146 +23,157 @@
2323

2424
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_qs15o"]
2525

26-
[sub_resource type="AtlasTexture" id="AtlasTexture_4gc0b"]
27-
atlas = ExtResource("6_dstmm")
26+
[sub_resource type="AtlasTexture" id="AtlasTexture_tidpj"]
27+
atlas = ExtResource("4_4gc0b")
2828
region = Rect2(0, 0, 96, 96)
2929

30-
[sub_resource type="AtlasTexture" id="AtlasTexture_yd672"]
31-
atlas = ExtResource("6_dstmm")
30+
[sub_resource type="AtlasTexture" id="AtlasTexture_hurny"]
31+
atlas = ExtResource("4_4gc0b")
3232
region = Rect2(96, 0, 96, 96)
3333

34-
[sub_resource type="AtlasTexture" id="AtlasTexture_dstmm"]
35-
atlas = ExtResource("6_dstmm")
34+
[sub_resource type="AtlasTexture" id="AtlasTexture_byt3c"]
35+
atlas = ExtResource("4_4gc0b")
3636
region = Rect2(192, 0, 96, 96)
3737

38+
[sub_resource type="AtlasTexture" id="AtlasTexture_kccyr"]
39+
atlas = ExtResource("4_4gc0b")
40+
region = Rect2(96, 0, 96, 96)
41+
3842
[sub_resource type="SpriteFrames" id="SpriteFrames_beu7u"]
3943
resource_local_to_scene = true
4044
animations = [{
4145
"frames": [{
4246
"duration": 10.0,
43-
"texture": SubResource("AtlasTexture_4gc0b")
47+
"texture": SubResource("AtlasTexture_tidpj")
4448
}, {
4549
"duration": 1.0,
46-
"texture": SubResource("AtlasTexture_yd672")
50+
"texture": SubResource("AtlasTexture_hurny")
4751
}, {
4852
"duration": 8.0,
49-
"texture": SubResource("AtlasTexture_dstmm")
53+
"texture": SubResource("AtlasTexture_byt3c")
5054
}, {
5155
"duration": 1.0,
52-
"texture": SubResource("AtlasTexture_yd672")
56+
"texture": SubResource("AtlasTexture_kccyr")
5357
}],
5458
"loop": true,
5559
"name": &"idle",
5660
"speed": 10.0
5761
}]
5862

59-
[sub_resource type="AtlasTexture" id="AtlasTexture_beu7u"]
60-
atlas = ExtResource("6_u5ew7")
63+
[sub_resource type="AtlasTexture" id="AtlasTexture_syy7w"]
64+
atlas = ExtResource("10_tidpj")
6165
region = Rect2(0, 0, 96, 96)
6266

63-
[sub_resource type="AtlasTexture" id="AtlasTexture_m2wva"]
64-
atlas = ExtResource("6_u5ew7")
67+
[sub_resource type="AtlasTexture" id="AtlasTexture_4rgc5"]
68+
atlas = ExtResource("10_tidpj")
6569
region = Rect2(96, 0, 96, 96)
6670

67-
[sub_resource type="AtlasTexture" id="AtlasTexture_u5ew7"]
68-
atlas = ExtResource("6_u5ew7")
71+
[sub_resource type="AtlasTexture" id="AtlasTexture_umw6f"]
72+
atlas = ExtResource("10_tidpj")
6973
region = Rect2(192, 0, 96, 96)
7074

71-
[sub_resource type="AtlasTexture" id="AtlasTexture_1in01"]
72-
atlas = ExtResource("6_u5ew7")
75+
[sub_resource type="AtlasTexture" id="AtlasTexture_hskxo"]
76+
atlas = ExtResource("10_tidpj")
7377
region = Rect2(96, 0, 96, 96)
7478

7579
[sub_resource type="SpriteFrames" id="SpriteFrames_6q5fn"]
7680
resource_local_to_scene = true
7781
animations = [{
7882
"frames": [{
7983
"duration": 10.0,
80-
"texture": SubResource("AtlasTexture_beu7u")
84+
"texture": SubResource("AtlasTexture_syy7w")
8185
}, {
8286
"duration": 1.0,
83-
"texture": SubResource("AtlasTexture_m2wva")
87+
"texture": SubResource("AtlasTexture_4rgc5")
8488
}, {
8589
"duration": 8.0,
86-
"texture": SubResource("AtlasTexture_u5ew7")
90+
"texture": SubResource("AtlasTexture_umw6f")
8791
}, {
8892
"duration": 1.0,
89-
"texture": SubResource("AtlasTexture_1in01")
93+
"texture": SubResource("AtlasTexture_hskxo")
9094
}],
9195
"loop": true,
9296
"name": &"idle",
9397
"speed": 10.0
9498
}]
9599

96-
[sub_resource type="AtlasTexture" id="AtlasTexture_82egq"]
97-
atlas = ExtResource("9_82egq")
100+
[sub_resource type="AtlasTexture" id="AtlasTexture_vw3e6"]
101+
atlas = ExtResource("14_rh0s3")
98102
region = Rect2(0, 0, 96, 96)
99103

100-
[sub_resource type="AtlasTexture" id="AtlasTexture_vqjnd"]
101-
atlas = ExtResource("9_82egq")
104+
[sub_resource type="AtlasTexture" id="AtlasTexture_35r5d"]
105+
atlas = ExtResource("14_rh0s3")
102106
region = Rect2(96, 0, 96, 96)
103107

104-
[sub_resource type="AtlasTexture" id="AtlasTexture_ynrks"]
105-
atlas = ExtResource("9_82egq")
108+
[sub_resource type="AtlasTexture" id="AtlasTexture_r7ycj"]
109+
atlas = ExtResource("14_rh0s3")
106110
region = Rect2(192, 0, 96, 96)
107111

108-
[sub_resource type="AtlasTexture" id="AtlasTexture_iqfub"]
109-
atlas = ExtResource("9_82egq")
112+
[sub_resource type="AtlasTexture" id="AtlasTexture_hbfaq"]
113+
atlas = ExtResource("14_rh0s3")
110114
region = Rect2(96, 0, 96, 96)
111115

112116
[sub_resource type="SpriteFrames" id="SpriteFrames_vq5og"]
113117
resource_local_to_scene = true
114118
animations = [{
115119
"frames": [{
116120
"duration": 10.0,
117-
"texture": SubResource("AtlasTexture_82egq")
121+
"texture": SubResource("AtlasTexture_vw3e6")
118122
}, {
119123
"duration": 1.0,
120-
"texture": SubResource("AtlasTexture_vqjnd")
124+
"texture": SubResource("AtlasTexture_35r5d")
121125
}, {
122126
"duration": 8.0,
123-
"texture": SubResource("AtlasTexture_ynrks")
127+
"texture": SubResource("AtlasTexture_r7ycj")
124128
}, {
125129
"duration": 1.0,
126-
"texture": SubResource("AtlasTexture_iqfub")
130+
"texture": SubResource("AtlasTexture_hbfaq")
127131
}],
128132
"loop": true,
129133
"name": &"idle",
130134
"speed": 10.0
131135
}]
132136

133-
[sub_resource type="AtlasTexture" id="AtlasTexture_tidpj"]
137+
[sub_resource type="AtlasTexture" id="AtlasTexture_5y6le"]
134138
atlas = ExtResource("12_4gc0b")
135139
region = Rect2(0, 0, 96, 96)
136140

137-
[sub_resource type="AtlasTexture" id="AtlasTexture_hurny"]
141+
[sub_resource type="AtlasTexture" id="AtlasTexture_xhyk4"]
138142
atlas = ExtResource("12_4gc0b")
139143
region = Rect2(96, 0, 96, 96)
140144

141-
[sub_resource type="AtlasTexture" id="AtlasTexture_byt3c"]
145+
[sub_resource type="AtlasTexture" id="AtlasTexture_fo0h8"]
142146
atlas = ExtResource("12_4gc0b")
143147
region = Rect2(192, 0, 96, 96)
144148

149+
[sub_resource type="AtlasTexture" id="AtlasTexture_k8jmh"]
150+
atlas = ExtResource("12_4gc0b")
151+
region = Rect2(96, 0, 96, 96)
152+
145153
[sub_resource type="SpriteFrames" id="SpriteFrames_m2wva"]
146154
resource_local_to_scene = true
147155
animations = [{
148156
"frames": [{
149157
"duration": 10.0,
150-
"texture": SubResource("AtlasTexture_tidpj")
158+
"texture": SubResource("AtlasTexture_5y6le")
151159
}, {
152160
"duration": 1.0,
153-
"texture": SubResource("AtlasTexture_hurny")
161+
"texture": SubResource("AtlasTexture_xhyk4")
154162
}, {
155163
"duration": 8.0,
156-
"texture": SubResource("AtlasTexture_byt3c")
164+
"texture": SubResource("AtlasTexture_fo0h8")
157165
}, {
158166
"duration": 1.0,
159-
"texture": SubResource("AtlasTexture_hurny")
167+
"texture": SubResource("AtlasTexture_k8jmh")
160168
}],
161169
"loop": true,
162170
"name": &"idle",
163171
"speed": 10.0
164172
}]
165173

174+
[sub_resource type="ColorPalette" id="ColorPalette_tidpj"]
175+
colors = PackedColorArray(0.8152, 0.6608, 0.43840003, 1, 0.769, 0.576, 0.298, 1, 0.6152, 0.4608, 0.23840001, 1, 0.6784, 0.45920002, 0.4232, 1, 0.598, 0.324, 0.279, 1, 0.4784, 0.2592, 0.22320001, 1, 0.3416, 0.47280002, 0.6336, 1, 0.177, 0.341, 0.542, 1, 0.1416, 0.2728, 0.4336, 1)
176+
166177
[node name="Townie" type="CharacterBody2D" unique_id=1098678013]
167178
material = ExtResource("1_nj51j")
168179
instance_shader_parameters/shade_high_new = Color(0.9056, 0.7616, 0.7928, 1)
@@ -171,6 +182,7 @@ instance_shader_parameters/shade_medium_new = Color(0.882, 0.702, 0.741, 1)
171182
collision_layer = 2
172183
collision_mask = 0
173184
script = ExtResource("2_xf1o5")
185+
character_seed = 622896973
174186

175187
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=128596675]
176188
rotation = -1.5707964
@@ -210,6 +222,7 @@ textures = Array[Texture2D]([ExtResource("6_u5ew7"), ExtResource("6_vqjnd"), Ext
210222
sprite = NodePath("..")
211223

212224
[node name="AnimatedSprite2DHead" type="AnimatedSprite2D" parent="CanvasGroup/AnimatedSprite2DLegs/AnimatedSprite2DBody" unique_id=421503015]
225+
position = Vector2(-4, -16)
213226
sprite_frames = SubResource("SpriteFrames_vq5og")
214227
animation = &"idle"
215228
autoplay = "idle"
@@ -236,6 +249,5 @@ metadata/_custom_type_script = "uid://boyesrjdix688"
236249
unique_name_in_owner = true
237250
script = ExtResource("2_nj51j")
238251
node_to_recolor = NodePath("..")
239-
high_color = Color(0.91999996, 0.91999996, 0.2, 1)
240-
low_color = Color(0.71999997, 0.71999997, 0, 1)
252+
output_palette = SubResource("ColorPalette_tidpj")
241253
metadata/_custom_type_script = "uid://c0a7xf5qx8p4y"

0 commit comments

Comments
 (0)