Skip to content

Commit afa881c

Browse files
authored
Merge pull request #624 from bosh/logic_block_events
Logic block events
2 parents 8949265 + b3dced9 commit afa881c

File tree

6 files changed

+68
-7
lines changed

6 files changed

+68
-7
lines changed

docs/config/accruals.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,18 @@ List of one (or more) events.
210210

211211
Events that will be posted when this device is completed.
212212

213+
If you do not provide a value for this config, the default
214+
[`logicblock_(name)_complete`](../events/logicblock_name_complete.md) will be used.
215+
213216
### events_when_hit:
214217

215218
List of one (or more) events.
216219

217220
Events that will be posted when this device is hit or advanced.
218221

222+
If you do not provide a value for this config, the default
223+
[`logicblock_(name)_hit`](../events/logicblock_name_hit.md) will be used.
224+
219225
### persist_state:
220226

221227
Single value, type: `boolean` (`true`/`false`). Default: `false`

docs/config/counters.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,18 @@ List of one (or more) events.
237237

238238
Events that will be posted when this device is completed.
239239

240+
If you do not provide a value for this config, the default
241+
[`logicblock_(name)_complete`](../events/logicblock_name_complete.md) will be used.
242+
240243
### events_when_hit:
241244

242245
List of one (or more) events.
243246

244247
Events that will be posted when this device is hit or advanced.
245248

249+
If you do not provide a value for this config, the default
250+
[`logicblock_(name)_hit`](../events/logicblock_name_hit.md) will be used.
251+
246252
### persist_state:
247253

248254
Single value, type: `boolean` (`true`/`false`). Default: `false`

docs/config/sequences.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,18 @@ List of one (or more) events.
190190

191191
Events that will be posted when this device is completed.
192192

193+
If you do not provide a value for this config, the default
194+
[`logicblock_(name)_complete`](../events/logicblock_name_complete.md) will be used.
195+
193196
### events_when_hit:
194197

195198
List of one (or more) events.
196199

197200
Events that will be posted when this device is hit or advanced.
198201

202+
If you do not provide a value for this config, the default
203+
[`logicblock_(name)_hit`](../events/logicblock_name_hit.md) will be used.
204+
199205
### persist_state:
200206

201207
Single value, type: `boolean` (`true`/`false`). Default: `false`

docs/cookbook/TAF_mansion_awards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ for the achievement group, so hitting either one of those will start the
531531
selected achievement (if the group is enabled) and also stop this mode.
532532

533533
You may be wondering why we have both of those ball enter events listed
534-
here? Why not just use an "events_when_started" setting in the
534+
here? Why not just use an `events_when_started:` setting in the
535535
achievement group to stop this mode? The reason is for this rule here:
536536

537537
* Accumulating 15, 25, 35, 45, 55, 65, 75, 85, 95 bear kicks (center

docs/events/logicblock_name_complete.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Event is posted by [counters:](../config/counters.md), [accruals:](../config/acc
1212
The logic block called (name) has just been completed.
1313

1414
Note that this is the default completion event for logic blocks, but
15-
this can be changed in a logic block's "events_when_complete:"
15+
this can be changed in a logic block's `events_when_complete:`
1616
setting, so this might not be the actual event that's posted for all
1717
logic blocks in your machine.
1818

docs/events/logicblock_name_hit.md

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,52 @@ Event is posted by [counters:](../config/counters.md), [accruals:](../config/acc
1111

1212
The logic block (name) was just hit.
1313

14-
Note that this is the default hit event for logic blocks, but this can
15-
be changed in a logic block's "events_when_hit:" setting, so this
16-
might not be the actual event that's posted for all logic blocks in
17-
your machine.
14+
Note that this is the default completion event for logic blocks, but
15+
this can be changed in a logic block's `events_when_hit:`
16+
setting, so this might not be the actual event that's posted for all
17+
logic blocks in your machine.
1818

19-
--8<-- "event_no_keywords_notice.md"
19+
#### Deprecation warning:
20+
21+
In previous versions of MPF, the event `counter_(name)_hit` was used for counters instead of this event, `logicblock_(name)_hit`.
22+
Currently, both events are posted together (if you have not provided a custom [`events_when_hit`](../config/counters.md#events_when_hit) value for the counter),
23+
but `counter_(name)_hit` is considered deprecated and may be removed in future versions of MPF.
24+
25+
26+
## Keyword arguments
27+
28+
(See the [Conditional Events](overview/conditional.md)
29+
guide for details for how to create entries in your config file that
30+
only respond to certain combinations of the arguments below.)
31+
32+
Accruals, Counters, and Sequences each have different keyword arguments.
33+
34+
### Accrual Keyword arguments
35+
36+
#### `step`:
37+
38+
The 0-based integer number of the step that was just hit.
39+
40+
### Counter Keyword arguments
41+
42+
If the counter has a config setting for `count_complete_value`,
43+
`count`, `hits` and `remaining` towards that goal will be included as arguments.
44+
If `count_complete_value` is `None`, then only `count` will be included.
45+
46+
#### `count`:
47+
48+
The current value of the counter.
49+
50+
#### `hits`:
51+
52+
The numbers of hits made on this counter.
53+
54+
#### `remaining`:
55+
56+
The numbers of hits remaining before completing this counter.
57+
58+
### Sequence Keyword arguments
59+
60+
#### `step`:
61+
62+
The 0-based integer number of the step that was just hit.

0 commit comments

Comments
 (0)