Skip to content

Commit f6ed97b

Browse files
committed
Enhances docs and schema with clubs, parameters, and UI frames
Provides new references for default clubs and shot metrics Expands usage notes on success/fail logic and flow control Introduces new example scripts and clarifies UI frame management
1 parent 1e8b95f commit f6ed97b

File tree

5 files changed

+1021
-15
lines changed

5 files changed

+1021
-15
lines changed

docs/authoring-guide.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,86 @@ npm run validate
6565
6666
---
6767
68+
## Reference: Clubs and Parameters
69+
70+
### Club Codes
71+
72+
All setup objects support an optional `club` property with these values:
73+
74+
- **Drivers**: `Drv`
75+
- **Woods**: `_2W`, `_3W`, `_4W`, `_5W`, `_6W`, `_7W`, `_8W`, `_9W`
76+
- **Hybrids**: `_1H`, `_2H`, `_3H`, `_4H`, `_5H`, `_6H`, `_7H`, `_8H`, `_9H`
77+
- **Irons**: `_1I`, `_2I`, `_3I`, `_4I`, `_5I`, `_6I`, `_7I`, `_8I`, `_9I`
78+
- **Wedges**: `_PW`, `_SW`, `_LW`, `_50W`, `_52W`, `_54W`, `_56W`, `_58W`, `_60W`
79+
- **Putter**: `Putt`
80+
81+
**Default**: `"Drv"` if not specified.
82+
83+
**Examples**:
84+
```json
85+
"club": "Drv" // Driver
86+
"club": "_7I" // 7-iron
87+
"club": "_PW" // Pitching wedge
88+
```
89+
90+
### Shot Parameters
91+
92+
Parameters can be used in conditions and UI data tiles. Values are expressed in:
93+
- **Meters** for distance parameters
94+
- **Meters per second** for speeds
95+
- **Degrees** for angles
96+
97+
**Club Metrics**:
98+
- `ClubSpeed`, `AttackAngle`, `ClubPath`, `DynamicLoft`, `FaceAngle`
99+
- `DynamicLie`, `ImpactHeight`, `SpinLoft`, `FaceToPath`, `SwingPlane`
100+
- `SwingDirection`, `LowPoint`, `ImpactOffset`
101+
102+
**Ball Flight**:
103+
- `Curve`, `Height`, `Carry`, `Total`, `Side`, `SideTotal`
104+
- `LandingAngle`, `FromPin`, `BallSpeed`, `SmashFactor`
105+
- `LaunchAngle`, `LaunchDirection`, `SpinRate`, `SpinAxis`
106+
107+
**Performance**:
108+
- `StrokesGained`
109+
110+
**Example condition**:
111+
```json
112+
"conditions": [
113+
{ "parameter": "Total", "min": 180.0, "max": 250.0 },
114+
{ "parameter": "Curve", "min": -10.0, "max": 10.0 }
115+
]
116+
```
117+
118+
### UI Frame Management
119+
120+
Control UI visibility during different shot phases using `beforeShot`, `duringShot`, and `afterShot`:
121+
122+
**Available Frames**:
123+
- `Player`, `Markers`, `Tiles`, `ShotList`, `GoToSetup`, `Minimap`
124+
- `BroadcastTiles`, `ClubDelivery`, `AllTiles`, `LandingCamera`
125+
- `StrokesGainedSummaryTile`, `StrokesGainedShotResult`, `TargetCarry`
126+
127+
**Actions**:
128+
- `addFrames`: Show additional frames beyond defaults
129+
- `removeFrames`: Hide frames that would normally show
130+
- `disableFrames`: Prevent user interaction with frames
131+
132+
**Example**:
133+
```json
134+
"beforeShot": {
135+
"removeFrames": ["Player", "Minimap"],
136+
"disableFrames": ["GoToSetup"]
137+
},
138+
"duringShot": {
139+
"removeFrames": ["LandingCamera", "BroadcastTiles"]
140+
},
141+
"afterShot": {
142+
"addFrames": ["AllTiles"]
143+
}
144+
```
145+
146+
---
147+
68148
## File Anatomy
69149
70150
Top-level shape:
@@ -263,6 +343,35 @@ Top-level shape:
263343
264344
---
265345
346+
## Important Behavioral Notes
347+
348+
### Success/Fail Condition Behavior
349+
350+
- **Missing `successCondition`**: Shots will always be considered not successful
351+
- **Missing `failCondition`**: Shots will always be considered not failed
352+
- **Both missing**: Step can't be completed (useful for allowing unlimited practice shots until a new script overwrites)
353+
354+
### Flow Control
355+
356+
- `canRetry: true`: Allows user to retry failed steps, otherwise auto-skips to next step
357+
- `skipOnSuccess: true`: Continues to next step immediately after success condition is met
358+
- `skipOnSuccess: false`: Continues only when both success and fail conditions are met
359+
360+
### Distance Ranges
361+
362+
For Performance Center approach setups:
363+
- If `minDistance == maxDistance`: All shots use that exact distance
364+
- If `minDistance != maxDistance`: Each shot uses a random distance between the values
365+
366+
### Data Tiles and UI
367+
368+
- `activeDataTiles`: Only first 8 items will be used
369+
- `shotListParameters`: Defaults to `["Total", "Carry", "BallSpeed"]` if not specified
370+
- `defaultShotListParameter`: Defaults to `"Carry"` if not specified
371+
- Message `seconds: -1`: Requires user to click button to dismiss message
372+
373+
---
374+
266375
## Logic & Evaluation Semantics
267376
268377
Per step:

