1
- # Route JSON
1
+ # Authoring routes
2
+
3
+ ## Route JSON
2
4
Routes are configured using a JSON file and use "events" generated by SwiftSplit.
3
5
4
6
Here's an example for Old Site Any%:
5
7
``` json
6
8
{
7
9
"useFileTime" : false ,
8
- "reset" : " reset chapter" ,
10
+ "reset" : " leave chapter" ,
9
11
"route" : [
10
12
" enter chapter 2 # Start" ,
11
13
" d8 > d3 # - Mirror" ,
@@ -27,15 +29,21 @@ Events are triggered when SwiftSplit observes a change in the game state, which
27
29
single event may have multiple variants, generally with differing levels of specificity (e.g. ` leave chapter ` ,
28
30
` leave chapter 1 ` , and ` leave a-side 1 ` ).
29
31
32
+ SwiftSplit has an "Event Stream" panel that displays events as they are triggered, which can be useful when creating
33
+ route files. (You can copy the text out of the panel to paste directly into the route file).
34
+
30
35
Note that the * exact* text of an event is important. Spaces and capitalization have to match, with a couple additions:
31
- - Whitespace * around* an event doesn't matter. (e.g. ` "leave chapter" ` is equivalent to ` " leave chapter " ` )
36
+
37
+ - Whitespace * around* an event is ignored. (e.g. ` "leave chapter" ` is equivalent to ` " leave chapter " ` )
32
38
- Inserting an exclamation point (` ! ` ) at the beginning of an event will cause that event to be "silent" and not trigger
33
39
a split. This can be useful for situations like [ expected resets] ( #expected-resets ) .
34
40
- Anything after ` # ` will be trimmed off. This can be useful for explaining events.
35
- - If after applying the previous two rules the event is empty, it's simply ignored. (e.g. ` ! # comment ` will be ignored)
41
+ - If after applying the previous rules the event is empty, it's simply ignored. (e.g. ` ! # comment ` will be ignored)
36
42
37
- SwiftSplit has an "Event Stream" panel that displays events as they are triggered, which can be useful when creating
38
- route files. (You can copy the text out of the panel to paste directly into the route file).
43
+ Bringing this together, ` " ! d8 > d3# other stuff " ` is a valid event, and translates to a silent transition from
44
+ ` d8 ` to ` d3 ` .
45
+
46
+ ## Event list
39
47
40
48
### Chapter start/end events
41
49
- ` leave chapter ` - Triggered when leaving any chapter (either by restarting the chapter, returning to the map, or
@@ -81,10 +89,10 @@ route files. (You can copy the text out of the panel to paste directly into the
81
89
## Return to Map & Save and Quit
82
90
83
91
Without the proper route file, both of these count as resetting a chapter. It's impossible for SwiftSplit to tell the
84
- difference between a reset , return to map, or save and quit. To get around this, you can define in your route where
85
- leaving the chapter is * expected.*
92
+ difference between a restart , return to map, or save and quit. To get around this, you can define in your route where
93
+ leaving the chapter is * expected.* Unless you're triggering a split there, the event should be marked as silent.
86
94
87
- Here's what the reset for the 1A might look like:
95
+ Here's what the reset for the 1A heart might look like:
88
96
``` json
89
97
"route" : [
90
98
" enter chapter 1 # Start" ,
@@ -101,8 +109,8 @@ leave the chapter *you can not automatically reset the run.* Any attempt to rest
101
109
progressing through the route. By putting the collect heart event before the leave chapter event we make sure that
102
110
SwiftSplit only starts waiting for the leave event right before we do it.
103
111
104
- For restarting after collecting berries you'd want to have two events: one when you enter the room you'll save and quit
105
- in, and the next when you collect the berry:
112
+ For restarting after collecting berries you'll probably want to have two events: one when you enter the room you'll
113
+ save and quit in, and the next when you collect the berry
106
114
107
115
``` json
108
116
"route" : [
0 commit comments