This commit is contained in:
Bryce
2026-02-21 12:18:48 -08:00
parent ff6d30259b
commit d6b36d1f13
97 changed files with 2329 additions and 68 deletions

View File

@@ -47,20 +47,30 @@ Reference the template import file, remember to use create_uid.py to create a ui
### Step 5: Update .tscn File - Transition Pieces
When adding a transition piece to the CURRENT room that leads to a DESTINATION room:
## CRITICAL: Transition Naming Convention
- **Node name**: The node name should match the destination room name (e.g., `kq4_016_graveyard`)
- **target**: The SCENE UID of the destination room (from the destination's .tscn file)
- **appear_at_node**: The NAME of the transition node in the DESTINATION room that leads BACK to the current room. This is almost always the name of the current room, as it it is saying which exit in the destination room to transition move the player to.
- **label**: Human-readable name for the destination (e.g., "Graveyard")
### Node Naming Rule
**ALWAYS name transition nodes after their DESTINATION room, NEVER use generic directional names.**
Example - Adding a south exit from room 010 to room 016:
| CORRECT | WRONG |
|---------|-------|
| `kq4_016_graveyard` | `north_exit` |
| `kq4_003_fountain_pool` | `south_exit` |
| `kq4_010_forest_path` | `east_exit` |
| `kq4_009_shady_wooded_area` | `west_exit` |
### appear_at_node Rule
The `appear_at_node` should be the name of the transition node in the DESTINATION room that leads back to the CURRENT room. Following the naming convention, this is always the current room's name.
### Example - Adding a south exit from room 010 to room 016:
In Room 010 (`kq4_010_forest_path.tscn`):
```gdscript
[node name="kq4_016_graveyard" parent="." instance=ExtResource("4_abc")]
position = Vector2(910, 542)
polygon = PackedVector2Array(-108, 454, -87, 649, 376, 658, 348, 381)
appear_at_node = "kq4_010_forest_path" # Name of transition in ROOM 016 that goes back to 010
target = "uid://621uqunr9pm" # Scene UID of room 016
appear_at_node = "kq4_010_forest_path" # This is the CURRENT room's name
target = "uid://27b2k6gky3afg" # Scene UID of destination room 016
label = "Graveyard"
[node name="entrance" parent="kq4_016_graveyard" index="0"]
@@ -68,40 +78,27 @@ position = Vector2(118, 514)
[node name="exit" parent="kq4_016_graveyard" index="1"]
position = Vector2(151, 615)
```
Then add the signal connection in the current room:
```gdscript
[connection signal="interacted" from="kq4_016_graveyard" to="." method="_on_graveyard_interacted"]
```
And add the handler in the current room's .gd file:
Then add the handler in Room 010's .gd file:
```gdscript
func _on_graveyard_interacted() -> void:
$kq4_016_graveyard.default_script(self)
$kq4_016_graveyard.default_script(self)
```
### Step 6: Update .gd File
Remove template functions and add only handlers for connected rooms:
```gdscript
extends Scene
### Step 6: Update the Destination Room (Bidirectional Transitions)
**Every transition MUST have a corresponding return transition in the destination room.**
func _on_forest_path_interacted() -> void:
$kq4_010_forest_path.default_script(self)
```
### Step 7: Update the Destination Room
For each exit you add, you need to add a corresponding transition in the DESTINATION room that leads back to the current room.
Example - In room 016 (Graveyard), add north exit back to room 010:
In Room 016 (`kq4_016_graveyard.tscn`), add the return transition:
```gdscript
[node name="kq4_010_forest_path" parent="." instance=ExtResource("4_abc")]
position = Vector2(910, -213)
polygon = PackedVector2Array(-108, 454, -87, 649, 376, 658, 348, 381)
appear_at_node = "kq4_010_forest_path" # Name of THIS transition (room 016's exit to 010)
target = "uid://bxsxv6esxljit" # Scene UID of room 010 (the room we're going TO)
appear_at_node = "kq4_016_graveyard" # This is the CURRENT room's name (016)
target = "uid://3ujj97iw54vo5" # Scene UID of destination room 010
label = "Forest Path"
[node name="entrance" parent="kq4_010_forest_path" index="0"]
@@ -113,19 +110,31 @@ position = Vector2(174, 519)
[connection signal="interacted" from="kq4_010_forest_path" to="." method="_on_forest_path_interacted"]
```
Then add the handler in room 016's .gd file:
Then add the handler in Room 016's .gd file:
```gdscript
func _on_forest_path_interacted() -> void:
$kq4_010_forest_path.default_script(self)
$kq4_010_forest_path.default_script(self)
```
### Summary: target vs appear_at_node
### Step 7: Run the Exit Checker Skill
Run the exit checker skill on the new room, as well as all rooms that you wired up to the new room.
| Field | Value | Meaning |
## Quick Reference: Transition Fields
| Field | Value | Example |
|-------|-------|---------|
| `target` | Scene UID of destination room | Which scene to load |
| `appear_at_node` | Node name of exit in destination room | Which transition in that scene should appear at
| Node name | Destination room name | `kq4_016_graveyard` |
| `target` | Scene UID of destination | `uid://27b2k6gky3afg` |
| `appear_at_node` | CURRENT room name | `kq4_010_forest_path` |
| `label` | Human-readable destination name | `Graveyard` |
## Common Mistakes to Avoid
1. **Generic node names**: Never use `north_exit`, `south_exit`, etc.
2. **Wrong appear_at_node**: Should be the CURRENT room name, not the destination
3. **Missing return transition**: Always add the bidirectional transition
4. **Duplicate nodes**: Never have two transitions with the same node name
5. **Wrong target UID**: Always verify the UID matches the destination scene
## Room Number Mapping
Reference the spec for cardinal direction matches