examples/custom_test.json

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
{
2+
"id": "sample-custom-test",
3+
4+
"activities": [
5+
{
6+
"nodeType": "PerformanceCenterScriptedActivity",
7+
"id": "custom-test-sample",
8+
"introMessage": {
9+
"header": "CUSTOM TEST",
10+
"description": "You will be hitting 4 shots with different clubs in varied scenarios",
11+
"seconds": 6
12+
},
13+
"endMessage": {
14+
"header": "TEST ENDED",
15+
"description": "",
16+
"seconds": 6
17+
},
18+
"steps": [
19+
{
20+
"nodeType": "PerformanceCenterScriptedStep",
21+
"id": "task-1-sample-id",
22+
"introMessage": {
23+
"header": "Shot 1",
24+
"description": "Hit your driver off the tee",
25+
"seconds": 5
26+
},
27+
"successMessage": {
28+
"header": "Success!",
29+
"description": "",
30+
"seconds": 3
31+
},
32+
"failMessage": {
33+
"header": "Failed",
34+
"description": "",
35+
"seconds": 3
36+
},
37+
"logic": {
38+
"nodeType": "PerformanceCenterScriptedLogic",
39+
"setup": {
40+
"nodeType": "PerformanceCenterTeeShotsScriptedSetup",
41+
"hole": 2,
42+
"playerCategory": "Handicap",
43+
"hcp": 15,
44+
"gender": "Male",
45+
"courseDistance": 5000,
46+
"club": "Drv"
47+
},
48+
"successCondition": {
49+
"nodeType": "PerformanceCenterScriptedConditions",
50+
"shots": 1
51+
},
52+
"skipOnSuccess": true
53+
},
54+
"ui": {
55+
"nodeType": "PerformanceCenterScriptedUI",
56+
"activeDataTiles": [ "Total", "Carry", "ClubSpeed", "BallSpeed", "AttackAngle" ],
57+
"shotListParameters": [ "Total", "Carry", "ClubSpeed", "BallSpeed" ],
58+
"defaultShotListParameter": "Total",
59+
"beforeShot": {
60+
"removeFrames": [ "Player", "StrokesGainedSummaryTile", "StrokesGainedShotResult", "TargetCarry" ],
61+
"disableFrames": [ "Tiles", "ShotList", "GoToSetup", "Minimap" ]
62+
},
63+
"duringShot": {
64+
"removeFrames": [ "LandingCamera", "BroadcastTiles", "GoToSetup", "ClubDelivery", "Tiles", "Player", "Minimap" ]
65+
},
66+
"afterShot": {
67+
"removeFrames": [ "GoToSetup", "StrokesGainedSummaryTile", "StrokesGainedShotResult" ],
68+
"addFrames": ["AllTiles"]
69+
}
70+
}
71+
},
72+
{
73+
"nodeType": "PerformanceCenterScriptedStep",
74+
"id": "task-2-sample-id",
75+
"introMessage": {
76+
"header": "Shot 2",
77+
"description": "Hit a 7-iron for your approach shot",
78+
"seconds": 5
79+
},
80+
"successMessage": {
81+
"header": "Success!",
82+
"description": "",
83+
"seconds": 3
84+
},
85+
"failMessage": {
86+
"header": "Failed",
87+
"description": "",
88+
"seconds": 3
89+
},
90+
"logic": {
91+
"nodeType": "PerformanceCenterScriptedLogic",
92+
"setup": {
93+
"nodeType": "PerformanceCenterApproachScriptedSetup",
94+
"hole": 1,
95+
"pin": 3,
96+
"playerCategory": "Handicap",
97+
"hcp": 15,
98+
"gender": "Male",
99+
"minDistance": 150,
100+
"maxDistance": 150,
101+
"club": "_7I"
102+
},
103+
"successCondition": {
104+
"nodeType": "PerformanceCenterScriptedConditions",
105+
"shots": 1
106+
},
107+
"skipOnSuccess": true
108+
},
109+
"ui": {
110+
"nodeType": "PerformanceCenterScriptedUI",
111+
"activeDataTiles": [ "Total", "Carry", "ClubSpeed", "BallSpeed", "AttackAngle" ],
112+
"shotListParameters": [ "Total", "Carry", "ClubSpeed", "BallSpeed" ],
113+
"defaultShotListParameter": "Total"
114+
}
115+
},
116+
{
117+
"nodeType": "PerformanceCenterScriptedStep",
118+
"id": "task-3-sample-id",
119+
"introMessage": {
120+
"header": "Shot 3",
121+
"description": "Hit your driver off the tee",
122+
"seconds": 5
123+
},
124+
"successMessage": {
125+
"header": "Success!",
126+
"description": "",
127+
"seconds": 3
128+
},
129+
"failMessage": {
130+
"header": "Failed",
131+
"description": "",
132+
"seconds": 3
133+
},
134+
"logic": {
135+
"nodeType": "PerformanceCenterScriptedLogic",
136+
"setup": {
137+
"nodeType": "PerformanceCenterTeeShotsScriptedSetup",
138+
"hole": 2,
139+
"playerCategory": "Handicap",
140+
"hcp": 15,
141+
"gender": "Male",
142+
"courseDistance": 5000,
143+
"club": "Drv"
144+
},
145+
"successCondition": {
146+
"nodeType": "PerformanceCenterScriptedConditions",
147+
"shots": 1
148+
},
149+
"skipOnSuccess": true
150+
},
151+
"ui": {
152+
"nodeType": "PerformanceCenterScriptedUI",
153+
"activeDataTiles": [ "Total", "Carry", "ClubSpeed", "BallSpeed", "AttackAngle" ],
154+
"shotListParameters": [ "Total", "Carry", "ClubSpeed", "BallSpeed" ],
155+
"defaultShotListParameter": "Total"
156+
}
157+
},
158+
{
159+
"nodeType": "PerformanceCenterScriptedStep",
160+
"id": "task-4-sample-id",
161+
"introMessage": {
162+
"header": "Shot 4",
163+
"description": "Hit a PW for your approach shot",
164+
"seconds": 5
165+
},
166+
"successMessage": {
167+
"header": "Success!",
168+
"description": "",
169+
"seconds": 3
170+
},
171+
"failMessage": {
172+
"header": "Failed",
173+
"description": "",
174+
"seconds": 3
175+
},
176+
"logic": {
177+
"nodeType": "PerformanceCenterScriptedLogic",
178+
"setup": {
179+
"nodeType": "PerformanceCenterApproachScriptedSetup",
180+
"hole": 3,
181+
"pin": 1,
182+
"playerCategory": "Handicap",
183+
"hcp": 15,
184+
"gender": "Male",
185+
"minDistance": 150,
186+
"maxDistance": 150,
187+
"club": "_PW"
188+
},
189+
"successCondition": {
190+
"nodeType": "PerformanceCenterScriptedConditions",
191+
"shots": 1
192+
},
193+
"skipOnSuccess": true
194+
},
195+
"ui": {
196+
"nodeType": "PerformanceCenterScriptedUI",
197+
"activeDataTiles": [ "Total", "Carry", "ClubSpeed", "BallSpeed", "AttackAngle" ],
198+
"shotListParameters": [ "Total", "Carry", "ClubSpeed", "BallSpeed" ],
199+
"defaultShotListParameter": "Total"
200+
}
201+
}
202+
]
203+
}
204+
],
205+
"startMode": "Append",
206+
"endMode": "Wait"
207+
}

0 commit comments

Comments
 (0)