1
- # Authoring routes
2
-
3
- ## Route JSON
1
+ # Route JSON
4
2
Routes are configured using a JSON file and use "events" generated by SwiftSplit.
5
3
6
4
Here's an example for Old Site Any%:
7
5
``` json
8
6
{
9
7
"useFileTime" : false ,
10
- "reset" : " leave chapter" ,
8
+ "reset" : " reset chapter" ,
11
9
"route" : [
12
- " enter chapter 2 # Start" ,
13
- " d8 > d3 # - Mirror" ,
14
- " 3x > 3 # Intervention" ,
15
- " 10 > 2 # - Escape" ,
16
- " 13 > end_0 # Awake" ,
10
+ " enter chapter 2 ## Start" ,
11
+ " d8 > d3 ## - Mirror" ,
12
+ " 3x > 3 ## Intervention" ,
13
+ " 10 > 2 ## - Escape" ,
14
+ " 13 > end_0 ## Awake" ,
17
15
" complete chapter 2"
18
16
]
19
17
}
@@ -24,44 +22,47 @@ and triggers splits on those events. The reset event can trigger at any point du
24
22
LiveSplit to reset the run. There are mechanisms in place to allow leaving a chapter mid-run (either via Save and Quit
25
23
or Return to Map). See the [ Expected Resets] ( #expected-resets ) section for more on that.
26
24
27
- ## Events
28
25
Events are triggered when SwiftSplit observes a change in the game state, which is checked 30 times every second. A
29
26
single event may have multiple variants, generally with differing levels of specificity (e.g. ` leave chapter ` ,
30
27
` leave chapter 1 ` , and ` leave a-side 1 ` ).
31
28
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
-
35
29
Note that the * exact* text of an event is important. Spaces and capitalization have to match, with a couple additions:
36
-
37
- - Whitespace * around* an event is ignored. (e.g. ` "leave chapter" ` is equivalent to ` " leave chapter " ` )
38
30
- Inserting an exclamation point (` ! ` ) at the beginning of an event will cause that event to be "silent" and not trigger
39
- a split. This can be useful for situations like [ expected resets ] ( #expected-resets ) .
40
- - Anything after ` # ` will be trimmed off. This can be useful for explaining events.
41
- - If after applying the previous rules the event is empty, it's simply ignored. (e.g. ` ! # comment` will be ignored)
31
+ a split. This can be useful when your route passes between two screens multiple times but you only want one split.
32
+ - Anything after ` ## ` will be trimmed off. This can be useful for explaining events.
33
+ - Any event entries that start with ` # ` will be ignored, allowing you to " comment out" events.
42
34
43
- Bringing this together, ` " ! d8 > d3# other stuff " ` is a valid event, and translates to a silent transition from
44
- ` d8 ` to ` d3 ` .
35
+ SwiftSplit has an "Event Stream" panel that displays events as they are triggered, which can be useful when creating
36
+ route files. (You can copy the text out of the panel to paste directly into the route file too) .
45
37
46
- ## Event list
38
+ ## Events
39
+ Leave events are triggered by restarting the chapter, returning to the map, or using "Save and Quit"
47
40
48
41
### Chapter start/end events
49
- - ` leave chapter ` - Triggered when leaving any chapter (either by restarting the chapter, returning to the map, or
50
- using "Save and Quit")
51
- - ` leave chapter <n> ` - Triggered when leaving chapter ` <n> `
52
42
- ` enter chapter ` - Triggered when any chapter is entered
53
- - ` enter chapter <n> ` - Triggered when chapter ` <n> ` is entered
43
+ - ` leave chapter` - Triggered when leaving any chapter
54
44
- ` complete chapter ` - Triggered when any chapter is completed
45
+ - ` enter chapter <n> ` - Triggered when chapter ` <n> ` is entered
46
+ - ` leave chapter <n> ` - Triggered when leaving chapter ` <n> `
55
47
- ` complete chapter <n> ` - Triggered when chapter ` <n> ` is completed
56
48
- ** A-side specific:**
49
+ - ` enter a-side ` - Triggered when any A-side is entered
50
+ - ` leave a-side ` - Triggered when leaving any A-side
51
+ - ` complete a-side ` - Triggered when completing any A-side
57
52
- ` enter a-side <n> ` - Triggered when chapter ` <n> ` 's A-side is entered
58
53
- ` leave a-side <n> ` - Triggered when leaving chapter ` <n> ` 's A-side
59
54
- ` complete a-side <n> ` - Triggered when chapter ` <n> ` 's A-side is completed
60
55
- ** B-side specific:**
56
+ - ` enter b-side ` - Triggered when any B-side is entered
57
+ - ` leave b-side ` - Triggered when leaving any B-side
58
+ - ` complete b-side ` - Triggered when completing any B-side
61
59
- ` enter b-side <n> ` - Triggered when chapter ` <n> ` 's B-side is entered
62
60
- ` leave b-side <n> ` - Triggered when leaving chapter ` <n> ` 's B-side
63
61
- ` complete b-side <n> ` - Triggered when chapter ` <n> ` 's B-side is completed
64
62
- ** C-side specific:**
63
+ - ` enter c-side ` - Triggered when any C-side is entered
64
+ - ` leave c-side ` - Triggered when leaving any C-side
65
+ - ` complete c-side ` - Triggered when completing any C-side
65
66
- ` enter c-side <n> ` - Triggered when chapter ` <n> ` 's C-side is entered
66
67
- ` leave c-side <n> ` - Triggered when leaving chapter ` <n> ` 's C-side
67
68
- ` complete c-side <n> ` - Triggered when chapter ` <n> ` 's C-side is completed
@@ -86,38 +87,53 @@ Bringing this together, `" ! d8 > d3# other stuff "` is a valid event, and tra
86
87
- ` <n> chapter strawberries ` - Triggered when a total of ` <n> ` strawberries are collected in a chapter
87
88
- ` <n> file strawberries ` - Triggered when a total of ` <n> ` strawberries are collected in the file
88
89
90
+ ## Extended Events (Everest)
91
+ Everest supplies additional split data
92
+
93
+ ### SID Events
94
+ Chapter numbers for custom maps are dynamically allocated by Everest, so when the Everest autosplitter data is present,
95
+ SwiftSplit emits variants of all the relevant events using the Area SID
96
+
97
+ - ` enter chapter '<sid>' ` - Triggered when the given chapter is entered
98
+ - ` leave chapter '<sid>' ` - Triggered when leaving the given chapter
99
+ - ` complete chapter '<sid>' ` - Triggered when the given chapter is completed
100
+ - ** A-side specific:**
101
+ - ` enter a-side '<sid>' ` - Triggered when the given chapter's A-side is entered
102
+ - ` leave a-side '<sid>' ` - Triggered when leaving the given chapter's A-side
103
+ - ` complete a-side '<sid>' ` - Triggered when the given chapter's A-side is completed
104
+ - ** B-side specific:**
105
+ - ` enter b-side '<sid>' ` - Triggered when the given chapter's B-side is entered
106
+ - ` leave b-side '<sid>' ` - Triggered when leaving the given chapter's B-side
107
+ - ` complete b-side '<sid>' ` - Triggered when the given chapter's B-side is completed
108
+ - ** C-side specific:**
109
+ - ` enter c-side '<sid>' ` - Triggered when the given chapter's C-side is entered
110
+ - ` leave c-side '<sid>' ` - Triggered when leaving the given chapter's C-side
111
+ - ` complete c-side '<sid>' ` - Triggered when the given chapter's C-side is completed
112
+ - ** Collectables**
113
+ - ` collect chapter '<sid>' cassette ` - Triggered when the cassette in the specified chapter is collected
114
+ - ` collect chapter '<sid>' heart ` - Triggered when the heart gem in the specified chapter is collected
115
+
89
116
## Return to Map & Save and Quit
90
117
91
118
Without the proper route file, both of these count as resetting a chapter. It's impossible for SwiftSplit to tell the
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.
119
+ difference between a reset, return to map, or save and quit. To get around this, you can define in your route where
120
+ leaving the chapter is * expected.* Generally you'll want to define an event that happens right before you leave, then
121
+ the leave event. This ensures that resetting any time outside that window will trigger a proper reset.
94
122
95
- Here's what the reset for the 1A heart might look like:
123
+ Here's what the reset for the 1A might look like:
96
124
``` json
97
125
"route" : [
98
- " enter chapter 1 # Start" ,
99
- " 5 > 6 # Crossing" ,
126
+ " enter chapter 1 ## Start" ,
127
+ " 5 > 6 ## Crossing" ,
100
128
" !collect heart" ,
101
129
" !leave chapter" ,
102
- " 9 > 9b # Chasm" ,
130
+ " 9 > 9b ## Chasm" ,
103
131
" complete chapter 1"
104
132
]
105
133
```
106
134
107
135
The reason we put ` !collect heart ` before ` !leave chapter ` is because any time that SwiftSplit is waiting for you to
108
- leave the chapter * you can not automatically reset the run.* Any attempt to restart the run will just result in
109
- progressing through the route. By putting the collect heart event before the leave chapter event we make sure that
110
- SwiftSplit only starts waiting for the leave event right before we do it.
111
-
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
114
-
115
- ``` json
116
- "route" : [
117
- " ..." ,
118
- " !a00 > a03" ,
119
- " !collect strawberry" ,
120
- " !leave chapter" ,
121
- " ..."
122
- ]
123
- ```
136
+ leave the chapter * you can not reset the run.* Any attempt to reset the run will just result in progressing through
137
+ the route. By putting the collect heart event before the leave chapter event we make sure that SwiftSplit only starts
138
+ waiting for the leave event right before we do it. You could stand two pixels away from the heart and restart the
139
+ chapter, and SwiftSplit would * still* recognize it as a reset.
0 commit comments