You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/3.0/concept-actions-functions.md
-3Lines changed: 0 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -199,12 +199,9 @@ What a beautiful evening, Amelia.
199
199
In this example, both `<<HideTheMoon>>` and `<<FlickerStars>>` are custom actions.
200
200
201
201
There are three ways that custom actions can be used in Chatterbox; to swap between the different implementations set [`CHATTERBOX_ACTION_MODE`](reference-configuration?id=chatterbox_action_mode) to one of the following (the default is option `1`):
202
-
-`0` Pass ChatterScript actions as a raw string to a function, defined by `CHATTERBOX_ACTION_FUNCTION`
203
202
-`1` Treat actions as expressions
204
203
-`2` Treat actions as they were in version 1 (Python-esque function calls)
205
204
206
-
Mode `0` is provided for compatibility with YarnScript. This mode instructs a chatter to actions as a strings into the game engine for manual interpretation. Chatterbox's implementation is that the function defined by `CHATTERBOX_ACTION_FUNCTION` is called when Chatterbox encounters an action, the first argument (`argument0`) for the function call being the text inside the action as a string. The intention is that you'd then parse that text and execute behaviour accordingly but... this sucks, it's a ton of work to actually do this, let's move on.
207
-
208
205
Mode `1` is the default Chatterbox behaviour:
209
206
1. Every custom action is expected to use GML-like syntax: functions are executed using their name followed by a comma-separated list of arguments e.g. `<<CustomFunction("string", "string with spaces", 3.14, true)>>`
210
207
2. Variables are referenced by using the standard dollar-prefixed token e.g. `<<TransmutateLead("Gold", $lead)>>`
Copy file name to clipboardExpand all lines: docs/3.0/reference-configuration.md
+3-30Lines changed: 3 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ Whether to allow scripts to be added as Chatterbox functions.
24
24
25
25
## `CHATTERBOX_FUNCTION_ARRAY_ARGUMENTS`
26
26
27
-
_Typical value:_`true`
27
+
_Typical value:_`false`
28
28
29
-
Whether to execute callbacks with an array of arguments. Setting this to `false` will execute callbacks with individual arguments.
29
+
Whether to execute callbacks with an array of arguments. Setting this to `false` will execute callbacks with individual arguments, setting this to `true` will execute callbacks with a single array that contains the arguments.
30
30
31
31
32
32
@@ -108,16 +108,11 @@ Whether nodes without an explicit `<<stop>>` or `<<hopback>>` instruct at the en
108
108
109
109
_Typical value:_`1`
110
110
111
-
`CHATTERBOX_ACTION_MODE` should be either 0, 1, or 2:
111
+
`CHATTERBOX_ACTION_MODE` should be either 1 or 2:
112
112
113
-
-`0` Pass ChatterScript actions as a raw string to a function, defined by `CHATTERBOX_ACTION_FUNCTION`
114
113
-`1` Treat actions as expressions
115
114
-`2` Treat actions as they were in version 1 (Python-esque function calls)
116
115
117
-
### `CHATTERBOX_ACTION_MODE` = 0
118
-
119
-
This is the officially recommended behaviour. The full contents of the direction (everything between `<<` and `>>`) are passed as a string to a function for parsing and execution by the developer (you). I think this behaviour is stupid but I've included it here because technically that is what the ChatterScript specification says. You can set the function that receives the direction string by setting `CHATTERBOX_ACTION_FUNCTION`. Exactly what syntax you use for actions is therefore completely up to you.
120
-
121
116
### `CHATTERBOX_ACTION_MODE` = 1
122
117
123
118
Chatterbox will treat actions as expressions to be executed in a similar manner to in-line expressions. This is covenient if you want to treat actions as little snippets of code that Chatterbox can run. Syntax for actions becomes the same as in-line expressions, which is broadly similar to "standard" GML syntax. Functions that you wish to execute must be added by calling ChatterboxAddFunction(). An example would be: `<<giveItem("amulet", 1)>>`
@@ -128,14 +123,6 @@ Chatterbox will treat actions as expressions with a greatly simplified syntax. T
128
123
129
124
130
125
131
-
## `CHATTERBOX_DIRECTION_FUNCTION`
132
-
133
-
_Typical value:_`ExampleActionFunction`
134
-
135
-
Function to use to handle actions. This only applies in mode `0` (see below).
136
-
137
-
138
-
139
126
## `CHATTERBOX_END_OF_NODE_HOPBACK`
140
127
141
128
_Typical value:_`true`
@@ -208,20 +195,6 @@ Directory inside Included Files that holds all external ChatterScript files. Use
208
195
209
196
210
197
211
-
## `CHATTERBOX_DECLARE_ON_COMPILE`
212
-
213
-
_Typical value:_`true`
214
-
215
-
Whether to declare variables when Chatterbox script is compiled. Set to `false` for legacy (2.1 and earlier) behaviour.
0 commit comments