@jarrodmedrano/claude-skills 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/bevy/SKILL.md +406 -0
- package/.claude/skills/bevy/references/bevy_specific_tips.md +385 -0
- package/.claude/skills/bevy/references/common_pitfalls.md +217 -0
- package/.claude/skills/bevy/references/ecs_patterns.md +277 -0
- package/.claude/skills/bevy/references/project_structure.md +116 -0
- package/.claude/skills/bevy/references/ui_development.md +147 -0
- package/.claude/skills/domain-driven-design/SKILL.md +459 -0
- package/.claude/skills/domain-driven-design/references/ddd_foundations_and_patterns.md +664 -0
- package/.claude/skills/domain-driven-design/references/rich_hickey_principles.md +406 -0
- package/.claude/skills/domain-driven-design/references/visualization_examples.md +790 -0
- package/.claude/skills/domain-driven-design/references/wlaschin_patterns.md +639 -0
- package/.claude/skills/godot/SKILL.md +728 -0
- package/.claude/skills/godot/assets/templates/attribute_template.gd +109 -0
- package/.claude/skills/godot/assets/templates/component_template.gd +76 -0
- package/.claude/skills/godot/assets/templates/interaction_template.gd +108 -0
- package/.claude/skills/godot/assets/templates/item_resource.tres +11 -0
- package/.claude/skills/godot/assets/templates/spell_resource.tres +20 -0
- package/.claude/skills/godot/references/architecture-patterns.md +608 -0
- package/.claude/skills/godot/references/common-pitfalls.md +518 -0
- package/.claude/skills/godot/references/file-formats.md +491 -0
- package/.claude/skills/godot/references/godot4-physics-api.md +302 -0
- package/.claude/skills/godot/scripts/validate_tres.py +145 -0
- package/.claude/skills/godot/scripts/validate_tscn.py +170 -0
- package/.claude/skills/react-three-fiber/SKILL.md +2055 -0
- package/.claude/skills/react-three-fiber/scripts/build-scene.ts +171 -0
- package/package.json +1 -1
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
# Godot File Formats Reference
|
|
2
|
+
|
|
3
|
+
This reference provides detailed syntax information for Godot's text-based file formats.
|
|
4
|
+
|
|
5
|
+
## GDScript Files (.gd)
|
|
6
|
+
|
|
7
|
+
Standard Python-like script files. Full GDScript syntax is supported.
|
|
8
|
+
|
|
9
|
+
### Basic Structure
|
|
10
|
+
|
|
11
|
+
```gdscript
|
|
12
|
+
extends BaseClass
|
|
13
|
+
class_name MyClass
|
|
14
|
+
|
|
15
|
+
signal my_signal(param: Type)
|
|
16
|
+
|
|
17
|
+
@export var speed: float = 5.0
|
|
18
|
+
@export_group("Combat")
|
|
19
|
+
@export var damage: int = 10
|
|
20
|
+
|
|
21
|
+
var _internal_var: String = ""
|
|
22
|
+
|
|
23
|
+
func _ready() -> void:
|
|
24
|
+
print("Ready")
|
|
25
|
+
|
|
26
|
+
func my_function(param: int) -> bool:
|
|
27
|
+
return param > 0
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Key Features
|
|
31
|
+
- Full object-oriented programming
|
|
32
|
+
- Type hints (optional but recommended)
|
|
33
|
+
- Signals for event-driven communication
|
|
34
|
+
- Export variables for Inspector editing
|
|
35
|
+
- Inheritance with `extends`
|
|
36
|
+
- Class naming with `class_name`
|
|
37
|
+
|
|
38
|
+
## Scene Files (.tscn)
|
|
39
|
+
|
|
40
|
+
Text serialization of scene node hierarchies. **STRICT FORMATTING REQUIRED**.
|
|
41
|
+
|
|
42
|
+
### File Structure
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
[gd_scene load_steps=N format=3 uid="uid://..."]
|
|
46
|
+
|
|
47
|
+
[ext_resource type="Type" path="res://path" id="1_name"]
|
|
48
|
+
[ext_resource type="Type" path="res://path" id="2_other"]
|
|
49
|
+
|
|
50
|
+
[sub_resource type="SomeType" id="SubResource_1"]
|
|
51
|
+
property = value
|
|
52
|
+
|
|
53
|
+
[node name="Root" type="NodeType"]
|
|
54
|
+
script = ExtResource("1_name")
|
|
55
|
+
property = value
|
|
56
|
+
|
|
57
|
+
[node name="Child" type="ChildType" parent="."]
|
|
58
|
+
property = value
|
|
59
|
+
|
|
60
|
+
[node name="Grandchild" type="Node" parent="Child"]
|
|
61
|
+
another_property = 123
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Critical Rules
|
|
65
|
+
|
|
66
|
+
#### 1. Header Format
|
|
67
|
+
```
|
|
68
|
+
[gd_scene load_steps=3 format=3 uid="uid://unique_identifier"]
|
|
69
|
+
```
|
|
70
|
+
- `load_steps`: Number of resources to load (ExtResource + SubResource count)
|
|
71
|
+
- `format`: Always 3 for Godot 4.x
|
|
72
|
+
- `uid`: Unique identifier (DO NOT change - breaks references)
|
|
73
|
+
|
|
74
|
+
#### 2. ExtResource Declarations
|
|
75
|
+
```
|
|
76
|
+
[ext_resource type="Script" path="res://src/my_script.gd" id="1_script"]
|
|
77
|
+
[ext_resource type="PackedScene" path="res://scenes/other.tscn" id="2_scene"]
|
|
78
|
+
```
|
|
79
|
+
- Must be declared before use
|
|
80
|
+
- `id` format: `number_descriptive_name`
|
|
81
|
+
- Common types: `Script`, `PackedScene`, `Texture2D`, `Material`
|
|
82
|
+
|
|
83
|
+
#### 3. ExtResource References
|
|
84
|
+
```
|
|
85
|
+
script = ExtResource("1_script")
|
|
86
|
+
texture = ExtResource("3_texture")
|
|
87
|
+
```
|
|
88
|
+
- **NEVER use `preload()`** - that's GDScript syntax
|
|
89
|
+
- **ALWAYS use `ExtResource("id")`**
|
|
90
|
+
|
|
91
|
+
#### 4. SubResource Declarations
|
|
92
|
+
```
|
|
93
|
+
[sub_resource type="BoxShape3D" id="SubResource_collision"]
|
|
94
|
+
size = Vector3(1, 2, 1)
|
|
95
|
+
```
|
|
96
|
+
- For resources defined inline within the scene
|
|
97
|
+
- Referenced with `SubResource("id")`
|
|
98
|
+
|
|
99
|
+
#### 5. Node Hierarchy
|
|
100
|
+
```
|
|
101
|
+
[node name="Player" type="CharacterBody3D"]
|
|
102
|
+
script = ExtResource("1_player")
|
|
103
|
+
|
|
104
|
+
[node name="CollisionShape" type="CollisionShape3D" parent="."]
|
|
105
|
+
shape = SubResource("SubResource_collision")
|
|
106
|
+
|
|
107
|
+
[node name="Model" type="MeshInstance3D" parent="."]
|
|
108
|
+
mesh = ExtResource("2_mesh")
|
|
109
|
+
|
|
110
|
+
[node name="Texture" type="Sprite2D" parent="Model"]
|
|
111
|
+
texture = ExtResource("3_texture")
|
|
112
|
+
```
|
|
113
|
+
- Root node: no parent
|
|
114
|
+
- Direct children: `parent="."`
|
|
115
|
+
- Nested children: `parent="ParentNodeName"`
|
|
116
|
+
- Deep nesting: `parent="Parent/Child"`
|
|
117
|
+
|
|
118
|
+
#### 6. Scene Instancing
|
|
119
|
+
```
|
|
120
|
+
[node name="Enemy" type="Node3D"]
|
|
121
|
+
|
|
122
|
+
[node name="BaseEnemy" parent="." instance=ExtResource("5_enemy_scene")]
|
|
123
|
+
|
|
124
|
+
[node name="SomeChild" parent="BaseEnemy" index="2"]
|
|
125
|
+
property = "modified value"
|
|
126
|
+
```
|
|
127
|
+
- `instance=ExtResource()`: Instantiate another scene
|
|
128
|
+
- `index="N"`: Modify instanced scene's child (see Instance Property Overrides below)
|
|
129
|
+
|
|
130
|
+
### Instance Property Overrides
|
|
131
|
+
|
|
132
|
+
**CRITICAL CONCEPT**: When you instance a scene in a .tscn file, the instance starts with ALL default property values from the source scene. To customize an instance, you MUST explicitly override properties using special syntax.
|
|
133
|
+
|
|
134
|
+
#### The Problem
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
# item_pickup.tscn (source scene)
|
|
138
|
+
[node name="ItemPickup" type="StaticBody3D"]
|
|
139
|
+
|
|
140
|
+
[node name="PickupInteraction" type="Node" parent="."]
|
|
141
|
+
script = ExtResource("1_pickup")
|
|
142
|
+
item_resource = null # Default value
|
|
143
|
+
quantity = 1
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
If you instance this scene WITHOUT overriding properties:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
# level.tscn
|
|
150
|
+
[node name="KeyPickup" parent="." instance=ExtResource("6_pickup")]
|
|
151
|
+
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
The `item_resource` will be `null` - the instance uses the default! This is a common source of bugs.
|
|
155
|
+
|
|
156
|
+
#### The Solution: Property Overrides
|
|
157
|
+
|
|
158
|
+
To customize an instanced scene's child nodes, use the `index` parameter:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
# level.tscn
|
|
162
|
+
[ext_resource type="PackedScene" path="res://scenes/item_pickup.tscn" id="6_pickup"]
|
|
163
|
+
[ext_resource type="Resource" path="res://resources/test_key.tres" id="7_key"]
|
|
164
|
+
|
|
165
|
+
[node name="KeyPickup" parent="." instance=ExtResource("6_pickup")]
|
|
166
|
+
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 3)
|
|
167
|
+
|
|
168
|
+
[node name="PickupInteraction" parent="KeyPickup" index="0"]
|
|
169
|
+
item_resource = ExtResource("7_key")
|
|
170
|
+
quantity = 1
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Key points:**
|
|
174
|
+
- `parent="KeyPickup"` - References the instanced scene node
|
|
175
|
+
- `index="0"` - Indicates this is modifying the first child (0-indexed)
|
|
176
|
+
- Property assignments override the defaults
|
|
177
|
+
|
|
178
|
+
#### Finding the Correct Index
|
|
179
|
+
|
|
180
|
+
The `index` parameter corresponds to the child's position in the parent's child list (0-indexed). To find it:
|
|
181
|
+
|
|
182
|
+
1. **Open the source scene** in the Godot editor
|
|
183
|
+
2. **Look at the Scene tree** - the order of children determines the index
|
|
184
|
+
3. **Count from 0** - first child is `index="0"`, second is `index="1"`, etc.
|
|
185
|
+
|
|
186
|
+
Or examine the source .tscn file to see the node order.
|
|
187
|
+
|
|
188
|
+
#### Multiple Property Overrides
|
|
189
|
+
|
|
190
|
+
You can override multiple children of an instance:
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
[node name="Door" parent="." instance=ExtResource("5_door")]
|
|
194
|
+
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0)
|
|
195
|
+
|
|
196
|
+
[node name="DoorInteraction" parent="Door" index="0"]
|
|
197
|
+
required_key = "gold_key"
|
|
198
|
+
interaction_text = "Unlock Gold Door"
|
|
199
|
+
|
|
200
|
+
[node name="MeshInstance3D" parent="Door" index="1"]
|
|
201
|
+
material_override = ExtResource("8_gold_material")
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
#### Common Patterns
|
|
205
|
+
|
|
206
|
+
**Configuring pickup items:**
|
|
207
|
+
```
|
|
208
|
+
[node name="HealthPotion" parent="." instance=ExtResource("6_pickup")]
|
|
209
|
+
|
|
210
|
+
[node name="PickupInteraction" parent="HealthPotion" index="0"]
|
|
211
|
+
item_resource = ExtResource("7_health_potion")
|
|
212
|
+
quantity = 3
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Configuring doors:**
|
|
216
|
+
```
|
|
217
|
+
[node name="LockedDoor" parent="." instance=ExtResource("5_door")]
|
|
218
|
+
|
|
219
|
+
[node name="DoorInteraction" parent="LockedDoor" index="0"]
|
|
220
|
+
starts_locked = true
|
|
221
|
+
required_key = "dungeon_key"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Configuring enemy spawns:**
|
|
225
|
+
```
|
|
226
|
+
[node name="BossSlime" parent="." instance=ExtResource("8_slime")]
|
|
227
|
+
|
|
228
|
+
[node name="Slime" parent="BossSlime" index="0"]
|
|
229
|
+
max_health = 200.0
|
|
230
|
+
move_speed = 3.0
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### When NOT to Use Index
|
|
234
|
+
|
|
235
|
+
Don't use `index` for properties on the root node of the instance - those can be set directly:
|
|
236
|
+
|
|
237
|
+
```
|
|
238
|
+
# ✅ CORRECT - Root node properties set directly
|
|
239
|
+
[node name="Slime" parent="." instance=ExtResource("8_slime")]
|
|
240
|
+
max_health = 50.0
|
|
241
|
+
move_speed = 2.0
|
|
242
|
+
|
|
243
|
+
# ❌ WRONG - Don't use index for root properties
|
|
244
|
+
[node name="Slime" parent="." instance=ExtResource("8_slime")]
|
|
245
|
+
|
|
246
|
+
[node name="Slime" parent="Slime" index="0"] # This is confusing and wrong!
|
|
247
|
+
max_health = 50.0
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Safe vs Risky Edits
|
|
251
|
+
|
|
252
|
+
#### ✅ SAFE Edits
|
|
253
|
+
```
|
|
254
|
+
# Add new ExtResource declaration
|
|
255
|
+
[ext_resource type="Script" path="res://new.gd" id="10_new"]
|
|
256
|
+
|
|
257
|
+
# Modify simple property values
|
|
258
|
+
[node name="Player"]
|
|
259
|
+
move_speed = 6.0
|
|
260
|
+
|
|
261
|
+
# Add new top-level node
|
|
262
|
+
[node name="NewNode" type="Node" parent="."]
|
|
263
|
+
script = ExtResource("10_new")
|
|
264
|
+
|
|
265
|
+
# Add new child to existing node
|
|
266
|
+
[node name="Component" type="Node" parent="Player"]
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### ⚠️ RISKY Edits
|
|
270
|
+
```
|
|
271
|
+
# Modifying instanced scene children (can break on editor re-save)
|
|
272
|
+
[node name="Mesh" parent="Enemy/Model" index="3"]
|
|
273
|
+
|
|
274
|
+
# Complex node restructuring
|
|
275
|
+
# Moving nodes between parents
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
#### ❌ DANGEROUS - Never Do
|
|
279
|
+
```
|
|
280
|
+
# Changing UIDs (breaks all references)
|
|
281
|
+
uid="uid://different_id"
|
|
282
|
+
|
|
283
|
+
# Deleting ExtResource declarations still in use
|
|
284
|
+
# Restructuring instanced scenes heavily
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
## Resource Files (.tres)
|
|
288
|
+
|
|
289
|
+
Serialized resource data. **NO GDSCRIPT SYNTAX ALLOWED**.
|
|
290
|
+
|
|
291
|
+
### File Structure
|
|
292
|
+
|
|
293
|
+
```
|
|
294
|
+
[gd_resource type="Resource" script_class="ClassName" load_steps=N format=3 uid="uid://..."]
|
|
295
|
+
|
|
296
|
+
[ext_resource type="Script" path="res://path/to/script.gd" id="1_script"]
|
|
297
|
+
|
|
298
|
+
[sub_resource type="Resource" id="SubRes_1"]
|
|
299
|
+
script = ExtResource("1_script")
|
|
300
|
+
property = value
|
|
301
|
+
|
|
302
|
+
[resource]
|
|
303
|
+
script = ExtResource("1_script")
|
|
304
|
+
property1 = "value"
|
|
305
|
+
property2 = 42
|
|
306
|
+
nested_resource = SubResource("SubRes_1")
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Critical Rules
|
|
310
|
+
|
|
311
|
+
#### 1. NO GDScript Syntax
|
|
312
|
+
```
|
|
313
|
+
# ❌ WRONG - GDScript syntax not allowed
|
|
314
|
+
script = preload("res://script.gd")
|
|
315
|
+
var my_value = 10
|
|
316
|
+
const SPEED = 5.0
|
|
317
|
+
func do_something():
|
|
318
|
+
pass
|
|
319
|
+
|
|
320
|
+
# ✅ CORRECT - Resource syntax only
|
|
321
|
+
script = ExtResource("1_script")
|
|
322
|
+
my_value = 10
|
|
323
|
+
speed = 5.0
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
#### 2. ExtResource for External References
|
|
327
|
+
```
|
|
328
|
+
# ❌ WRONG
|
|
329
|
+
[resource]
|
|
330
|
+
script = preload("res://spell_effect.gd")
|
|
331
|
+
|
|
332
|
+
# ✅ CORRECT
|
|
333
|
+
[ext_resource type="Script" path="res://spell_effect.gd" id="1_effect"]
|
|
334
|
+
|
|
335
|
+
[resource]
|
|
336
|
+
script = ExtResource("1_effect")
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
#### 3. SubResource for Nested Resources
|
|
340
|
+
```
|
|
341
|
+
# Declare SubResource first
|
|
342
|
+
[sub_resource type="Resource" id="Effect_1"]
|
|
343
|
+
script = ExtResource("1_effect_script")
|
|
344
|
+
magnitude = 10.0
|
|
345
|
+
|
|
346
|
+
# Use in main resource
|
|
347
|
+
[resource]
|
|
348
|
+
script = ExtResource("1_main_script")
|
|
349
|
+
effect = SubResource("Effect_1")
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
#### 4. Typed Arrays
|
|
353
|
+
```
|
|
354
|
+
# ❌ WRONG - Untyped array
|
|
355
|
+
effects = [SubResource("Effect_1"), SubResource("Effect_2")]
|
|
356
|
+
|
|
357
|
+
# ✅ CORRECT - Must specify type
|
|
358
|
+
effects = Array[Resource]([SubResource("Effect_1"), SubResource("Effect_2")])
|
|
359
|
+
|
|
360
|
+
# ✅ ALSO CORRECT - Using ExtResource for type
|
|
361
|
+
[ext_resource type="Script" path="res://effect.gd" id="2_effect"]
|
|
362
|
+
effects = Array[ExtResource("2_effect")]([SubResource("Effect_1")])
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### 5. Common Data Types
|
|
366
|
+
```
|
|
367
|
+
# Primitives
|
|
368
|
+
my_int = 42
|
|
369
|
+
my_float = 3.14
|
|
370
|
+
my_bool = true
|
|
371
|
+
my_string = "text"
|
|
372
|
+
|
|
373
|
+
# Vectors
|
|
374
|
+
position = Vector2(10, 20)
|
|
375
|
+
position3d = Vector3(1, 2, 3)
|
|
376
|
+
|
|
377
|
+
# Colors
|
|
378
|
+
color = Color(1, 0, 0, 1) # RGBA
|
|
379
|
+
color_hex = Color("#ff0000")
|
|
380
|
+
|
|
381
|
+
# Arrays
|
|
382
|
+
numbers = Array[int]([1, 2, 3])
|
|
383
|
+
strings = Array[String](["a", "b", "c"])
|
|
384
|
+
|
|
385
|
+
# Resources
|
|
386
|
+
script = ExtResource("1_script")
|
|
387
|
+
nested = SubResource("SubRes_1")
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### Complete Example
|
|
391
|
+
|
|
392
|
+
```tres
|
|
393
|
+
[gd_resource type="Resource" script_class="SpellResource" load_steps=4 format=3 uid="uid://abc123"]
|
|
394
|
+
|
|
395
|
+
[ext_resource type="Script" path="res://src/spells/spell_resource.gd" id="1_spell"]
|
|
396
|
+
[ext_resource type="Script" path="res://src/spells/spell_effect.gd" id="2_effect"]
|
|
397
|
+
|
|
398
|
+
[sub_resource type="Resource" id="Effect_damage"]
|
|
399
|
+
script = ExtResource("2_effect")
|
|
400
|
+
effect_type = 0
|
|
401
|
+
magnitude_min = 15.0
|
|
402
|
+
magnitude_max = 25.0
|
|
403
|
+
duration = 0.0
|
|
404
|
+
|
|
405
|
+
[sub_resource type="Resource" id="Effect_slow"]
|
|
406
|
+
script = ExtResource("2_effect")
|
|
407
|
+
effect_type = 12
|
|
408
|
+
magnitude_min = 50.0
|
|
409
|
+
magnitude_max = 50.0
|
|
410
|
+
duration = 3.0
|
|
411
|
+
|
|
412
|
+
[resource]
|
|
413
|
+
script = ExtResource("1_spell")
|
|
414
|
+
spell_name = "Ice Bolt"
|
|
415
|
+
spell_id = "ice_bolt"
|
|
416
|
+
mana_cost = 20.0
|
|
417
|
+
spell_color = Color(0.5, 0.7, 1, 1)
|
|
418
|
+
projectile_speed = 15.0
|
|
419
|
+
effects = Array[ExtResource("2_effect")]([SubResource("Effect_damage"), SubResource("Effect_slow")])
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
## Common Mistakes Reference
|
|
423
|
+
|
|
424
|
+
### 1. preload() in .tres/.tscn
|
|
425
|
+
```
|
|
426
|
+
# ❌ WRONG
|
|
427
|
+
script = preload("res://script.gd")
|
|
428
|
+
|
|
429
|
+
# ✅ CORRECT
|
|
430
|
+
[ext_resource type="Script" path="res://script.gd" id="1"]
|
|
431
|
+
script = ExtResource("1")
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### 2. GDScript Keywords in .tres
|
|
435
|
+
```
|
|
436
|
+
# ❌ WRONG
|
|
437
|
+
var speed = 5.0
|
|
438
|
+
const MAX_HEALTH = 100
|
|
439
|
+
|
|
440
|
+
# ✅ CORRECT
|
|
441
|
+
speed = 5.0
|
|
442
|
+
max_health = 100
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### 3. Untyped Arrays in .tres
|
|
446
|
+
```
|
|
447
|
+
# ❌ WRONG
|
|
448
|
+
items = [SubResource("Item1"), SubResource("Item2")]
|
|
449
|
+
|
|
450
|
+
# ✅ CORRECT
|
|
451
|
+
items = Array[Resource]([SubResource("Item1"), SubResource("Item2")])
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### 4. Missing ExtResource Declarations
|
|
455
|
+
```
|
|
456
|
+
# ❌ WRONG - Using without declaring
|
|
457
|
+
[node name="Player"]
|
|
458
|
+
script = ExtResource("1_player") # Not declared!
|
|
459
|
+
|
|
460
|
+
# ✅ CORRECT - Declare first
|
|
461
|
+
[ext_resource type="Script" path="res://player.gd" id="1_player"]
|
|
462
|
+
|
|
463
|
+
[node name="Player"]
|
|
464
|
+
script = ExtResource("1_player")
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### 5. Invalid Parent References
|
|
468
|
+
```
|
|
469
|
+
# ❌ WRONG - Parent doesn't exist
|
|
470
|
+
[node name="Child" parent="NonExistentNode"]
|
|
471
|
+
|
|
472
|
+
# ✅ CORRECT - Use valid parent
|
|
473
|
+
[node name="Parent" type="Node"]
|
|
474
|
+
|
|
475
|
+
[node name="Child" parent="Parent"]
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
### 6. Forgetting Instance Property Overrides
|
|
479
|
+
```
|
|
480
|
+
# ❌ WRONG - Instance uses default (null) values
|
|
481
|
+
[node name="KeyPickup" parent="." instance=ExtResource("6_pickup")]
|
|
482
|
+
# item_resource will be null! Pickup won't work!
|
|
483
|
+
|
|
484
|
+
# ✅ CORRECT - Override the property
|
|
485
|
+
[node name="KeyPickup" parent="." instance=ExtResource("6_pickup")]
|
|
486
|
+
|
|
487
|
+
[node name="PickupInteraction" parent="KeyPickup" index="0"]
|
|
488
|
+
item_resource = ExtResource("7_key")
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
**This is a very common bug!** Instanced scenes start with default values. If a scene has configurable components (like PickupInteraction with item_resource, or DoorInteraction with required_key), you MUST override those properties in the instance. See "Instance Property Overrides" section for details.
|