@bgforge/mls-server 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3818 @@
1
+ {
2
+ "ARE_V10_ACTORS": {
3
+ "contents": {
4
+ "kind": "markdown",
5
+ "value": "```weidu-tp2-tooltip\nARE_V10_ACTORS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
6
+ }
7
+ },
8
+ "ARE_V10_REGIONS": {
9
+ "contents": {
10
+ "kind": "markdown",
11
+ "value": "```weidu-tp2-tooltip\nARE_V10_REGIONS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
12
+ }
13
+ },
14
+ "ARE_V10_SPAWN_POINTS": {
15
+ "contents": {
16
+ "kind": "markdown",
17
+ "value": "```weidu-tp2-tooltip\nARE_V10_SPAWN_POINTS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
18
+ }
19
+ },
20
+ "ARE_V10_ENTRANCES": {
21
+ "contents": {
22
+ "kind": "markdown",
23
+ "value": "```weidu-tp2-tooltip\nARE_V10_ENTRANCES\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
24
+ }
25
+ },
26
+ "ARE_V10_CONTAINERS": {
27
+ "contents": {
28
+ "kind": "markdown",
29
+ "value": "```weidu-tp2-tooltip\nARE_V10_CONTAINERS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
30
+ }
31
+ },
32
+ "ARE_V10_AMBIENTS": {
33
+ "contents": {
34
+ "kind": "markdown",
35
+ "value": "```weidu-tp2-tooltip\nARE_V10_AMBIENTS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
36
+ }
37
+ },
38
+ "ARE_V10_DOORS": {
39
+ "contents": {
40
+ "kind": "markdown",
41
+ "value": "```weidu-tp2-tooltip\nARE_V10_DOORS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
42
+ }
43
+ },
44
+ "ARE_V10_ANIMATIONS": {
45
+ "contents": {
46
+ "kind": "markdown",
47
+ "value": "```weidu-tp2-tooltip\nARE_V10_ANIMATIONS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
48
+ }
49
+ },
50
+ "ARE_V91_ACTORS": {
51
+ "contents": {
52
+ "kind": "markdown",
53
+ "value": "```weidu-tp2-tooltip\nARE_V91_ACTORS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
54
+ }
55
+ },
56
+ "CRE_V10_KNOWN_SPELLS": {
57
+ "contents": {
58
+ "kind": "markdown",
59
+ "value": "```weidu-tp2-tooltip\nCRE_V10_KNOWN_SPELLS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
60
+ }
61
+ },
62
+ "CRE_V10_SPELL_MEM_INFO": {
63
+ "contents": {
64
+ "kind": "markdown",
65
+ "value": "```weidu-tp2-tooltip\nCRE_V10_SPELL_MEM_INFO\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
66
+ }
67
+ },
68
+ "CRE_V10_EFFECTS": {
69
+ "contents": {
70
+ "kind": "markdown",
71
+ "value": "```weidu-tp2-tooltip\nCRE_V10_EFFECTS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
72
+ }
73
+ },
74
+ "CRE_V10_ITEMS": {
75
+ "contents": {
76
+ "kind": "markdown",
77
+ "value": "```weidu-tp2-tooltip\nCRE_V10_ITEMS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
78
+ }
79
+ },
80
+ "ITM_V10_HEADERS": {
81
+ "contents": {
82
+ "kind": "markdown",
83
+ "value": "```weidu-tp2-tooltip\nITM_V10_HEADERS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
84
+ }
85
+ },
86
+ "ITM_V10_GEN_EFFECTS": {
87
+ "contents": {
88
+ "kind": "markdown",
89
+ "value": "```weidu-tp2-tooltip\nITM_V10_GEN_EFFECTS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
90
+ }
91
+ },
92
+ "SPL_V10_HEADERS": {
93
+ "contents": {
94
+ "kind": "markdown",
95
+ "value": "```weidu-tp2-tooltip\nSPL_V10_HEADERS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
96
+ }
97
+ },
98
+ "SPL_V10_GEN_EFFECTS": {
99
+ "contents": {
100
+ "kind": "markdown",
101
+ "value": "```weidu-tp2-tooltip\nSPL_V10_GEN_EFFECTS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
102
+ }
103
+ },
104
+ "STO_V10_ITEMS_PURCHASED": {
105
+ "contents": {
106
+ "kind": "markdown",
107
+ "value": "```weidu-tp2-tooltip\nSTO_V10_ITEMS_PURCHASED\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
108
+ }
109
+ },
110
+ "STO_V10_ITEMS_SOLD": {
111
+ "contents": {
112
+ "kind": "markdown",
113
+ "value": "```weidu-tp2-tooltip\nSTO_V10_ITEMS_SOLD\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
114
+ }
115
+ },
116
+ "STO_V10_DRINKS": {
117
+ "contents": {
118
+ "kind": "markdown",
119
+ "value": "```weidu-tp2-tooltip\nSTO_V10_DRINKS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
120
+ }
121
+ },
122
+ "STO_V10_CURES": {
123
+ "contents": {
124
+ "kind": "markdown",
125
+ "value": "```weidu-tp2-tooltip\nSTO_V10_CURES\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
126
+ }
127
+ },
128
+ "WMP_AREAS": {
129
+ "contents": {
130
+ "kind": "markdown",
131
+ "value": "```weidu-tp2-tooltip\nWMP_AREAS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
132
+ }
133
+ },
134
+ "WMP_LINKS": {
135
+ "contents": {
136
+ "kind": "markdown",
137
+ "value": "```weidu-tp2-tooltip\nWMP_LINKS\n```\nPredefined set of values for `GET_OFFSET_ARRAY`."
138
+ }
139
+ },
140
+ "ARE_V10_ITEMS": {
141
+ "contents": {
142
+ "kind": "markdown",
143
+ "value": "```weidu-tp2-tooltip\nARE_V10_ITEMS\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
144
+ }
145
+ },
146
+ "ARE_V10_REGION_VERTICES": {
147
+ "contents": {
148
+ "kind": "markdown",
149
+ "value": "```weidu-tp2-tooltip\nARE_V10_REGION_VERTICES\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
150
+ }
151
+ },
152
+ "ARE_V10_CONTAINER_VERTICES": {
153
+ "contents": {
154
+ "kind": "markdown",
155
+ "value": "```weidu-tp2-tooltip\nARE_V10_CONTAINER_VERTICES\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
156
+ }
157
+ },
158
+ "ARE_V10_DOOR_OPEN_OUTLINE_VERTICES": {
159
+ "contents": {
160
+ "kind": "markdown",
161
+ "value": "```weidu-tp2-tooltip\nARE_V10_DOOR_OPEN_OUTLINE_VERTICES\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
162
+ }
163
+ },
164
+ "ARE_V10_DOOR_CLOSED_OUTLINE_VERTICES": {
165
+ "contents": {
166
+ "kind": "markdown",
167
+ "value": "```weidu-tp2-tooltip\nARE_V10_DOOR_CLOSED_OUTLINE_VERTICES\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
168
+ }
169
+ },
170
+ "ARE_V10_DOOR_OPEN_CELL_VERTICES": {
171
+ "contents": {
172
+ "kind": "markdown",
173
+ "value": "```weidu-tp2-tooltip\nARE_V10_DOOR_OPEN_CELL_VERTICES\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
174
+ }
175
+ },
176
+ "ARE_V10_DOOR_CLOSED_CELL_VERTICES": {
177
+ "contents": {
178
+ "kind": "markdown",
179
+ "value": "```weidu-tp2-tooltip\nARE_V10_DOOR_CLOSED_CELL_VERTICES\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
180
+ }
181
+ },
182
+ "CRE_V10_SPELL_MEM": {
183
+ "contents": {
184
+ "kind": "markdown",
185
+ "value": "```weidu-tp2-tooltip\nCRE_V10_SPELL_MEM\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
186
+ }
187
+ },
188
+ "ITM_V10_HEAD_EFFECTS": {
189
+ "contents": {
190
+ "kind": "markdown",
191
+ "value": "```weidu-tp2-tooltip\nITM_V10_HEAD_EFFECTS\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
192
+ }
193
+ },
194
+ "SPL_V10_HEAD_EFFECTS": {
195
+ "contents": {
196
+ "kind": "markdown",
197
+ "value": "```weidu-tp2-tooltip\nSPL_V10_HEAD_EFFECTS\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
198
+ }
199
+ },
200
+ "WMP_NORTH_LINKS": {
201
+ "contents": {
202
+ "kind": "markdown",
203
+ "value": "```weidu-tp2-tooltip\nWMP_NORTH_LINKS\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
204
+ }
205
+ },
206
+ "WMP_WEST_LINKS": {
207
+ "contents": {
208
+ "kind": "markdown",
209
+ "value": "```weidu-tp2-tooltip\nWMP_WEST_LINKS\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
210
+ }
211
+ },
212
+ "WMP_SOUTH_LINKS": {
213
+ "contents": {
214
+ "kind": "markdown",
215
+ "value": "```weidu-tp2-tooltip\nWMP_SOUTH_LINKS\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
216
+ }
217
+ },
218
+ "WMP_EAST_LINKS": {
219
+ "contents": {
220
+ "kind": "markdown",
221
+ "value": "```weidu-tp2-tooltip\nWMP_EAST_LINKS\n```\nPredefined set of values for `GET_OFFSET_ARRAY2`."
222
+ }
223
+ },
224
+ "SOURCE_FILE": {
225
+ "contents": {
226
+ "kind": "markdown",
227
+ "value": "```weidu-tp2-tooltip\nSOURCE_FILE\n```\nSet by `COPY_*` family of functions. If `COPY fromFile` is `mymod/cre/bigboss.cre`, then `SOURCE_FILE` is `bigboss.cre`."
228
+ }
229
+ },
230
+ "SOURCE_DIRECTORY": {
231
+ "contents": {
232
+ "kind": "markdown",
233
+ "value": "```weidu-tp2-tooltip\nSOURCE_DIRECTORY\n```\nSet by `COPY_*` family of functions. If `COPY fromFile` is `mymod/cre/bigboss.cre`, then `SOURCE_DIRECTORY` is `mymod/cre`."
234
+ }
235
+ },
236
+ "SOURCE_FILESPEC": {
237
+ "contents": {
238
+ "kind": "markdown",
239
+ "value": "```weidu-tp2-tooltip\nSOURCE_FILESPEC\n```\nSet by `COPY_*` family of functions. If `COPY fromFile` is `mymod/cre/bigboss.cre`, then `SOURCE_FILESPEC` is ` mymod/cre/bigboss.cre`."
240
+ }
241
+ },
242
+ "SOURCE_RES": {
243
+ "contents": {
244
+ "kind": "markdown",
245
+ "value": "```weidu-tp2-tooltip\nSOURCE_RES\n```\nSet by `COPY_*` family of functions. If `COPY fromFile` is `mymod/cre/bigboss.cre`, then `SOURCE_RES` is `bigboss`."
246
+ }
247
+ },
248
+ "SOURCE_EXT": {
249
+ "contents": {
250
+ "kind": "markdown",
251
+ "value": "```weidu-tp2-tooltip\nSOURCE_EXT\n```\nSet by `COPY_*` family of functions. If `COPY fromFile` is `mymod/cre/bigboss.cre`, then `SOURCE_EXT` is `cre`."
252
+ }
253
+ },
254
+ "SOURCE_SIZE": {
255
+ "contents": {
256
+ "kind": "markdown",
257
+ "value": "```weidu-tp2-tooltip\nSOURCE_SIZE\n```\nSet by `COPY_*` family of functions. It is set to the size (in bytes) of the source file."
258
+ }
259
+ },
260
+ "DEST_FILE": {
261
+ "contents": {
262
+ "kind": "markdown",
263
+ "value": "```weidu-tp2-tooltip\nDEST_FILE\n```\nSet by `COPY_*` family of functions. Like `SOURCE_FILE`, but based on `toFile`."
264
+ }
265
+ },
266
+ "DEST_DIRECTORY": {
267
+ "contents": {
268
+ "kind": "markdown",
269
+ "value": "```weidu-tp2-tooltip\nDEST_DIRECTORY\n```\nSet by `COPY_*` family of functions. Like `SOURCE_DIRECTORY`, but based on `toFile`."
270
+ }
271
+ },
272
+ "DEST_FILESPEC": {
273
+ "contents": {
274
+ "kind": "markdown",
275
+ "value": "```weidu-tp2-tooltip\nDEST_FILESPEC\n```\nSet by `COPY_*` family of functions. Like `SOURCE_FILESPEC`, but based on `toFile`."
276
+ }
277
+ },
278
+ "DEST_RES": {
279
+ "contents": {
280
+ "kind": "markdown",
281
+ "value": "```weidu-tp2-tooltip\nDEST_RES\n```\nSet by `COPY_*` family of functions. Like `SOURCE_RES`, but based on `toFile`."
282
+ }
283
+ },
284
+ "DEST_EXT": {
285
+ "contents": {
286
+ "kind": "markdown",
287
+ "value": "```weidu-tp2-tooltip\nDEST_EXT\n```\nSet by `COPY_*` family of functions. Like `SOURCE_EXT`, but based on `toFile`."
288
+ }
289
+ },
290
+ "%COMPONENT_NUMBER%": {
291
+ "contents": {
292
+ "kind": "markdown",
293
+ "value": "```weidu-tp2-tooltip\n%COMPONENT_NUMBER%\n```\nThe special variable `COMPONENT_NUMBER` is set to the number of the component being installed."
294
+ }
295
+ },
296
+ "%INTERACTIVE%": {
297
+ "contents": {
298
+ "kind": "markdown",
299
+ "value": "```weidu-tp2-tooltip\n%INTERACTIVE%\n```\nThe special variable `INTERACTIVE` is set to `1` if the install is being done interactively (IE you launched `setup-mymod.exe` and you're installing `mymod`), or is set to `0` if the install is being done non-interactively (IE you launched `setup-mymod.exe` and now WeiDU is reinstalling `othermod` due to the domino uninstall and reinstall)."
300
+ }
301
+ },
302
+ "%WEIDU_ARCH%": {
303
+ "contents": {
304
+ "kind": "markdown",
305
+ "value": "```weidu-tp2-tooltip\n%WEIDU_ARCH%\n```\nThe special variable `WEIDU_ARCH` is set to either `x86`, `amd64` or `mac` at WeiDU startup and can be used to determine the architecture of the WeiDU binary."
306
+ }
307
+ },
308
+ "%WEIDU_EXECUTABLE%": {
309
+ "contents": {
310
+ "kind": "markdown",
311
+ "value": "```weidu-tp2-tooltip\n%WEIDU_EXECUTABLE%\n```\nThe special variable `WEIDU_EXECUTABLE` is set to the name of the running WeiDU instance."
312
+ }
313
+ },
314
+ "%WEIDU_OS%": {
315
+ "contents": {
316
+ "kind": "markdown",
317
+ "value": "```weidu-tp2-tooltip\n%WEIDU_OS%\n```\nThe special variable `WEIDU_OS` is set to either `win32`, `osx` or `unix` at WeiDU startup and can be used to determine the operating system for which the WeiDU binary was compiled."
318
+ }
319
+ },
320
+ "%WEIDU_VER%": {
321
+ "contents": {
322
+ "kind": "markdown",
323
+ "value": "```weidu-tp2-tooltip\n%WEIDU_VER%\n```\nThe special variable `WEIDU_VER` is set at start-up to the 5-digit version number of the currently running WeiDU binary (e.g.: `25100`)."
324
+ }
325
+ },
326
+ "%MOD_FOLDER%": {
327
+ "contents": {
328
+ "kind": "markdown",
329
+ "value": "```weidu-tp2-tooltip\n%MOD_FOLDER%\n```\nThe `MOD_FOLDER` variable is set to the directory containing the `TP2` file, if there is one, otherwise it is set to the root directory of `directoryName` (see `BACKUP`).\nAs of `v251`, the contents of `%MOD_FOLDER%` are **case-exact**."
330
+ }
331
+ },
332
+ "AUTHOR": {
333
+ "contents": {
334
+ "kind": "markdown",
335
+ "value": "```weidu-tp2-tooltip\nAUTHOR\n```\nThe AUTHOR directive gives an email address for users to send bugs to if there are problems during the installation. You may use SUPPORT as an alias for AUTHOR. The TP2_AUTHOR variable is set to the \"emailAddress\" value."
336
+ }
337
+ },
338
+ "BACKUP": {
339
+ "contents": {
340
+ "kind": "markdown",
341
+ "value": "```weidu-tp2-tooltip\nBACKUP\n```\nThe BACKUP declaration tells WeiDU where to put backed-up versions of files that would be overwritten so that they can be uninstalled later. This directory will be created automatically if it is missing."
342
+ }
343
+ },
344
+ "ALLOW_MISSING": {
345
+ "contents": {
346
+ "kind": "markdown",
347
+ "value": "```weidu-tp2-tooltip\nALLOW_MISSING file list\n```\nAllows you to specify files that can be missing (when you try to copy them or reference them from D files). Empty versions of those files will be created on demand. Try to use ACTION_IF instead of this."
348
+ }
349
+ },
350
+ "ALWAYS": {
351
+ "contents": {
352
+ "kind": "markdown",
353
+ "value": "```weidu-tp2-tooltip\nALWAYS TP2 Action list END\n```\nThis flag specified a TP2 Action that is executed at the beginning of each Component, before the component-specific TP2 Action."
354
+ }
355
+ },
356
+ "ASK_EVERY_COMPONENT": {
357
+ "contents": {
358
+ "kind": "markdown",
359
+ "value": "```weidu-tp2-tooltip\nASK_EVERY_COMPONENT\n```\nThis flag instructs WeiDU to ask about installing every component in this TP2 file individually, rather than asking questions like \"Would you like to install them all?\""
360
+ }
361
+ },
362
+ "AUTO_EVAL_STRINGS": {
363
+ "contents": {
364
+ "kind": "markdown",
365
+ "value": "```weidu-tp2-tooltip\nAUTO_EVAL_STRINGS\n```\nEVALUATE_BUFFER is used whenever variables are evaluated. In particular, you can now \"forget\" about using it in FUNCTIONs and arrays. Note, TP2 defines multiple instances of EVALUATE_BUFFER, like EVALUATE_BUFFER, but these are not affected by AUTO_EVAL_STRINGS."
366
+ }
367
+ },
368
+ "AUTO_TRA": {
369
+ "contents": {
370
+ "kind": "markdown",
371
+ "value": "```weidu-tp2-tooltip\nAUTO_TRA path [ subdir ]\n```\nThe `AUTO_TRA` flag is used with the `COMPILE` and\n`EXTEND_TOP (TP2)` `TP2 Action`s. It automatically loads\n`TRA` files that match your `D` files. The\nexpression `%s`, occurring in path, is replaced with the\n`languageDirectory` of the `LANGUAGE` the user\nselected. The `TRA` file loaded by `AUTO_TRA` takes\nprecedence over all other `TRA` files. Variables are\nevaluated when the action is processed. If a subdirectory is\nprovided, any matching `TRA` file in this directory is loaded\nafter the corresponding `TRA` file in the normal directory on\n**EE-type** games. Only the name of the subdirectory itself should\nbe given. If `foo` is your mod folder, `bar` is your `TRA` folder\nand `baz` is your subdirectory, your `AUTO_TRA` might look\nlike `AUTO_TRA ~foo/bar~ ~baz~`."
372
+ }
373
+ },
374
+ "MODDER": {
375
+ "contents": {
376
+ "kind": "markdown",
377
+ "value": "```weidu-tp2-tooltip\nMODDER String list\n```\nEnable additional debug info. By default, these messages are verbose but do not halt the installation. Some options are configurable, see the MODDER in-depth description."
378
+ }
379
+ },
380
+ "NO_IF_EVAL_BUG": {
381
+ "contents": {
382
+ "kind": "markdown",
383
+ "value": "```weidu-tp2-tooltip\nNO_IF_EVAL_BUG\n```\nThis action solves a long-standing bug with the IF_EVAL action. Since solving it is not directly possible without damaging backwards compatibility, you have to use this action (preferably in an ALWAYS statement) to solve the bug for yourself. IF_EVAL will not work with this action in the TP2 - use PATCH_IF and BUT_ONLY_IF_IT_CHANGES instead."
384
+ }
385
+ },
386
+ "QUICK_MENU": {
387
+ "contents": {
388
+ "kind": "markdown",
389
+ "value": "```weidu-tp2-tooltip\nQUICK_MENU lots of parameters\n```\nUsed to specify one or more groups of components that can be installed in a single step. See the QUICK_MENU tutorial for syntax, usage instructions, and caveats."
390
+ }
391
+ },
392
+ "README": {
393
+ "contents": {
394
+ "kind": "markdown",
395
+ "value": "```weidu-tp2-tooltip\nREADME file list\n```\nThe given file is displayed to the user after choosing the language, but before installing any component. If more than one file name is provided, they are checked for existence in the order they're provided, and the first available one will be opened. If you wish to open multiple readme files, use multiple README statements."
396
+ }
397
+ },
398
+ "SCRIPT_STYLE": {
399
+ "contents": {
400
+ "kind": "markdown",
401
+ "value": "```weidu-tp2-tooltip\nSCRIPT_STYLE style\n```\nThis flag determines how WeiDU will read in BAF and BCS files and write out BAF and BCS files. Possible options for \"style\" include BG (the default), IWD1, IWD2, and PST. See the Scripting Styles tutorial."
402
+ }
403
+ },
404
+ "UNINSTALL_ORDER": {
405
+ "contents": {
406
+ "kind": "markdown",
407
+ "value": "```weidu-tp2-tooltip\nUNINSTALL_ORDER String list\n```\nDo not use this without a real reason.\nSpecifies the order in which uninstallation operations are handled. The operations are STRSET (uninstall STRING_SET and ALTER_TLK), MOVE (uninstall MOVE), AT (perform AT_UNINSTALL and AT_INTERACTIVE_UNINSTALL) and COPY (uninstall all various file operations).\nIf not specified, the order is MOVE - STRSET - COPY - AT.\nIf this is specified, then ALL operations must be specified (if any isn't, a warning is printed). Please note that this means that your mod might start printing warnings three years down the line if a new uninstall action is coded."
408
+ }
409
+ },
410
+ "VERSION": {
411
+ "contents": {
412
+ "kind": "markdown",
413
+ "value": "```weidu-tp2-tooltip\nVERSION String\n```\n\"String\" (variables evaluated) will be appended to every component's name in the weidu.log file."
414
+ }
415
+ },
416
+ "BEGIN": {
417
+ "contents": {
418
+ "kind": "markdown",
419
+ "value": "```weidu-tp2-tooltip\nBEGIN componentName [ component flags... ] TP2 Action list\n```\nStarts a new component. Each component has a name, optional component flags (DESIGNATED, GROUP, etc.), and a list of actions to perform."
420
+ }
421
+ },
422
+ "LANGUAGE": {
423
+ "contents": {
424
+ "kind": "markdown",
425
+ "value": "```weidu-tp2-tooltip\nLANGUAGE languageName languageDirectory defaultLanguageTRA list\n```\nThe languageName is the name of the language as it is presented to the user. \"American English\" and \"Italiano\" are examples. The languageDirectory is the name of the subdirectory in which you have stored the TRA files for that language. Examples include \"american\" and \"spanish\". The variable named LANGUAGE is set to languageDirectory if the user selects this language.. Finally, all of the TRA files in the defaultLanguageTRA list are loaded as soon as the user selects a language."
426
+ }
427
+ },
428
+ "DEPRECATED": {
429
+ "contents": {
430
+ "kind": "markdown",
431
+ "value": "```weidu-tp2-tooltip\nDEPRECATED String\n```\nMark the given component as deprecated. If it is currently installed, it will be uninstalled and the given String will be displayed. The user will never be asked to install the given component -- it will be silently skipped in all listings. However, it will still take up a \"component number\"."
432
+ }
433
+ },
434
+ "DESIGNATED": {
435
+ "contents": {
436
+ "kind": "markdown",
437
+ "value": "```weidu-tp2-tooltip\nDESIGNATED forcedNumber\n```\nNormally module components are numbered based on their order in the TP2 file (starting from 0). This flag sets the current component number to forcedNumber. The next component (if it lacks a DESIGNATED flag) will be forcedNumber+1. You can easily shoot yourself in the foot by setting forcedNumber too low (e.g., so that multiple components have the same number)."
438
+ }
439
+ },
440
+ "FORBID_COMPONENT": {
441
+ "contents": {
442
+ "kind": "markdown",
443
+ "value": "```weidu-tp2-tooltip\nFORBID_COMPONENT modToUninstall modComponent String\n```\nMake this component so that it can only be installed if another component is not installed. This does the opposite of REQUIRE_COMPONENT."
444
+ }
445
+ },
446
+ "FORCED_SUBCOMPONENT": {
447
+ "contents": {
448
+ "kind": "markdown",
449
+ "value": "```weidu-tp2-tooltip\nFORCED_SUBCOMPONENT String [ value ]\n```\nSee the SUBCOMPONENT tutorial."
450
+ }
451
+ },
452
+ "GROUP": {
453
+ "contents": {
454
+ "kind": "markdown",
455
+ "value": "```weidu-tp2-tooltip\nGROUP String [ value ]\n```\nUsed for grouping components; the user will be asked to display these or not. See the GROUP tutorial."
456
+ }
457
+ },
458
+ "INSTALL_BY_DEFAULT": {
459
+ "contents": {
460
+ "kind": "markdown",
461
+ "value": "```weidu-tp2-tooltip\nINSTALL_BY_DEFAULT\n```\nIf WeiDU would ask the user whether to install this component or not, and this component is not already installed, WeiDU will instead install it by default (without asking the user). If there is an error or the component is already installed, WeiDU will ask the user. The --uninstall command-line argument overrides this. See also REQUIRE_COMPONENT and ALWAYS."
462
+ }
463
+ },
464
+ "LABEL": {
465
+ "contents": {
466
+ "kind": "markdown",
467
+ "value": "```weidu-tp2-tooltip\nLABEL String\n```\nDefines the LABEL, or unique textual identifier, of this module. Any component can have zero or more LABELs. Will print a warning if two components in the same tp2 share a LABEL. Do not alter a component's LABEL once you publish that mod."
468
+ }
469
+ },
470
+ "METADATA": {
471
+ "contents": {
472
+ "kind": "markdown",
473
+ "value": "```weidu-tp2-tooltip\nMETADATA String\n```\nAssociates a string of metadata with this component. WeiDU does not use the metadata for anything, but external programs might. `METADATA` may be used multiple times per component."
474
+ }
475
+ },
476
+ "NO_LOG_RECORD": {
477
+ "contents": {
478
+ "kind": "markdown",
479
+ "value": "```weidu-tp2-tooltip\nNO_LOG_RECORD\n```\nNormally all module components are recorded in WeiDU.log and can be uninstalled later. This component flag prevents this component from writing a log record when it is successfully installed. As a result it is “invisible” to WeiDU, can be installed multiple times, and cannot be uninstalled with WeiDU. Do not use this flag without a real reason."
480
+ }
481
+ },
482
+ "REQUIRE_COMPONENT": {
483
+ "contents": {
484
+ "kind": "markdown",
485
+ "value": "```weidu-tp2-tooltip\nREQUIRE_COMPONENT modToUninstall modComponent String\n```\nMake this component so that it can only be installed if another component is installed. If that other component is not installed, the String will be displayed and the user will not get a chance to install this component. This is in some sense the opposite of the UNINSTALL TP2 Action. For example, REQUIRE_COMPONENT \"setup-ease.tp2\" \"0\" \"You must have infinite stacking installed!\" prevents a component from being installed unless the infinite stacking part of the Ease-of-Use mod is installed."
486
+ }
487
+ },
488
+ "REQUIRE_PREDICATE": {
489
+ "contents": {
490
+ "kind": "markdown",
491
+ "value": "```weidu-tp2-tooltip\nREQUIRE_PREDICATE value String\n```\nThis component can only be installed if the value evaluates to true (non-zero)."
492
+ }
493
+ },
494
+ "SUBCOMPONENT": {
495
+ "contents": {
496
+ "kind": "markdown",
497
+ "value": "```weidu-tp2-tooltip\nSUBCOMPONENT String [ value ]\n```\nAt most one component of the given subcomponent group can be installed at any time. All subcomponents of the same group are listed together for the user. See the SUBCOMPONENT tutorial."
498
+ }
499
+ },
500
+ "ABORT": {
501
+ "contents": {
502
+ "kind": "markdown",
503
+ "value": "```weidu-tp2-tooltip\nABORT string\n```\nThe string is displayed and installation of the component is undone. No error is implied."
504
+ }
505
+ },
506
+ "ACTION_BASH_FOR": {
507
+ "contents": {
508
+ "kind": "markdown",
509
+ "value": "```weidu-tp2-tooltip\nACTION_BASH_FOR directory-file-regexp BEGIN TP2 Action list END\n```\nFor all files that match directory-file-regexp, sets a bunch of variables and executes the actions for each file found. Assuming the file being copied is somedir/yourfile.cre, the following variables will be set: \"%BASH_FOR_DIRECTORY%\" = \"somedir\" \"%BASH_FOR_FILESPEC%\" = \"somedir/yourfile.cre\" \"%BASH_FOR_FILE%\" = \"yourfile.cre\" \"%BASH_FOR_RES%\" = \"yourfile\" \"%BASH_FOR_EXT%\" = \"cre\" \"%BASH_FOR_SIZE%\" = <size of somedir/yourfile.cre>"
510
+ }
511
+ },
512
+ "ACTION_CLEAR_ARRAY": {
513
+ "contents": {
514
+ "kind": "markdown",
515
+ "value": "```weidu-tp2-tooltip\nACTION_CLEAR_ARRAY String\n```\n'Forgets' that the array string exists until its values are recalled. The actual variables' values are kept, the only effect is that PHP_EACH will not consider old values."
516
+ }
517
+ },
518
+ "ACTION_DEFINE_ARRAY": {
519
+ "contents": {
520
+ "kind": "markdown",
521
+ "value": "```weidu-tp2-tooltip\nACTION_DEFINE_ARRAY String1 BEGIN String2 list END\n```\nSets the array $string1(0),$string1(1) etc. to the various elements in string2."
522
+ }
523
+ },
524
+ "ACTION_DEFINE_ASSOCIATIVE_ARRAY": {
525
+ "contents": {
526
+ "kind": "markdown",
527
+ "value": "```weidu-tp2-tooltip\nACTION_DEFINE_ASSOCIATIVE_ARRAY String BEGIN key1 [ , key2 ... ] => result1 list END\n```\nSets the array $string, indexed by the keys, to the corresponding results. The results can either be Strings or values. Example: ACTION_DEFINE_ASSOCIATIVE_ARRAY mix_with_blue BEGIN red => purple yellow => green END"
528
+ }
529
+ },
530
+ "ACTION_FOR_EACH": {
531
+ "contents": {
532
+ "kind": "markdown",
533
+ "value": "```weidu-tp2-tooltip\nACTION_FOR_EACH String1 IN String list BEGIN TP2 Action list END\n```\nWill set the string1 variable to each value in string list and process each action."
534
+ }
535
+ },
536
+ "ACTION_GET_STRREF": {
537
+ "contents": {
538
+ "kind": "markdown",
539
+ "value": "```weidu-tp2-tooltip\nACTION_GET_STRREF value variable\n```\nThe string reference value is looked up in DIALOG.TLK and the (male) string (without any quotes) is stored in the variable."
540
+ }
541
+ },
542
+ "ACTION_GET_STRREF_F": {
543
+ "contents": {
544
+ "kind": "markdown",
545
+ "value": "```weidu-tp2-tooltip\nACTION_GET_STRREF_F value variable\n```\nThe string reference value is looked up in DIALOGF.TLK and the female string (without any quotes) is stored in the variable. If there is no DIALOGF.TLK, the string from DIALOG.TLK is used instead."
546
+ }
547
+ },
548
+ "ACTION_GET_STRREF_FS": {
549
+ "contents": {
550
+ "kind": "markdown",
551
+ "value": "```weidu-tp2-tooltip\nACTION_GET_STRREF_FS value variable\n```\nThe string reference value is looked up in DIALOGF.TLK and the sound reference associated with the female string is stored in the variable. If there is no DIALOGF.TLK, the sound reference associated with the string from DIALOG.TLK is used instead. If the string has no sound, the empty string is used instead."
552
+ }
553
+ },
554
+ "ACTION_GET_STRREF_S": {
555
+ "contents": {
556
+ "kind": "markdown",
557
+ "value": "```weidu-tp2-tooltip\nACTION_GET_STRREF_S value variable\n```\nThe string reference value is looked up in DIALOG.TLK and the sound reference associated with the (male) string is stored in the variable. If the string has no sound, the empty string is used instead."
558
+ }
559
+ },
560
+ "ACTION_IF": {
561
+ "contents": {
562
+ "kind": "markdown",
563
+ "value": "```weidu-tp2-tooltip\nACTION_IF value THEN BEGIN TP2 Action list END [ ELSE BEGIN TP2 Action list END ]\n```\nIf value evaluates to true (non-zero), the TP2 Actions in the THEN-branch are executed. Otherwise, if an ELSE-branch is present, its commands are executed. Otherwise nothing happens."
564
+ }
565
+ },
566
+ "ACTION_INCLUDE": {
567
+ "contents": {
568
+ "kind": "markdown",
569
+ "value": "```weidu-tp2-tooltip\nACTION_INCLUDE String list\n```\nA synonym of INCLUDE."
570
+ }
571
+ },
572
+ "ACTION_MATCH": {
573
+ "contents": {
574
+ "kind": "markdown",
575
+ "value": "```weidu-tp2-tooltip\nACTION_MATCH value WITH [ guardvalue ... [ WHEN conditionvalue ] BEGIN TP2 Action list END ] ... DEFAULT TP2 Action list END\n```\nThe value is case-insensitively matched against the guard values. If value matches one of the guard values, the associated action list is executed. If there is a condition, it additionally needs to evaluate to true for the values to match. If none of the values match, the DEFAULT action list is executed. See the MATCH and TRY tutorial for additional information."
576
+ }
577
+ },
578
+ "ACTION_PHP_EACH": {
579
+ "contents": {
580
+ "kind": "markdown",
581
+ "value": "```weidu-tp2-tooltip\nACTION_PHP_EACH String1 AS String2 => String3 list BEGIN TP2 Action list END\n```\nFor every value of the string1 array that has been created or read, sets string2_0 to the first array parameter, string2_1 to the second array parameter, etc. and string3 to the result of the array. string2 will also contain the first array parameter (as a synonym of string2_0). then executes the actions listed. More exhaustive documentation will be provided by SConrad."
582
+ }
583
+ },
584
+ "ACTION_READLN": {
585
+ "contents": {
586
+ "kind": "markdown",
587
+ "value": "```weidu-tp2-tooltip\nACTION_READLN variable\n```\nWaits for the user to provided an enter-terminated string and store it in variable. Said string will be stored and re-used during non-interactive reinstalls. See the READLN tutorial.\nAs of `v251`, it emits the 'bell' (code 7) control character when asking for input."
588
+ }
589
+ },
590
+ "ACTION_REINCLUDE": {
591
+ "contents": {
592
+ "kind": "markdown",
593
+ "value": "```weidu-tp2-tooltip\nACTION_REINCLUDE String list\n```\nA synonym of REINCLUDE."
594
+ }
595
+ },
596
+ "ACTION_RERAISE": {
597
+ "contents": {
598
+ "kind": "markdown",
599
+ "value": "```weidu-tp2-tooltip\nACTION_RERAISE\n```\nWhen used inside an ACTION_TRY, the matched error is re-raised. See the MATCH and TRY tutorial for additional information."
600
+ }
601
+ },
602
+ "ACTION_SORT_ARRAY_INDICES": {
603
+ "contents": {
604
+ "kind": "markdown",
605
+ "value": "```weidu-tp2-tooltip\nACTION_SORT_ARRAY_INDICES String ArrayIndicesSortType\n```\nSorts the indices of the array given by String according to the order ArrayIndicesSortType. String is evaluated for variables and you can use the array construct."
606
+ }
607
+ },
608
+ "ACTION_TIME": {
609
+ "contents": {
610
+ "kind": "markdown",
611
+ "value": "```weidu-tp2-tooltip\nACTION_TIME String BEGIN TP2 Action list END\n```\nMeasure the time taken to execute the TP2 Actions and report it under the label String together with the other time measurements at the end of the mod's debug file."
612
+ }
613
+ },
614
+ "ACTION_TO_LOWER": {
615
+ "contents": {
616
+ "kind": "markdown",
617
+ "value": "```weidu-tp2-tooltip\nACTION_TO_LOWER variable\n```\nTurns to lower-case the contents of %variable% and store the results in variable."
618
+ }
619
+ },
620
+ "ACTION_TO_UPPER": {
621
+ "contents": {
622
+ "kind": "markdown",
623
+ "value": "```weidu-tp2-tooltip\nACTION_TO_UPPER variable\n```\nTurns to upper-case the contents of %variable% and store the results in variable."
624
+ }
625
+ },
626
+ "ACTION_TRY": {
627
+ "contents": {
628
+ "kind": "markdown",
629
+ "value": "```weidu-tp2-tooltip\nACTION_TRY TP2 Action list WITH [ guardvalue ... [ WHEN conditionvalue ] BEGIN TP2 Action list END ] ... DEFAULT TP2 Action list END\n```\nIf evaluating the action list results in an error, the error is matched, as per ACTION_MATCH. N.B. TRY is generally not safe to use because many errors are intended to be fatal and if the mod installation were to proceed anyway, it might do so in an inconsistent state, with resource leaks or with other errors. ACTION_RERAISE mitigates or eliminates these risks, since the unsafe part is allowing the installation to continue and re-raising the error allows it to fail, like intended. See the MATCH and TRY tutorial for additional information."
630
+ }
631
+ },
632
+ "ADD_AREA_TYPE": {
633
+ "contents": {
634
+ "kind": "markdown",
635
+ "value": "```weidu-tp2-tooltip\nADD_AREA_TYPE areaTypeName\n```\nAdds a new (guaranteed-unique) area type to areatype.ids, and sets the areaTypeName variable to the index of the bit the type is associated with: the type can be set with WRITE_SHORT 0x48 THIS | (1 << areaTypeName). If areatype.ids already contains areaTypeName, the variable is set to the type's current identifier and no other operation is performed.\nAlso note that only 8 area types can be added to an unmodded installation of BG2; as such, don't add a new area type type unless you really need it (most likely, another modder is already using a type with a similar name, and you can share the type between your mods without issue)."
636
+ }
637
+ },
638
+ "ADD_JOURNAL": {
639
+ "contents": {
640
+ "kind": "markdown",
641
+ "value": "```weidu-tp2-tooltip\nADD_JOURNAL [ EXISTING ] [ MANAGED ] [ TITLE ( text ) ] reference list [ USING traFile list ]\n```\nIf the game is not of an EE-type, this action does nothing. If the game is of an EE-type, this action patches BGEE.SQL or BGEE.LUA (depending on game version) with the provided quests and journal entries, so they will work with the EE-type journal system.\nFor each of the provided references, which are taken to be journal entries, the first line of text, up to a newline character, is taken to be the title of the journal entry. Titles isolated in this way have any trailing whitespace and full stops trimmed. The title is added as a separate string to the TLK, together with the complete journal entry. The game files patched with the strrefs of the title and journal entry. Each unique title is given a unique quest id and journal entries that share titles end up sharing quest ids.\nIf EXISTING is specified, the strref of the title is matched against the existing title strrefs. If a match is found, the journal entry is added under the quest id of the existing quest. Otherwise it is added as a new quest. Note that TITLE should be given a string reference in this case. ADD_JOURNAL cannot guarantee correct results if EXISTING is used without TITLE or if TITLE is given a string or tra reference instead of a string reference.\nIf MANAGED is specified, all provided journal entries are given a unique, non-zero quest-group number. They share the same quest-group number regardless of whether they share the same title. If EXISTING is also specified, the quest-group numbers for all existing journal entries that match the provided titles are assigned a quest-group number, provided they do not already have one. This option does nothing unless the game version supports quest groups.\nIf TITLE is specified, the provided text is used as the title for all provided journal entries. The titles of each individual journal entry remains unchanged, they are just all listed under the same title."
642
+ }
643
+ },
644
+ "ADD_GAM_NPC": {
645
+ "contents": {
646
+ "kind": "markdown",
647
+ "value": "```weidu-tp2-tooltip\nADD_GAM_NPC npcCRE npcARE xCoord yCoord\n```\nSee the ADD_GAM_NPC tutorial for more information about this action, which is used when adding NPCs to Baldur's Gate 1. BG2 mods should not use this command."
648
+ }
649
+ },
650
+ "ADD_KIT": {
651
+ "contents": {
652
+ "kind": "markdown",
653
+ "value": "```weidu-tp2-tooltip\nADD_KIT internalKitName String1 String2 String3 String4 String6 String7 String8 String9 String10 String11 String12 String13 SAY text1 SAY text2 SAY text3\n```\nThis command allows you to add new kits to the BGII. See the example file mymod.tp2 or the tutorial at http://gibberlings3.net/forums/index.php?showtopic=584 for information on how to do this. ADD_KIT sets the variable %internalKitName% to the number your kit occupies in kitlist.2da. This value is exactly 0x4000 less than the number your kit is assigned in kit.ids. Also observe that the kit DWORD in the CRE file format uses a reversed WORD order, unlike all other fields in the CRE file format."
654
+ }
655
+ },
656
+ "ADD_MUSIC": {
657
+ "contents": {
658
+ "kind": "markdown",
659
+ "value": "```weidu-tp2-tooltip\nADD_MUSIC internalMusicName newMUSFile\n```\nnewMUSFile is copied to the music directory and added to songlist.2da under the name internalMusicName. The variable %internalMusicName% is set to the number of this new entry in songlist.2da. If newMUSFile already exists, the variable %internalMusicName% is set to the existing entry in songlist.2da and all other operations are skipped. Variables are evaluated. Some versions of the Infinity Engine cannot handle more than 100 entries in songlist.2da. ADD_MUSIC will fail under those circumstances unless the appropriate versions of ToB Hacks or ToBEx are installed or the game is GemRB or BGEE."
660
+ }
661
+ },
662
+ "ADD_PROJECTILE": {
663
+ "contents": {
664
+ "kind": "markdown",
665
+ "value": "```weidu-tp2-tooltip\nADD_PROJECTILE modpath/PROName.PRO [idsName]\n```\nAppends an entry for PROName to PROJECTL.IDS and assigns it the next available ProRef number. Then copies the file modpath/PROName.PRO to the override folder. The new ProRef number can be accessed through the variable %PROName% and used to updated the Projectile type field of an ITM or SPL file's Item Ability or Spell Ability sub-structures.\nIf `idsName` is specified, then it will give the projectile the name `idsName` in `MISSILE.IDS`."
666
+ }
667
+ },
668
+ "ADD_SCHOOL": {
669
+ "contents": {
670
+ "kind": "markdown",
671
+ "value": "```weidu-tp2-tooltip\nADD_SCHOOL schoolName removalString\n```\nCreates a new (guaranteed-unique) spell school (as per mschool.2da), associate removalString (can be a tra reference) to its removal, and sets the schoolName variable to the school identifier. If mschool.2da already contains schoolName, the variable is set to the school's current identifier and no other operation is performed."
672
+ }
673
+ },
674
+ "ADD_SECTYPE": {
675
+ "contents": {
676
+ "kind": "markdown",
677
+ "value": "```weidu-tp2-tooltip\nADD_SECTYPE sectypeName removalString\n```\nCreates a new (guaranteed-unique) spell secondary type (as per msectype.2da), associate removalString (can be a tra reference) to its removal, and sets the sectypeName variable to the sectype identifier. If msectype.2da already contains sectypeName, the variable is set to the sectype's current identifier and no other operation is performed."
678
+ }
679
+ },
680
+ "ADD_SPELL": {
681
+ "contents": {
682
+ "kind": "markdown",
683
+ "value": "```weidu-tp2-tooltip\nADD_SPELL newSPLfile type level idsName patch list [ IF_EXISTING patch list END ] [ ON_DISABLE patch list END ]\n```\nAdds newSPLfile as a spell of type and level into the game (IE, SPPR102 or whatnot), in the first empty slot possible, appends the idsName to spell.ids, and sets %idsName% to the 4-digit code associated with idsName in Spell.ids. While you copy newSPLfile to the override, you also apply the patches listed.\nIf Spell.ids already contains a spell named idsName, of the same type and level than the one you're adding, then that spell is overwritten (rather than adding a duplicate version). If you have the IF_EXISTING section, its patches are applied to the current version instead.\n\nIf Spell.ids already contains a spell named idsName, but of of different type and/or level than the one you're adding, then the current reference is removed from spell.ids, and then the action proceeds as usual. In this case, if there is the ON_DISABLE section, the patches declared there will be applied to the older spell."
684
+ }
685
+ },
686
+ "ALTER_TLK": {
687
+ "contents": {
688
+ "kind": "markdown",
689
+ "value": "```weidu-tp2-tooltip\nALTER_TLK BEGIN patch list END\n```\nExecutes the given patch list on all the strings *currently* in dialog.tlk. This means that strings added in the current mod installation will not be patched, and strings already altered via ALTER_TLK* and/or STRING_SET* will be patched from the pre-patch condition. Consider using ALTER_TLK_RANGE with the base game's boundaries instead."
690
+ }
691
+ },
692
+ "ALTER_TLK_LIST": {
693
+ "contents": {
694
+ "kind": "markdown",
695
+ "value": "```weidu-tp2-tooltip\nALTER_TLK_LIST BEGIN value list END BEGIN patch list END\n```\nExecutes the given patch list on all the strings *currently* in dialog.tlk from the given list. This means that strings added in the current mod installation will not be patched, and strings already altered via ALTER_TLK* and/or STRING_SET* will be patched from the pre-patch condition."
696
+ }
697
+ },
698
+ "ALTER_TLK_RANGE": {
699
+ "contents": {
700
+ "kind": "markdown",
701
+ "value": "```weidu-tp2-tooltip\nALTER_TLK_RANGE value value BEGIN patch list END\n```\nExecutes the given patch list on all the strings *currently* in dialog.tlk between the two given values (both inclusive). This means that strings added in the current mod installation will not be patched, and strings already altered via ALTER_TLK* and/or STRING_SET* will be patched from the pre-patch condition."
702
+ }
703
+ },
704
+ "APPEND": {
705
+ "contents": {
706
+ "kind": "markdown",
707
+ "value": "```weidu-tp2-tooltip\nAPPEND optNoBackup filename newText when list [ KEEP_CRLF ]\n```\nIf there are no when conditions or they are all true, the ASCII text newText is appended to the existing file filename (which is read from the game BIFFs or the override folder). Any variables in newText are replaced by their values. If KEEP_CRLF is not present, double newlines in the file (but not in newText) will be removed; otherwise, they're kept. In any event, if the file ends with CRLF only newText and an ending CRLF will be written; otherwise, if the file does not end with CRLF, it will be written before newText."
708
+ }
709
+ },
710
+ "APPEND_COL": {
711
+ "contents": {
712
+ "kind": "markdown",
713
+ "value": "```weidu-tp2-tooltip\nAPPEND_COL optNoBackup filename newText [ prepend ] when list\n```\nIf there are no when conditions or they are all true, the string newText is appended column-wise to the existing file filename (which is read from the game BIFFs or the override folder). You must have the same number of whitespace-separated words in newText as there are columns in filename. Prepend empty cells are assumed to be at the beginning of newText. A cell containing exactly $ is printed as empty."
714
+ }
715
+ },
716
+ "APPEND_COL_OUTER": {
717
+ "contents": {
718
+ "kind": "markdown",
719
+ "value": "```weidu-tp2-tooltip\nAPPEND_COL_OUTER optNoBackup filename newText [ prepend ] when list\n```\nIf there are no when conditions or they are all true, the string newText is appended column-wise to the existing file filename (which is treated as a path to a file). You must have the same number of whitespace-separated words in newText as there are columns in filename. Prepend empty cells are assumed to be at the beginning of newText. A cell containing exactly $ is printed as empty."
720
+ }
721
+ },
722
+ "APPEND_OUTER": {
723
+ "contents": {
724
+ "kind": "markdown",
725
+ "value": "```weidu-tp2-tooltip\nAPPEND_OUTER optNoBackup filename newText when list [ KEEP_CRLF ]\n```\nIf there are no when conditions or they are all true, the ASCII text newText is appended to the existing file filename (which is treated as a path to a file). Any variables in newText are replaced by their values. If KEEP_CRLF is not present, double newlines in the file (but not in newText) will be removed; otherwise, they're kept. In any event, if the file ends with CRLF only newText and an ending CRLF will be written; otherwise, if the file does not end with CRLF, it will be written before newText."
726
+ }
727
+ },
728
+ "AT_EXIT": {
729
+ "contents": {
730
+ "kind": "markdown",
731
+ "value": "```weidu-tp2-tooltip\nAT_EXIT commandToRun [ EXACT ]\n```\nWhenever this component attempts to be installed, commandToRun is executed. Variables (e.g., %LANGUAGE%) in the string commandToRun are replaced by their values. Note that the command is executed even if the component does not install correctly, so AT_EXIT should probably be the last command in a component.\nIf commandToRun consists of a single TP2 filename, WeiDU will enqueue that TP2 file and run it when the current one is done (asking the user all the standard questions about languages and which components to install).\nIf commandToRun consists of the word VIEW followed by a file, a system-specific viewer will be used to present the file to the user. For example, on Windows systems notepad will be used to view txt files and a web browser will be used to view html files. Note: also NOTEPAD and EXPLORER work like this, but use of those are reserved to differently able modders. Otherwise, commandToRun is executed by the underlying operating system (and is thus system dependant). If you want to do something that WeiDU doesn't handle, like extracting WAVs from an MP3, make a batch file and run it from here. Slashes and backslashes will be converted appropriately for the underlying operating system. If EXACT is specified, / and will instead be preserved as they are. The most common usage is:\nAT_INTERACTIVE_EXIT ~VIEW mymod\\README.txt~\nThis causes your README file to be displayed using a system appropriate viewer. Here's a more complicated example that pulls up a language-specific README if one is available:\nACTION_IF FILE_EXISTS ~mymod\\README.%LANGUAGE%.txt~ THEN BEGIN AT_INTERACTIVE_EXIT ~VIEW mymod\\README.%LANGUAGE%.txt~ END ELSE BEGIN AT_INTERACTIVE_EXIT ~VIEW mymod\\README.txt~ END"
732
+ }
733
+ },
734
+ "AT_INTERACTIVE_EXIT": {
735
+ "contents": {
736
+ "kind": "markdown",
737
+ "value": "```weidu-tp2-tooltip\nAT_INTERACTIVE_EXIT commandToRun [ EXACT ]\n```\nAs AT_EXIT, but the command is only executed if the user specifically asked for the component to be installed or upgraded."
738
+ }
739
+ },
740
+ "AT_INTERACTIVE_NOW": {
741
+ "contents": {
742
+ "kind": "markdown",
743
+ "value": "```weidu-tp2-tooltip\nAT_INTERACTIVE_NOW [ variable ] commandToRun [ EXACT ]\n```\nAs AT_NOW, but commandToRun is executed only if the installation is run interactively."
744
+ }
745
+ },
746
+ "AT_INTERACTIVE_UNINSTALL": {
747
+ "contents": {
748
+ "kind": "markdown",
749
+ "value": "```weidu-tp2-tooltip\nAT_INTERACTIVE_UNINSTALL commandToRun [ EXACT ]\n```\nAs AT_EXIT, but whenever the user specifically asks for this component to be removed, commandToRun is executed. Only the %LANGUAGE% variable is guaranteed to be replaced, so do not count on any others."
750
+ }
751
+ },
752
+ "AT_INTERACTIVE_UNINSTALL_EXIT": {
753
+ "contents": {
754
+ "kind": "markdown",
755
+ "value": "```weidu-tp2-tooltip\nAT_INTERACTIVE_UNINSTALL_EXIT commandToRun [ EXACT ]\n```\nAs AT_UNINSTALL_EXIT, but only whenever the user specifically asks for this component to be removed."
756
+ }
757
+ },
758
+ "AT_NOW": {
759
+ "contents": {
760
+ "kind": "markdown",
761
+ "value": "```weidu-tp2-tooltip\nAT_NOW [ variable ] commandToRun [ EXACT ]\n```\nAs AT_EXIT, but commandToRun is executed when found, rather than at the end of the installation. Use with oggdec, tisunpack, wav2acm... but not with readmes (you'll create dozens of windows), nor with --make-biff (you'll crash the installation). If the optional variable is provided, a TP2 variable is of that name is assigned the return value of commandToRun."
762
+ }
763
+ },
764
+ "AT_UNINSTALL": {
765
+ "contents": {
766
+ "kind": "markdown",
767
+ "value": "```weidu-tp2-tooltip\nAT_UNINSTALL commandToRun [ EXACT ]\n```\nAs AT_EXIT, but when this component is removed, commandToRun is executed."
768
+ }
769
+ },
770
+ "AT_UNINSTALL_EXIT": {
771
+ "contents": {
772
+ "kind": "markdown",
773
+ "value": "```weidu-tp2-tooltip\nAT_UNINSTALL_EXIT commandToRun [ EXACT ]\n```\nAs AT_UNINSTALL, but executed at the end of the WeiDU run (after printing 'SUCCESFULLY INSTALLED xyz')."
774
+ }
775
+ },
776
+ "CLEAR_ARRAYS": {
777
+ "contents": {
778
+ "kind": "markdown",
779
+ "value": "```weidu-tp2-tooltip\nCLEAR_ARRAYS\n```\nRemoves the names and contents of all arrays from the memory (while still keeping their values)."
780
+ }
781
+ },
782
+ "CLEAR_CODES": {
783
+ "contents": {
784
+ "kind": "markdown",
785
+ "value": "```weidu-tp2-tooltip\nCLEAR_CODES\n```\nRemoves all loaded functions and macros from the memory."
786
+ }
787
+ },
788
+ "CLEAR_EVERYTHING": {
789
+ "contents": {
790
+ "kind": "markdown",
791
+ "value": "```weidu-tp2-tooltip\nCLEAR_EVERYTHING\n```\nRuns CLEAR_MEMORY, CLEAR_ARRAY, CLEAR_CODES and CLEAR_INLINED."
792
+ }
793
+ },
794
+ "CLEAR_IDS_MAP": {
795
+ "contents": {
796
+ "kind": "markdown",
797
+ "value": "```weidu-tp2-tooltip\nCLEAR_IDS_MAP\n```\nForce WeiDU to remove all loaded IDSes in memory (otherwise, if you compile a script, append to an IDS and compile another script, WeiDU will not handle the new IDS entry)."
798
+ }
799
+ },
800
+ "CLEAR_INLINED": {
801
+ "contents": {
802
+ "kind": "markdown",
803
+ "value": "```weidu-tp2-tooltip\nCLEAR_INLINED\n```\nRemoves all inlined files from the memory."
804
+ }
805
+ },
806
+ "CLEAR_MEMORY": {
807
+ "contents": {
808
+ "kind": "markdown",
809
+ "value": "```weidu-tp2-tooltip\nCLEAR_MEMORY\n```\nRemoves all variables from the memory, then reloads the automatic ones (TP2_AUTHOR, TP2_FILE_NAME, TP2_BASE_NAME, MOD_FOLDER, LANGUAGE, WEIDU_ARCH, WEIDU_OS, COMPONENT_NUMBER, all numeric constants such as NAME1, the soundsets, or SCRIPT_OVERRIDE). INTERACTIVE is automatically set when you call the next component. Do not use this feature without a real reason."
810
+ }
811
+ },
812
+ "COMPILE": {
813
+ "contents": {
814
+ "kind": "markdown",
815
+ "value": "```weidu-tp2-tooltip\nCOMPILE [ EVALUATE_BUFFER ] sourceFile list [ patch list ] [ USING traFile list ]\n```\nThis command compiles D and BAF source files. If sourceFile is a directory, all D and BAF files within that directory are processed individually. If there is EVALUATE_BUFFER, all %variables% in the files are substituted with their values. After the special EVALUATE_BUFFER is executed, all other patches are executed.\nFirst, this loads all of the traFiles presented. If any of their paths contain %s, the %s is replaced with the languageDirectory of from the Language the user selected. If you specified AUTO_TRA mymod/%s above, WeiDU will also attempt to load mymod/languageDirectory/sourceFile.tra for every sourceFile in the list. Once all of the TRA files are loaded, the D and BAF files are compiled. Any DLGs or BCSs they create or modify are placed in the override directory."
816
+ }
817
+ },
818
+ "COPY": {
819
+ "contents": {
820
+ "kind": "markdown",
821
+ "value": "```weidu-tp2-tooltip\nCOPY optNoBackup optGlob fromFile toFile ... patch list when list\n```\nYou may specify as many fromFile-toFile pairs as you like. Each fromFile is copied to its associated toFile. If there are any WeiDU variables inside explicit %s in toFile or fromFile, they are replaced by their values. All of the patches are applied. If there are any when conditions and any of them are false, the copy does not happen. A typical example is COPY \"mymod/sword.itm\" \"override/m#sword.itm\". COPY commands set the user-defined SOURCE_DIRECTORY, SOURCE_FILESPEC, SOURCE_FILE, SOURCE_RES, SOURCE_EXT, DEST_DIRECTORY, DEST_FILESPEC, DEST_FILE,DEST_RES and DEST_EXT variables based on fromFile and toFile as follows. If fromFile is mymod/cre/bigboss.cre, then SOURCE_DIRECTORY is mymod/cre, SOURCE_FILESPEC is mymod/cre/bigboss.cre, SOURCE_FILE is bigboss.cre, SOURCE_RES is bigboss and SOURCE_EXT is cre. The DEST_ variables are similarly based on toFile. In addition, SOURCE_SIZE is set to the size (in bytes) of the source file. This is generally only useful if you have enabled globbing. Any user-defined variables in toFile are replaced with their values. You may also reference these variables in patches."
822
+ }
823
+ },
824
+ "COPY_ALL_GAM_FILES": {
825
+ "contents": {
826
+ "kind": "markdown",
827
+ "value": "```weidu-tp2-tooltip\nCOPY_ALL_GAM_FILES patch list when list\n```\nCopies Default.gam from the biff and the ones in the save/ and mpsave/ saved games, applying the list of patches. If there are any when conditions and any of them are false, the copy does not happen. NO BACKUP is applied to files in the save/ and mpsave/ directories. The savegame from the biffs is backed up as usual."
828
+ }
829
+ },
830
+ "COPY_EXISTING": {
831
+ "contents": {
832
+ "kind": "markdown",
833
+ "value": "```weidu-tp2-tooltip\nCOPY_EXISTING optNoBackup fromFile toFile ...\n```\nBehaves like COPY except that the fromFiles are drawn from the game BIFFs or override directory. This is useful for making changes to files that other mods may have changed as well."
834
+ }
835
+ },
836
+ "COPY_EXISTING_REGEXP": {
837
+ "contents": {
838
+ "kind": "markdown",
839
+ "value": "```weidu-tp2-tooltip\nCOPY_EXISTING_REGEXP optNoBackup optGlob fromFileRegexp toDirOrFile ... patch list when list\n```\nBehaves like COPY_EXISTING except that fromFileRegexp may contain regular expressions (regexps). Additionally, toDirOrFile may reference matched groups in fromFileRegexp with \\1, \\2, etc. If toDirOrFile is an existing directory or lacks a file extension, it will be treated as a directory and all matching files in the game BIFFs will be copied there. Otherwise, toDirOrFile will be treated as a file. If GLOB is specified, matching files in override will also be patched and copied. If a file appears in both the BIFFs and the override folder, it will only be copied once. For example, if HARM.ITM is in the BIFFs and HARM2.ITM is in override, this code will copy and patch them both: COPY_EXISTING_REGEXP GLOB ~HARM.*.ITM~ ~override~ SAY // ... whatever"
840
+ }
841
+ },
842
+ "COPY_KIT": {
843
+ "contents": {
844
+ "kind": "markdown",
845
+ "value": "```weidu-tp2-tooltip\nCOPY_KIT oldKit newKit ( diffName diffValue list )\n```\nCopies a copy of the oldKit kit called newKit. This copy is non-player selectable, while all other fields can be edited by setting diffName to the field to be changed and diffValue to the new value. Valid values for diffName are: clasweap, weapprof, abclasrq, abclsmod, abdcdsrq, abdcscrq, dualclas, alignmnt, clab, lower, mixed, help, luabbr, 25stweap, unusabilities. Currently, lower, mixed and help can only be numbers referring to a TLK string. Unusabilities requires to be both kit and class unusables, there isn't a way to BAND or BOR them."
846
+ }
847
+ },
848
+ "COPY_LARGE": {
849
+ "contents": {
850
+ "kind": "markdown",
851
+ "value": "```weidu-tp2-tooltip\nCOPY_LARGE optNoBackup optGlob fromFile toFile ...\n```\nBehaves like COPY except that the fromFiles can be of arbitrary size (the limit should be over a Gigabyte), but on the other side of the coin you can't apply patches to the copying. Like COPY, COPY_LARGE sets the variables SOURCE_DIRECTORY, SOURCE_FILESPEC, SOURCE_FILE, SOURCE_RES, SOURCE_EXT, SOURCE_SIZE, DEST_DIRECTORY, DEST_FILESPEC, DEST_FILE, DEST_RES and DEST_EXT."
852
+ }
853
+ },
854
+ "COPY_RANDOM": {
855
+ "contents": {
856
+ "kind": "markdown",
857
+ "value": "```weidu-tp2-tooltip\nCOPY_RANDOM ( file1 list ) [ ( fileN list ) list ] patch list when list\n```\nThis command works like COPY_EXISTING but the destination for any given source file in the file1-list is some other different file in the file1-list. Similarly, the destination for any file in the fileN-list is some other file in the fileN-list. This allows you to randomly shuffle categories of game resources."
858
+ }
859
+ },
860
+ "CREATE": {
861
+ "contents": {
862
+ "kind": "markdown",
863
+ "value": "```weidu-tp2-tooltip\nCREATE type [ VERSION version ] resref [ patch list ]\n```\nCreates a new file of the specified type with the resource reference resref and a correct file extension for the file type. If there are any patches, they are applied to contents of the new file. Any existing file with the same name will be backed up, as normal. The file will be created structurally correct but will contain no non-zero data aside from the structural details. The file version will be native to the current game, or default to \"V1.0\", but can be overridden with the VERSION option, which takes a string specifying the desired version. CREATE supports the file types ARE, CRE, EFF, ITM, SPL and STO and all their known file versions (aside from EFF V1.0, which is never found as a file).\nAs of `v251`, `CREATE` sets `COPY` variables (`SOURCE_*` and `DEST_*`) as if the file were an implicit file being copied to the `override/` directory."
864
+ }
865
+ },
866
+ "DECOMPRESS_BIFF": {
867
+ "contents": {
868
+ "kind": "markdown",
869
+ "value": "```weidu-tp2-tooltip\nDECOMPRESS_BIFF file ...\n```\nDecompresses one or more biff files from either \"BIF V1.0\" or \"BIFCV1.0\" into \"BIFFV1 \". The biff file is looked for in /data and the CD paths specified in baldur.ini. You should consequently not specify the biff path, merely the name. All matching biff files are decompressed, even ones that are duplicated between CD paths. The biff file is backed up to another file in the same directory before it is decompressed. Since multiple games can share the same biffs, this action is not uninstalled together with the mod. WeiDU will raise a Failure exception if the biff is not found in any of the paths.\nDecompressing a biff file can be helpful in preventing crashes related to area files, commonly WAV ambient sounds or TIS files. Do not use this action without a real reason."
870
+ }
871
+ },
872
+ "DEFINE_ACTION_FUNCTION": {
873
+ "contents": {
874
+ "kind": "markdown",
875
+ "value": "```weidu-tp2-tooltip\nDEFINE_ACTION_FUNCTION String [ INT_VAR variable = value ... ] [ STR_VAR variable = String ... ] [ RET variable ... ] [ RET_ARRAY variable ... ] BEGIN TP2 Action list END\n```\nDefine an action function. Refer to the Functions section for additional information."
876
+ }
877
+ },
878
+ "DEFINE_DIMORPHIC_FUNCTION": {
879
+ "contents": {
880
+ "kind": "markdown",
881
+ "value": "```weidu-tp2-tooltip\nDEFINE_DIMORPHIC_FUNCTION String [ INT_VAR variable = value ... ] [ STR_VAR variable = String ... ] [ RET variable ... ] [ RET_ARRAY variable ... ] BEGIN TP2 Action list END\n```\nAs `DEFINE_ACTION_FUNCTION`, except the function is additionally defined as a `PATCH` function."
882
+ }
883
+ },
884
+ "DEFINE_ACTION_MACRO": {
885
+ "contents": {
886
+ "kind": "markdown",
887
+ "value": "```weidu-tp2-tooltip\nDEFINE_ACTION_MACRO String BEGIN TP2 Action list END\n```\nDefine an action macro. Refer to the macros section for additional information."
888
+ }
889
+ },
890
+ "DEFINE_PATCH_FUNCTION": {
891
+ "contents": {
892
+ "kind": "markdown",
893
+ "value": "```weidu-tp2-tooltip\nDEFINE_PATCH_FUNCTION String [ INT_VAR variable = value ... ] [ STR_VAR variable = String ... ] [ RET variable ... ] [ RET_ARRAY variable ... ] BEGIN patch list END\n```\nDefine a patch function. Refer to the Functions section for additional information."
894
+ }
895
+ },
896
+ "DEFINE_PATCH_MACRO": {
897
+ "contents": {
898
+ "kind": "markdown",
899
+ "value": "```weidu-tp2-tooltip\nDEFINE_PATCH_MACRO String BEGIN patch list END\n```\nDefine a patch macro. Refer to the macros section for additional information."
900
+ }
901
+ },
902
+ "DELETE": {
903
+ "contents": {
904
+ "kind": "markdown",
905
+ "value": "```weidu-tp2-tooltip\nDELETE optNoBackup file ...\n```\nRemoves one or more files from the file system. If file is a directory, it will be recursively deleted together with anything it contains. Do not use without a real reason."
906
+ }
907
+ },
908
+ "DISABLE_FROM_KEY": {
909
+ "contents": {
910
+ "kind": "markdown",
911
+ "value": "```weidu-tp2-tooltip\nDISABLE_FROM_KEY file ...\n```\nRemoves one or more files from the chitin.key, while leaving the containing bif file itself untouched. Do not use without a real reason."
912
+ }
913
+ },
914
+ "EXTEND_BOTTOM": {
915
+ "contents": {
916
+ "kind": "markdown",
917
+ "value": "```weidu-tp2-tooltip\nEXTEND_BOTTOM existingBCS newFile patch list [ USING traName list ] when list\n```\nAs EXTEND_TOP, but the newFile file is put at the bottom of the existingBCS file. User variables in the filenames existingFile and newFile are replaced by their values."
918
+ }
919
+ },
920
+ "EXTEND_BOTTOM_REGEXP": {
921
+ "contents": {
922
+ "kind": "markdown",
923
+ "value": "```weidu-tp2-tooltip\nEXTEND_BOTTOM_REGEXP existingBCSregexp newFile patch list [ USING traName list ] when list\n```\nSee EXTEND_TOP_REGEXP."
924
+ }
925
+ },
926
+ "EXTEND_TOP": {
927
+ "contents": {
928
+ "kind": "markdown",
929
+ "value": "```weidu-tp2-tooltip\nEXTEND_TOP existingBCS newFile patch list [ USING traName list ] when list\n```\nLoads existingFile (which may be BAF or BCS), prepends all of newBCS to the top of it, applies all of the patches, and then copies it to the override folder. User variables in the filenames existingFile and newFile are replaced by their values. Use EVALUATE_BUFFER if you want to evaluate variables inside the body of newFile before parsing it."
930
+ }
931
+ },
932
+ "EXTEND_TOP_REGEXP": {
933
+ "contents": {
934
+ "kind": "markdown",
935
+ "value": "```weidu-tp2-tooltip\nEXTEND_TOP_REGEXP existingBCSregexp newFile patch list [ USING traName list ] when list\n```\nAs EXTEND_TOP, but the newFile file is put at the top of the every BCS file that matches the regexp existingBCSregexp."
936
+ }
937
+ },
938
+ "FAIL": {
939
+ "contents": {
940
+ "kind": "markdown",
941
+ "value": "```weidu-tp2-tooltip\nFAIL warningString\n```\nIf this TP2 Action is executed, warningString is displayed and the component fails to install."
942
+ }
943
+ },
944
+ "FORBID_FILE": {
945
+ "contents": {
946
+ "kind": "markdown",
947
+ "value": "```weidu-tp2-tooltip\nFORBID_FILE filename warningString\n```\nIf filename does exist (or the bif file is referenced inside the chitin.key), warningString is displayed and this component cannot be installed. This is checked before any actions are executed."
948
+ }
949
+ },
950
+ "GET_DIRECTORY_ARRAY": {
951
+ "contents": {
952
+ "kind": "markdown",
953
+ "value": "```weidu-tp2-tooltip\nGET_DIRECTORY_ARRAY String path regexp\n```\nLike GET_FILE_ARRAY except regexp is matched against directories instead of files."
954
+ }
955
+ },
956
+ "GET_FILE_ARRAY": {
957
+ "contents": {
958
+ "kind": "markdown",
959
+ "value": "```weidu-tp2-tooltip\nGET_FILE_ARRAY String path regexp\n```\nThe array `$string(0), $string{1}` etc is set to the file names, including `path`, that match `regexp` in `path`. The `path` is relative to the installation directory (e.g. `save/000000000-Auto-Save`)."
960
+ }
961
+ },
962
+ "INCLUDE": {
963
+ "contents": {
964
+ "kind": "markdown",
965
+ "value": "```weidu-tp2-tooltip\nINCLUDE String list\n```\nLoads the file string as if it were a list of tp2 actions and executes it (as if it had been typed inside your tp2). These files have by convenience tph as an extension, due to no reason other than randomness (you can use .tp1 or .xyzsucks if you're so oriented). Please note that, to speed up inclusions, tph files are stored in memory, rather than re-read each time from the hard-disk. If you need automorphing code (IE, you want to edit your tph file), you can use REINCLUDE instead."
966
+ }
967
+ },
968
+ "LAUNCH_ACTION_FUNCTION": {
969
+ "contents": {
970
+ "kind": "markdown",
971
+ "value": "```weidu-tp2-tooltip\nLAUNCH_ACTION_FUNCTION String\n [ INT_VAR variable [ = value ] ... ]\n [ STR_VAR variable [ = [ EVALUATE_BUFFER ] String ] ... ]\n [ RET variable [ = String ] ... ]\n [ RET_ARRAY variable [ = String ] ... ]\nEND\n```\nLaunch an action function. Refer to the [Functions](https://weidu.org/~thebigg/README-WeiDU.html#sec-functions) section for additional information. You may use `LAF` as a synonym for `LAUNCH_ACTION_FUNCTION`."
972
+ }
973
+ },
974
+ "LAF": {
975
+ "contents": {
976
+ "kind": "markdown",
977
+ "value": "```weidu-tp2-tooltip\nLAF String\n [ INT_VAR variable [ = value ] ... ]\n [ STR_VAR variable [ = [ EVALUATE_BUFFER ] String ] ... ]\n [ RET variable [ = String ] ... ]\n [ RET_ARRAY variable [ = String ] ... ]\nEND\n```\nLaunch an action function. Refer to the [Functions](https://weidu.org/~thebigg/README-WeiDU.html#sec-functions) section for additional information. You may use `LAF` as a synonym for `LAUNCH_ACTION_FUNCTION`."
978
+ }
979
+ },
980
+ "LAUNCH_ACTION_MACRO": {
981
+ "contents": {
982
+ "kind": "markdown",
983
+ "value": "```weidu-tp2-tooltip\nLAUNCH_ACTION_MACRO String\n```\nLaunch an action macro. Refer to the macros section for additional information. You may use LAM as a synonym for LAUNCH_ACTION_MACRO."
984
+ }
985
+ },
986
+ "LAM": {
987
+ "contents": {
988
+ "kind": "markdown",
989
+ "value": "```weidu-tp2-tooltip\nLAM String\n```\nLaunch an action macro. Refer to the macros section for additional information. You may use LAM as a synonym for LAUNCH_ACTION_MACRO."
990
+ }
991
+ },
992
+ "LOAD_TRA": {
993
+ "contents": {
994
+ "kind": "markdown",
995
+ "value": "```weidu-tp2-tooltip\nLOAD_TRA traName list\n```\nLoads all traName files (variable substitution is done; the file can be inlined) to be used in the following tp2 actions, as if you had declared them in LANGUAGE."
996
+ }
997
+ },
998
+ "LOG": {
999
+ "contents": {
1000
+ "kind": "markdown",
1001
+ "value": "```weidu-tp2-tooltip\nLOG displayString\n```\nThe string DisplayString is echoed to setup-mymod.debug. If displayString contains %variable% references, their values will be displayed."
1002
+ }
1003
+ },
1004
+ "MAKE_BIFF": {
1005
+ "contents": {
1006
+ "kind": "markdown",
1007
+ "value": "```weidu-tp2-tooltip\nMAKE_BIFF name-of-biff BEGIN directory-file-regexp list END\n```\nCreate a biff Data/name-of-biff.bif from the files that can be matched by directory-file-regexp. The chitin.key file is restored as a normal file, and reloaded whenever the component is installed or uninstalled (which means that its contents will be available exactly when the biff exists), while the .bif file itself is deleted or on uninstall as usual."
1008
+ }
1009
+ },
1010
+ "MKDIR": {
1011
+ "contents": {
1012
+ "kind": "markdown",
1013
+ "value": "```weidu-tp2-tooltip\nMKDIR dirName list\n```\nInstructs WeiDU to create all of the directories in the list."
1014
+ }
1015
+ },
1016
+ "MOVE": {
1017
+ "contents": {
1018
+ "kind": "markdown",
1019
+ "value": "```weidu-tp2-tooltip\nMOVE optNoBackup fromFile toFile ... ( directory-file-regexp ) toFile ...\n```\nIf optNoBackup is specified, in addition to the usual effects, fromFile may be moved to toFile even if one or both contain spaces in their names. Do not use this feature without a real reason. You may specify as many fromFile--toFile pairs as you like. Each fromFile is moved to its associated toFile.\nIf fromFile is a file, toFile can be a file or a directory; if fromFile is a directory, toFile must be a directory; if fromFile doesn't exist, an error is raised. If toFile already exists, MOVE is equivalent to COPY_LARGE.\nMOVE also supports the directory-file-regexp construct in place of fromFile; in this form, it must be wrapped in parenthesis, toFile must be a directory, and no error is raised if no file is matched. Examples:\nMOVE ~sourceFile~ ~destinationFile~ MOVE ~sourceFile~ ~destinationDirectory~ MOVE ~sourceDirectory~ ~destinationDirectory~ MOVE (~sourceDirectory~ ~^[A-M].*\\.itm$~) ~destinationDirectory\nSafety notes: when uninstalling, MOVE is restored first, then all generic actions are restored, then AT_*_UNINSTALL is handled. As such, do your AT_NOW, then do your COPY, then do your MOVEs (exception: if you MOVE for biffing purposes, it is safe to call MAKE_BIFF after MOVE. Do not use the --make-biff command-line argument)."
1020
+ }
1021
+ },
1022
+ "OUTER_FOR": {
1023
+ "contents": {
1024
+ "kind": "markdown",
1025
+ "value": "```weidu-tp2-tooltip\nOUTER_FOR ( patch list ; value ; patch list ) BEGIN TP2 Action list END\n```\nThe TP2 Action OUTER_FOR (init;pred;inc) BEGIN body END is equivalent to init WHILE pred BEGIN INNER_ACTION BEGIN body END inc END, except that it's considered an action. Note that the predicate value cannot be empty."
1026
+ }
1027
+ },
1028
+ "OUTER_INNER_PATCH": {
1029
+ "contents": {
1030
+ "kind": "markdown",
1031
+ "value": "```weidu-tp2-tooltip\nOUTER_INNER_PATCH buffString BEGIN patch list END\n```\nAny WeiDU variables inside %s within buffString are replaced by their values. All of the patches given are evaluated as if the contents of the current file were buffString. Any modifications to buffString are thrown away. This is considered an action, not a patch."
1032
+ }
1033
+ },
1034
+ "OUTER_INNER_PATCH_SAVE": {
1035
+ "contents": {
1036
+ "kind": "markdown",
1037
+ "value": "```weidu-tp2-tooltip\nOUTER_INNER_PATCH_SAVE savevar buffString BEGIN patch list END\n```\nAs with OUTER_INNER_PATCH, except that any modifications to buffString are stored inside savevar."
1038
+ }
1039
+ },
1040
+ "OUTER_PATCH": {
1041
+ "contents": {
1042
+ "kind": "markdown",
1043
+ "value": "```weidu-tp2-tooltip\nOUTER_PATCH buffString BEGIN patch list END\n```\nEqual to OUTER_INNER_PATCH, if you feel that OUTER_INNER sounds wrong."
1044
+ }
1045
+ },
1046
+ "OUTER_PATCH_SAVE": {
1047
+ "contents": {
1048
+ "kind": "markdown",
1049
+ "value": "```weidu-tp2-tooltip\nOUTER_PATCH_SAVE savevar buffString BEGIN patch list END\n```\nEqual to OUTER_INNER_PATCH_SAVE, if you feel that OUTER_INNER sounds wrong."
1050
+ }
1051
+ },
1052
+ "OUTER_SET": {
1053
+ "contents": {
1054
+ "kind": "markdown",
1055
+ "value": "```weidu-tp2-tooltip\nOUTER_SET [ GLOBAL ] variable = value\n```\nUpdate variable so that it is equal to value.\nIf `GLOBAL` is provided, the variable is set in a special variable scope that can be accessed from any other variable scope. Normal variables do, however, shadow `GLOBAL` variables if they have the same variable name."
1056
+ }
1057
+ },
1058
+ "LOCAL_SET": {
1059
+ "contents": {
1060
+ "kind": "markdown",
1061
+ "value": "```weidu-tp2-tooltip\nLOCAL_SET variable = value\n```\nUpdate variable so that it is equal to value. Only usable in ACTION and PATCH macros.\n\nBasically, at the beginning of the macro declaration, you may use `LOCAL_SET variable = value` to declare a variable as local, and assign it a new value. Use this for all variables that don't need to be changed by the macro. After computing the macro, these variables are set to the value they had before the macro was processed."
1062
+ }
1063
+ },
1064
+ "OUTER_SNPRINT": {
1065
+ "contents": {
1066
+ "kind": "markdown",
1067
+ "value": "```weidu-tp2-tooltip\nOUTER_SNPRINT value variable stringWithVars\n```\nIf value evaluates to zero or a positive number, N, the first N characters of the evaluated contents of stringWithVars are assigned to variable. If value evaluates to a negative number, N, it's instead the last N characters. Thus: SPRINT author Jason SNPRINT 3 myvar \"1:%author%\" ... assigns 1:J to myvar."
1068
+ }
1069
+ },
1070
+ "OUTER_SPRINT": {
1071
+ "contents": {
1072
+ "kind": "markdown",
1073
+ "value": "```weidu-tp2-tooltip\nOUTER_SPRINT [ GLOBAL ] variable stringWithVars\n```\nLike OUTER_TEXT_SPRINT, but stringWithVars can be an @reference, and will break --traify. Use OUTER_TEXT_SPRINT instead."
1074
+ }
1075
+ },
1076
+ "LOCAL_SPRINT": {
1077
+ "contents": {
1078
+ "kind": "markdown",
1079
+ "value": "```weidu-tp2-tooltip\nLOCAL_SPRINT variable stringWithVars\n```\nLike LOCAL_TEXT_SPRINT, but stringWithVars can be an @reference, and will break --traify. Use LOCAL_TEXT_SPRINT instead."
1080
+ }
1081
+ },
1082
+ "OUTER_TEXT_SPRINT": {
1083
+ "contents": {
1084
+ "kind": "markdown",
1085
+ "value": "```weidu-tp2-tooltip\nOUTER_TEXT_SPRINT [ GLOBAL ] variable stringWithVars\n```\nAny WeiDU variables (enclosed in %s) inside stringWithVars are replaced by their values and the resulting string (constructed at mod-installation time!) is assigned to the variable variable.\nIf `GLOBAL` is provided, the variable is set in a special variable scope that can be accessed from any other variable scope. Normal variables do, however, shadow `GLOBAL` variables if they have the same variable name."
1086
+ }
1087
+ },
1088
+ "LOCAL_TEXT_SPRINT": {
1089
+ "contents": {
1090
+ "kind": "markdown",
1091
+ "value": "```weidu-tp2-tooltip\nLOCAL_TEXT_SPRINT variable stringWithVars\n```\nAny WeiDU variables (enclosed in %s) inside stringWithVars are replaced by their values and the resulting string (constructed at mod-installation time!) is assigned to the variable variable. Only usable in ACTION and PATCH macros.\n\nBasically, at the beginning of the macro declaration, you may use `LOCAL_TEXT_SPRINT variable stringWithVars` to declare a variable as local, and assign it a new value. Use this for all variables that don't need to be changed by the macro. After computing the macro, these variables are set to the value they had before the macro was processed."
1092
+ }
1093
+ },
1094
+ "OUTER_WHILE": {
1095
+ "contents": {
1096
+ "kind": "markdown",
1097
+ "value": "```weidu-tp2-tooltip\nOUTER_WHILE value BEGIN TP2 Action list END\n```\nIf value is non-zero, execute the given TP2 Action list and then repeat, re-evaluating the value. Be very careful when using this command. You can easily describe an infinite loop. See the WHILE loop tutorial for more information."
1098
+ }
1099
+ },
1100
+ "PRINT": {
1101
+ "contents": {
1102
+ "kind": "markdown",
1103
+ "value": "```weidu-tp2-tooltip\nPRINT displayString\n```\nThe string DisplayString is echoed to the user. Useful for debugging or status reports. If displayString contains %variable% references, their values will be displayed."
1104
+ }
1105
+ },
1106
+ "RANDOM_SEED": {
1107
+ "contents": {
1108
+ "kind": "markdown",
1109
+ "value": "```weidu-tp2-tooltip\nRANDOM_SEED someInteger\n```\nSets the random number generator seed to someInteger. This allows you to get reproducible results when using random functions. If you specify a string that is not a valid integer the system initializes itself (e.g., by using the current time)."
1110
+ }
1111
+ },
1112
+ "REINCLUDE": {
1113
+ "contents": {
1114
+ "kind": "markdown",
1115
+ "value": "```weidu-tp2-tooltip\nREINCLUDE String list\n```\nWorks like INCLUDE, but loads each time the tph file from the hard disk. This is slower, but required if you want to edit your tph file between an inclusion and another."
1116
+ }
1117
+ },
1118
+ "REQUIRE_FILE": {
1119
+ "contents": {
1120
+ "kind": "markdown",
1121
+ "value": "```weidu-tp2-tooltip\nREQUIRE_FILE filename warningString\n```\nIf filename does not exist (or the bif file is not referenced inside the chitin.key), warningString is displayed and this component cannot be installed. This is checked before any actions are executed."
1122
+ }
1123
+ },
1124
+ "SILENT": {
1125
+ "contents": {
1126
+ "kind": "markdown",
1127
+ "value": "```weidu-tp2-tooltip\nSILENT\n```\nMakes WeiDU skip all messages; it's reenabled once a component is installed (or fails to), or a PRINT, PATCH_PRINT, VERBOSE or PATCH_VERBOSE is found."
1128
+ }
1129
+ },
1130
+ "STRING_SET": {
1131
+ "contents": {
1132
+ "kind": "markdown",
1133
+ "value": "```weidu-tp2-tooltip\nSTRING_SET indexOrString newValue list [ USING traFile ]\n```\nThis command replaces each given string in the user's TLK file with the associated newValue. If a traFile is given, that file is is read once before all of the replacements take place and its contents are forgotten after."
1134
+ }
1135
+ },
1136
+ "STRING_SET_EVALUATE": {
1137
+ "contents": {
1138
+ "kind": "markdown",
1139
+ "value": "```weidu-tp2-tooltip\nSTRING_SET_EVALUATE value newValue list [ USING traFile ]\n```\nThis command replaces the string at index value in the user's TLK file with the associated newValue. If a traFile is given, that file is is read once before all of the replacements take place and its contents are forgotten after. If the index value equals the current number of strings in the TLK file (for example, through NEXT_STRREF), newValue will be added to the TLK file as a new string. This addition is made with no deduplication. Use with caution, as this will continue to grow the TLK file each time the mod is reinstalled."
1140
+ }
1141
+ },
1142
+ "STRING_SET_RANGE": {
1143
+ "contents": {
1144
+ "kind": "markdown",
1145
+ "value": "```weidu-tp2-tooltip\nSTRING_SET_RANGE #min #max USING traFile\n```\nFor every integer i between min and max (inclusive) we do STRING_SET i @i USING traFile (except that this command should be executed more rapidly). The command will fail if @i is not defined (either by traFile or by some other tra file in scope) for some i between min and max."
1146
+ }
1147
+ },
1148
+ "UNINSTALL": {
1149
+ "contents": {
1150
+ "kind": "markdown",
1151
+ "value": "```weidu-tp2-tooltip\nUNINSTALL modToUninstall modComponent\n```\nIf the given component of the given mod is currently installed, uninstall it before proceeding. Do not use this action without a real reason. This should only be used if you release a new version of a component under a new name. For example, many Tactics Mod components replace old Solaufein mod components. In order to prevent such a component from being installed twice, the Tactics version uninstalls the Solaufein version."
1152
+ }
1153
+ },
1154
+ "VERBOSE": {
1155
+ "contents": {
1156
+ "kind": "markdown",
1157
+ "value": "```weidu-tp2-tooltip\nVERBOSE\n```\nUndoes the latest SILENT command."
1158
+ }
1159
+ },
1160
+ "WARN": {
1161
+ "contents": {
1162
+ "kind": "markdown",
1163
+ "value": "```weidu-tp2-tooltip\nWARN displayString\n```\nThe string DisplayString is echoed to the user. Useful for debugging or status reports. If displayString contains %variable% references, their values will be displayed. Additionally, INSTALLED WITH WARNINGS is printed at the end of the install."
1164
+ }
1165
+ },
1166
+ "WITH_SCOPE": {
1167
+ "contents": {
1168
+ "kind": "markdown",
1169
+ "value": "```weidu-tp2-tooltip\nWITH_SCOPE BEGIN TP2 Action list END\n```\nCreates a new variable scope copied from the surrounding scope and evaluates the TP2 Actions inside the new scope. When WITH_SCOPE exits, the new scope is discarded, all new variables defined inside the scope and all changes to existing variables are forgotten."
1170
+ }
1171
+ },
1172
+ "WITH_TRA": {
1173
+ "contents": {
1174
+ "kind": "markdown",
1175
+ "value": "```weidu-tp2-tooltip\nWITH_TRA traName list BEGIN TP2 Action list END\n```\nCreates a new TRA scope copied from the surrounding scope, loads all traName files (variable substitution is done; the file can be inlined) and evaluates the TP2 Actions. When WITH_TRA exits, the new TRA scope is discarded, that is, all TRA changes made by WITH_TRA or any of its enclosed actions are forgotten."
1176
+ }
1177
+ },
1178
+ "REGISTER_UNINSTALL": {
1179
+ "contents": {
1180
+ "kind": "markdown",
1181
+ "value": "```weidu-tp2-tooltip\nREGISTER_UNINSTALL String\n```\n`String` should be a file name, including directory, if any. `String` is evaluated for variables and the array construct. This action generates uninstall information equivalent to a `COPY` with the file name as the target (toFile)."
1182
+ }
1183
+ },
1184
+ "GET_RESOURCE_ARRAY": {
1185
+ "contents": {
1186
+ "kind": "markdown",
1187
+ "value": "```weidu-tp2-tooltip\nGET_RESOURCE_ARRAY String regexp\n```\nThe array `$String(0)`, `$String(1)` etc is set to a sorted list of resource references that match the regexp case-insensitively. Resource references are all biffed files as well as those existing in the `override/` directory.\nThe result does not include any file paths. Both the string and the regexp are evaluated for variables and the array construct."
1188
+ }
1189
+ },
1190
+ "OUTER_SPRINTF": {
1191
+ "contents": {
1192
+ "kind": "markdown",
1193
+ "value": "```weidu-tp2-tooltip\nOUTER_SPRINTF variable stringWithVars ( variable or value list )\n```\nThis is just the `ACTION` counterpart of `SPRINTF`."
1194
+ }
1195
+ },
1196
+ "GLOB": {
1197
+ "contents": {
1198
+ "kind": "markdown",
1199
+ "value": "```weidu-tp2-tooltip\nGLOB\n```\nUse local filesystem globbing. Globbing is generally architecture specific!"
1200
+ }
1201
+ },
1202
+ "NOGLOB": {
1203
+ "contents": {
1204
+ "kind": "markdown",
1205
+ "value": "```weidu-tp2-tooltip\nNOGLOB\n```\nNever use local file system globbing. Or use sane defaults: enable globbing with COPY_EXISTING_REGEXP, disable it with COPY."
1206
+ }
1207
+ },
1208
+ "CASE_INSENSITIVE": {
1209
+ "contents": {
1210
+ "kind": "markdown",
1211
+ "value": "```weidu-tp2-tooltip\nCASE_INSENSITIVE\n```\nMatching is case-insensitive."
1212
+ }
1213
+ },
1214
+ "CASE_SENSITIVE": {
1215
+ "contents": {
1216
+ "kind": "markdown",
1217
+ "value": "```weidu-tp2-tooltip\nCASE_SENSITIVE\n```\nMatching is case-sensitive."
1218
+ }
1219
+ },
1220
+ "EVALUATE_REGEXP": {
1221
+ "contents": {
1222
+ "kind": "markdown",
1223
+ "value": "```weidu-tp2-tooltip\nEVALUATE_REGEXP\n```\nMatching is evaluated following the usual regexp conventions."
1224
+ }
1225
+ },
1226
+ "EXACT_MATCH": {
1227
+ "contents": {
1228
+ "kind": "markdown",
1229
+ "value": "```weidu-tp2-tooltip\nEXACT_MATCH\n```\nOnly the given string is searched for."
1230
+ }
1231
+ },
1232
+ "EXACT": {
1233
+ "contents": {
1234
+ "kind": "markdown",
1235
+ "value": "```weidu-tp2-tooltip\nEXACT\n```\nIn AT_EXIT and sister ACTIONs, If EXACT is specified, / and \\ will be preserved as they are."
1236
+ }
1237
+ },
1238
+ "LEXICOGRAPHICALLY": {
1239
+ "contents": {
1240
+ "kind": "markdown",
1241
+ "value": "```weidu-tp2-tooltip\nLEXICOGRAPHICALLY\n```\nThe sorting is in ascending lexicographical order. This means each row of indices are interpreted as a string and that, for example, 10 is sorted before 2."
1242
+ }
1243
+ },
1244
+ "NUMERICALLY": {
1245
+ "contents": {
1246
+ "kind": "markdown",
1247
+ "value": "```weidu-tp2-tooltip\nNUMERICALLY\n```\nThe sorting is in ascending numerical order. This requires that the first column of indices can be interpreted as numbers; any strings will raise a warning and the sort order will be undefined."
1248
+ }
1249
+ },
1250
+ "CACHE": {
1251
+ "contents": {
1252
+ "kind": "markdown",
1253
+ "value": "```weidu-tp2-tooltip\nCACHE\n```\nThe result is cached and repeat calls use the cached result instead of calculating a new result. This can improve performance significantly."
1254
+ }
1255
+ },
1256
+ "CLEAR": {
1257
+ "contents": {
1258
+ "kind": "markdown",
1259
+ "value": "```weidu-tp2-tooltip\nCLEAR\n```\nA cached result is cleared and the result is calculated anew."
1260
+ }
1261
+ },
1262
+ "ADD_CRE_ITEM": {
1263
+ "contents": {
1264
+ "kind": "markdown",
1265
+ "value": "```weidu-tp2-tooltip\nADD_CRE_ITEM itmName charge1 charge2 charge3 flags slot [ EQUIP ] [ TWOHANDED ] [ NOMOVE ]\n```\nAdd the item `itmName` to the current CRE file, with the number of charges determined by `charge1`, `charge2` and `charge3`, respectively.\n\nEach charge should be an integer, either in the form of `#integer` or `( value )`.\n\nThe argument `flags` must be a string consisting of one of\n- `none`\n- `identified`\n- `unstealable`\n- `stolen`\n- `undroppable`\n- `identified&stolen`\n- `identified&unstealable`\n- `identified&undroppable`\n- `unstealable&undroppable`\n- `stolen&undroppable`\n- `identified&stolen&undroppable`\n- `identified&unstealable&undroppable`\n\nThe argument `slot` should be a whitespace-separated list of entries chosen from\n- `helmet`\n- `armor`\n- `shield`\n- `gloves`\n- `lring`/`rring`\n- `amulet`\n- `belt`\n- `boots`\n- `weapon1-4`\n- `quiver1-4`\n- `cloak`\n- `qitem1-3`\n- `inv1-16`\n\nOn PST, there are the additional slots\n- `tattoo1-3`\n- `earring1-2`\n- `inv17-20`\n\nOn IWD2, there are the additional slots\n- `shield1-4`\n- `inv17-24`\n\n`ADD_CRE_ITEM` will add the item to the first empty slot in the list.\n\nIf no slot is empty, the item will be placed in the first slot in the list and the item that previously occupied the slot will be moved to the general inventory.\n\nIf the general inventory is full, the moved item will be discarded.\n\nAdditionally, `slot` may contain one or more entries chosen from\n- `inv`\n- `qitem`\n- `quiver`\n- `weapon`\n- `ring`\n\nThese entries unfold to the full range of corresponding slots. For example, `qitem` unfolds to `qitem1`, `qitem2` and `qitem3`.\n\nOn PST, you may additionally use `tattoo` and `earring`.\n\nOn IWD2, you may additionally use `shield`.\n\nThe optional argument `EQUIP` only applies to the weapon slots only and will make the creature have the weapon selected.\n\nThe optional argument `TWOHANDED` also only applies to weapon slots and will cause items in the shield slot to be unequipped.\n\nThe optional argument `NOMOVE` will cause the new item to be added to the specified slot(s) only if there is an empty slot, otherwise the new item is placed in the inventory."
1266
+ }
1267
+ },
1268
+ "ADD_KNOWN_SPELL": {
1269
+ "contents": {
1270
+ "kind": "markdown",
1271
+ "value": "```weidu-tp2-tooltip\nADD_KNOWN_SPELL splName spellLevel spellType\n```\nWhen applied to a CRE file, this patch causes the given spell to be known. Note that spellLevel counts from 0 (e.g., you should say #2 for a third-level Fireball). Possible values for spellType are priest, innate and wizard. Example: COPY_EXISTING ~some.cre~ ~override/some.cre~ ADD_KNOWN_SPELL ~SPPR314~ #2 ~priest~ // Unholy Blight is now known as a 3rd level priest spell Special thanks to Japh for coding this feature."
1272
+ }
1273
+ },
1274
+ "ADD_MAP_NOTE": {
1275
+ "contents": {
1276
+ "kind": "markdown",
1277
+ "value": "```weidu-tp2-tooltip\nADD_MAP_NOTE xCoord yCoord color String\n```\nIf the file currently being patched is an ARE area file, this patch command adds a map note to it. Valid colors include: gray, violent, green, orange, red, blue, darkblue, lightgray. Example: COPY_EXISTING ~ar0202.are~ ~override/ar0202.are~ ADD_MAP_NOTE #123 #777 ~violet~ ~This is my new map note! Yippee!~ Special thanks to Japh for coding this feature."
1278
+ }
1279
+ },
1280
+ "ADD_MEMORIZED_SPELL": {
1281
+ "contents": {
1282
+ "kind": "markdown",
1283
+ "value": "```weidu-tp2-tooltip\nADD_MEMORIZED_SPELL splName spellLevel spellType [ ( value ) ]\n```\nWhen applied to a CRE file, this patch causes the given spell to be memorized one more time (or value times if specified). Note that spellLevel counts from 0 (e.g., you should say #2 for a third-level Fireball). Possible values for spellType are priest, innate and wizard. Example: COPY_EXISTING ~some.cre~ ~override/some.cre~ ADD_MEMORIZED_SPELL ~SPPR314~ #2 ~priest~ ( 5 ) // Unholy Blight is now memorized five times as 3rd priest"
1284
+ }
1285
+ },
1286
+ "ADD_STORE_ITEM": {
1287
+ "contents": {
1288
+ "kind": "markdown",
1289
+ "value": "```weidu-tp2-tooltip\nADD_STORE_ITEM [ + ] itemName [ position ] charge1 charge2 charge3 flags stack [ unlimited ]\n```\nAdd the item itemName to the current STO file. An optional + signifies that the new instance of the item should overwrite any existing instance of the same item. The item's number of charges are given by the respective charge argument, which must take the form of #integer or ( value ). The optional position argument must be one of AFTER String, BEFORE String, LAST, FIRST or AT value. AFTER will place the new item behind the item given by String. BEFORE will place the item before the item provided by String. LAST will place the new item after all existing items. FIRST will place the new item as the first item in the store. AT will place the new item at the position given by value, with the first item having position 0. If no position argument is given, ADD_STORE_ITEM defaults to FIRST. The argument flags must be a string consisting of one of none, identified, unstealable, stolen, identified&stolen or identified&unstealable. The argument stack sets the number of item the store carries in the stack and must take the form of #integer or ( value ). The optional argument unlimited should be one of the strings limited or unlimited and controls whether the store should carry an inexhaustible stack of the new item, or not. limited is the default behaviour. See the ADD_STORE_ITEM tutorial for more information."
1290
+ }
1291
+ },
1292
+ "ADD_STORE_PURCHASE": {
1293
+ "contents": {
1294
+ "kind": "markdown",
1295
+ "value": "```weidu-tp2-tooltip\nADD_STORE_PURCHASE\n```\nAdds one or more item categories the store will buy to the current STO file. Existing categories will be skipped.\n - INT_VAR `category` to the item category to add. A nearly complete list of supported item category codes can be found [here](https://gibberlings3.github.io/iesdp/file_formats/ie_formats/sto_v1.htm#tableItemType).\n - RET `index` returns the index of the added purchase. Returns `-1` if the purchase could not be added.\n - RET `offset` returns the offset of the added purchase. Returns `-1` if the purchase could not be added."
1296
+ }
1297
+ },
1298
+ "REMOVE_STORE_ITEM_EX": {
1299
+ "contents": {
1300
+ "kind": "markdown",
1301
+ "value": "```weidu-tp2-tooltip\nREMOVE_STORE_ITEM_EX\n```\nRemoves all sale instances matching the specified item name from the current STO file. This is a patch function.\n - STR_VAR `item_name` to the resource name (resref) of the item to remove. Regular expression syntax is supported.\n - RET `index` returns the index of the first removed entry matching the item name, returns `-1` otherwise.\n - RET `offset` returns the offset of the first removed entry matching the item name, returns `-1` otherwise."
1302
+ }
1303
+ },
1304
+ "REMOVE_STORE_DRINK": {
1305
+ "contents": {
1306
+ "kind": "markdown",
1307
+ "value": "```weidu-tp2-tooltip\nREMOVE_STORE_DRINK\n```\nRemoves all drink instances matching the specified drink name from the current STO file. This is a patch function.\n - STR_VAR `drink_name` to the name of the drink. The following syntax is supported:\n - `Literal string`: Example: Elminster's Choice Beer\n - Note: Regular expression syntax is supported for literal strings.\n - `Strref value`: Example: `#1234`\n - `Translation reference`: Example: `@1000`\n - RET `index` returns the index of the first removed entry matching the drink name, returns `-1` otherwise.\n - RET `offset` returns the offset of the first removed entry matching the drink name, returns `-1` otherwise."
1308
+ }
1309
+ },
1310
+ "REMOVE_STORE_CURE": {
1311
+ "contents": {
1312
+ "kind": "markdown",
1313
+ "value": "```weidu-tp2-tooltip\nREMOVE_STORE_CURE\n```\nRemoves all cure instances matching the specified spell name from the current STO file. This is a patch function.\n - STR_VAR `spell_name` to the resource name (resref) of the spell to remove. Regular expression syntax is supported.\n - RET `index` returns the index of the first removed entry matching the spell name, returns `-1` otherwise.\n - RET `offset` returns the offset of the first removed entry matching the spell name, returns `-1` otherwise."
1314
+ }
1315
+ },
1316
+ "REMOVE_STORE_PURCHASE": {
1317
+ "contents": {
1318
+ "kind": "markdown",
1319
+ "value": "```weidu-tp2-tooltip\nREMOVE_STORE_PURCHASE\n```\nRemoves the specified item category from the current STO file. This is a patch function.\n - INT_VAR `category` to the item category to remove. A nearly complete list of supported item category codes can be found [here](https://gibberlings3.github.io/iesdp/file_formats/ie_formats/sto_v1.htm#tableItemType).\n - RET `index` returns the index of the first removed entry matching the category, returns `-1` otherwise.\n - RET `offset` returns the offset of the first removed entry matching the category, returns `-1` otherwise."
1320
+ }
1321
+ },
1322
+ "ALTER_EFFECT": {
1323
+ "contents": {
1324
+ "kind": "markdown",
1325
+ "value": "```weidu-tp2-tooltip\nALTER_EFFECT\n```\nThis is a patch function for creature, item, or spell files that will match an existing effect and alter it based on the defined variables. Numerous variables are available for matching the specified effect and for specifying new values.\n The first batch of variables are meta-variables which will help determine the scope of the function\":\"\n - INT_VAR `check_globals` to whether the function should loop through global effects on items (also known as equipping effects) and spells (default is 1). Creature effects are all global effects, so this variable will always be considered to be one when this function is run on a creature.\n - INT_VAR `check_headers` to whether the function should loop through effects on extended headers on items and spells (default is 1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n - INT_VAR `header` to whether the function should target effects on one specific header, counting the first header as zero. A negative value will match all headers (default is -1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n - INT_VAR `header_type` to whether the function should only alter effects on extended headers of the specified type (1 - melee, 2 - ranged, etc.). Negative values will look at effects on all headers (default is -1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n - INT_VAR `multi_match` to the number of effects to alter in the active stack. If you just want to match the first effect and have the function stop, use 1. Otherwise the function will continue matching until the number of altered effects matches this value. The function will always make at least one change (e.g. 0 or negative values are treated as 1). (default is 999).\n - INT_VAR `verbose` to whether the function should provide some rudimentary information on how many effects were added (default is 0).\n - INT_VAR `silent` to whether the function should suppress warnings when no effects were altered. This option also suppresses the verbose option (default is 0).\n The next batch of variables sets the function boundaries on matching an effect to alter. Any variables not specified will not be used to determine a match. The function will only determine an effect is a match only if ALL of the variables specified are matched.\n - INT_VAR `match_opcode` to the opcode of effects to be matched (default is -1).\n - INT_VAR `match_target` to the target of effects to be matched (default is -1).\n - INT_VAR `match_power` to the power of effects to be matched (default is -1).\n - INT_VAR `match_parameter1` to parameter1 of effects to be matched (default is -1).\n - INT_VAR `match_parameter2` to parameter2 of effects to be matched (default is -1).\n - INT_VAR `match_timing` to the timing of effects to be matched (default is -1).\n - INT_VAR `match_resist_dispel` to the resist/dispel setting of effects to be matched (default is -1).\n - INT_VAR `match_duration` to the duration of effects to be matched (default is -1).\n - INT_VAR `match_probability1` to probability1 (the upper bound) of effects to be matched (default is -1).\n - INT_VAR `match_probability2` to probability2 (the lower bound) of effects to be matched (default is -1).\n - INT_VAR `match_dicenumber` to the number of dice of effects to be matched (default is -1). This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `match_dicesize` to the size of dice of effects to be matched (default is -1). This field is used instead for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `match_savingthrow` to the saving throw type of effects to be matched (default is -1).\n - INT_VAR `match_savebonus` to the saving trow bonus effects to be matched (default is -11). Since saving throws can range into negative values, this variable can match all the way down to -10.\n - INT_VAR `match_special` to the special field of effects to be matched (default is -1). The special field is used by some EE effects.\n - STR_VAR `match_resource` to the resource of effects to be matched (default is \"SAME\").\n Once a matching effect is found, the next series of variables allows the function to change the fields to these new values in the matched effect. Any variables not set in this batch will keep their existing values.\n - INT_VAR `opcode` to the value the of the altered effect's opcode.\n - INT_VAR `target` to the altered effect's target.\n - INT_VAR `power` to the altered effect's power.\n - INT_VAR `parameter1` to the altered effect's parameter1.\n - INT_VAR `parameter2` to the altered effect's parameter2.\n - INT_VAR `timing` to the altered effect's timing mode.\n - INT_VAR `resist_dispel` to the altered effect's resist/dispel setting.\n - INT_VAR `duration` to the altered effect's duration.\n - INT_VAR `probability1` to the altered effect's probability1 (the upper bound).\n - INT_VAR `probability2` to the altered effect's probability2 (the lower bound).\n - INT_VAR `dicenumber` to the altered effect's number of dice. This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `dicesize` to the altered effect's size of dice. This field is also instead used for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `savingthrow` to the altered effect's saving-throw type.\n - INT_VAR `savebonus` to the altered effect's saving-throw bonus/penalty. This variable can take negative values down to -10 while still writing to the corresponding field.\n - INT_VAR `special` to the new effect's special field. The special field is used by many EE effects.\n - STR_VAR `resource` to the altered effect's resource reference."
1326
+ }
1327
+ },
1328
+ "APPEND_FILE": {
1329
+ "contents": {
1330
+ "kind": "markdown",
1331
+ "value": "```weidu-tp2-tooltip\nAPPEND_FILE [ TEXT ] filename\n```\nAppends the contents of filename onto the current file. If TEXT is specified, the contents of filename and the current file is separated by a newline character (LF) unless the first character of filename or the last character of the current file is a newline character."
1332
+ }
1333
+ },
1334
+ "APPEND_FILE_EVALUATE": {
1335
+ "contents": {
1336
+ "kind": "markdown",
1337
+ "value": "```weidu-tp2-tooltip\nAPPEND_FILE_EVALUATE [ TEXT ] filename\n```\nJust like APPEND_FILE except that %variables% in the contents of filename are evaluated before the appending."
1338
+ }
1339
+ },
1340
+ "APPLY_BCS_PATCH": {
1341
+ "contents": {
1342
+ "kind": "markdown",
1343
+ "value": "```weidu-tp2-tooltip\nAPPLY_BCS_PATCH patchFile\n```\nApplies patchFile to the current file. See --bcmp-from and similar command-line arguments for constructing these patches."
1344
+ }
1345
+ },
1346
+ "APPLY_BCS_PATCH_OR_COPY": {
1347
+ "contents": {
1348
+ "kind": "markdown",
1349
+ "value": "```weidu-tp2-tooltip\nAPPLY_BCS_PATCH_OR_COPY patchFile copyFile\n```\nApplies patchFile to the current file, as APPLY_BCS_PATCH. However, if the patching fails the current file is replaced with copyFile instead."
1350
+ }
1351
+ },
1352
+ "CLEAR_ARRAY": {
1353
+ "contents": {
1354
+ "kind": "markdown",
1355
+ "value": "```weidu-tp2-tooltip\nCLEAR_ARRAY String\n```\n'Forgets' that the array string exists until its values are recalled. The actual variables' values are kept, the only effect is that *PHP_EACH will not consider old values."
1356
+ }
1357
+ },
1358
+ "CLONE_EFFECT": {
1359
+ "contents": {
1360
+ "kind": "markdown",
1361
+ "value": "```weidu-tp2-tooltip\nCLONE_EFFECT\n```\nThis is a patch function for creature, item, or spell files that will match an existing effect and create a new one based on the matched effect. Numerous variables are available for matching the specified effect and for specifying new values in the new effect based on the matched effect.\nThe first batch of variables are meta-variables which will help determine the scope of the function:\n- INT_VAR `check_globals` to whether the function should loop through global effects on items (also known as equipping effects) and spells (default is 1). Creature effects are all global effects, so this variable will always be considered to be one when this function is run on a creature.\n- INT_VAR `check_headers` to whether the function should loop through effects on extended headers on items and spells if set to 1 (default is 1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n- INT_VAR `header` to whether the function should target effects on one specific header, counting the first header as zero. A negative value will match all headers (default is -1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n- INT_VAR `header_type` to whether the function should only clone effects on extended headers of the specified type (1 - melee, 2 - ranged, etc.). Negative values will look at effects on all headers (default is -1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n- INT_VAR `multi_match` to the number of effects to clone in the active stack. If you just want to match the first effect and have the function stop, use 1. Otherwise the function will continue matching until the number of cloned effects matches this value. The function will always make at least one change (e.g. 0 or negative values are treated as 1). (default is 999).\n- INT_VAR `verbose` to whether the function should provide some rudimentary information on how many effects were added (default is 0).\n- INT_VAR `silent` to whether the function should suppress warnings when no effects were added. This option also suppresses the verbose option (default is 0).\n- STR_VAR `insert` to the relative position the cloned effect should be inserted at. A value of `below` puts the new, cloned effect immediately below the matched effect. Values of `first` or `last` will put the new effect at the top or bottom of the effect stack, respectively. All other values will default to `above`, where the effect is added immediately before the matched effect (default is `above`).\n\nThe next batch of variables sets the function boundaries on matching an effect to clone. Any variables not specified will not be used to determine a match. The function will only determine an effect is a match only if ALL of the variables specified are matched.\n- INT_VAR `match_opcode` to the opcode of effects to be matched (default -1).\n- INT_VAR `match_target` to the target of effects to be matched (default -1).\n- INT_VAR `match_power` to the power of effects to be matched (default -1).\n- INT_VAR `match_parameter1` to parameter1 of effects to be matched (default -1).\n- INT_VAR `match_parameter2` to parameter2 of effects to be matched (default -1).\n- INT_VAR `match_timing` to the timing of effects to be matched (default -1).\n- INT_VAR `match_resist_dispel` to the resist/dispel setting of effects to be matched (default -1).\n- INT_VAR `match_duration` to the duration of effects to be matched (default -1).\n- INT_VAR `match_probability1` to probability1 (the upper bound) of effects to be matched (default -1).\n- INT_VAR `match_probability2` to probability2 (the lower bound) of effects to be matched (default -1).\n- INT_VAR `match_dicenumber` to the number of dice of effects to be matched (default -1). This field is instead used for maximum hit-dice (HD) by some opcodes.\n- INT_VAR `match_dicesize` to the size of dice of effects to be matched (default -1). This field is used instead for minimum hit-dice (HD) by some opcodes.\n- INT_VAR `match_savingthrow` to the saving throw type of effects to be matched (default -1).\n- INT_VAR `match_savebonus` to the saving throw bonus of effects to be matched (default -11). Since saving throws can range into negative values, this variable can match all the way down to -10.\n- INT_VAR `match_special` to the special field of effects to be matched (default -1). The special field is used by some EE effects.\n- STR_VAR `match_resource` to the resource of effects to be matched (default \\\"SAME\\\").\nOnce a matching effect is found, a new effect is created (STR_VAR `insert` determines its placement) with all of the same specifications as the matched effect. The next series of variables allows the function to change the fields to new values in the newly-created effect. Any variables not set in this batch will simply inherit their values from the matched effect.\n- INT_VAR `opcode` to the value the of the new effect's opcode.\n- INT_VAR `target` to the new effect's target.\n- INT_VAR `power` to the new effect's power.\n- INT_VAR `parameter1` to the new effect's parameter1.\n- INT_VAR `parameter2` to the new effect's parameter2.\n- INT_VAR `timing` to the new effect's timing mode.\n- INT_VAR `resist_dispel` to the new effect's resist/dispel setting.\n- INT_VAR `duration` to the new effect's duration.\n- INT_VAR `probability1` to the new effect's probability1 (the upper bound).\n- INT_VAR `probability2` to the new effect's probability2 (the lower bound).\n- INT_VAR `dicenumber` to the new effect's number of dice. This field is instead used for maximum hit-dice (HD) by some opcodes.\n- INT_VAR `dicesize` to the new effect's size of dice. This field is also instead for minimum hit-dice (HD) by some opcodes.\n- INT_VAR `savingthrow` to the new effect's saving-throw type.\n- INT_VAR `savebonus` to the new effect's saving-throw bonus/penalty. This variable can take negative values down to -10 while still writing to the corresponding field.\n- INT_VAR `special` to the new effect's special field. The special field is used by many EE effects.\n- STR_VAR `resource` to the new effect's resource reference.\n"
1362
+ }
1363
+ },
1364
+ "COMPILE_BAF_TO_BCS": {
1365
+ "contents": {
1366
+ "kind": "markdown",
1367
+ "value": "```weidu-tp2-tooltip\nCOMPILE_BAF_TO_BCS\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid BAF script, is compiled to a BCS. In general you should use the COMPILE TP2 Action instead, unless you are using other patch commands to modify the file under consideration."
1368
+ }
1369
+ },
1370
+ "COMPILE_D_TO_DLG": {
1371
+ "contents": {
1372
+ "kind": "markdown",
1373
+ "value": "```weidu-tp2-tooltip\nCOMPILE_D_TO_DLG\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid D file that defines a single DLG file (via an obvious BEGIN action) is compiled to a DLG. Typically this is only used after a DECOMPILE_DLG_TO_D."
1374
+ }
1375
+ },
1376
+ "COMPRESS_INTO_FILE": {
1377
+ "contents": {
1378
+ "kind": "markdown",
1379
+ "value": "```weidu-tp2-tooltip\nCOMPRESS_INTO_FILE start length level overwritefrom overwriteto\n```\nCompress (ZLIB) the start...start+length-1 portion of the current \tfile (level is 0 to 9; 0 means don't compress, 1 is fastest compression, 9 is best \tcompression). The result overwrites \tthe overwritefrom...overwriteto-1 portion of the current file."
1380
+ }
1381
+ },
1382
+ "COMPRESS_INTO_VAR": {
1383
+ "contents": {
1384
+ "kind": "markdown",
1385
+ "value": "```weidu-tp2-tooltip\nCOMPRESS_INTO_VAR start length level varName\n```\nCompress (ZLIB) the start...start+length-1 portion of the current \tfile (level is 0 to 9; 0 means don't compress, 1 is fastest compression, 9 is best \tcompression). The result is stored into varName."
1386
+ }
1387
+ },
1388
+ "COMPRESS_REPLACE_FILE": {
1389
+ "contents": {
1390
+ "kind": "markdown",
1391
+ "value": "```weidu-tp2-tooltip\nCOMPRESS_REPLACE_FILE start length level\n```\nCompress (ZLIB) the start...start+length-1 portion of the current \tfile (level is 0 to 9; 0 means don't compress, 1 is fastest compression, 9 is best \tcompression). The result overwrites \tthe current file. It's equivalent to \tDECOMPRESS_INTO_FILE start length uncompressedlength 0 BUFFER_LENGTH"
1392
+ }
1393
+ },
1394
+ "COUNT_2DA_COLS": {
1395
+ "contents": {
1396
+ "kind": "markdown",
1397
+ "value": "```weidu-tp2-tooltip\nCOUNT_2DA_COLS variable\n```\nThis command counts the number of columns in the current file (which should be a 2DA file) and stores the result in the variable."
1398
+ }
1399
+ },
1400
+ "COUNT_2DA_ROWS": {
1401
+ "contents": {
1402
+ "kind": "markdown",
1403
+ "value": "```weidu-tp2-tooltip\nCOUNT_2DA_ROWS value variable\n```\nThe first value is the required column count. This command counts the number of rows in the current file (which should be a 2DA file) that have at least as many columns as the required column count and stores the result in the variable."
1404
+ }
1405
+ },
1406
+ "COUNT_REGEXP_INSTANCES": {
1407
+ "contents": {
1408
+ "kind": "markdown",
1409
+ "value": "```weidu-tp2-tooltip\nCOUNT_REGEXP_INSTANCES optcase optexact regexp variable\n```\nThis command counts the number of times regexp appears in the current file and stores the result in the variable. Variable substitution is performed on regexp prior to regexp handling (EG, if %var% = ~abc~, ~[%var%]~ is evaluated as ~[abc]~)."
1410
+ }
1411
+ },
1412
+ "DECOMPILE_AND_PATCH": {
1413
+ "contents": {
1414
+ "kind": "markdown",
1415
+ "value": "```weidu-tp2-tooltip\nDECOMPILE_AND_PATCH BEGIN patch list END\n```\nActs like DECOMPILE_BCS_TO_BAF // or DLG_TO_D patch list COMPILE_BAF_TO_BCS // or D_TO_DLG except it enforces that the DECOMPILE is followed by the compile, can indiscriminately patch BCS and DLG files, and is guaranteed not to leave a decompiled file in the override (if decompiling, patching or recompiling fails, a warning is printed and the original version of the file is left in the override)."
1416
+ }
1417
+ },
1418
+ "DECOMPILE_BCS_TO_BAF": {
1419
+ "contents": {
1420
+ "kind": "markdown",
1421
+ "value": "```weidu-tp2-tooltip\nDECOMPILE_BCS_TO_BAF\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid BCS script, is decompiled to a BAF."
1422
+ }
1423
+ },
1424
+ "DECOMPILE_DLG_TO_D": {
1425
+ "contents": {
1426
+ "kind": "markdown",
1427
+ "value": "```weidu-tp2-tooltip\nDECOMPILE_DLG_TO_D\n```\nDeprecated. Use `DECOMPILE_AND_PATCH` instead.\n\n---\nThe current file, which must be a valid DLG file, is decompile to a textual D file (with string refs and no comments). Once you have a D file you can use other patch commands to change the actions and triggers around. You should use D actions (like REPLACE_ACTION_TEXT) instead whenever possible."
1428
+ }
1429
+ },
1430
+ "DECOMPRESS_INTO_FILE": {
1431
+ "contents": {
1432
+ "kind": "markdown",
1433
+ "value": "```weidu-tp2-tooltip\nDECOMPRESS_INTO_FILE start length uncompressedlength overwritefrom overwriteto\n```\nDecompress (ZLIB) the start...start+length-1 portion of the current \tfile (requires to specify the uncompressed length as well). The result overwrites \tthe overwritefrom...overwriteto-1 portion of the current file."
1434
+ }
1435
+ },
1436
+ "DECOMPRESS_INTO_VAR": {
1437
+ "contents": {
1438
+ "kind": "markdown",
1439
+ "value": "```weidu-tp2-tooltip\nDECOMPRESS_INTO_VAR start length uncompressedlength varName\n```\nDecompress (ZLIB) the start...start+length-1 portion of the current \tfile (requires to specify the uncompressed length as well). The result is stored \tinto varName."
1440
+ }
1441
+ },
1442
+ "DECOMPRESS_REPLACE_FILE": {
1443
+ "contents": {
1444
+ "kind": "markdown",
1445
+ "value": "```weidu-tp2-tooltip\nDECOMPRESS_REPLACE_FILE start length uncompressedlength\n```\nDecompress (ZLIB) the start...start+length-1 portion of the current \tfile (requires to specify the uncompressed length as well). The result overwrites \tthe current file. It's equivalent to \tDECOMPRESS_INTO_FILE start length uncompressedlength 0 BUFFER_LENGTH"
1446
+ }
1447
+ },
1448
+ "DEFINE_ARRAY": {
1449
+ "contents": {
1450
+ "kind": "markdown",
1451
+ "value": "```weidu-tp2-tooltip\nDEFINE_ARRAY String1 BEGIN String2 list END\n```\nSets the array $string1(0),$string1(1) etc. to the various elements in string2."
1452
+ }
1453
+ },
1454
+ "DEFINE_ASSOCIATIVE_ARRAY": {
1455
+ "contents": {
1456
+ "kind": "markdown",
1457
+ "value": "```weidu-tp2-tooltip\nDEFINE_ASSOCIATIVE_ARRAY String BEGIN key1 [ , key2 ... ] => result1 list END\n```\nSets the array $string, indexed by the keys, to the corresponding results. The results can either be Strings or values. Example: DEFINE_ASSOCIATIVE_ARRAY mix_with_blue BEGIN red => purple yellow => green END You may use PATCH_DEFINE_ASSOCIATIVE_ARRAY as a synonym for DEFINE_ASSOCIATIVE_ARRAY."
1458
+ }
1459
+ },
1460
+ "DELETE_BYTES": {
1461
+ "contents": {
1462
+ "kind": "markdown",
1463
+ "value": "```weidu-tp2-tooltip\nDELETE_BYTES offset value\n```\nThe first argument is the offset, the second argument is the count. The file will shrink as count bytes are deleted starting at the given offset."
1464
+ }
1465
+ },
1466
+ "DELETE_EFFECT": {
1467
+ "contents": {
1468
+ "kind": "markdown",
1469
+ "value": "```weidu-tp2-tooltip\nDELETE_EFFECT\n```\nThis is a patch function for creature, item, or spell files that will match an existing effect and then delete it. Numerous variables are available for matching the specified effect.\n The first batch of variables are meta-variables which will help determine the scope of the function\":\"\n - INT_VAR `check_globals` to whether the function should loop through global effects on items (also known as equipping effects) and spells (default is 1). Creature effects are all global effects, so this variable will always be considered to be one when this function is run on a creature.\n - INT_VAR `check_headers` to whether the function should loop through effects on extended headers on items and spells (default is 1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n - INT_VAR `header` to whether the function should target effects on one specific header, counting the first header as zero. A negative value will match all headers (default is -1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n - INT_VAR `header_type` to whether the function should only delete effects on extended headers of the specified type (1 - melee, 2 - ranged, etc.). Negative values will look at effects on all headers (default is -1). Creatures have no extended headers, so this variable is ignored when used on creatures.\n - INT_VAR `multi_match` to the number of effects to delete in the active stack. If you just want to match the first effect and have the function stop, use 1. Otherwise the function will continue matching until the number of deleted effects matches this value. The function will always make at least one change (e.g. 0 or negative values are treated as 1). (default is 999).\n - INT_VAR `verbose` to whether the function should provide some rudimentary information on how many effects were deleted (default is 0).\n The next batch of variables sets the function boundaries on matching an effect to delete. Any variables not specified will not be used to determine a match. The function will only determine an effect is a match only if ALL of the variables specified are matched.\n - INT_VAR `match_opcode` to the opcode of effects to be matched (default -1).\n - INT_VAR `match_target` to the target of effects to be matched (default -1).\n - INT_VAR `match_power` to the power of effects to be matched (default -1).\n - INT_VAR `match_parameter1` to parameter1 of effects to be matched (default -1).\n - INT_VAR `match_parameter2` to parameter2 of effects to be matched (default -1).\n - INT_VAR `match_timing` to the timing of effects to be matched (default -1).\n - INT_VAR `match_resist_dispel` to the resist/dispel setting of effects to be matched (default -1).\n - INT_VAR `match_duration` to the duration of effects to be matched (default -1).\n - INT_VAR `match_probability1` to probability1 (the upper bound) of effects to be matched (default -1).\n - INT_VAR `match_probability2` to probability2 (the lower bound) of effects to be matched (default -1).\n - INT_VAR `match_dicenumber` to the number of dice of effects to be matched (default -1). This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `match_dicesize` to the size of dice of effects to be matched (default -1). This field is used instead for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `match_savingthrow` to the saving throw type of effects to be matched (default -1).\n - INT_VAR `match_savebonus` to the saving throw bonus effects to be matched (default -11). Since saving throws can range into negative values, this variable can match all the way down to -10.\n - INT_VAR `match_special` to the special field of effects to be matched (default -1). The special field is used by some EE effects.\n - STR_VAR `match_resource` to the resource of effects to be matched (default \"SAME\").\n Once a matching effect is found it is deleted. The function will continue to delete effects from the stack until the number of effects deleted matches the `multi_match` variable."
1470
+ }
1471
+ },
1472
+ "EDIT_SAV_FILE": {
1473
+ "contents": {
1474
+ "kind": "markdown",
1475
+ "value": "```weidu-tp2-tooltip\nEDIT_SAV_FILE level [ ADD_IF_MISSING ] [ filename list ] BEGIN TP2 Patch list END\n```\nThe current file should be a SAV file. EDIT_SAV_FILE will iterate over the files contained within the SAV file, set the variable SAV_FILE to the name of the current file and evaluate the patch list against the decompressed contents of SAV_FILE. The file contents are then recompressed into the SAV file using the specified compression level. level can be 0 to 9, where 0 means no compression, 1 is the fastest compression and 9 is the best compression.If the list of filenames is non-empty, only files whose name appear in that list are patched (the comparison is case-insensitive, variables and arrays are parsed if using EVALUATE_BUFFER or AUTO_EVAL_STRINGS). If the optional ADD_IF_MISSING is provided, the file will be loaded if it exists (determined with FILE_EXISTS_IN_GAME) and the patches are applied. If the file does not exist, the patches will instead be applied to the empty buffer. The resulting file is added to the SAV itself."
1476
+ }
1477
+ },
1478
+ "EVALUATE_BUFFER": {
1479
+ "contents": {
1480
+ "kind": "markdown",
1481
+ "value": "```weidu-tp2-tooltip\nEVALUATE_BUFFER variable\n```\nUser variables inside the given string are evaluated one additional time. You may prepend `EVALUATE_BUFFER` when a value is called for and you would normally use a string. You may also use it for `SET` and `SPRINT` statements. Example:\n```\nSPRINT x ~y~\nSET y = 5\nSPRINT z EVALUATE_BUFFER ~tricky %%x%%~\nSET EVALUATE_BUFFER \"%x%\" += 77\nPATCH_PRINT \"y is %y% ; z is %z%\"\n```\nThis prints out `y is 82 ; z is tricky 5`. You may also do hackery like `FILE_SIZE \"myfile\" \"%%indirection%%\"`. Be very careful with this feature."
1482
+ }
1483
+ },
1484
+ "EVALUATE_BUFFER_SPECIAL": {
1485
+ "contents": {
1486
+ "kind": "markdown",
1487
+ "value": "```weidu-tp2-tooltip\nEVALUATE_BUFFER_SPECIAL string\n```\nString must be one character long. Any WeiDU variables (like XmyvarX) \tinside the current file are replaced by their values, where X is to be intended \tas string. Example: <<<<<<<< .../mymod-inlined/script.baf IF See($myvar$) THEN RESPONSE #100 Kill(%myvar%) END >>>>>>>> EXTEND_TOP ~sola.bcs~ ~.../mymod-inlined/script.baf~ SPRINT myvar = ~\"Anomen\"~ EVALUATE_BUFFER_SPECIAL ~$~ \tmyvar will be substituted with Anomen, but %myvar% will be not.\tDo not use this without a real reason."
1488
+ }
1489
+ },
1490
+ "FOR": {
1491
+ "contents": {
1492
+ "kind": "markdown",
1493
+ "value": "```weidu-tp2-tooltip\nFOR ( patch list ; value ; patch list ) BEGIN patch list END\n```\nThe patch FOR (init;pred;inc) BEGIN body END is equivalent to init WHILE pred BEGIN body inc END. Note that the predicate value cannot be empty."
1494
+ }
1495
+ },
1496
+ "GET_OFFSET_ARRAY": {
1497
+ "contents": {
1498
+ "kind": "markdown",
1499
+ "value": "```weidu-tp2-tooltip\nGET_OFFSET_ARRAY String seven values\n```\nThe seven values are:\n 1. Offset\n 2. Read length of \"Offset\"\n 3. Iterations\n 4. Read length of \"Iterations\"\n 5. Index\n 6. Read length of \"Index\"\n 7. Length between iterations.\n\nWeiDU comes with a number of pre-defined sets of values for `GET_OFFSET_ARRAY`.\n\nThese sets are:\n - `ARE_V10_ACTORS (0x54 4 0x58 2 0 0 0x110)`\n - `ARE_V10_REGIONS (0x5c 4 0x5a 2 0 0 0xc4)`\n - `ARE_V10_SPAWN_POINTS (0x60 4 0x64 4 0 0 0xc8)`\n - `ARE_V10_ENTRANCES (0x68 4 0x6c 4 0 0 0x68)`\n - `ARE_V10_CONTAINERS (0x70 4 0x74 2 0 0 0xc0)`\n - `ARE_V10_AMBIENTS (0x84 4 0x82 2 0 0 0xd4)`\n - `ARE_V10_DOORS (0xa8 4 0xa4 4 0 0 0xc8)`\n - `ARE_V10_ANIMATIONS (0xb0 4 0xac 4 0 0 0x4c)`\n - `ARE_V91_ACTORS (0x64 4 0x68 2 0 0 0x110)`\n - `CRE_V10_KNOWN_SPELLS (0x2a0 4 0x2a4 4 0 0 0xc)`\n - `CRE_V10_SPELL_MEM_INFO (0x2a8 4 0x2ac 4 0 0 0x10)`\n - `CRE_V10_EFFECTS (0x2c4 4 0x2c8 4 0 0 0x108)`\n - `CRE_V10_ITEMS (0x2bc 4 0x2c0 4 0 0 0x14)`\n - `ITM_V10_HEADERS (0x64 4 0x68 2 0 0 0x38)`\n - `ITM_V10_GEN_EFFECTS (0x6a 4 0x70 2 0x6e 2 0x30)`\n - `SPL_V10_HEADERS (0x64 4 0x68 2 0 0 0x28)`\n - `SPL_V10_GEN_EFFECTS (0x6a 4 0x70 2 0x6e 2 0x30)`\n - `STO_V10_ITEMS_PURCHASED (0x2c 4 0x30 4 0 0 0x4)`\n - `STO_V10_ITEMS_SOLD (0x34 4 0x38 4 0 0 0x1c)`\n - `STO_V10_DRINKS (0x4c 4 0x50 4 0 0 0x14)`\n - `STO_V10_CURES (0x70 4 0x74 4 0 0 0xc)`\n - `WMP_AREAS (0x34 4 0x30 4 0 0 0xf0)`\n - `WMP_LINKS (0x38 4 0x3c 4 0 0 0xd8)`\n\n`GET_OFFSET_ARRAY` performs \"Iterations\" number of reads and sets the array `$string(0)`, `$string(1)` etc to the result of these reads.\n\nA more detailed explanation can be found in the\n[`GET_OFFSET_ARRAY` and `GET_OFFSET_ARRAY2` tutorial](https://weidu.org/~thebigg/README-WeiDU.html#sec-get-offset-array12)."
1500
+ }
1501
+ },
1502
+ "GET_OFFSET_ARRAY2": {
1503
+ "contents": {
1504
+ "kind": "markdown",
1505
+ "value": "```weidu-tp2-tooltip\nGET_OFFSET_ARRAY2 String eight values\n```\nThe eight values are:\n 1. Offset2\n 2. Offset\n 3. Read length of \"Offset\"\n 4. Iterations\n 5. Read length of \"Iterations\"\n 6. Index\n 7. Read length of \"Index\"\n 8. Length between iterations\n\nWeiDU comes with a number of pre-defined sets of values for `GET_OFFSET_ARRAY2`.\nThese sets are:\n - `ARE_V10_ITEMS (0x78 4 0x44 4 0x40 4 0x14)`\n - `ARE_V10_REGION_VERTICES (0x7c 4 0x2a 2 0x2c 4 0x4)`\n - `ARE_V10_CONTAINER_VERTICES (0x7c 4 0x54 2 0x50 4 0x4)`\n - `ARE_V10_DOOR_OPEN_OUTLINE_VERTICES (0x7c 4 0x30 2 0x2c 4 0x4)`\n - `ARE_V10_DOOR_CLOSED_OUTLINE_VERTICES (0x7c 4 0x32 2 0x34 4 0x4)`\n - `ARE_V10_DOOR_OPEN_CELL_VERTICES (0x7c 4 0x4c 2 0x48 4 0x4)`\n - `ARE_V10_DOOR_CLOSED_CELL_VERTICES (0x7c 4 0x4e 2 0x50 4 0x4)`\n - `CRE_V10_SPELL_MEM (0x2b0 4 0xc 4 0x8 4 0xc)`\n - `ITM_V10_HEAD_EFFECTS (0x6a 4 0x1e 2 0x20 2 0x30)`\n - `SPL_V10_HEAD_EFFECTS (0x6a 4 0x1e 2 0x20 2 0x30)`\n - `WMP_NORTH_LINKS (0x38 4 0x54 4 0x50 4 0xd8)`\n - `WMP_WEST_LINKS (0x38 4 0x5c 4 0x58 4 0xd8)`\n - `WMP_SOUTH_LINKS (0x38 4 0x64 4 0x60 4 0xd8)\n - `WMP_EAST_LINKS (0x38 4 0x6c 4 0x68 4 0xd8)`\n\n As you can see, the value for `Offset2` isn't included in the sets, since it varies.\n `Offset2` corresponds to the result from `GET_OFFSET_ARRAY`. `Offset` is read from the start of the file.\n `Iterations` and `Index` are read from `Offset2 + value`.\n Apart from that `GET_OFFSET_ARRAY2` functions like `GET_OFFSET_ARRAY`.\n\nA more detailed explanation can be found in the\n[`GET_OFFSET_ARRAY` and `GET_OFFSET_ARRAY2` tutorial](https://weidu.org/~thebigg/README-WeiDU.html#sec-get-offset-array12)."
1506
+ }
1507
+ },
1508
+ "GET_STRREF": {
1509
+ "contents": {
1510
+ "kind": "markdown",
1511
+ "value": "```weidu-tp2-tooltip\nGET_STRREF value variable\n```\nThe string reference value is looked up in DIALOG.TLK and the (male) string (without any quotes) is stored in the variable."
1512
+ }
1513
+ },
1514
+ "GET_STRREF_F": {
1515
+ "contents": {
1516
+ "kind": "markdown",
1517
+ "value": "```weidu-tp2-tooltip\nGET_STRREF_F value variable\n```\nThe string reference value is looked up in DIALOGF.TLK and the female string (without any quotes) is stored in the variable. If there is no DIALOGF.TLK, the string from DIALOG.TLK is used instead."
1518
+ }
1519
+ },
1520
+ "GET_STRREF_FS": {
1521
+ "contents": {
1522
+ "kind": "markdown",
1523
+ "value": "```weidu-tp2-tooltip\nGET_STRREF_FS value variable\n```\nThe string reference value is looked up in DIALOGF.TLK and the sound reference associated with the female string is stored in the variable. If there is not DIALOGF.TLK, the sound reference associated with the string from DIALOG.TLK is used instead. If the string has no sound, the empty string is used instead."
1524
+ }
1525
+ },
1526
+ "GET_STRREF_S": {
1527
+ "contents": {
1528
+ "kind": "markdown",
1529
+ "value": "```weidu-tp2-tooltip\nGET_STRREF_S value variable\n```\nThe string reference value is looked up in DIALOG.TLK and the sound reference associated with the (male) string is stored in the variable. If the string has no sound, the empty string is used instead."
1530
+ }
1531
+ },
1532
+ "INNER_ACTION": {
1533
+ "contents": {
1534
+ "kind": "markdown",
1535
+ "value": "```weidu-tp2-tooltip\nINNER_ACTION BEGIN TP2 Action list END\n```\nSee the INNER_ACTION tutorial, but loosely the current COPY is paused, the given TP2 Actions are executed, and then the current COPY is resumed. Note that an INNER_ACTION should never modify a file that is being modified by the current action. For example, never put APPEND foo.2da inside of COPY_EXISTING foo.2da . More formally, if the inner action and the outer action both modify the same file, the results are undefined."
1536
+ }
1537
+ },
1538
+ "INNER_PATCH": {
1539
+ "contents": {
1540
+ "kind": "markdown",
1541
+ "value": "```weidu-tp2-tooltip\nINNER_PATCH buffString BEGIN patch list END\n```\nAny WeiDU variables inside %s within buffString are replaced by their values. All of the patches given are evaluated as if the contents of the current file were buffString. Any modifications to buffString are thrown away (making this mostly useful for reads). Example: INNER_PATCH \"ABC\" BEGIN READ_BYTE 0x2 \"myvar\" END PATCH_PRINT \"myvar is %myvar%\" This sequence will always print myvar is 67 (since 67 is the ASCII code for C)."
1542
+ }
1543
+ },
1544
+ "INNER_PATCH_FILE": {
1545
+ "contents": {
1546
+ "kind": "markdown",
1547
+ "value": "```weidu-tp2-tooltip\nINNER_PATCH_FILE resource BEGIN patch list END\n```\nAny WeiDU variables inside %s within resource are replaced by their values. If the resulting resource is present in the game or in the override folder, the patches given are evaluated as if the current file were that resource. If not, nothing happens. Any modifications to that resource are thrown away (making this mostly useful for reads). Example: INNER_PATCH_FILE \"SW1H01.ITM\" BEGIN READ_BYTE 0x1 \"myvar\" END PATCH_PRINT \"myvar is %myvar%\" This sequence will always print myvar is 84 (since 84 is the ASCII code for T and SW1H01.ITM starts with ITM)."
1548
+ }
1549
+ },
1550
+ "INNER_PATCH_SAVE": {
1551
+ "contents": {
1552
+ "kind": "markdown",
1553
+ "value": "```weidu-tp2-tooltip\nINNER_PATCH_SAVE savevar buffString BEGIN patch list END\n```\nAs with INNER_PATCH, except that any modifications to buffString are stored inside savevar. Example: SPRINT foo \"ABC\" INNER_PATCH_SAVE bar \"%foo%\" BEGIN WRITE_BYTE 0x2 65 END PATCH_PRINT \"foo is %foo%, bar is %bar%\" This sequence will always print foo is ABC, bar is ABA (since 65 is the ASCII code for A)."
1554
+ }
1555
+ },
1556
+ "INSERT_2DA_ROW": {
1557
+ "contents": {
1558
+ "kind": "markdown",
1559
+ "value": "```weidu-tp2-tooltip\nINSERT_2DA_ROW value1 value2 String\n```\nString (after variable substitution) will be inserted as a new line in the table. Value1 is the row count, value2 is the required column count. If row count is the same as the number of long enough lines in the file, then the line will be inserted at the end; if row count is lesser than the number of lines, it will be inserted just before the nth line in the original file (starting count from 0); finally, if row count is greater than the number of lines, the component will fail to install. <<<<<<<< ~.../mymod-inlined/2dafile~ asd foo a b c d e f g h i >>>>>>>> COPY ~.../mymod-inlined/2dafile~ ~.../mymod-inlined/2dafile~ INSERT_2DA_ROW 3 3 ~4 4 4~ INSERT_2DA_ROW 2 3 ~3 3 3~ INSERT_2DA_ROW 1 3 ~2 2 2~ INSERT_2DA_ROW 0 3 ~1 1 1~ will result in asd foo 1 1 1 a b c 2 2 2 d e f 3 3 3 g h i 4 4 4"
1560
+ }
1561
+ },
1562
+ "INSERT_BYTES": {
1563
+ "contents": {
1564
+ "kind": "markdown",
1565
+ "value": "```weidu-tp2-tooltip\nINSERT_BYTES offset value\n```\nThe first argument is the offset, the second argument is the count. The file will be expanded at the given offset with count bytes worth of zeroes."
1566
+ }
1567
+ },
1568
+ "INSERT_FILE": {
1569
+ "contents": {
1570
+ "kind": "markdown",
1571
+ "value": "```weidu-tp2-tooltip\nINSERT_FILE offset filename\n```\nJust like WRITE_FILE except that the entire contents of \"filename\" are inserted at offset, just as if you had done an INSERT_BYTES with the size of \"filename\" to that offset followed by a WRITE_FILE to that offset."
1572
+ }
1573
+ },
1574
+ "LAUNCH_PATCH_FUNCTION": {
1575
+ "contents": {
1576
+ "kind": "markdown",
1577
+ "value": "```weidu-tp2-tooltip\nLAUNCH_PATCH_FUNCTION String\n [ INT_VAR variable [ = value ] ... ]\n [ STR_VAR variable [ = [ EVALUATE_BUFFER ] String ] ... ]\n [ RET variable [ = String ] ... ]\n [ RET_ARRAY variable [ = String ] ... ]\nEND\n```\nLaunch a patch function. Refer to the [Functions](https://weidu.org/~thebigg/README-WeiDU.html#sec-functions) section for additional information. You may use `LPF` as a synonym for `LAUNCH_PATCH_FUNCTION`."
1578
+ }
1579
+ },
1580
+ "LPF": {
1581
+ "contents": {
1582
+ "kind": "markdown",
1583
+ "value": "```weidu-tp2-tooltip\nLPF String\n [ INT_VAR variable [ = value ] ... ]\n [ STR_VAR variable [ = [ EVALUATE_BUFFER ] String ] ... ]\n [ RET variable [ = String ] ... ]\n [ RET_ARRAY variable [ = String ] ... ]\nEND\n```\nLaunch a patch function. Refer to the [Functions](https://weidu.org/~thebigg/README-WeiDU.html#sec-functions) section for additional information. You may use `LPF` as a synonym for `LAUNCH_PATCH_FUNCTION`."
1584
+ }
1585
+ },
1586
+ "LAUNCH_PATCH_MACRO": {
1587
+ "contents": {
1588
+ "kind": "markdown",
1589
+ "value": "```weidu-tp2-tooltip\nLAUNCH_PATCH_MACRO String\n```\nLaunch a patch macro. Refer to the macros section for additional information. You may use LPM as a synonym for LAUNCH_PATCH_MACRO."
1590
+ }
1591
+ },
1592
+ "LPM": {
1593
+ "contents": {
1594
+ "kind": "markdown",
1595
+ "value": "```weidu-tp2-tooltip\nLPM String\n```\nLaunch a patch macro. Refer to the macros section for additional information. You may use LPM as a synonym for LAUNCH_PATCH_MACRO."
1596
+ }
1597
+ },
1598
+ "LOOKUP_IDS_SYMBOL_OF_INT": {
1599
+ "contents": {
1600
+ "kind": "markdown",
1601
+ "value": "```weidu-tp2-tooltip\nLOOKUP_IDS_SYMBOL_OF_INT variable idsFile value\n```\nThe symbolic constant associated with value in idsFile (which may contain user variables) is stored in variable. If that doesn't work, value is stored in variable. Example: LOOKUP_IDS_SYMBOL_OF_INT foo ~spell~ 1101 SPRINT myfile \"SPELL\" LOOKUP_IDS_SYMBOL_OF_INT bar ~%myfile%~ (0x44c + 1) LOOKUP_IDS_SYMBOL_OF_INT baz ~spell~ 77777 Both foo and bar are CLERIC_BLESS while baz is 777777."
1602
+ }
1603
+ },
1604
+ "ON_MISMATCH": {
1605
+ "contents": {
1606
+ "kind": "markdown",
1607
+ "value": "```weidu-tp2-tooltip\nON_MISMATCH patch list END\n```\nSee R_B_B. If the segment corresponding to oldFile is not found and the ON_MISMATCH section is present, those patches are run; if oldFile is not found and ON_MISMATCH is not present, a warning message is printed."
1608
+ }
1609
+ },
1610
+ "PATCH_ABORT": {
1611
+ "contents": {
1612
+ "kind": "markdown",
1613
+ "value": "```weidu-tp2-tooltip\nPATCH_ABORT string\n```\nThe string is displayed and installation of the component is undone. No error is implied."
1614
+ }
1615
+ },
1616
+ "PATCH_BASH_FOR": {
1617
+ "contents": {
1618
+ "kind": "markdown",
1619
+ "value": "```weidu-tp2-tooltip\nPATCH_BASH_FOR directory-file-regexp BEGIN patch list END\n```\nfor all files that match directory-file-regexp, sets a bunch of variables and executes the patches for each file found. Assuming the file being copied is somedir/yourfile.cre, the following variables will be set: \"%BASH_FOR_DIRECTORY%\" = \"somedir\" \"%BASH_FOR_FILESPEC%\" = \"somedir/yourfile.cre\" \"%BASH_FOR_FILE%\" = \"yourfile.cre\" \"%BASH_FOR_RES%\" = \"yourfile\" \"%BASH_FOR_EXT%\" = \"cre\" \"%BASH_FOR_SIZE%\" = <size of somedir/yourfile.cre>"
1620
+ }
1621
+ },
1622
+ "PATCH_CLEAR_ARRAY": {
1623
+ "contents": {
1624
+ "kind": "markdown",
1625
+ "value": "```weidu-tp2-tooltip\nPATCH_CLEAR_ARRAY String\n```\nA synonym of CLEAR_ARRAY."
1626
+ }
1627
+ },
1628
+ "PATCH_DEFINE_ARRAY": {
1629
+ "contents": {
1630
+ "kind": "markdown",
1631
+ "value": "```weidu-tp2-tooltip\nPATCH_DEFINE_ARRAY String1 BEGIN String2 list END\n```\nSame as DEFINE_ARRAY."
1632
+ }
1633
+ },
1634
+ "PATCH_FAIL": {
1635
+ "contents": {
1636
+ "kind": "markdown",
1637
+ "value": "```weidu-tp2-tooltip\nPATCH_FAIL warningString\n```\nIf this TP2 Action is execution, warningString is displayed and the component fails to install."
1638
+ }
1639
+ },
1640
+ "PATCH_FOR_EACH": {
1641
+ "contents": {
1642
+ "kind": "markdown",
1643
+ "value": "```weidu-tp2-tooltip\nPATCH_FOR_EACH String1 IN String list BEGIN patch list END\n```\nwill set the string1 variable to each value in string list and process each patch."
1644
+ }
1645
+ },
1646
+ "PATCH_IF": {
1647
+ "contents": {
1648
+ "kind": "markdown",
1649
+ "value": "```weidu-tp2-tooltip\nPATCH_IF value [ THEN ] BEGIN patch list END [ ELSE BEGIN patch list END ]\n```\nIf value is non-zero, execute the first patch list once. Otherwise, execute the second patch list (if any). As a convenient shorthand, you may omit the BEGIN-END in the ELSE branch if the ELSE branch contains exactly one patch."
1650
+ }
1651
+ },
1652
+ "PATCH_INCLUDE": {
1653
+ "contents": {
1654
+ "kind": "markdown",
1655
+ "value": "```weidu-tp2-tooltip\nPATCH_INCLUDE String list\n```\nloads the file string as if it were a list of tp2 patches and executes it (as if \t\tit had been typed inside your tp2). These files have by convention tpp as an extension, due to no reason other than randomness (you can use .tp1 or .xyzsucks if you're so oriented). \t\tPlease note that, to speed up inclusions, tpp files are stored in memory, \t rather than re-read each time from the hard-disk. If you need automorphing code \t\t(IE, you want to edit your tpp file), you can use PATCH_REINCLUDE instead."
1656
+ }
1657
+ },
1658
+ "PATCH_LOG": {
1659
+ "contents": {
1660
+ "kind": "markdown",
1661
+ "value": "```weidu-tp2-tooltip\nPATCH_LOG displayString\n```\nThe string DisplayString is echoed to setup-mymod.debug. If displayString contains %variable% references, their values will be displayed."
1662
+ }
1663
+ },
1664
+ "PATCH_MATCH": {
1665
+ "contents": {
1666
+ "kind": "markdown",
1667
+ "value": "```weidu-tp2-tooltip\nPATCH_MATCH value WITH [ guardvalue ... [ WHEN conditionvalue ] BEGIN patch list END ] ... DEFAULT patch list END\n```\nThe value is case-insensitively matched against the guard values. If value matches one of the guard values, the associated patch list is executed. If there is a condition, it additionally needs to evaluate to true for the values to match. If none of the values match, the DEFAULT patch list is executed. See the MATCH and TRY tutorial for additional information."
1668
+ }
1669
+ },
1670
+ "WITH": {
1671
+ "contents": {
1672
+ "kind": "markdown",
1673
+ "value": "```weidu-tp2-tooltip\nPATCH_MATCH value WITH [ guardvalue ... [ WHEN conditionvalue ] BEGIN patch list END ] ... DEFAULT patch list END\n```\nThe value is case-insensitively matched against the guard values. If value matches one of the guard values, the associated patch list is executed. If there is a condition, it additionally needs to evaluate to true for the values to match. If none of the values match, the DEFAULT patch list is executed. See the MATCH and TRY tutorial for additional information."
1674
+ }
1675
+ },
1676
+ "DEFAULT": {
1677
+ "contents": {
1678
+ "kind": "markdown",
1679
+ "value": "```weidu-tp2-tooltip\nPATCH_MATCH value WITH [ guardvalue ... [ WHEN conditionvalue ] BEGIN patch list END ] ... DEFAULT patch list END\n```\nThe value is case-insensitively matched against the guard values. If value matches one of the guard values, the associated patch list is executed. If there is a condition, it additionally needs to evaluate to true for the values to match. If none of the values match, the DEFAULT patch list is executed. See the MATCH and TRY tutorial for additional information."
1680
+ }
1681
+ },
1682
+ "PATCH_PHP_EACH": {
1683
+ "contents": {
1684
+ "kind": "markdown",
1685
+ "value": "```weidu-tp2-tooltip\nPATCH_PHP_EACH String1 AS String2 => String3 list BEGIN patch list END\n```\nA synonym of PHP_EACH."
1686
+ }
1687
+ },
1688
+ "PATCH_PRINT": {
1689
+ "contents": {
1690
+ "kind": "markdown",
1691
+ "value": "```weidu-tp2-tooltip\nPATCH_PRINT displayString\n```\nThe string DisplayString is echoed to the user. Useful for debugging or status reports. If displayString contains %variable% references, their values will be displayed. See also PRINT. Example: COPY_EXISTING_REGEXP ~.*\\.CRE~ ~override~ READ_BYTE 0x272 race READ_BYTE 0x273 class PATCH_IF class = 3 THEN BEGIN PATCH_PRINT ~%SOURCE_FILE% is a cleric with race = %race%.~ END"
1692
+ }
1693
+ },
1694
+ "PATCH_RANDOM_SEED": {
1695
+ "contents": {
1696
+ "kind": "markdown",
1697
+ "value": "```weidu-tp2-tooltip\nPATCH_RANDOM_SEED value\n```\nSee RANDOM_SEED."
1698
+ }
1699
+ },
1700
+ "PATCH_READLN": {
1701
+ "contents": {
1702
+ "kind": "markdown",
1703
+ "value": "```weidu-tp2-tooltip\nPATCH_READLN variable\n```\nWaits for the user to provided an enter-terminated string and store it in variable. Said string will be stored and re-used during non-interactive reinstalls. See the READLN tutorial.\nAs of `v251`, it emits the 'bell' (code 7) control character when asking for input."
1704
+ }
1705
+ },
1706
+ "PATCH_REINCLUDE": {
1707
+ "contents": {
1708
+ "kind": "markdown",
1709
+ "value": "```weidu-tp2-tooltip\nPATCH_REINCLUDE String list\n```\nWorks like PATCH_INCLUDE, but loads each time the tph file from the hard disk. This is slower, but required if you want to edit your tpp file between an inclusion and another."
1710
+ }
1711
+ },
1712
+ "PATCH_RERAISE": {
1713
+ "contents": {
1714
+ "kind": "markdown",
1715
+ "value": "```weidu-tp2-tooltip\nPATCH_RERAISE\n```\nWhen used inside a PATCH_TRY, the matched error is re-raised.See the MATCH and TRY tutorial for additional information."
1716
+ }
1717
+ },
1718
+ "PATCH_SILENT": {
1719
+ "contents": {
1720
+ "kind": "markdown",
1721
+ "value": "```weidu-tp2-tooltip\nPATCH_SILENT\n```\nmakes WeiDU skip all messages; it's reenabled once a component is installed (or fails to), or a PRINT, PATCH_PRINT, VERBOSE or PATCH_VERBOSE is found."
1722
+ }
1723
+ },
1724
+ "PATCH_TIME": {
1725
+ "contents": {
1726
+ "kind": "markdown",
1727
+ "value": "```weidu-tp2-tooltip\nPATCH_TIME String BEGIN patch list END\n```\nMeasure the time taken to execute the patches and report it under the label String together with the other time measurements at the end of the mod's debug file."
1728
+ }
1729
+ },
1730
+ "PATCH_TRY": {
1731
+ "contents": {
1732
+ "kind": "markdown",
1733
+ "value": "```weidu-tp2-tooltip\nPATCH_TRY patch list WITH [ patternvalue ... [ WHEN guardvalue ] BEGIN patch list END ] ... DEFAULT patch list END\n```\nIf evaluating the patch list results in an error, the error is matched, as per PATCH_MATCH.N.B. TRY is generally not safe to use because many errors are intended to be fatal and if the mod installation were to proceed anyway, it might do so in an inconsistent state, with resource leaks or with other errors. PATCH_RERAISE mitigates or eliminates these risks, since the unsafe part is allowing the installation to continue and re-raising the error allows it to fail, like intended.See the MATCH and TRY tutorial for additional information."
1734
+ }
1735
+ },
1736
+ "PATCH_VERBOSE": {
1737
+ "contents": {
1738
+ "kind": "markdown",
1739
+ "value": "```weidu-tp2-tooltip\nPATCH_VERBOSE\n```\nundoes the latest SILENT or PATCH_SILENT command."
1740
+ }
1741
+ },
1742
+ "PATCH_WARN": {
1743
+ "contents": {
1744
+ "kind": "markdown",
1745
+ "value": "```weidu-tp2-tooltip\nPATCH_WARN displayString\n```\nThe string DisplayString is echoed to the user. Useful for debugging or status reports. If displayString contains %variable% references, their values will be displayed. Additionally, INSTALLED WITH WARNINGS is printed at the end of the install."
1746
+ }
1747
+ },
1748
+ "PATCH_WITH_SCOPE": {
1749
+ "contents": {
1750
+ "kind": "markdown",
1751
+ "value": "```weidu-tp2-tooltip\nPATCH_WITH_SCOPE BEGIN patch list END\n```\nCreates a new variable scope copied from the surrounding scope and evaluates the patches inside the new scope. When PATCH_WITH_SCOPE exits, the new scope is discarded, all new variables defined inside the scope and all changes to existing variables are forgotten."
1752
+ }
1753
+ },
1754
+ "PATCH_WITH_TRA": {
1755
+ "contents": {
1756
+ "kind": "markdown",
1757
+ "value": "```weidu-tp2-tooltip\nPATCH_WITH_TRA traName list BEGIN patch list END\n```\nCreates a new TRA scope copied from the surrounding scope, loads all traName files (variable substitution is done; the file can be inlined) and evaluates the patches. When PATCH_WITH_TRA exits, the new TRA scope is discarded, that is, all TRA changes made by PATCH_WITH_TRA or any of its enclosed patches are forgotten."
1758
+ }
1759
+ },
1760
+ "PHP_EACH": {
1761
+ "contents": {
1762
+ "kind": "markdown",
1763
+ "value": "```weidu-tp2-tooltip\nPHP_EACH String1 AS String2 => String3 list BEGIN patch list END\n```\nFor every value of the string1 array that has been created or read, sets string2_0 to the first array parameter, string2_1 to the second array parameter, etc. and string3 to the result of the array. string2 will also contain \t\tthe first array parameter (as a synonym of string2_0). then executes the patches listed. More exhaustive documentation will be provided by SConrad."
1764
+ }
1765
+ },
1766
+ "PRETTY_PRINT_2DA": {
1767
+ "contents": {
1768
+ "kind": "markdown",
1769
+ "value": "```weidu-tp2-tooltip\nPRETTY_PRINT_2DA\n```\nIndents the 3rd line in the current file (which should be a `2da` file).\n\n**Alternative form**: `PRETTY_PRINT_2DA value`\nIndents the value'th line (counting from 0) in the current file (which should be a `2da` file)."
1770
+ }
1771
+ },
1772
+ "QUOTE": {
1773
+ "contents": {
1774
+ "kind": "markdown",
1775
+ "value": "```weidu-tp2-tooltip\nQUOTE variable stringWithVars\n```\n%variable% will be inited to a string that will match exactly stringWithVars. QUOTE var ~some\\thing^~ will create %var% = \"some\\\\thing\\^\"."
1776
+ }
1777
+ },
1778
+ "READ_2DA_ENTRIES_NOW": {
1779
+ "contents": {
1780
+ "kind": "markdown",
1781
+ "value": "```weidu-tp2-tooltip\nREAD_2DA_ENTRIES_NOW string value\n```\nThe contents of the 2DA table is read in one go into an array derived from the first parameter, string. The second parameter, value, is the required column count. Rows with fewer columns are disregarded. The parameter string is also used to set a variable named after string that is set to the number of rows in the 2DA table with the required number of columns. Retrieve values from the constructed array with READ_2DA_ENTRY_FORMER. If you use READ_2DA_ENTRIES_NOW together with SET_2DA_ENTRY_LATER you must use different string variables for the two. See the READ_2DA_ENTRIES_NOW tutorial."
1782
+ }
1783
+ },
1784
+ "READ_2DA_ENTRY": {
1785
+ "contents": {
1786
+ "kind": "markdown",
1787
+ "value": "```weidu-tp2-tooltip\nREAD_2DA_ENTRY value value value variable\n```\nThe first value is the row, the second is the column and the third is the required column count. The variable specified is set to the entry on the given column of the given row, but only column with at least as many columns as the required column count are considered. This is the reverse of SET_2DA_ENTRY."
1788
+ }
1789
+ },
1790
+ "READ_2DA_ENTRY_FORMER": {
1791
+ "contents": {
1792
+ "kind": "markdown",
1793
+ "value": "```weidu-tp2-tooltip\nREAD_2DA_ENTRY_FORMER string value value variable\n```\nRetrieves values from an array constructed by READ_2DA_ENTRIES_NOW. The first parameter, string, is the name of the array. The following two values are the 2DA row and column from which to read the entry. The value of the 2DA entry is stored in the last parameter, variable. See the READ_2DA_ENTRY_FORMER tutorial."
1794
+ }
1795
+ },
1796
+ "READ_ASCII": {
1797
+ "contents": {
1798
+ "kind": "markdown",
1799
+ "value": "```weidu-tp2-tooltip\nREAD_ASCII offset variable [ ELSE string ] [ ( value ) [ NULL ] ]\n```\nA nul-terminated string is read from the file at the given offset and is stored in the given variable. The terminating nul is not stored. The default read size is 8 bytes. If an explicit size value is specified then that many bytes are read into the variable, even if some of them are nuls, except if NULL is present, in which case a nul-terminated string is read, without storing the terminating null. See READ_BYTE. If the offset is out-of-bounds and the ELSE clause is present, the string is evaluated as in WRITE_EVALUATED_ASCII and then assigned into variable."
1800
+ }
1801
+ },
1802
+ "READ_BYTE": {
1803
+ "contents": {
1804
+ "kind": "markdown",
1805
+ "value": "```weidu-tp2-tooltip\nREAD_BYTE offset variable [ ELSE value ]\n```\nAn 8-bit value is read from the file at the given offset and is stored in the given variable. If offset is out-of-bounds and the ELSE is present, the ELSE-value is assigned to variable. If offset is out-of-bounds and the ELSE is not present, the patch fails with a visible error."
1806
+ }
1807
+ },
1808
+ "READ_LONG": {
1809
+ "contents": {
1810
+ "kind": "markdown",
1811
+ "value": "```weidu-tp2-tooltip\nREAD_LONG offset variable [ ELSE value ]\n```\nA 32-bit value is read from the file at the given offset and is stored in the given variable. See READ_BYTE."
1812
+ }
1813
+ },
1814
+ "READ_SBYTE": {
1815
+ "contents": {
1816
+ "kind": "markdown",
1817
+ "value": "```weidu-tp2-tooltip\nREAD_SBYTE offset variable [ ELSE value ]\n```\nAs READ_BYTE, but the value is interpreted as signed."
1818
+ }
1819
+ },
1820
+ "READ_SHORT": {
1821
+ "contents": {
1822
+ "kind": "markdown",
1823
+ "value": "```weidu-tp2-tooltip\nREAD_SHORT offset variable [ ELSE value ]\n```\nA 16-bit value is read from the file at the given offset and is stored in the given variable. See READ_BYTE."
1824
+ }
1825
+ },
1826
+ "READ_SLONG": {
1827
+ "contents": {
1828
+ "kind": "markdown",
1829
+ "value": "```weidu-tp2-tooltip\nREAD_SLONG offset variable [ ELSE value ]\n```\nAs READ_LONG, but the value is interpreted as signed."
1830
+ }
1831
+ },
1832
+ "READ_SSHORT": {
1833
+ "contents": {
1834
+ "kind": "markdown",
1835
+ "value": "```weidu-tp2-tooltip\nREAD_SSHORT offset variable [ ELSE value ]\n```\nAs READ_SHORT, but the value is interpreted as signed."
1836
+ }
1837
+ },
1838
+ "READ_STRREF": {
1839
+ "contents": {
1840
+ "kind": "markdown",
1841
+ "value": "```weidu-tp2-tooltip\nREAD_STRREF offset variable [ ELSE string ]\n```\nA 32-bit Infinity Engine string reference is read from the file at the given offset. The string reference is looked up in DIALOG.TLK and the (male) string (without any quotes) is stored in the variable. In some sense this is the opposite of SAY_EVALUATED."
1842
+ }
1843
+ },
1844
+ "READ_STRREF_F": {
1845
+ "contents": {
1846
+ "kind": "markdown",
1847
+ "value": "```weidu-tp2-tooltip\nREAD_STRREF_F offset variable [ ELSE string ]\n```\nA 32-bit Infinity Engine string reference is read from the file at the given offset. The string reference is looked up in DIALOGF.TLK and the female string (without any quotes) is stored in the variable."
1848
+ }
1849
+ },
1850
+ "READ_STRREF_FS": {
1851
+ "contents": {
1852
+ "kind": "markdown",
1853
+ "value": "```weidu-tp2-tooltip\nREAD_STRREF_FS offset variable [ ELSE string ]\n```\nA 32-bit Infinity Engine string reference is read from the file at the given offset. The string reference is looked up in DIALOGF.TLK and the sound reference associated with the female string is stored in the variable. If there is no DIALOGF.TLK, the sound reference associated with the string from DIALOG.TLK is used instead. If the string has no sound, the empty string is used instead."
1854
+ }
1855
+ },
1856
+ "READ_STRREF_S": {
1857
+ "contents": {
1858
+ "kind": "markdown",
1859
+ "value": "```weidu-tp2-tooltip\nREAD_STRREF_S offset variable [ ELSE string ]\n```\nA 32-bit Infinity Engine string reference is read from the file at the given offset. The string reference is looked up in DIALOG.TLK and the sound reference associated with the (male) string is stored in the variable. If the string has no sound, the empty string is used instead."
1860
+ }
1861
+ },
1862
+ "REFACTOR_BAF_TRIGGER": {
1863
+ "contents": {
1864
+ "kind": "markdown",
1865
+ "value": "```weidu-tp2-tooltip\nREFACTOR_BAF_TRIGGER optcase optexact String String\n```\nSynonym for REFACTOR_TRIGGER."
1866
+ }
1867
+ },
1868
+ "REFACTOR_D_TRIGGER": {
1869
+ "contents": {
1870
+ "kind": "markdown",
1871
+ "value": "```weidu-tp2-tooltip\nREFACTOR_D_TRIGGER optcase optexact String String\n```\nSynonym for REFACTOR_TRIGGER."
1872
+ }
1873
+ },
1874
+ "REFACTOR_TRIGGER": {
1875
+ "contents": {
1876
+ "kind": "markdown",
1877
+ "value": "```weidu-tp2-tooltip\nREFACTOR_TRIGGER optcase optexact String String\n```\nWorks like REPLACE_TEXTUALLY, except that it only works on triggers (for both D and BAF files) and applies Boolean Algebra to ensure that the structure of the trigger is not broken (like REPLACE_TEXTUALLY would do if you are substituting one trigger with several and the matching trigger is inside an OR() block and/or negated).Caveats: \n this command is very slow, so you should use REPLACE_TEXTUALLY if you are substituting a trigger with another, as well as using IF to \tavoid calling this patch on script files that do not contain the trigger \tyou are looking for. \nthe resulting file will have messed up whitespace, so remember that if you plan on using REPLACE_TEXTUALLY later (the file will work correctly \tin-game). Applying another (empty) DECOMPILE_AND_PATCH will fix this issue. \nthe searching regexp must match exactly against a single trigger (so REFACTOR_TRIGGER ~A() B()~ ~C()~ or \tREFACTOR_TRIGGER ~A(~ ~C() A(~ will not work). The substituting \tstring can contain multiple triggers."
1878
+ }
1879
+ },
1880
+ "REMOVE_2DA_ROW": {
1881
+ "contents": {
1882
+ "kind": "markdown",
1883
+ "value": "```weidu-tp2-tooltip\nREMOVE_2DA_ROW value1 value2\n```\nthe Value1-th row from the 2da file containing at least value2 items will be removed."
1884
+ }
1885
+ },
1886
+ "REMOVE_CRE_EFFECTS": {
1887
+ "contents": {
1888
+ "kind": "markdown",
1889
+ "value": "```weidu-tp2-tooltip\nREMOVE_CRE_EFFECTS\n```\nRemove all effects from the current creature."
1890
+ }
1891
+ },
1892
+ "REMOVE_CRE_ITEM": {
1893
+ "contents": {
1894
+ "kind": "markdown",
1895
+ "value": "```weidu-tp2-tooltip\nREMOVE_CRE_ITEM itmName list\n```\nRemove the listed items from the current creature. Does nothing if an item is not possessed. \tMultiple instances are removed."
1896
+ }
1897
+ },
1898
+ "REMOVE_CRE_ITEMS": {
1899
+ "contents": {
1900
+ "kind": "markdown",
1901
+ "value": "```weidu-tp2-tooltip\nREMOVE_CRE_ITEMS\n```\nRemove all items from the current creature."
1902
+ }
1903
+ },
1904
+ "REMOVE_KNOWN_SPELL": {
1905
+ "contents": {
1906
+ "kind": "markdown",
1907
+ "value": "```weidu-tp2-tooltip\nREMOVE_KNOWN_SPELL splName list\n```\nWhen applied to a CRE file, this patch causes all of the listed spells to be removed. Example: COPY_EXISTING ~aerie.cre~ ~override/aerie.cre~ REMOVE_KNOWN_SPELL ~sppr101~ ~sppr102~ Special thanks to Japh for coding this feature."
1908
+ }
1909
+ },
1910
+ "REMOVE_KNOWN_SPELLS": {
1911
+ "contents": {
1912
+ "kind": "markdown",
1913
+ "value": "```weidu-tp2-tooltip\nREMOVE_KNOWN_SPELLS\n```\nRemove all known spells from the current creature."
1914
+ }
1915
+ },
1916
+ "REMOVE_MEMORIZED_SPELL": {
1917
+ "contents": {
1918
+ "kind": "markdown",
1919
+ "value": "```weidu-tp2-tooltip\nREMOVE_MEMORIZED_SPELL splName list\n```\nWhen applied to a CRE file, this patch causes all of the listed spells to be removed from their memory. Example: COPY_EXISTING ~aerie.cre~ ~override/aerie.cre~ REMOVE_MEMORIZED_SPELL ~sppr101~ ~sppr102~"
1920
+ }
1921
+ },
1922
+ "REMOVE_MEMORIZED_SPELLS": {
1923
+ "contents": {
1924
+ "kind": "markdown",
1925
+ "value": "```weidu-tp2-tooltip\nREMOVE_MEMORIZED_SPELLS\n```\nRemove all memorized spells from the current creature."
1926
+ }
1927
+ },
1928
+ "REMOVE_STORE_ITEM": {
1929
+ "contents": {
1930
+ "kind": "markdown",
1931
+ "value": "```weidu-tp2-tooltip\nREMOVE_STORE_ITEM itmName list\n```\nRemove the listed items from the current store. Does nothing if an item is not for sale. \tMultiple instances are removed."
1932
+ }
1933
+ },
1934
+ "REPLACE": {
1935
+ "contents": {
1936
+ "kind": "markdown",
1937
+ "value": "```weidu-tp2-tooltip\nREPLACE optcase optexact regexp text\n```\nAll occurrences of regexp in the file are replaced with the ASCII printing of the string reference for text. So if regexp is \"FRED\" and the text ends up being strref #1234, \"FRED\" will be replaced with \"1234\". This is usually used to replace string references in BCS files (where they are stored textually). Put a command like DisplayString(Myself,99999) in your BCS file and use something like REPLACE 99999 \"Hello, World\"."
1938
+ }
1939
+ },
1940
+ "REPLACE_BCS_BLOCK": {
1941
+ "contents": {
1942
+ "kind": "markdown",
1943
+ "value": "```weidu-tp2-tooltip\nREPLACE_BCS_BLOCK [ EVALUATE_BUFFER ] optcase oldFile newFile [ ON_MISMATCH patch list END ]\n```\nIf the current file is a BCS file, the segment of it corresponding to oldFile is replaced with the contents of newFile. oldFile and newFile may be BCS or BAF files. If they are BAF files they will not get the benefit of AUTO_TRA. If EVALUATE_BUFFER is given, variables inside oldFile and newFile are evaluated, but only they are BAF files. If the segment corresponding to oldFile is not found and the ON_MISMATCH section is present, those patches are run; if oldFile is not found and ON_MISMATCH is not present, a warning message is printed. You may use R_B_B as a synonym for REPLACE_BCS_BLOCK."
1944
+ }
1945
+ },
1946
+ "REPLACE_CRE_ITEM": {
1947
+ "contents": {
1948
+ "kind": "markdown",
1949
+ "value": "```weidu-tp2-tooltip\nREPLACE_CRE_ITEM itmName #charge1 #charge2 #charge3 flags slot [ EQUIP ] [ TWOHANDED ]\n```\nIf there's an item in the slot position, replace it; otherwise, process ADD_CRE_ITEM"
1950
+ }
1951
+ },
1952
+ "REPLACE_EVALUATE": {
1953
+ "contents": {
1954
+ "kind": "markdown",
1955
+ "value": "```weidu-tp2-tooltip\nREPLACE_EVALUATE optcase findRegexp BEGIN patch list END replaceRegexp\n```\nFor every instance of the regexp findRegexp found, the patch list is evaluated (with the variable MATCHi set to the ith matched group in findRegexp), variable substitution is performed on replaceRegexp, and then findRegexp is replaced by replaceRegexp. Note that REPLACE_EVALUATE defines up to 200 MATCHi variables, but that MATCH1 is normally the variable matching the first group in findRegexp. Due to details of the implementation, MATCH0 normally evaluates to the string matched by the whole of findRegexp. Any writes done by the patch list (e.g., SAY or WRITE_ASCII) are ignored: SET should be the main component of the patch list. For example: COPY ~nice.baf~ ~mean.baf~ REPLACE_EVALUATE ~Give(\\([0-9]+\\),\\([0-9]+\\))~ BEGIN SET result = (MATCH1 + MATCH2) / 2 END ~Take(%result%)~ This COPY TP2 Action would replace Give(10,20) with Take(15). optcase allows you to decide if the matching is case-sensitive or not. Matching is case-sensitive by default."
1956
+ }
1957
+ },
1958
+ "REPLACE_TEXTUALLY": {
1959
+ "contents": {
1960
+ "kind": "markdown",
1961
+ "value": "```weidu-tp2-tooltip\nREPLACE_TEXTUALLY optcase optexact regexp string [ ( sizeValue ) ]\n```\nAll occurrences of the given regexp in the file are replaced with the given string. variable substitution (e.g., kit and music names) is performed on both the string and the regexp. If you use the sizeValue field, optexact is automatically set to true (IE without regexp patterns). The regexp and the string are padded by zeros to be long exactly sizeValue bytes."
1962
+ }
1963
+ },
1964
+ "R_B_B": {
1965
+ "contents": {
1966
+ "kind": "markdown",
1967
+ "value": "```weidu-tp2-tooltip\nR_B_B [ EVALUATE_BUFFER ] optcase oldFile newFile [ ON_MISMATCH patch list END ]\n```\nIf the current file is a BCS file, the segment of it corresponding to oldFile is replaced with the contents of newFile. oldFile and newFile may be BCS or BAF files. If they are BAF files they will not get the benefit of AUTO_TRA. If EVALUATE_BUFFER is given, variables inside oldFile and newFile are evaluated, but only they are BAF files. If the segment corresponding to oldFile is not found and the ON_MISMATCH section is present, those patches are run; if oldFile is not found and ON_MISMATCH is not present, a warning message is printed."
1968
+ }
1969
+ },
1970
+ "SAY": {
1971
+ "contents": {
1972
+ "kind": "markdown",
1973
+ "value": "```weidu-tp2-tooltip\nSAY offset String\n```\nThe string-ref associated with String is written at offset. This is commonly used to change the name or description of a spell or item."
1974
+ }
1975
+ },
1976
+ "SAY_EVALUATED": {
1977
+ "contents": {
1978
+ "kind": "markdown",
1979
+ "value": "```weidu-tp2-tooltip\nSAY_EVALUATED offset stringWithVars\n```\nAny WeiDU variables (enclosed in `%s`) inside stringWithVars are replaced by their values and the resulting string (constructed at mod-installation time!) is added to `DIALOG.TLK` and its string reference it written to the offset. Example:\n```\nCOPY_EXISTING_REGEXP ~RING.*.ITM~ ~override~\n READ_LONG 0x38 cost\n SAY_EVALUATED IDENTIFIED_DESC ~I Am %SOURCE_RES%, I Cost %cost%~\n```"
1980
+ }
1981
+ },
1982
+ "SET": {
1983
+ "contents": {
1984
+ "kind": "markdown",
1985
+ "value": "```weidu-tp2-tooltip\nSET [ GLOBAL ] variable = value\n```\nUpdate variable so that it is equal to value.\nIf `GLOBAL` is provided, the variable is set in a special variable scope that can be accessed from any other variable scope. Normal variables do, however, shadow `GLOBAL` variables if they have the same variable name.\n\n**Equivalent**: `variable = value`"
1986
+ }
1987
+ },
1988
+ "SET_2DA_ENTRIES_NOW": {
1989
+ "contents": {
1990
+ "kind": "markdown",
1991
+ "value": "```weidu-tp2-tooltip\nSET_2DA_ENTRIES_NOW string value\n```\nFlush the changes to the 2DA table that have been queued by SET_2DA_ENTRY_LATER. The first parameter, string, should be the same string you used for SET_2DA_ENTRY_LATER. The second value is the required column count. Rows with fewer columns are disregarded. See the SET_2DA_ENTRIES_NOW tutorial."
1992
+ }
1993
+ },
1994
+ "SET_2DA_ENTRY": {
1995
+ "contents": {
1996
+ "kind": "markdown",
1997
+ "value": "```weidu-tp2-tooltip\nSET_2DA_ENTRY value value value value\n```\nThe first value is the row, the second is the column and the third is the required column count. The entry on the given column of the given row is set to the fourth value, but only rows with at least as many columns as the required column count are considered. The fourth value, the new entry, is evaluated specially: if it can be evaluated like a value (e.g., \"3+4\") it will be evaluated and its integer result will be written as an ASCII string. Otherwise if it is a single string (that is not a variable in scope) that string will be written at the new value. See the SET_2DA_ENTRY tutorial for more information."
1998
+ }
1999
+ },
2000
+ "SET_2DA_ENTRY_LATER": {
2001
+ "contents": {
2002
+ "kind": "markdown",
2003
+ "value": "```weidu-tp2-tooltip\nSET_2DA_ENTRY_LATER string value value value\n```\nDefines an change to a 2DA file to be made at some point in the future. The change is stored in variables derived from the first parameter, string. The first two values are the row and column of the 2DA table to be changed and the third value the new value of the 2DA entry. Use SET_2DA_ENTRIES_NOW to flush the queued changes and update the 2DA table. If you use SET_2DA_ENTRY_LATER together with READ_2DA_ENTRY_FORMER you must use different string variables for the two. See the SET_2DA_ENTRY_LATER tutorial."
2004
+ }
2005
+ },
2006
+ "SET_BG2_PROFICIENCY": {
2007
+ "contents": {
2008
+ "kind": "markdown",
2009
+ "value": "```weidu-tp2-tooltip\nSET_BG2_PROFICIENCY String value\n```\nRemoves all effects from the current CRE file that alter the proficiency specified by \tString (relative to Stats.ids). After that, if value is different from zero, add an effect \tto set said proficiency to value."
2010
+ }
2011
+ },
2012
+ "SNPRINT": {
2013
+ "contents": {
2014
+ "kind": "markdown",
2015
+ "value": "```weidu-tp2-tooltip\nSNPRINT value variable stringWithVars\n```\nIf value evaluates to zero or a positive number, N, the first N characters of the evaluated contents of stringWithVars are assigned to variable. If value evaluates to a negative number, N, it's instead the last N characters. Thus: SPRINT author Jason SNPRINT 3 myvar \"1:%author%\" ... assigns 1:J to myvar."
2016
+ }
2017
+ },
2018
+ "SORT_ARRAY_INDICES": {
2019
+ "contents": {
2020
+ "kind": "markdown",
2021
+ "value": "```weidu-tp2-tooltip\nSORT_ARRAY_INDICES String\n```\nSemantically identical to ACTION_SORT_ARRAY_INDICES"
2022
+ }
2023
+ },
2024
+ "SOURCE_BIFF": {
2025
+ "contents": {
2026
+ "kind": "markdown",
2027
+ "value": "```weidu-tp2-tooltip\nSOURCE_BIFF variable filename\n```\nIf filename is in a biff (whether it is also in the override or not), sets variable to the name of the containing biff (the name is printed as E.G. data/items.bif)."
2028
+ }
2029
+ },
2030
+ "SPACES": {
2031
+ "contents": {
2032
+ "kind": "markdown",
2033
+ "value": "```weidu-tp2-tooltip\nSPACES variable stringWithVars\n```\n%variable% will be inited to a string the same length as stringWithVars, but made entirely of spaces. SPACES var ~123~ will create %var% = \" \"."
2034
+ }
2035
+ },
2036
+ "SPRINT": {
2037
+ "contents": {
2038
+ "kind": "markdown",
2039
+ "value": "```weidu-tp2-tooltip\nSPRINT [ GLOBAL ] variable stringWithVars\n```\nLike TEXT_SPRINT, but stringWithVars can be an @reference, and will break --traify. Use TEXT_SPRINT instead."
2040
+ }
2041
+ },
2042
+ "SPRINTF": {
2043
+ "contents": {
2044
+ "kind": "markdown",
2045
+ "value": "```weidu-tp2-tooltip\nSPRINTF variable stringWithVars ( variable or value list )\n```\nIn stringWithVars, any instance of %s, %d and %x will consume one variable of the list of variables and format the contents of the variable as a string, decimal number or hexadecimal number, respectively. Any normal text in stringWithVars is reproduced verbatim. Variables enclosed in % are not evaluated. The result is stored in the variable given as the first argument. SET ten = 10 SPRINTF foo \"%s %d %x quux\" (\"bar\" 10 ten) will set the variable foo to the string ~bar 10 0xa quux~"
2046
+ }
2047
+ },
2048
+ "TEXT_SPRINT": {
2049
+ "contents": {
2050
+ "kind": "markdown",
2051
+ "value": "```weidu-tp2-tooltip\nTEXT_SPRINT [ GLOBAL ] variable stringWithVars\n```\nAny WeiDU variables (enclosed in %s) inside stringWithVars are replaced by their values and the resulting string (constructed at mod-installation time!) is assigned to the variable variable.\nIf `GLOBAL` is provided, the variable is set in a special variable scope that can be accessed from any other variable scope. Normal variables do, however, shadow `GLOBAL` variables if they have the same variable name."
2052
+ }
2053
+ },
2054
+ "TO_LOWER": {
2055
+ "contents": {
2056
+ "kind": "markdown",
2057
+ "value": "```weidu-tp2-tooltip\nTO_LOWER variable\n```\nTurns to lower-case the contents of %variable% and store the results in variable."
2058
+ }
2059
+ },
2060
+ "TO_UPPER": {
2061
+ "contents": {
2062
+ "kind": "markdown",
2063
+ "value": "```weidu-tp2-tooltip\nTO_UPPER variable\n```\nTurns to upper-case the contents of %variable% and store the results in variable."
2064
+ }
2065
+ },
2066
+ "WHILE": {
2067
+ "contents": {
2068
+ "kind": "markdown",
2069
+ "value": "```weidu-tp2-tooltip\nWHILE value BEGIN patch list END\n```\nIf value is non-zero, execute the given patch list and then repeat, re-evaluating the value. Be very careful when using this command. You can easily describe an infinite loop. See the WHILE loop tutorial for more information."
2070
+ }
2071
+ },
2072
+ "WRITE_ASCII": {
2073
+ "contents": {
2074
+ "kind": "markdown",
2075
+ "value": "```weidu-tp2-tooltip\nWRITE_ASCII offset ascString [ #requiredSize ]\n```\nThe ASCII ascString is written to the file starting at offset. If you specify a requiredSize then exactly that many bytes are written (if ascString is smaller, it is padded with NULs; if ascString is larger, it is truncated). If you do not specify a requiredSize, the terminating NUL is not written."
2076
+ }
2077
+ },
2078
+ "WRITE_ASCIIE": {
2079
+ "contents": {
2080
+ "kind": "markdown",
2081
+ "value": "```weidu-tp2-tooltip\nWRITE_ASCIIE offset ascString [ #requiredSize ]\n```\nThe ASCII ascString is evaluated (so %variable% is replaced by its value) and written to the file starting at offset (as in WRITE_ASCII). You may use WRITE_ASCIIE as a synonym for WRITE_EVALUATED_ASCII."
2082
+ }
2083
+ },
2084
+ "WRITE_ASCIIL": {
2085
+ "contents": {
2086
+ "kind": "markdown",
2087
+ "value": "```weidu-tp2-tooltip\nWRITE_ASCIIL offset ascString list\n```\nThe given ASCII strings are written at offset, offset + 8, offset + 16... Automatically evaluates variables. You may use WRITE_ASCIIL as a synonym for WRITE_ASCII_LIST."
2088
+ }
2089
+ },
2090
+ "WRITE_ASCIIT": {
2091
+ "contents": {
2092
+ "kind": "markdown",
2093
+ "value": "```weidu-tp2-tooltip\nWRITE_ASCIIT offset ascString\n```\nThe ASCII ascString is written to the file starting at offset. The terminating NUL is written. You may use WRITE_ASCIIT as a synonym for WRITE_ASCII_TERMINATE."
2094
+ }
2095
+ },
2096
+ "WRITE_ASCII_LIST": {
2097
+ "contents": {
2098
+ "kind": "markdown",
2099
+ "value": "```weidu-tp2-tooltip\nWRITE_ASCII_LIST offset ascString list\n```\nThe given ASCII strings are written at offset, offset + 8, offset + 16... Automatically evaluates variables. You may use WRITE_ASCIIL as a synonym for WRITE_ASCII_LIST."
2100
+ }
2101
+ },
2102
+ "WRITE_ASCII_TERMINATE": {
2103
+ "contents": {
2104
+ "kind": "markdown",
2105
+ "value": "```weidu-tp2-tooltip\nWRITE_ASCII_TERMINATE offset ascString\n```\nThe ASCII ascString is written to the file starting at offset. The terminating NUL is written. You may use WRITE_ASCIIT as a synonym for WRITE_ASCII_TERMINATE."
2106
+ }
2107
+ },
2108
+ "WRITE_BYTE": {
2109
+ "contents": {
2110
+ "kind": "markdown",
2111
+ "value": "```weidu-tp2-tooltip\nWRITE_BYTE offset value\n```\nThe first argument is the offset at which the second argument (an 8-bit byte value) is written. Performs READ_BYTE offset THIS and READ_SBYTE offset STHIS automatically (you can now write WRITE_BYTE 100 THIS 2)."
2112
+ }
2113
+ },
2114
+ "WRITE_EVALUATED_ASCII": {
2115
+ "contents": {
2116
+ "kind": "markdown",
2117
+ "value": "```weidu-tp2-tooltip\nWRITE_EVALUATED_ASCII offset ascString [ #requiredSize ]\n```\nThe ASCII ascString is evaluated (so %variable% is replaced by its value) and written to the file starting at offset (as in WRITE_ASCII). You may use WRITE_ASCIIE as a synonym for WRITE_EVALUATED_ASCII."
2118
+ }
2119
+ },
2120
+ "WRITE_FILE": {
2121
+ "contents": {
2122
+ "kind": "markdown",
2123
+ "value": "```weidu-tp2-tooltip\nWRITE_FILE offset filename\n```\nThe entire contents of \"filename\" (which may contain variables) are loaded and copied over the current file starting at offset offset. \" filename\" must be a literal filename like mymod/data/file.bam. If there is not enough room between offset and the end of the file for the contents of \" filename\" the patch will fail with an error message."
2124
+ }
2125
+ },
2126
+ "WRITE_LONG": {
2127
+ "contents": {
2128
+ "kind": "markdown",
2129
+ "value": "```weidu-tp2-tooltip\nWRITE_LONG offset value\n```\nThe first argument is the offset at which the second argument (a 32-bit long word value) is written. Performs READ_LONG offset THIS and READ_SLONG offset STHIS automatically."
2130
+ }
2131
+ },
2132
+ "WRITE_SHORT": {
2133
+ "contents": {
2134
+ "kind": "markdown",
2135
+ "value": "```weidu-tp2-tooltip\nWRITE_SHORT offset value\n```\nThe first argument is the offset at which the second argument (a 16-bit short value) is written. Performs READ_SHORT offset THIS and READ_SSHORT offset STHIS automatically."
2136
+ }
2137
+ },
2138
+ "variable": {
2139
+ "contents": {
2140
+ "kind": "markdown",
2141
+ "value": "```weidu-tp2-tooltip\nvariable = value\n```\nUpdate variable so that it is equal to value."
2142
+ }
2143
+ },
2144
+ "BUT_ONLY": {
2145
+ "contents": {
2146
+ "kind": "markdown",
2147
+ "value": "```weidu-tp2-tooltip\nBUT_ONLY\n```\nTrue only if the file is actually changed by patching actions. Unlike all other when clauses, this one is evaluated just before the result would be written out to the disk. You may use BUT_ONLY as a synonym for BUT_ONLY_IF_IT_CHANGES."
2148
+ }
2149
+ },
2150
+ "BUT_ONLY_IF_IT_CHANGES": {
2151
+ "contents": {
2152
+ "kind": "markdown",
2153
+ "value": "```weidu-tp2-tooltip\nBUT_ONLY_IF_IT_CHANGES\n```\nTrue only if the file is actually changed by patching actions. Unlike all other when clauses, this one is evaluated just before the result would be written out to the disk. You may use BUT_ONLY as a synonym for BUT_ONLY_IF_IT_CHANGES."
2154
+ }
2155
+ },
2156
+ "IF": {
2157
+ "contents": {
2158
+ "kind": "markdown",
2159
+ "value": "```weidu-tp2-tooltip\nIF regexp\n```\nTrue if the input file contains regexp."
2160
+ }
2161
+ },
2162
+ "IF_EXISTS": {
2163
+ "contents": {
2164
+ "kind": "markdown",
2165
+ "value": "```weidu-tp2-tooltip\nIF_EXISTS\n```\nTrue only if the file exists. For COPY, this check is done with FILE_EXISTS. For COPY_EXISTING, COPY_EXISTING_REGEXP, COPY_RANDOM, APPEND and APPEND_COL this check is done with FILE_EXISTS_IN_GAME. For COPY_ALL_GAM_FILES, this when clause is redundant."
2166
+ }
2167
+ },
2168
+ "IF_SIZE_IS": {
2169
+ "contents": {
2170
+ "kind": "markdown",
2171
+ "value": "```weidu-tp2-tooltip\nIF_SIZE_IS fileSize\n```\nTrue if the input file size is fileSize. You may use I_S_I as a synonym for IF_SIZE_IS."
2172
+ }
2173
+ },
2174
+ "UNLESS": {
2175
+ "contents": {
2176
+ "kind": "markdown",
2177
+ "value": "```weidu-tp2-tooltip\nUNLESS regexp\n```\nFalse if the input file contains regexp."
2178
+ }
2179
+ },
2180
+ "ABS": {
2181
+ "contents": {
2182
+ "kind": "markdown",
2183
+ "value": "```weidu-tp2-tooltip\nABS Value\n```\nAbsolute value. If the value is >= 0, the result is x. Otherwise the result is -x."
2184
+ }
2185
+ },
2186
+ "AND": {
2187
+ "contents": {
2188
+ "kind": "markdown",
2189
+ "value": "```weidu-tp2-tooltip\nvalue AND value\n```\nConjunction. If both values are non-zero, the result is 1. Otherwise, the result is 0. Synonym: `&&`."
2190
+ }
2191
+ },
2192
+ "AREA_CITY": {
2193
+ "contents": {
2194
+ "kind": "markdown",
2195
+ "value": "```weidu-tp2-tooltip\nAREA_CITY\n```\n0xFC"
2196
+ }
2197
+ },
2198
+ "AREA_DAY": {
2199
+ "contents": {
2200
+ "kind": "markdown",
2201
+ "value": "```weidu-tp2-tooltip\nAREA_DAY\n```\n0x104"
2202
+ }
2203
+ },
2204
+ "AREA_DUNGEON": {
2205
+ "contents": {
2206
+ "kind": "markdown",
2207
+ "value": "```weidu-tp2-tooltip\nAREA_DUNGEON\n```\n0x100"
2208
+ }
2209
+ },
2210
+ "AREA_FOREST": {
2211
+ "contents": {
2212
+ "kind": "markdown",
2213
+ "value": "```weidu-tp2-tooltip\nAREA_FOREST\n```\n0xF8"
2214
+ }
2215
+ },
2216
+ "AREA_NIGHT": {
2217
+ "contents": {
2218
+ "kind": "markdown",
2219
+ "value": "```weidu-tp2-tooltip\nAREA_NIGHT\n```\n0x108"
2220
+ }
2221
+ },
2222
+ "AREA_SCRIPT": {
2223
+ "contents": {
2224
+ "kind": "markdown",
2225
+ "value": "```weidu-tp2-tooltip\nAREA_SCRIPT\n```\n0x94"
2226
+ }
2227
+ },
2228
+ "ATTACK1": {
2229
+ "contents": {
2230
+ "kind": "markdown",
2231
+ "value": "```weidu-tp2-tooltip\nATTACK1\n```\n0xDC"
2232
+ }
2233
+ },
2234
+ "ATTACK2": {
2235
+ "contents": {
2236
+ "kind": "markdown",
2237
+ "value": "```weidu-tp2-tooltip\nATTACK2\n```\n0xE0"
2238
+ }
2239
+ },
2240
+ "ATTACK3": {
2241
+ "contents": {
2242
+ "kind": "markdown",
2243
+ "value": "```weidu-tp2-tooltip\nATTACK3\n```\n0xE4"
2244
+ }
2245
+ },
2246
+ "ATTACK4": {
2247
+ "contents": {
2248
+ "kind": "markdown",
2249
+ "value": "```weidu-tp2-tooltip\nATTACK4\n```\n0xE8"
2250
+ }
2251
+ },
2252
+ "BAND": {
2253
+ "contents": {
2254
+ "kind": "markdown",
2255
+ "value": "```weidu-tp2-tooltip\nvalue BAND value\n```\nBitwise And. 0b101 BAND 0b110 = 0b100. Synonym: &."
2256
+ }
2257
+ },
2258
+ "BASR": {
2259
+ "contents": {
2260
+ "kind": "markdown",
2261
+ "value": "```weidu-tp2-tooltip\nvalue BASR value\n```\nBitwise Arithmetic Shift Right. This is an arithmetic shift: the sign bit of the first value is replicated and inserted in the vacated bits. 0b101 BASR 2 = 0b1."
2262
+ }
2263
+ },
2264
+ "BATTLE_CRY1": {
2265
+ "contents": {
2266
+ "kind": "markdown",
2267
+ "value": "```weidu-tp2-tooltip\nBATTLE_CRY1\n```\n0xC8"
2268
+ }
2269
+ },
2270
+ "BATTLE_CRY2": {
2271
+ "contents": {
2272
+ "kind": "markdown",
2273
+ "value": "```weidu-tp2-tooltip\nBATTLE_CRY2\n```\n0xCC"
2274
+ }
2275
+ },
2276
+ "BATTLE_CRY3": {
2277
+ "contents": {
2278
+ "kind": "markdown",
2279
+ "value": "```weidu-tp2-tooltip\nBATTLE_CRY3\n```\n0xD0"
2280
+ }
2281
+ },
2282
+ "BATTLE_CRY4": {
2283
+ "contents": {
2284
+ "kind": "markdown",
2285
+ "value": "```weidu-tp2-tooltip\nBATTLE_CRY4\n```\n0xD4"
2286
+ }
2287
+ },
2288
+ "BATTLE_CRY5": {
2289
+ "contents": {
2290
+ "kind": "markdown",
2291
+ "value": "```weidu-tp2-tooltip\nBATTLE_CRY5\n```\n0xD8"
2292
+ }
2293
+ },
2294
+ "ALWAYS_ASK": {
2295
+ "contents": {
2296
+ "kind": "markdown",
2297
+ "value": "```weidu-tp2-tooltip\nALWAYS_ASK\n```\nFor use with `QUICK_MENU`."
2298
+ }
2299
+ },
2300
+ "WHEN": {
2301
+ "contents": {
2302
+ "kind": "markdown",
2303
+ "value": "```weidu-tp2-tooltip\nWHEN\n```\nFor use with `ACTION_MATCH`, `ACTION_TRY`, `PATCH_MATCH` and `PATCH_TRY`."
2304
+ }
2305
+ },
2306
+ "ANY": {
2307
+ "contents": {
2308
+ "kind": "markdown",
2309
+ "value": "```weidu-tp2-tooltip\nANY\n```\nWhen using `ACTION_MATCH` and `PATCH_MATCH`, it is also possible to have a condition without a guard, in which case the syntax is:\n\n```\nACTION_MATCH ~%something%~\nWITH\n ANY GAME_IS ~BG1 TotSC~\n BEGIN\n // the game is BG1\n END\n ANY GAME_IS ~SoA ToB~\n BEGIN\n // the game is BG2\n END\n DEFAULT\n // not BG1 or BG2\nEND\n```"
2310
+ }
2311
+ },
2312
+ "ERROR_MESSAGE": {
2313
+ "contents": {
2314
+ "kind": "markdown",
2315
+ "value": "```weidu-tp2-tooltip\nERROR_MESSAGE\n```\nFor use with `ACTION_TRY` and `PATCH_TRY`.\n\n```\nACTION_TRY\n COPY ~override/sw1h01.itm~ ~override~\n DO_SOMETHING_ELSE\nWITH\n ~Unix.Unix_error(20, \"stat\", \"override/sw1h01.itm\")~\n BEGIN\n PRINT ~I caught sw1h01.itm not found!~\n END\n ~Unix.Unix_error(20, \"stat\", \"override/.*.itm\")~\n BEGIN\n PRINT ~I caught another missing item!~\n END\n DEFAULT\n PRINT ~I caught another error!~\nEND\n```\n\nThe actions in `ACTION_TRY` are executed. If none of those fails, the `WITH` part is skipped; otherwise, the error message is printed as usual (use `SILENT`), the exception text (from the `ERROR: blah blah` line) is saved to the `%ERROR_MESSAGE%` variable, and a `MATCH` is executed on that.\n\nAfter running the correct error handling code, execution continues after the end of the `ACTION_TRY` block. If you still want to block the installation, use `ACTION_RERAISE` (in theory, you could use `FAIL ~%ERROR_MESSAGE%~`, but this changes the exception and its text, which would cause you headaches when nesting multiple `TRY`s)."
2316
+ }
2317
+ },
2318
+ "THIS": {
2319
+ "contents": {
2320
+ "kind": "markdown",
2321
+ "value": "```weidu-tp2-tooltip\nTHIS\n```\nCurrent (unsigned) value.\nFor use with `WRITE_BYTE`, `WRITE_SHORT` and `WRITE_LONG`."
2322
+ }
2323
+ },
2324
+ "STHIS": {
2325
+ "contents": {
2326
+ "kind": "markdown",
2327
+ "value": "```weidu-tp2-tooltip\nSTHIS\n```\nCurrent (signed) value.\nFor use with `WRITE_BYTE`, `WRITE_SHORT` and `WRITE_LONG`."
2328
+ }
2329
+ },
2330
+ "BIFF_IS_COMPRESSED": {
2331
+ "contents": {
2332
+ "kind": "markdown",
2333
+ "value": "```weidu-tp2-tooltip\nBIFF_IS_COMPRESSED fileName\n```\nEvaluates to 1 if the file is a compressed biff. Evaluates to 0 otherwise.FileName must match against the contents of what is stored in chitin.key (similar to how command-line arguments that touch bif files work). For example, data/AREA000A.bif. Notably, SOURCE_BIFF outputs file names compatible with this command."
2334
+ }
2335
+ },
2336
+ "BIO": {
2337
+ "contents": {
2338
+ "kind": "markdown",
2339
+ "value": "```weidu-tp2-tooltip\nBIO\n```\nThe offset within an infinity engine resource where NPC Biography is stored (i.e., 0x1CC)."
2340
+ }
2341
+ },
2342
+ "BIT0": {
2343
+ "contents": {
2344
+ "kind": "markdown",
2345
+ "value": "```weidu-tp2-tooltip\nBIT0\n```\n0b00000000000000000000000000000001"
2346
+ }
2347
+ },
2348
+ "BIT1": {
2349
+ "contents": {
2350
+ "kind": "markdown",
2351
+ "value": "```weidu-tp2-tooltip\nBIT1\n```\n0b00000000000000000000000000000010"
2352
+ }
2353
+ },
2354
+ "BIT10": {
2355
+ "contents": {
2356
+ "kind": "markdown",
2357
+ "value": "```weidu-tp2-tooltip\nBIT10\n```\n0b00000000000000000000010000000000"
2358
+ }
2359
+ },
2360
+ "BIT11": {
2361
+ "contents": {
2362
+ "kind": "markdown",
2363
+ "value": "```weidu-tp2-tooltip\nBIT11\n```\n0b00000000000000000000100000000000"
2364
+ }
2365
+ },
2366
+ "BIT12": {
2367
+ "contents": {
2368
+ "kind": "markdown",
2369
+ "value": "```weidu-tp2-tooltip\nBIT12\n```\n0b00000000000000000001000000000000"
2370
+ }
2371
+ },
2372
+ "BIT13": {
2373
+ "contents": {
2374
+ "kind": "markdown",
2375
+ "value": "```weidu-tp2-tooltip\nBIT13\n```\n0b00000000000000000010000000000000"
2376
+ }
2377
+ },
2378
+ "BIT14": {
2379
+ "contents": {
2380
+ "kind": "markdown",
2381
+ "value": "```weidu-tp2-tooltip\nBIT14\n```\n0b00000000000000000100000000000000"
2382
+ }
2383
+ },
2384
+ "BIT15": {
2385
+ "contents": {
2386
+ "kind": "markdown",
2387
+ "value": "```weidu-tp2-tooltip\nBIT15\n```\n0b00000000000000001000000000000000"
2388
+ }
2389
+ },
2390
+ "BIT16": {
2391
+ "contents": {
2392
+ "kind": "markdown",
2393
+ "value": "```weidu-tp2-tooltip\nBIT16\n```\n0b00000000000000010000000000000000"
2394
+ }
2395
+ },
2396
+ "BIT17": {
2397
+ "contents": {
2398
+ "kind": "markdown",
2399
+ "value": "```weidu-tp2-tooltip\nBIT17\n```\n0b00000000000000100000000000000000"
2400
+ }
2401
+ },
2402
+ "BIT18": {
2403
+ "contents": {
2404
+ "kind": "markdown",
2405
+ "value": "```weidu-tp2-tooltip\nBIT18\n```\n0b00000000000001000000000000000000"
2406
+ }
2407
+ },
2408
+ "BIT19": {
2409
+ "contents": {
2410
+ "kind": "markdown",
2411
+ "value": "```weidu-tp2-tooltip\nBIT19\n```\n0b00000000000010000000000000000000"
2412
+ }
2413
+ },
2414
+ "BIT2": {
2415
+ "contents": {
2416
+ "kind": "markdown",
2417
+ "value": "```weidu-tp2-tooltip\nBIT2\n```\n0b00000000000000000000000000000100"
2418
+ }
2419
+ },
2420
+ "BIT20": {
2421
+ "contents": {
2422
+ "kind": "markdown",
2423
+ "value": "```weidu-tp2-tooltip\nBIT20\n```\n0b00000000000100000000000000000000"
2424
+ }
2425
+ },
2426
+ "BIT21": {
2427
+ "contents": {
2428
+ "kind": "markdown",
2429
+ "value": "```weidu-tp2-tooltip\nBIT21\n```\n0b00000000001000000000000000000000"
2430
+ }
2431
+ },
2432
+ "BIT22": {
2433
+ "contents": {
2434
+ "kind": "markdown",
2435
+ "value": "```weidu-tp2-tooltip\nBIT22\n```\n0b00000000010000000000000000000000"
2436
+ }
2437
+ },
2438
+ "BIT23": {
2439
+ "contents": {
2440
+ "kind": "markdown",
2441
+ "value": "```weidu-tp2-tooltip\nBIT23\n```\n0b00000000100000000000000000000000"
2442
+ }
2443
+ },
2444
+ "BIT24": {
2445
+ "contents": {
2446
+ "kind": "markdown",
2447
+ "value": "```weidu-tp2-tooltip\nBIT24\n```\n0b00000001000000000000000000000000"
2448
+ }
2449
+ },
2450
+ "BIT25": {
2451
+ "contents": {
2452
+ "kind": "markdown",
2453
+ "value": "```weidu-tp2-tooltip\nBIT25\n```\n0b00000010000000000000000000000000"
2454
+ }
2455
+ },
2456
+ "BIT26": {
2457
+ "contents": {
2458
+ "kind": "markdown",
2459
+ "value": "```weidu-tp2-tooltip\nBIT26\n```\n0b00000100000000000000000000000000"
2460
+ }
2461
+ },
2462
+ "BIT27": {
2463
+ "contents": {
2464
+ "kind": "markdown",
2465
+ "value": "```weidu-tp2-tooltip\nBIT27\n```\n0b00001000000000000000000000000000"
2466
+ }
2467
+ },
2468
+ "BIT28": {
2469
+ "contents": {
2470
+ "kind": "markdown",
2471
+ "value": "```weidu-tp2-tooltip\nBIT28\n```\n0b00010000000000000000000000000000"
2472
+ }
2473
+ },
2474
+ "BIT29": {
2475
+ "contents": {
2476
+ "kind": "markdown",
2477
+ "value": "```weidu-tp2-tooltip\nBIT29\n```\n0b00100000000000000000000000000000"
2478
+ }
2479
+ },
2480
+ "BIT3": {
2481
+ "contents": {
2482
+ "kind": "markdown",
2483
+ "value": "```weidu-tp2-tooltip\nBIT3\n```\n0b00000000000000000000000000001000"
2484
+ }
2485
+ },
2486
+ "BIT30": {
2487
+ "contents": {
2488
+ "kind": "markdown",
2489
+ "value": "```weidu-tp2-tooltip\nBIT30\n```\n0b01000000000000000000000000000000"
2490
+ }
2491
+ },
2492
+ "BIT31": {
2493
+ "contents": {
2494
+ "kind": "markdown",
2495
+ "value": "```weidu-tp2-tooltip\nBIT31\n```\n0b10000000000000000000000000000000"
2496
+ }
2497
+ },
2498
+ "BIT4": {
2499
+ "contents": {
2500
+ "kind": "markdown",
2501
+ "value": "```weidu-tp2-tooltip\nBIT4\n```\n0b00000000000000000000000000010000"
2502
+ }
2503
+ },
2504
+ "BIT5": {
2505
+ "contents": {
2506
+ "kind": "markdown",
2507
+ "value": "```weidu-tp2-tooltip\nBIT5\n```\n0b00000000000000000000000000100000"
2508
+ }
2509
+ },
2510
+ "BIT6": {
2511
+ "contents": {
2512
+ "kind": "markdown",
2513
+ "value": "```weidu-tp2-tooltip\nBIT6\n```\n0b00000000000000000000000001000000"
2514
+ }
2515
+ },
2516
+ "BIT7": {
2517
+ "contents": {
2518
+ "kind": "markdown",
2519
+ "value": "```weidu-tp2-tooltip\nBIT7\n```\n0b00000000000000000000000010000000"
2520
+ }
2521
+ },
2522
+ "BIT8": {
2523
+ "contents": {
2524
+ "kind": "markdown",
2525
+ "value": "```weidu-tp2-tooltip\nBIT8\n```\n0b00000000000000000000000100000000"
2526
+ }
2527
+ },
2528
+ "BIT9": {
2529
+ "contents": {
2530
+ "kind": "markdown",
2531
+ "value": "```weidu-tp2-tooltip\nBIT9\n```\n0b00000000000000000000001000000000"
2532
+ }
2533
+ },
2534
+ "BLSL": {
2535
+ "contents": {
2536
+ "kind": "markdown",
2537
+ "value": "```weidu-tp2-tooltip\nvalue BLSL value\n```\nBitwise Logical Shift Left. 0b101 BLSL 2 = 0b10100. Synonym: <<."
2538
+ }
2539
+ },
2540
+ "BLSR": {
2541
+ "contents": {
2542
+ "kind": "markdown",
2543
+ "value": "```weidu-tp2-tooltip\nvalue BLSR value\n```\nBitwise Logical Shift Right. 0b101 BLSR 2 = 0b1. Synonym: >>."
2544
+ }
2545
+ },
2546
+ "BNOT": {
2547
+ "contents": {
2548
+ "kind": "markdown",
2549
+ "value": "```weidu-tp2-tooltip\nBNOT value\n```\nBitwise Not. BNOT 0b111 = 0b1111111111111111111111111111000. Synonym: `."
2550
+ }
2551
+ },
2552
+ "BOR": {
2553
+ "contents": {
2554
+ "kind": "markdown",
2555
+ "value": "```weidu-tp2-tooltip\nvalue BOR value\n```\nBitwise Or. 0b101 BOR 0b110 = 0b111. Synonym: |."
2556
+ }
2557
+ },
2558
+ "BORED": {
2559
+ "contents": {
2560
+ "kind": "markdown",
2561
+ "value": "```weidu-tp2-tooltip\nBORED\n```\n0xC4"
2562
+ }
2563
+ },
2564
+ "BUFFER_LENGTH": {
2565
+ "contents": {
2566
+ "kind": "markdown",
2567
+ "value": "```weidu-tp2-tooltip\nBUFFER_LENGTH\n```\nReturns the length of the string currently being patched, or 0 if outside of a patch expression."
2568
+ }
2569
+ },
2570
+ "BXOR": {
2571
+ "contents": {
2572
+ "kind": "markdown",
2573
+ "value": "```weidu-tp2-tooltip\nvalue BXOR value\n```\nBitwise Exclusive Or. 0b101 BXOR 0b110 = 0b011. Synonym: ^^."
2574
+ }
2575
+ },
2576
+ "BYTE_AT": {
2577
+ "contents": {
2578
+ "kind": "markdown",
2579
+ "value": "```weidu-tp2-tooltip\nBYTE_AT offset\n```\nThe 8-bit value from the file at the given offset."
2580
+ }
2581
+ },
2582
+ "COMPLIMENT1": {
2583
+ "contents": {
2584
+ "kind": "markdown",
2585
+ "value": "```weidu-tp2-tooltip\nCOMPLIMENT1\n```\n0x160"
2586
+ }
2587
+ },
2588
+ "COMPLIMENT2": {
2589
+ "contents": {
2590
+ "kind": "markdown",
2591
+ "value": "```weidu-tp2-tooltip\nCOMPLIMENT2\n```\n0x164"
2592
+ }
2593
+ },
2594
+ "COMPLIMENT3": {
2595
+ "contents": {
2596
+ "kind": "markdown",
2597
+ "value": "```weidu-tp2-tooltip\nCOMPLIMENT3\n```\n0x168"
2598
+ }
2599
+ },
2600
+ "CRITICAL_HIT": {
2601
+ "contents": {
2602
+ "kind": "markdown",
2603
+ "value": "```weidu-tp2-tooltip\nCRITICAL_HIT\n```\n0x1A8"
2604
+ }
2605
+ },
2606
+ "CRITICAL_MISS": {
2607
+ "contents": {
2608
+ "kind": "markdown",
2609
+ "value": "```weidu-tp2-tooltip\nCRITICAL_MISS\n```\n0x1AC"
2610
+ }
2611
+ },
2612
+ "DAMAGE": {
2613
+ "contents": {
2614
+ "kind": "markdown",
2615
+ "value": "```weidu-tp2-tooltip\nDAMAGE\n```\n0xEC"
2616
+ }
2617
+ },
2618
+ "DEATHVAR": {
2619
+ "contents": {
2620
+ "kind": "markdown",
2621
+ "value": "```weidu-tp2-tooltip\nDEATHVAR\n```\n0x280"
2622
+ }
2623
+ },
2624
+ "DESC": {
2625
+ "contents": {
2626
+ "kind": "markdown",
2627
+ "value": "```weidu-tp2-tooltip\nDESC\n```\n0x54"
2628
+ }
2629
+ },
2630
+ "DIALOG": {
2631
+ "contents": {
2632
+ "kind": "markdown",
2633
+ "value": "```weidu-tp2-tooltip\nDIALOG\n```\n0x2CC"
2634
+ }
2635
+ },
2636
+ "DIALOG_DEFAULT": {
2637
+ "contents": {
2638
+ "kind": "markdown",
2639
+ "value": "```weidu-tp2-tooltip\nDIALOG_DEFAULT\n```\n0x19C"
2640
+ }
2641
+ },
2642
+ "DIALOG_HOSTILE": {
2643
+ "contents": {
2644
+ "kind": "markdown",
2645
+ "value": "```weidu-tp2-tooltip\nDIALOG_HOSTILE\n```\n0x198"
2646
+ }
2647
+ },
2648
+ "DIRECTORY_EXISTS": {
2649
+ "contents": {
2650
+ "kind": "markdown",
2651
+ "value": "```weidu-tp2-tooltip\nDIRECTORY_EXISTS dirName\n```\nEvaluates to 1 if dirName is a directory and exists in the filesystem and evaluates to 0 otherwise."
2652
+ }
2653
+ },
2654
+ "DYING": {
2655
+ "contents": {
2656
+ "kind": "markdown",
2657
+ "value": "```weidu-tp2-tooltip\nDYING\n```\n0xF0"
2658
+ }
2659
+ },
2660
+ "EE_LANGUAGE": {
2661
+ "contents": {
2662
+ "kind": "markdown",
2663
+ "value": "```weidu-tp2-tooltip\nEE_LANGUAGE\n```\nEvaluates to the Enhanced Edition language directory the user has selected, for example, en_US. This variable is undefined on non-EE games."
2664
+ }
2665
+ },
2666
+ "ENGINE_IS": {
2667
+ "contents": {
2668
+ "kind": "markdown",
2669
+ "value": "```weidu-tp2-tooltip\nENGINE_IS Caching String\n```\nFunctions like `GAME_IS` except bg2=soa will detect SoA-based Tutu games in addition to SoA games, and tob will detect ToB-based Tutu games in addition to ToB and BGT games. As such, a mod that requires Throne of Bhaal's engine enhancements could use `REQUIRE_PREDICATE ENGINE_IS ~tob~`.\nIf caching (disabled by default), `ENGINE_IS` will return the same result for the same string, and do so much faster."
2670
+ }
2671
+ },
2672
+ "EVAL": {
2673
+ "contents": {
2674
+ "kind": "markdown",
2675
+ "value": "```weidu-tp2-tooltip\nEVAL variable\n```\nUser variables inside the given string are evaluated one additional time. You may prepend `EVAL` when a value is called for and you would normally use a string. You may also use it for `SET` and `SPRINT` statements. Example:\n```\nSPRINT x ~y~\nSET y = 5\nSPRINT z EVAL ~tricky %%x%%~\nSET EVAL \"%x%\" += 77\nPATCH_PRINT \"y is %y% ; z is %z%\"\n```\nThis prints out `y is 82 ; z is tricky 5`. You may also do hackery like `FILE_SIZE \"myfile\" \"%%indirection%%\"`. Be very careful with this feature."
2676
+ }
2677
+ },
2678
+ "EXISTANCE4": {
2679
+ "contents": {
2680
+ "kind": "markdown",
2681
+ "value": "```weidu-tp2-tooltip\nEXISTANCE4\n```\n0x1C8"
2682
+ }
2683
+ },
2684
+ "FILE_CONTAINS": {
2685
+ "contents": {
2686
+ "kind": "markdown",
2687
+ "value": "```weidu-tp2-tooltip\nFILE_CONTAINS fileName regexp\n```\nEvaluates to 1 if the file fileName contains the regular expression regexp and 0 otherwise. Case is ignored."
2688
+ }
2689
+ },
2690
+ "FILE_CONTAINS_EVALUATED": {
2691
+ "contents": {
2692
+ "kind": "markdown",
2693
+ "value": "```weidu-tp2-tooltip\nFILE_CONTAINS_EVALUATED ( fileName varsRegexp )\n```\nFirst, all WeiDU variables enclosed in %s in varsRegexp and fileName are substituted. The expression is 1 if the resulting regexp occurs in fileName and 0 otherwise. If fileName does not exist or has size 0, the result is 0. The comparison ignores case. See also FILE_CONTAINS. Example: COPY_EXISTING_REGEXP ~.*\\.CRE~ ~override~ READ_BYTE 0x273 class READ_ASCII 0x280 deathvar PATCH_IF (class = 14) AND // class 14 = CLERIC_MAGE (NOT FILE_CONTAINS_EVALUATED(~pdialog.2da~ ~%deathvar%~)) THEN BEGIN ADD_CRE_ITEM ~POTN08~ #10 #10 #10 ~IDENTIFIED~ ~INV15~ END BUT_ONLY_IF_IT_CHANGES The example gives ten healing potions to all cleric-mages who cannot join the party. Notably it excludes Aerie since she has the death variable Aerie and pdialog.2da contains AERIE."
2694
+ }
2695
+ },
2696
+ "RESOURCE_CONTAINS": {
2697
+ "contents": {
2698
+ "kind": "markdown",
2699
+ "value": "```weidu-tp2-tooltip\nRESOURCE_CONTAINS fileName varsRegexp\n```\n`fileName` and `varsRegexp` are evaluated for variables. `fileName` is loaded as a game resource (searching only the `biffs` and the `override` directories) and a regexp search is performed on the file contents. The result is 1 if the regexp `varsRegexp` occurs within `fileName`, or otherwise 0. The comparison ignores case. If `fileName` does not exist or has a file size 0, the result is 0."
2700
+ }
2701
+ },
2702
+ "FILE_EXISTS": {
2703
+ "contents": {
2704
+ "kind": "markdown",
2705
+ "value": "```weidu-tp2-tooltip\nFILE_EXISTS fileName\n```\nEvaluates to 1 if the file exists in the filesystem (or the bif file is referenced inside the chitin.key) and evaluates to 0 otherwise. The results of FILE_EXISTS are undefined if fileName is a directory."
2706
+ }
2707
+ },
2708
+ "FILE_EXISTS_IN_GAME": {
2709
+ "contents": {
2710
+ "kind": "markdown",
2711
+ "value": "```weidu-tp2-tooltip\nFILE_EXISTS_IN_GAME fileName\n```\nEvaluates to 1 if the file exists as a game resource and has non-zero size. Evaluates to 0 otherwise. BIFFs and the override directory are searched in the standard manner. Evaluates to 0 for a file that does not exist but has been ALLOW_MISSING'd."
2712
+ }
2713
+ },
2714
+ "FILE_IS_IN_COMPRESSED_BIFF": {
2715
+ "contents": {
2716
+ "kind": "markdown",
2717
+ "value": "```weidu-tp2-tooltip\nFILE_IS_IN_COMPRESSED_BIFF fileName\n```\nEvaluates to 1 if the file is stored in a compressed biff (ignoring copies in the override). Evaluates to 0 otherwise (the file is not in a biff, or it is in an uncompressed biff)."
2718
+ }
2719
+ },
2720
+ "FILE_MD5": {
2721
+ "contents": {
2722
+ "kind": "markdown",
2723
+ "value": "```weidu-tp2-tooltip\nFILE_MD5 fileName md5sum\n```\nEvaluates to 1 if the file exists and has the given MD5 checksum. Evaluates to 0 otherwise. Two different files are exceptionally unlikely to have the same MD5 checksum. In any event, the discovered checksum is printed to the log. If the file does not exist, it evaluates to 0."
2724
+ }
2725
+ },
2726
+ "FILE_SIZE": {
2727
+ "contents": {
2728
+ "kind": "markdown",
2729
+ "value": "```weidu-tp2-tooltip\nFILE_SIZE fileName fileSize\n```\nEvaluates to 1 if the size of the file fileName is exactly fileSize. Evaluates to 0 otherwise."
2730
+ }
2731
+ },
2732
+ "GAME_INCLUDES": {
2733
+ "contents": {
2734
+ "kind": "markdown",
2735
+ "value": "```weidu-tp2-tooltip\nGAME_INCLUDES Caching String\n```\nReturns `true` if the IE game variant includes the game content specified by String, otherwise returns `false`.\nString is a single game chosen from\n- bg1\n- bg2=soa\n- ca\n- iwd=iwd1\n- iwd2\n- how\n- pst\n- sod\n- tob\n- totlm\n- totsc\n\nIn the list, `bg2=soa` means that `bg2` and `soa` are synonyms, and you can use whichever one you like.\nPlease note that unlike `GAME_IS` you only specify a single game, rather than a list of games.\nAs an example, `GAME_INCLUDES ~tob~` will return true for any game which includes the ToB content, such as ToB itself, BGT or BG2EE.\nIf caching (disabled by default), `GAME_INCLUDES` will return the same result for the same string, and do so much faster."
2736
+ }
2737
+ },
2738
+ "GAME_IS": {
2739
+ "contents": {
2740
+ "kind": "markdown",
2741
+ "value": "```weidu-tp2-tooltip\nGAME_IS Caching String\n```\nReturns `true` if the IE game variant is one of the entries in String, otherwise returns `false`.\nString is a list of whitespace-separated entries, chosen from (case doesn't matter)\n- bg1\n- bg2=soa\n- bgee\n- bg2ee\n- bgt\n- ca\n- eet\n- how\n- iwd=iwd1\n- iwd2\n- iwd_in_bg2\n- iwdee\n- pst\n- pstee\n- totsc\n- tob\n- totlm\n- tutu\n- tutu_totsc\n\nIn the list, `bg2=soa` means that `bg2` and `soa` are synonyms, and you can use whichever one you like.\nPlease note that the items in the list are defined to be mutually exclusive\n(except `tob` will detect both plain ToB and ToB with BGT installed, for legacy purposes),\nso bg2 will detect a SoA-only game, without either ToB or Tutu installed.\nAs such, a mod which is usable with any flavor of BG2 and any flavor of Tutu or BG: EE would contain\n`REQUIRE_PREDICATE GAME_IS ~bg2 tob tutu tutu_totsc bgee bg2ee~`.\nIf caching (disabled by default), `GAME_IS` will return the same result for the same string, and do so much faster."
2742
+ }
2743
+ },
2744
+ "HAPPY": {
2745
+ "contents": {
2746
+ "kind": "markdown",
2747
+ "value": "```weidu-tp2-tooltip\nHAPPY\n```\n0xAC"
2748
+ }
2749
+ },
2750
+ "HIDDEN_IN_SHADOWS": {
2751
+ "contents": {
2752
+ "kind": "markdown",
2753
+ "value": "```weidu-tp2-tooltip\nHIDDEN_IN_SHADOWS\n```\n0x1BC"
2754
+ }
2755
+ },
2756
+ "HURT": {
2757
+ "contents": {
2758
+ "kind": "markdown",
2759
+ "value": "```weidu-tp2-tooltip\nHURT\n```\n0xF4"
2760
+ }
2761
+ },
2762
+ "IDENTIFIED_DESC": {
2763
+ "contents": {
2764
+ "kind": "markdown",
2765
+ "value": "```weidu-tp2-tooltip\nIDENTIFIED_DESC\n```\nThe offset within an infinity engine resource where the identified description is stored."
2766
+ }
2767
+ },
2768
+ "IDS_OF_SYMBOL": {
2769
+ "contents": {
2770
+ "kind": "markdown",
2771
+ "value": "```weidu-tp2-tooltip\nIDS_OF_SYMBOL ( File String )\n```\nWill return the number associated with String in File.ids, or -1 if String is not associated in File.ids."
2772
+ }
2773
+ },
2774
+ "ID_OF_LABEL": {
2775
+ "contents": {
2776
+ "kind": "markdown",
2777
+ "value": "```weidu-tp2-tooltip\nID_OF_LABEL modTp2Name String\n```\nReturns the numerical identifier (component number) of the component in modTp2Name which has the given LABEL. Returns -231 if no such tp2 exists, said tp2 has no component with that LABEL, or two or more components have that LABEL. In the last two cases will print a WARNING."
2778
+ }
2779
+ },
2780
+ "INDEX": {
2781
+ "contents": {
2782
+ "kind": "markdown",
2783
+ "value": "```weidu-tp2-tooltip\nINDEX ( optcase optexact string1 string2 [ value ] )\n```\nReturns the index of the first regexp match of string1 inside string2, or -1 if not found. If provided, value specifies from what point of string2 the searching should begin (instead of 0)."
2784
+ }
2785
+ },
2786
+ "INDEX_BUFFER": {
2787
+ "contents": {
2788
+ "kind": "markdown",
2789
+ "value": "```weidu-tp2-tooltip\nINDEX_BUFFER ( optcase optexact string [ value ] )\n```\nReturns the index of the first regexp match of string inside the current string, or -1 if not found. If provided, value specifies from what point of the string the searching should begin (instead of 0)."
2790
+ }
2791
+ },
2792
+ "INITIAL_MEETING": {
2793
+ "contents": {
2794
+ "kind": "markdown",
2795
+ "value": "```weidu-tp2-tooltip\nINITIAL_MEETING\n```\n0xA4"
2796
+ }
2797
+ },
2798
+ "INSTALL_ORDER": {
2799
+ "contents": {
2800
+ "kind": "markdown",
2801
+ "value": "```weidu-tp2-tooltip\nINSTALL_ORDER modTp2Name1 modComponent1 BEFORE modTp2Name2 modComponent2\n```\nReturns true if the modComponent1 of modTp2Name1 is installed before the modComponent2 of modTp2Name2 (and both components are installed). The syntax is the same as with REQUIRE_COMPONENT."
2802
+ }
2803
+ },
2804
+ "INTERACTION1": {
2805
+ "contents": {
2806
+ "kind": "markdown",
2807
+ "value": "```weidu-tp2-tooltip\nINTERACTION1\n```\n0x140"
2808
+ }
2809
+ },
2810
+ "INTERACTION2": {
2811
+ "contents": {
2812
+ "kind": "markdown",
2813
+ "value": "```weidu-tp2-tooltip\nINTERACTION2\n```\n0x144"
2814
+ }
2815
+ },
2816
+ "INTERACTION3": {
2817
+ "contents": {
2818
+ "kind": "markdown",
2819
+ "value": "```weidu-tp2-tooltip\nINTERACTION3\n```\n0x148"
2820
+ }
2821
+ },
2822
+ "INTERACTION4": {
2823
+ "contents": {
2824
+ "kind": "markdown",
2825
+ "value": "```weidu-tp2-tooltip\nINTERACTION4\n```\n0x14C"
2826
+ }
2827
+ },
2828
+ "INTERACTION5": {
2829
+ "contents": {
2830
+ "kind": "markdown",
2831
+ "value": "```weidu-tp2-tooltip\nINTERACTION5\n```\n0x150"
2832
+ }
2833
+ },
2834
+ "INVENTORY_FULL": {
2835
+ "contents": {
2836
+ "kind": "markdown",
2837
+ "value": "```weidu-tp2-tooltip\nINVENTORY_FULL\n```\n0x1B4"
2838
+ }
2839
+ },
2840
+ "IS_AN_INT": {
2841
+ "contents": {
2842
+ "kind": "markdown",
2843
+ "value": "```weidu-tp2-tooltip\nIS_AN_INT String\n```\nReturns true if the variable String is set to an integer (there's a variable called either String or %String% with integer value)."
2844
+ }
2845
+ },
2846
+ "IS_SILENT": {
2847
+ "contents": {
2848
+ "kind": "markdown",
2849
+ "value": "```weidu-tp2-tooltip\nIS_SILENT\n```\nReturns true if the output is currently silenced, false otherwise."
2850
+ }
2851
+ },
2852
+ "LEADER": {
2853
+ "contents": {
2854
+ "kind": "markdown",
2855
+ "value": "```weidu-tp2-tooltip\nLEADER\n```\n0xBC"
2856
+ }
2857
+ },
2858
+ "LONG_AT": {
2859
+ "contents": {
2860
+ "kind": "markdown",
2861
+ "value": "```weidu-tp2-tooltip\nLONG_AT offset\n```\nThe 32-bit value from the file at the given offset."
2862
+ }
2863
+ },
2864
+ "MODULO": {
2865
+ "contents": {
2866
+ "kind": "markdown",
2867
+ "value": "```weidu-tp2-tooltip\nvalue MODULO value\n```\nAn operation that returns the remainder of a division between two numbers. If the second value is 0, the returned value is 0. You may use REM as a synonym."
2868
+ }
2869
+ },
2870
+ "REM": {
2871
+ "contents": {
2872
+ "kind": "markdown",
2873
+ "value": "```weidu-tp2-tooltip\nvalue REM value\n```\nAn operation that returns the remainder of a division between two numbers. If the second value is 0, the returned value is 0. You may use MODULO as a synonym."
2874
+ }
2875
+ },
2876
+ "MOD_IS_INSTALLED": {
2877
+ "contents": {
2878
+ "kind": "markdown",
2879
+ "value": "```weidu-tp2-tooltip\nMOD_IS_INSTALLED modTp2Name modComponent\n```\nReturns true if the modComponent of modTp2Name is installed. The syntax is the same as with REQUIRE_COMPONENT."
2880
+ }
2881
+ },
2882
+ "MORALE": {
2883
+ "contents": {
2884
+ "kind": "markdown",
2885
+ "value": "```weidu-tp2-tooltip\nMORALE\n```\n0xA8"
2886
+ }
2887
+ },
2888
+ "MPSAVE_DIRECTORY": {
2889
+ "contents": {
2890
+ "kind": "markdown",
2891
+ "value": "```weidu-tp2-tooltip\nMPSAVE_DIRECTORY\n```\nEvaluates to the directory in which the current game type stores its multiplayer saved games. The determination is done the same way as with the save directory, but for the directory mpsave instead."
2892
+ }
2893
+ },
2894
+ "NAME1": {
2895
+ "contents": {
2896
+ "kind": "markdown",
2897
+ "value": "```weidu-tp2-tooltip\nNAME1\n```\nThe offset within an infinity engine resource where the unidentified general name (e.g., \"Battle Axe\") is stored."
2898
+ }
2899
+ },
2900
+ "NAME2": {
2901
+ "contents": {
2902
+ "kind": "markdown",
2903
+ "value": "```weidu-tp2-tooltip\nNAME2\n```\nThe offset within an infinity engine resource where the identified general name (e.g., \"K'logarath +4\") is stored."
2904
+ }
2905
+ },
2906
+ "NEXT_STRREF": {
2907
+ "contents": {
2908
+ "kind": "markdown",
2909
+ "value": "```weidu-tp2-tooltip\nNEXT_STRREF\n```\nReturns the next available string reference in the TLK file."
2910
+ }
2911
+ },
2912
+ "NOT": {
2913
+ "contents": {
2914
+ "kind": "markdown",
2915
+ "value": "```weidu-tp2-tooltip\nNOT value\n```\nNegation. If the value is 0, the result is 1. Otherwise the result is 0."
2916
+ }
2917
+ },
2918
+ "OR": {
2919
+ "contents": {
2920
+ "kind": "markdown",
2921
+ "value": "```weidu-tp2-tooltip\nvalue OR value\n```\nDisjunction. If either value is non-zero, the result is 1. Otherwise, the result is 0. Synonym: `||`."
2922
+ }
2923
+ },
2924
+ "PICKED_POCKET": {
2925
+ "contents": {
2926
+ "kind": "markdown",
2927
+ "value": "```weidu-tp2-tooltip\nPICKED_POCKET\n```\n0x1B8"
2928
+ }
2929
+ },
2930
+ "PORTRAIT_SMALL": {
2931
+ "contents": {
2932
+ "kind": "markdown",
2933
+ "value": "```weidu-tp2-tooltip\nPORTRAIT_SMALL\n```\n0x34"
2934
+ }
2935
+ },
2936
+ "PORTRAIT_LARGE": {
2937
+ "contents": {
2938
+ "kind": "markdown",
2939
+ "value": "```weidu-tp2-tooltip\nPORTRAIT_LARGE\n```\n0x3C"
2940
+ }
2941
+ },
2942
+ "RANDOM": {
2943
+ "contents": {
2944
+ "kind": "markdown",
2945
+ "value": "```weidu-tp2-tooltip\nRANDOM ( value value )\n```\nA random-number generator. The first value is the lower bound, the second value is the upper bound. A random integer between the lower bound and the upper bound (inclusive) is returned. Thus RANDOM(3 5) can return 3, 4 or 5. If the lower bound is greater than the upper bound, zero is returned. See also RANDOM_SEED."
2946
+ }
2947
+ },
2948
+ "REACT_TO_DIE_GENERAL": {
2949
+ "contents": {
2950
+ "kind": "markdown",
2951
+ "value": "```weidu-tp2-tooltip\nREACT_TO_DIE_GENERAL\n```\n0x178"
2952
+ }
2953
+ },
2954
+ "REACT_TO_DIE_SPECIFIC": {
2955
+ "contents": {
2956
+ "kind": "markdown",
2957
+ "value": "```weidu-tp2-tooltip\nREACT_TO_DIE_SPECIFIC\n```\n0x17C"
2958
+ }
2959
+ },
2960
+ "REGISTRY_BG1_PATH": {
2961
+ "contents": {
2962
+ "kind": "markdown",
2963
+ "value": "```weidu-tp2-tooltip\nREGISTRY_BG1_PATH\n```\nThe path of BG1 (as read from the registry), or empty if not available."
2964
+ }
2965
+ },
2966
+ "REGISTRY_BG2_PATH": {
2967
+ "contents": {
2968
+ "kind": "markdown",
2969
+ "value": "```weidu-tp2-tooltip\nREGISTRY_BG2_PATH\n```\nThe path of BG2 (as read from the registry), or empty if not available."
2970
+ }
2971
+ },
2972
+ "REGISTRY_IWD1_PATH": {
2973
+ "contents": {
2974
+ "kind": "markdown",
2975
+ "value": "```weidu-tp2-tooltip\nREGISTRY_IWD1_PATH\n```\nThe path of IWD1 (as read from the registry), or empty if not available."
2976
+ }
2977
+ },
2978
+ "REGISTRY_IWD2_PATH": {
2979
+ "contents": {
2980
+ "kind": "markdown",
2981
+ "value": "```weidu-tp2-tooltip\nREGISTRY_IWD2_PATH\n```\nThe path of IWD2 (as read from the registry), or empty if not available."
2982
+ }
2983
+ },
2984
+ "REGISTRY_PST_PATH": {
2985
+ "contents": {
2986
+ "kind": "markdown",
2987
+ "value": "```weidu-tp2-tooltip\nREGISTRY_PST_PATH\n```\nThe path of PST (as read from the registry), or empty if not available."
2988
+ }
2989
+ },
2990
+ "RESOLVE_STR_REF": {
2991
+ "contents": {
2992
+ "kind": "markdown",
2993
+ "value": "```weidu-tp2-tooltip\nRESOLVE_STR_REF ( text )\n```\nResolves the given text (adding it to the tlk), and returns its TLK index (so you can pass the result of this command to a function which then uses WRITE_LONG rather than SAY)."
2994
+ }
2995
+ },
2996
+ "RESPONSE_TO_COMPLIMENT1": {
2997
+ "contents": {
2998
+ "kind": "markdown",
2999
+ "value": "```weidu-tp2-tooltip\nRESPONSE_TO_COMPLIMENT1\n```\n0x180"
3000
+ }
3001
+ },
3002
+ "RESPONSE_TO_COMPLIMENT2": {
3003
+ "contents": {
3004
+ "kind": "markdown",
3005
+ "value": "```weidu-tp2-tooltip\nRESPONSE_TO_COMPLIMENT2\n```\n0x184"
3006
+ }
3007
+ },
3008
+ "RESPONSE_TO_COMPLIMENT3": {
3009
+ "contents": {
3010
+ "kind": "markdown",
3011
+ "value": "```weidu-tp2-tooltip\nRESPONSE_TO_COMPLIMENT3\n```\n0x188"
3012
+ }
3013
+ },
3014
+ "RESPONSE_TO_INSULT1": {
3015
+ "contents": {
3016
+ "kind": "markdown",
3017
+ "value": "```weidu-tp2-tooltip\nRESPONSE_TO_INSULT1\n```\n0x18C"
3018
+ }
3019
+ },
3020
+ "RESPONSE_TO_INSULT2": {
3021
+ "contents": {
3022
+ "kind": "markdown",
3023
+ "value": "```weidu-tp2-tooltip\nRESPONSE_TO_INSULT2\n```\n0x190"
3024
+ }
3025
+ },
3026
+ "RESPONSE_TO_INSULT3": {
3027
+ "contents": {
3028
+ "kind": "markdown",
3029
+ "value": "```weidu-tp2-tooltip\nRESPONSE_TO_INSULT3\n```\n0x194"
3030
+ }
3031
+ },
3032
+ "RINDEX": {
3033
+ "contents": {
3034
+ "kind": "markdown",
3035
+ "value": "```weidu-tp2-tooltip\nRINDEX ( optcase optexact string1 string2 [ value ] )\n```\nReturns the index of the last regexp match of string1 inside string2, or -1 if not found. If provided, value specifies from what point of string2 the searching should begin (instead of STRING_LENGTH string2)."
3036
+ }
3037
+ },
3038
+ "RINDEX_BUFFER": {
3039
+ "contents": {
3040
+ "kind": "markdown",
3041
+ "value": "```weidu-tp2-tooltip\nRINDEX_BUFFER ( optcase optexact string [ value ] )\n```\nReturns the index of the last regexp match of string inside the current string, or -1 if not found. If provided, value specifies from what point of the string the searching should begin (instead of BUFFER_LENGTH)."
3042
+ }
3043
+ },
3044
+ "SAVE_DIRECTORY": {
3045
+ "contents": {
3046
+ "kind": "markdown",
3047
+ "value": "```weidu-tp2-tooltip\nSAVE_DIRECTORY\n```\nEvaluates to the directory in which the current game type stores its saved games. This is \"%USER_DIRECTORY%/save\"."
3048
+ }
3049
+ },
3050
+ "SBYTE_AT": {
3051
+ "contents": {
3052
+ "kind": "markdown",
3053
+ "value": "```weidu-tp2-tooltip\nSBYTE_AT offset\n```\nThe 8-bit signed value from the file at the given offset."
3054
+ }
3055
+ },
3056
+ "SCRIPT_CLASS": {
3057
+ "contents": {
3058
+ "kind": "markdown",
3059
+ "value": "```weidu-tp2-tooltip\nSCRIPT_CLASS\n```\n0x250"
3060
+ }
3061
+ },
3062
+ "SCRIPT_DEFAULT": {
3063
+ "contents": {
3064
+ "kind": "markdown",
3065
+ "value": "```weidu-tp2-tooltip\nSCRIPT_DEFAULT\n```\n0x268"
3066
+ }
3067
+ },
3068
+ "SCRIPT_GENERAL": {
3069
+ "contents": {
3070
+ "kind": "markdown",
3071
+ "value": "```weidu-tp2-tooltip\nSCRIPT_GENERAL\n```\n0x260"
3072
+ }
3073
+ },
3074
+ "SCRIPT_OVERRIDE": {
3075
+ "contents": {
3076
+ "kind": "markdown",
3077
+ "value": "```weidu-tp2-tooltip\nSCRIPT_OVERRIDE\n```\n0x248"
3078
+ }
3079
+ },
3080
+ "SCRIPT_RACE": {
3081
+ "contents": {
3082
+ "kind": "markdown",
3083
+ "value": "```weidu-tp2-tooltip\nSCRIPT_RACE\n```\n0x258"
3084
+ }
3085
+ },
3086
+ "SELECT_ACTION1": {
3087
+ "contents": {
3088
+ "kind": "markdown",
3089
+ "value": "```weidu-tp2-tooltip\nSELECT_ACTION1\n```\n0x124"
3090
+ }
3091
+ },
3092
+ "SELECT_ACTION2": {
3093
+ "contents": {
3094
+ "kind": "markdown",
3095
+ "value": "```weidu-tp2-tooltip\nSELECT_ACTION2\n```\n0x128"
3096
+ }
3097
+ },
3098
+ "SELECT_ACTION3": {
3099
+ "contents": {
3100
+ "kind": "markdown",
3101
+ "value": "```weidu-tp2-tooltip\nSELECT_ACTION3\n```\n0x12C"
3102
+ }
3103
+ },
3104
+ "SELECT_ACTION4": {
3105
+ "contents": {
3106
+ "kind": "markdown",
3107
+ "value": "```weidu-tp2-tooltip\nSELECT_ACTION4\n```\n0x130"
3108
+ }
3109
+ },
3110
+ "SELECT_ACTION5": {
3111
+ "contents": {
3112
+ "kind": "markdown",
3113
+ "value": "```weidu-tp2-tooltip\nSELECT_ACTION5\n```\n0x134"
3114
+ }
3115
+ },
3116
+ "SELECT_ACTION6": {
3117
+ "contents": {
3118
+ "kind": "markdown",
3119
+ "value": "```weidu-tp2-tooltip\nSELECT_ACTION6\n```\n0x138"
3120
+ }
3121
+ },
3122
+ "SELECT_ACTION7": {
3123
+ "contents": {
3124
+ "kind": "markdown",
3125
+ "value": "```weidu-tp2-tooltip\nSELECT_ACTION7\n```\n0x13C"
3126
+ }
3127
+ },
3128
+ "SELECT_COMMON1": {
3129
+ "contents": {
3130
+ "kind": "markdown",
3131
+ "value": "```weidu-tp2-tooltip\nSELECT_COMMON1\n```\n0x10C"
3132
+ }
3133
+ },
3134
+ "SELECT_COMMON2": {
3135
+ "contents": {
3136
+ "kind": "markdown",
3137
+ "value": "```weidu-tp2-tooltip\nSELECT_COMMON2\n```\n0x110"
3138
+ }
3139
+ },
3140
+ "SELECT_COMMON3": {
3141
+ "contents": {
3142
+ "kind": "markdown",
3143
+ "value": "```weidu-tp2-tooltip\nSELECT_COMMON3\n```\n0x114"
3144
+ }
3145
+ },
3146
+ "SELECT_COMMON4": {
3147
+ "contents": {
3148
+ "kind": "markdown",
3149
+ "value": "```weidu-tp2-tooltip\nSELECT_COMMON4\n```\n0x118"
3150
+ }
3151
+ },
3152
+ "SELECT_COMMON5": {
3153
+ "contents": {
3154
+ "kind": "markdown",
3155
+ "value": "```weidu-tp2-tooltip\nSELECT_COMMON5\n```\n0x11C"
3156
+ }
3157
+ },
3158
+ "SELECT_COMMON6": {
3159
+ "contents": {
3160
+ "kind": "markdown",
3161
+ "value": "```weidu-tp2-tooltip\nSELECT_COMMON6\n```\n0x120"
3162
+ }
3163
+ },
3164
+ "SELECT_RARE1": {
3165
+ "contents": {
3166
+ "kind": "markdown",
3167
+ "value": "```weidu-tp2-tooltip\nSELECT_RARE1\n```\n0x1A0"
3168
+ }
3169
+ },
3170
+ "SELECT_RARE2": {
3171
+ "contents": {
3172
+ "kind": "markdown",
3173
+ "value": "```weidu-tp2-tooltip\nSELECT_RARE2\n```\n0x1A4"
3174
+ }
3175
+ },
3176
+ "SET_A_TRAP": {
3177
+ "contents": {
3178
+ "kind": "markdown",
3179
+ "value": "```weidu-tp2-tooltip\nSET_A_TRAP\n```\n0x1C4"
3180
+ }
3181
+ },
3182
+ "SHORT_AT": {
3183
+ "contents": {
3184
+ "kind": "markdown",
3185
+ "value": "```weidu-tp2-tooltip\nSHORT_AT offset\n```\nThe 16-bit value from the file at the given offset."
3186
+ }
3187
+ },
3188
+ "SIZE_OF_FILE": {
3189
+ "contents": {
3190
+ "kind": "markdown",
3191
+ "value": "```weidu-tp2-tooltip\nSIZE_OF_FILE fileName\n```\nReturns the size of fileName or -1 if the file does not exist. Variables in fileName are evaluated. fileName can be a file on the local file system or an inlined file."
3192
+ }
3193
+ },
3194
+ "SLONG_AT": {
3195
+ "contents": {
3196
+ "kind": "markdown",
3197
+ "value": "```weidu-tp2-tooltip\nSLONG_AT offset\n```\nThe 32-bit signed value from the file at the given offset."
3198
+ }
3199
+ },
3200
+ "SPECIAL1": {
3201
+ "contents": {
3202
+ "kind": "markdown",
3203
+ "value": "```weidu-tp2-tooltip\nSPECIAL1\n```\n0x16C"
3204
+ }
3205
+ },
3206
+ "SPECIAL2": {
3207
+ "contents": {
3208
+ "kind": "markdown",
3209
+ "value": "```weidu-tp2-tooltip\nSPECIAL2\n```\n0x170"
3210
+ }
3211
+ },
3212
+ "SPECIAL3": {
3213
+ "contents": {
3214
+ "kind": "markdown",
3215
+ "value": "```weidu-tp2-tooltip\nSPECIAL3\n```\n0x174"
3216
+ }
3217
+ },
3218
+ "SPELL_DISRUPTED": {
3219
+ "contents": {
3220
+ "kind": "markdown",
3221
+ "value": "```weidu-tp2-tooltip\nSPELL_DISRUPTED\n```\n0x1C0"
3222
+ }
3223
+ },
3224
+ "SSHORT_AT": {
3225
+ "contents": {
3226
+ "kind": "markdown",
3227
+ "value": "```weidu-tp2-tooltip\nSSHORT_AT offset\n```\nThe 16-bit signed value from the file at the given offset."
3228
+ }
3229
+ },
3230
+ "STATE_WHICH_SAYS": {
3231
+ "contents": {
3232
+ "kind": "markdown",
3233
+ "value": "```weidu-tp2-tooltip\nSTATE_WHICH_SAYS text FROM String\n```\nString must be an in-game or in-override `.dlg` file. Returns:\n- Fails the installation if it can't evaluate the text (an `@x` reference out of bounds)\n- `-3` if the text is not currently in the tlk or in the list of strings to add\n- `-2` if the text is spoken (`= SAY ~Foo~`) at least twice in the file `String`\n- `-1` if the text is never spoken in the file String Otherwise it returns the number of the state in which text is spoken in the file `String`. `@x` references are taken from the loaded TRA files (the ones defined in the Language part).\n\n**Alternative form**: `STATE_WHICH_SAYS value IN String1 FROM String2`\nAs above, except that `@x` references are taken from the `String1` tra file. In particular, one `%s` in `String1` is expanded to the list of directories; for example (as of Sola `v102`), `solarom/%s/epilogue.tra` would match\n- `solarom/american/epilogue.tra`\n- `solarom/french/epilogue.tra`\n- `solarom/german/epilogue.tra`\n- `solarom/italian/epilogue.tra`\n- `solarom/polski/epilogue.tra`\n- `solarom/portuguese/epilogue.tra`\n- `solarom/russian/epilogue.tra`"
3234
+ }
3235
+ },
3236
+ "STORE_NAME": {
3237
+ "contents": {
3238
+ "kind": "markdown",
3239
+ "value": "```weidu-tp2-tooltip\nSTORE_NAME\n```\n0xC"
3240
+ }
3241
+ },
3242
+ "STRING_COMPARE": {
3243
+ "contents": {
3244
+ "kind": "markdown",
3245
+ "value": "```weidu-tp2-tooltip\nString STRING_COMPARE String\n```\nThis is legacy syntax for STRING_EQUAL: This expression evaluates to 0 if and only if its two string arguments are equal (have the same length and the same contents). Otherwise it will evaluate to a negative or positive integer, depending on whether the first string argument would sort lexicographically before or after the second string argument. variables within the strings (e.g., \"%mykit%\") are replaced by their values. Note that variables that you want expanded must be put in %'s, otherwise the raw text will be used. You may use STR_CMP as a synonym for STRING_COMPARE. This function works just like C's strcmp. Note also that STRING_EQUAL and STRING_COMPARE are similar, but STRING_EQUAL has more intuitive return values."
3246
+ }
3247
+ },
3248
+ "STRING_COMPARE_CASE": {
3249
+ "contents": {
3250
+ "kind": "markdown",
3251
+ "value": "```weidu-tp2-tooltip\nString STRING_COMPARE_CASE String\n```\nThis is legacy syntax for STRING_EQUAL_CASE: As STRING_COMPARE, but the comparison ignores case. That is, \"ANOMEN\" and \"aNoMeN\" are considered equal."
3252
+ }
3253
+ },
3254
+ "STRING_COMPARE_REGEXP": {
3255
+ "contents": {
3256
+ "kind": "markdown",
3257
+ "value": "```weidu-tp2-tooltip\nString STRING_COMPARE_REGEXP String\n```\nAs STRING_COMPARE_CASE, but the second string is treated as a regexp. Thus \"AR1005\" STRING_MATCHES_REGEXP \"AR[0-9]+\" evaluates to 0 (\"no difference\" ). You may use STRING_COMPARE_REGEXP as a synonym."
3258
+ }
3259
+ },
3260
+ "STRING_CONTAINS_REGEXP": {
3261
+ "contents": {
3262
+ "kind": "markdown",
3263
+ "value": "```weidu-tp2-tooltip\nString STRING_CONTAINS_REGEXP String\n```\nAs STRING_MATCHES_REGEXP, but it evaluates to 0 if the first string contains the second regexp. Thus \"AR1005\" STRING_CONTAINS_REGEXP \"[w-z]\" evaluates to 1 (\"mismatch\").Be warned that this does the exact opposite of what the name suggests."
3264
+ }
3265
+ },
3266
+ "STRING_EQUAL": {
3267
+ "contents": {
3268
+ "kind": "markdown",
3269
+ "value": "```weidu-tp2-tooltip\nString STRING_EQUAL String\n```\nThis expression evaluates to 1 if and only if its two string arguments are equal (have the same length and the same contents), otherwise it values to 0. variables within the strings (e.g., \"%mykit%\") are replaced by their values. Note that variables that you want expanded must be put in %'s, otherwise the raw text will be used. Note also that STRING_EQUAL and STRING_COMPARE are similar, but STRING_EQUAL has more intuitive return values."
3270
+ }
3271
+ },
3272
+ "STRING_EQUAL_CASE": {
3273
+ "contents": {
3274
+ "kind": "markdown",
3275
+ "value": "```weidu-tp2-tooltip\nString STRING_EQUAL_CASE String\n```\nAs STRING_EQUAL, but the comparison ignores case. That is, \"ANOMEN\" and \"aNoMeN\" are considered equal. You may use STR_EQ as a synonym for STRING_EQUAL_CASE."
3276
+ }
3277
+ },
3278
+ "STRING_LENGTH": {
3279
+ "contents": {
3280
+ "kind": "markdown",
3281
+ "value": "```weidu-tp2-tooltip\nSTRING_LENGTH String\n```\nReturns the length of the argument String (after variable evaluation)."
3282
+ }
3283
+ },
3284
+ "STRING_MATCHES_REGEXP": {
3285
+ "contents": {
3286
+ "kind": "markdown",
3287
+ "value": "```weidu-tp2-tooltip\nString STRING_MATCHES_REGEXP String\n```\nAs STRING_COMPARE_CASE, but the second string is treated as a regexp. Thus \"AR1005\" STRING_MATCHES_REGEXP \"AR[0-9]+\" evaluates to 0 (\"no difference\" ). You may use STRING_COMPARE_REGEXP as a synonym."
3288
+ }
3289
+ },
3290
+ "STR_CMP": {
3291
+ "contents": {
3292
+ "kind": "markdown",
3293
+ "value": "```weidu-tp2-tooltip\nString STR_CMP String\n```\nThis is legacy syntax for STRING_EQUAL: This expression evaluates to 0 if and only if its two string arguments are equal (have the same length and the same contents). Otherwise it will evaluate to a negative or positive integer, depending on whether the first string argument would sort lexicographically before or after the second string argument. variables within the strings (e.g., \"%mykit%\") are replaced by their values. Note that variables that you want expanded must be put in %'s, otherwise the raw text will be used. This function works just like C's strcmp. Note also that STRING_EQUAL and STRING_COMPARE are similar, but STRING_EQUAL has more intuitive return values."
3294
+ }
3295
+ },
3296
+ "STR_EQ": {
3297
+ "contents": {
3298
+ "kind": "markdown",
3299
+ "value": "```weidu-tp2-tooltip\nString STR_EQ String\n```\nAs STRING_EQUAL, but the comparison ignores case. That is, \"ANOMEN\" and \"aNoMeN\" are considered equal."
3300
+ }
3301
+ },
3302
+ "TAB": {
3303
+ "contents": {
3304
+ "kind": "markdown",
3305
+ "value": "```weidu-tp2-tooltip\nTAB\n```\nTabulation character (`\\t`)."
3306
+ }
3307
+ },
3308
+ "STR_VAR": {
3309
+ "contents": {
3310
+ "kind": "markdown",
3311
+ "value": "```weidu-tp2-tooltip\nSTR_VAR\n```\nString variable"
3312
+ }
3313
+ },
3314
+ "TARGET_IMMUNE": {
3315
+ "contents": {
3316
+ "kind": "markdown",
3317
+ "value": "```weidu-tp2-tooltip\nTARGET_IMMUNE\n```\n0x1B0"
3318
+ }
3319
+ },
3320
+ "TIRED": {
3321
+ "contents": {
3322
+ "kind": "markdown",
3323
+ "value": "```weidu-tp2-tooltip\nTIRED\n```\n0xC0"
3324
+ }
3325
+ },
3326
+ "TRA_ENTRY_EXISTS": {
3327
+ "contents": {
3328
+ "kind": "markdown",
3329
+ "value": "```weidu-tp2-tooltip\nTRA_ENTRY_EXISTS ( String String list )\n```\nreturns true if the variable String maps to a valid TRA entry. \tIf the String list is empty the tra entry is looked for into the loaded TRAs, \totherwise it's looked for into the listed TRA files."
3330
+ }
3331
+ },
3332
+ "UNHAPPY_ANNOYED": {
3333
+ "contents": {
3334
+ "kind": "markdown",
3335
+ "value": "```weidu-tp2-tooltip\nUNHAPPY_ANNOYED\n```\n0xB0"
3336
+ }
3337
+ },
3338
+ "UNHAPPY_BREAKING": {
3339
+ "contents": {
3340
+ "kind": "markdown",
3341
+ "value": "```weidu-tp2-tooltip\nUNHAPPY_BREAKING\n```\n0xB8"
3342
+ }
3343
+ },
3344
+ "UNHAPPY_SERIOUS": {
3345
+ "contents": {
3346
+ "kind": "markdown",
3347
+ "value": "```weidu-tp2-tooltip\nUNHAPPY_SERIOUS\n```\n0xB4"
3348
+ }
3349
+ },
3350
+ "UNIDENTIFIED_DESC": {
3351
+ "contents": {
3352
+ "kind": "markdown",
3353
+ "value": "```weidu-tp2-tooltip\nUNIDENTIFIED_DESC\n```\nThe offset within an infinity engine resource where the unidentified description is stored."
3354
+ }
3355
+ },
3356
+ "USER_DIRECTORY": {
3357
+ "contents": {
3358
+ "kind": "markdown",
3359
+ "value": "```weidu-tp2-tooltip\nUSER_DIRECTORY\n```\nEvaluates to the directory in which user files are kept. This is the game path on non-EE-type games. On EE-type games, the USER_DIRECTORY variable is constructed from two parts, the user directory and a game-specific directory. If the file engine.lua exists, WeiDU will attempt to read the game-specific directory from it. If the engine.lua does not exist or does not contain the necessary information, WeiDU will use default paths. On Windows, the user directory is the user's personal directory, as read from the Windows registry. On macOS, the user directory is \"$HOME/Documents\". On Linux, the user directory is \"$HOME/.local/share\". In both cases, $HOME is the user's home directory, as read from the pwd database. The default game-specific path for BG: EE is \"Baldur's Gate - Enhanced Edition\"; for BGII: EE it is \"Baldur's Gate II - Enhanced Edition\"; for IWD: EE it is \"Icewind Dale - Enhanced Edition\"; and for PST: EE it is \"Planescape Torment - Enhanced Edition\"."
3360
+ }
3361
+ },
3362
+ "VALID_SCRIPT_ACTIONS": {
3363
+ "contents": {
3364
+ "kind": "markdown",
3365
+ "value": "```weidu-tp2-tooltip\nVALID_SCRIPT_ACTIONS variable\n```\nVariable can be an array construct and should be or evaluate to a string of whitespace-separated Infinity Engine actions. Returns true if the string compiles into BCS without unrecoverable errors, otherwise false."
3366
+ }
3367
+ },
3368
+ "VALID_SCRIPT_TRIGGERS": {
3369
+ "contents": {
3370
+ "kind": "markdown",
3371
+ "value": "```weidu-tp2-tooltip\nVALID_SCRIPT_TRIGGERS variable\n```\nVariable can be an array construct and should be or evaluate to a string of whitespace-separated Infinity Engine triggers. Returns true of the string compiles into BCS without unrecoverable errors, otherwise false."
3372
+ }
3373
+ },
3374
+ "VARIABLE_IS_SET": {
3375
+ "contents": {
3376
+ "kind": "markdown",
3377
+ "value": "```weidu-tp2-tooltip\nVARIABLE_IS_SET String\n```\nReturns true if the variable String is set (there's a variable called either String or %String%, regardless of whether it is a string or an integer)."
3378
+ }
3379
+ },
3380
+ "WNL": {
3381
+ "contents": {
3382
+ "kind": "markdown",
3383
+ "value": "```weidu-tp2-tooltip\nWNL\n```\nWindows new line (`\\r\\n`)."
3384
+ }
3385
+ },
3386
+ "MNL": {
3387
+ "contents": {
3388
+ "kind": "markdown",
3389
+ "value": "```weidu-tp2-tooltip\nMNL\n```\n(Pre-OSX) Macintosh new line (`\\r`)."
3390
+ }
3391
+ },
3392
+ "LNL": {
3393
+ "contents": {
3394
+ "kind": "markdown",
3395
+ "value": "```weidu-tp2-tooltip\nLNL\n```\nLinux/Unix/OSX new line (`\\n`)."
3396
+ }
3397
+ },
3398
+ "VARIABLE_IS_IN_ARRAY": {
3399
+ "contents": {
3400
+ "kind": "markdown",
3401
+ "value": "```weidu-tp2-tooltip\nVARIABLE_IS_IN_ARRAY arrayConstruct\n```\nReturns true if the array variable is set, as per\n`VARIABLE_IS_SET`, and if it is a member of an array, in the way\nthat has it, for example, iterated over by `PHP_EACH`."
3402
+ }
3403
+ },
3404
+ "DEFINED_AS_FUNCTION": {
3405
+ "contents": {
3406
+ "kind": "markdown",
3407
+ "value": "```weidu-tp2-tooltip\nDEFINED_AS_FUNCTION variable\n```\nVariable can be a string (variables are evaluated) or an array\nconstruct that evaluates to a string. Returns `1` if the string is the\nname of an action function, `2` if the string is the name of a patch\nfunction, `3` if the string is the name of both an action function and a\npatch function, and `0` if string is not the name of any defined\nfunction. Note that `1`, `2` and `3` are all `true` in a boolean context."
3408
+ }
3409
+ },
3410
+ "DEFINED_AS_INLINED": {
3411
+ "contents": {
3412
+ "kind": "markdown",
3413
+ "value": "```weidu-tp2-tooltip\nDEFINED_AS_INLINED variable\n```\nVariable can be a string (variables are evaluated) or an array\nconstruct that evaluates to a string. Returns `1` if the string is the\npath of a defined inlined file, otherwise `0`."
3414
+ }
3415
+ },
3416
+ "INT_VAR": {
3417
+ "contents": {
3418
+ "kind": "markdown",
3419
+ "value": "```weidu-tp2-tooltip\nINT_VAR\n```\nInteger variable"
3420
+ }
3421
+ },
3422
+ "RET": {
3423
+ "contents": {
3424
+ "kind": "markdown",
3425
+ "value": "```weidu-tp2-tooltip\nRET\n```\nReturn value"
3426
+ }
3427
+ },
3428
+ "RET_ARRAY": {
3429
+ "contents": {
3430
+ "kind": "markdown",
3431
+ "value": "```weidu-tp2-tooltip\nRET_ARRAY\n```\nReturn value (arrays)"
3432
+ }
3433
+ },
3434
+ "HANDLE_AUDIO": {
3435
+ "contents": {
3436
+ "kind": "markdown",
3437
+ "value": "```weidu-tp2-tooltip\nHANDLE_AUDIO\n```\nInstall Ogg--Vorbis compressed audio files in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X, GNU/Linux and all IE games, including BG:EE. If the game is not BG:EE, the audio will be decompressed and the resulting .wav files will be `MOVE`d to the override. If the game is BG:EE, the .ogg files are copied into the override and renamed into .wav files. Refer to the `HANDLE_AUDIO` and `HANDLE_TILESETS` tutorial for usage examples and a more practical explanation.\n\nIf the audio files need to be decompressed, this function will use oggdec.exe on Windows, which is by default expected to be found in `audio_path`. The most recent version of oggdec can be downloaded [http://downloads.xiph.org/releases/vorbis/vorbis-tools-win32-bin.7z here] (direct link). On OS X, SoX will be used, which is by default also expected to be found in `audio_path`. SoX compiled for OS X can be downloaded [http://sourceforge.net/projects/sox/files/sox/14.4.1/sox-14.4.1-macosx.zip/download here]. On GNU/Linux, oggdec will be used, but it is expected to be found on the system path and the user should install it him/herself. If you provide installation instructions for GNU/Linux, just include something to the effect of \"install oggdec, which is usually part of the package vorbis-tools\".\n\nIf the decompression utility cannot be found, the user is warned that the audio files were not installed.\n\n- INT_VAR `music` if this variable is not `0` and the game is BG:EE, the audio files are given the extension `.acm` instead of `.wav`. This variable has no effect if the game is not BG:EE. By default its value is `0`.\n- INT_VAR `quiet` if this variable is `1`, the function will suppress output from oggdec and sox. By default this is `0`.\n- STR_VAR `audio_path` to the path your `.ogg` files are stored in. By default this variable is `~%MOD_FOLDER%/audio~`.\n- STR_VAR `oggdec_path` to the path oggdec is located in. By default this variable is `~%audio_path%~`.\n- STR_VAR `sox_path` to the path SoX is located in. By default this variable is `~%audio_path%~`.\n- STR_VAR `output_path` to the path the audio should be installed into. By default this variable is `override`.\n"
3438
+ }
3439
+ },
3440
+ "HANDLE_CHARSETS": {
3441
+ "contents": {
3442
+ "kind": "markdown",
3443
+ "value": "```weidu-tp2-tooltip\nHANDLE_CHARSETS\n```\nRuntime-convert `TRA` files into `UTF-8` in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X and GNU/Linux. If the game is BG:EE or BG2:EE, `TRA` files are encoded into `UTF-8` so the text can be installed without causing problems. `HANDLE_CHARSETS` needs to be used before any text is installed and is compatible with `AUTO_TRA` and all other methods of loading `TRA` files.\n\nConversion is handled by the program `iconv`. The program is available as part of the base system on OS X and GNU/Linux but a Windows version needs to be included in your mod. A Windows version can be downloaded [http://gnuwin32.sourceforge.net/packages/libiconv.htm here].\n\nIn order to function, `HANDLE_CHARSETS` needs to know a few things. First, you need to specify where you keep your `TRA` files. You do this with the variable `tra_path`. Second, `HANDLE_CHARSETS` needs to know where the Windows version of `iconv` is located. You do this with the variable `iconv_path`. Third, `HANDLE_CHARSETS` needs to know which character set the `TRA` files are in. Note that they can only be converted into `UTF-8` and cannot already be in `UTF-8`. You provide this information with `charset_table` or tell `HANDLE_CHARSETS` to try to infer this by itself with `infer_charsets`. Lastly, `HANDLE_CHARSETS` needs to know which `TRA` files to convert and whether any of them should be reloaded. You can do this with `noconvert_array`, `convert_array` and `reload_array`.\n\nUnless `convert_array` is specified, `HANDLE_CHARSETS` will recursively convert all `TRA` files in `tra_path` except those listed in `noconvert_array`. If `convert_array` is specified, only those `TRA` files listed in the array will be converted. `convert_array` may contain references to `TRA` files in subdirectories of `tra_path`.\n\n- INT_VAR `infer_charsets` to whether `HANDLE_CHARSETS` should try to infer which character set the `TRA` files are encoded in. It uses the contents of the `%language%` variable (''vide infra''). If the contents of the variable can be recognised, `HANDLE_CHARSETS` will use the character set used by the localised version of BG2 for this language. If the contents of the variable cannot be recognised, or if the `TRA` files use a different character set than the expected one, `HANDLE_CHARSETS` will fail. Refer to the compatibility matrix below for additional information. `infer_charsets` overrides `charset_table`. Defaults to `0`.\n- INT_VAR `from_utf8` to whether the function should assume the source `TRA` files are in UTF-8 or not. The default value is `0`, that is, the function assumes the `TRA` files use language-dependent charater sets and should be converted into UTF-8 when the mod is installed on EE-type games; the function produces no results on the original editions of the games. If set to `1`, the source `TRA` files are assumed to be in UTF-8 and are to be converted into language-dependent character sets when the mod is installed on original editions of the games; the function produces no results when installed on EE-type games.\n- INT_VAR `verbose` to whether the function should print debug information. Defaults to `0`.\n- STR_VAR `language` to the name of the language directory you wish to convert. The default value of this variable is `\\%LANGUAGE\\%`, in other words, the directory corresponding to the language the user selected at the start of the installation. You should never need to alter the value of this variable.\n- STR_VAR `default_language` to the name of the directory used by the default language of your mod, if your mod has one. The default language is typically one for which the translation is always complete and up to date and which you use to guard against incomplete translations. `HANDLE_CHARSETS` will convert the `TRA` files of the default language in addition to those of the user-selected language. Should these two languages be the same, the `TRA` files will only be converted once. Additionally, any `TRA` files listed in the `reload_array` (''vide infra'') will be reloaded for the default language before they are reloaded for the user-selected language. The default value of this variable is `~~` (the empty string).\n- STR_VAR `tra_path` to the path where your mod's language directories are located. `%tra_path%/%language%` should be a valid directory containing `TRA` files.\n- STR_VAR `out_path` to the path to which the converted files should be directed. The default value of this variable is `%tra_path%`, that is, the converted files reversibly overwrite the originals and the conversion is transparent to the rest of your mod. Note that if `%tra_path%` and `%out_path%` are the same directory, the conversion will naturally happen only once regardless of how many times `HANDLE_CHARSETS` are invoked, but if the directories are different, the conversion will happen for every invocation (notably, if `HANDLE_CHARSETS` is invoked among the `ALWAYS` actions).\n- STR_VAR `iconv_path` to the path where iconv.exe is located. Defaults to `%tra_path%/iconv`.\n- STR_VAR `charset_table` to the name of an associative array where the keys are the names of your language directories and the corresponding values are the character sets used by the respective language. The keys must be entirely in lowercase. `charset_table` is not used if you also specify `infer_charsets`.\n- STR_VAR `noconvert_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files that should not be converted into `UTF-8`. All `TRA` files in the language directory and its subdirectories except the ones listed in `noconvert_array` will be converted. The .tra file extension is optional. This variable should not be provided if you also provide `convert_array`.\n- STR_VAR `convert_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files that should be converted into `UTF-8`. Only those `TRA` files in the language directory or its subdirectories which are listed in `convert_array` will be converted. The .tra file extension is optional. If this variable is provided, `noconvert_array` will not be used.\n- STR_VAR `reload_array` to the name of an array indexed by monotonically increasing integers starting from 0. The values should be the names of `TRA` files which should be reloaded after they have been converted. The .tra file extension is optional. You should use this variable for reloading those `TRA` files loaded by `LANGUAGE` which should also be converted.\n- STR_VAR `exclude_directories` to the name of an array indexed by monotonically increasing integers starting from `0`. The values should be the names of directories whose contents should not be converted. The directories should be subdirectories within `%tra_path%/%language%` or its subdirectories. Only the directory name itself should be specified, not its path.\n- STR_VAR `file_regexp` to a regexp expression with the file names that must be converted. Defaults to `~.+\\.tra~`.\n"
3444
+ }
3445
+ },
3446
+ "HANDLE_TILESETS": {
3447
+ "contents": {
3448
+ "kind": "markdown",
3449
+ "value": "```weidu-tp2-tooltip\nHANDLE_TILESETS\n```\nInstall TISpack-compressed tilesets in a safe and easy manner. This is an ACTION function.\n\nThis function supports Windows, OS X, GNU/Linux and all IE games that support the `TIS V1` file format. The program tisunpack, part of `TISpack`, is used to decompress the provided .tiz files and the resulting .tis files are placed in the override. Refer to the `HANDLE_AUDIO` and `HANDLE_TILESETS` tutorial for usage examples and a more practical explanation.\n\nThis function expects to find tisunpack for one or more of Windows, OS X or GNU/Linux in a common directory under the subdirectories `win32`, `osx`, and `unix`, respectively. For example, in `mymod/tiz/win32`, `mymod/tiz/osx` and `mymod/tiz/unix`, the common directory is `mymod/tiz` and `mymod/tiz/win32/tisunpack.exe` should be a valid file. For GNU/Linux, this function also supports tisunpack being located on the system path (something the user would take care of). If you choose to leave tisunpack to the user, you should mention this requirement in any installation instructions you provide.\n\nIf tisunpack for the user's platform could not be found, the installation fails.\n\n- STR_VAR `tiz_path` to the path your .tiz files are stored in. By default this variable is `~%MOD_FOLDER%/tiz~`.\n- STR_VAR `tisunpack_path` to the common directory where the subdirectories `win32`, `osx` and `unix` are located. By default this variable is `~%tiz_path%~`.\n- STR_VAR `output_path` to the path the tilesets should be installed into. By default this variable is `override`.\n"
3450
+ }
3451
+ },
3452
+ "INSTALL_PVRZ": {
3453
+ "contents": {
3454
+ "kind": "markdown",
3455
+ "value": "```weidu-tp2-tooltip\nINSTALL_PVRZ\n```\nInstall a PVRZ file and updates the PVRZ index. This is an ACTION function.\n This function copies the specified PVRZ file into the target folder and updates the PVRZ index. This function should be used in conjunction with UPDATE_PVRZ_INDICES.\n - INT_VAR `original_base_index` to the current base index. This value is returned by the function UPDATE_PVRZ_INDICES as `original_base_index`.\n - INT_VAR `new_base_index` to the new base index. This value is returned by the function UPDATE_PVRZ_INDICES as `new_base_index`.\n - STR_VAR `source_file` to the source file to copy. The filename must match the regular expression ~MOS[0-9]+\\.PVRZ~ (e.g., MOS0000.PVRZ, mos1592.pvrz or Mos12345.PVRZ). Case is ignored.\n - STR_VAR `target_folder` to the target folder to copy the source file into. The default value is \"override\".\n - RET `success` is set to non-zero if the function returned successfully and is set to zero on error.\n This function can additionally return all the variables automatically set by COPY."
3456
+ }
3457
+ },
3458
+ "sc#addWmpAre": {
3459
+ "contents": {
3460
+ "kind": "markdown",
3461
+ "value": "```weidu-tp2-tooltip\nsc#addWmpAre\n```\nAdds an area to the worldmap. All variables are zero or blank by default unless otherwise indicated. This is an ACTION function.\n\n- ACTION_DEFINE_ASSOCIATIVE_ARRAY `toNewArea` to the area references that lead to the new area;\n- ACTION_DEFINE_ASSOCIATIVE_ARRAY `fromNewArea` to the area references that lead away from the new area;\n- STR_VAR `areName` to the resource reference of the area to add (like \\\"ar0700\\\");\n- STR_VAR `strName` to the descriptive name of the area (like \\\"Waukeen's Promenade\\\");\n- STR_VAR `strDesc` to the area description that will show up when hovering the cursor over the area on the worldmap;\n- STR_VAR `worldmap` to the name of the .wmp file you want patched (default is \\\"worldmap\\\");\n- INT_VAR `mapIcon` to the area's map icon index (from mapicons.bam);\n- INT_VAR `xCoord` to the area's X (east-west) coordinate;\n- INT_VAR `yCoord` to the area's Y (north-south) coordinate;\n- INT_VAR `tTime` to the area's travel time in hours * 4 (so 2 = 8 hours);\n- INT_VAR `inclSv` to 1 if you want to patch saved game worldmaps as well as the master worldmap. '''NB:''' changes to saved games are uninstallable;\n- INT_VAR `visible` to 1 if you want the ''visible'' flag to be set;\n- INT_VAR `visibleAdjacent` to 1 if you want the ''visible from adjacent'' flag to be set;\n- INT_VAR `reachable` to 1 if you want the ''reachable'' flag to be set;\n- INT_VAR `visited` to 1 if you want the ''visited'' flag to be set;\n- RET `areNum` returns the worldmap entry number for the new area;\n"
3462
+ }
3463
+ },
3464
+ "ADD_AREA_ITEM": {
3465
+ "contents": {
3466
+ "kind": "markdown",
3467
+ "value": "```weidu-tp2-tooltip\nADD_AREA_ITEM\n```\nAdds an item to a container of an area. This is a PATCH macro and function.\n - SPRINT `item_to_add` to the item you want to add\n - SET `container_to_add_to` to the number of the container the item should be added to. The count starts at 1.\n - SPRINT `flags` to flags the item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to amount in stock/number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
3468
+ }
3469
+ },
3470
+ "ADD_AREA_REGION_TRIGGER": {
3471
+ "contents": {
3472
+ "kind": "markdown",
3473
+ "value": "```weidu-tp2-tooltip\nADD_AREA_REGION_TRIGGER\n```\nAdds an area region to the current are file. This is a PATCH macro and function. Unlike other macros you do not need to set every variable. You are only required to set those values that you need to write.\n - SPRINT `ab_RT_Name` -- Name to assign to new region\n - SET `ab_RT_Type` -- Type of trigger -- 0=proximity; 1=info; 2=travel\n - SET `ab_RT_BbLX` -- Bounding Box - low x value - LEFT\n - SET `ab_RT_BbLY` -- Bounding Box - low y value - TOP\n - SET `ab_RT_BbHX` -- Bounding Box - High x value - RIGHT\n - SET `ab_RT_BbHY` -- Bounding Box - High y value - BOTTOM\n - SET `ab_RT_VxPr` -- Number of Vertex Pairs for current region\n - SET `ab_RT_CuId` -- Cursor Index - points to a graphic in cursors.bam\n - SPRINT `ab_RT_Dest` -- Destination Area\n - SPRINT `ab_RT_EntN` -- Entrance Name\n - SET `ab_RT_Fbit` -- Flag bits set in bit format which are read right to left - 0=off; 1=on\n - SET `ab_RT_Itxt` -- Info text\n - SET `ab_RT_TDtD` -- Trap Detection Difficulty\n - SET `ab_RT_TRmD` -- Trap Removal Difficulty\n - SET `ab_RT_TSet` -- Trap is set - 0=no; 1=yes\n - SET `ab_RT_TDet` -- Trap is detected - 0=no; 1=yes\n - SET `ab_RT_LPoX` -- Launch Point X\n - SET `ab_RT_LPoY` -- Launch Point Y\n - SPRINT `ab_RT_KeyI` -- Key Item\n - SET `ab_RT_Rbcs` -- Region Script file\n - SET `ab_RT_ALPX` -- Alternate Launch Point X\n - SET `ab_RT_ALPY` -- Alternate Launch Point Y\n - SET `ab_RT_Dial` -- Dialog file (used only in PST)\n The vertex points are separated by their XY values You may have as many pairs as you need. Just copy this set and increment the #. Example\":\" For the X values\":\" 'ab_RT_Vx_X_0', 'ab_RT_Vx_X_1', 'ab_RT_Vx_X_2'\n For the Y values\":\" 'ab_RT_Vx_Y_0', 'ab_RT_Vx_Y_1', 'ab_RT_Vx_Y_2'\n - SET `ab_RT_Vx_X_0` -- Point #0 X value\n - SET `ab_RT_Vx_Y_0` -- Point #0 Y value\n NOTE: The original code released in WeiDU v211 has been overhauled and re-released in v212. Therefore, the user defined variable names have been changed. If you used the 211 version you will need to update your mod to use the variables in this version. Sorry for the inconvenience..."
3474
+ }
3475
+ },
3476
+ "ADD_CRE_EFFECT": {
3477
+ "contents": {
3478
+ "kind": "markdown",
3479
+ "value": "```weidu-tp2-tooltip\nADD_CRE_EFFECT\n```\nAdds an effect to a creature. All variables except `probability1` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode.\n - SET `timing` to timing type.\n - SET `target` to target type.\n - SET `parameter1` to first parameter.\n - SET `parameter2` to second parameter.\n - SET `parameter3` to third parameter.\n - SET `parameter4` to forth parameter.\n - SET `power` to power.\n - SET `resist_dispel` to magic resistance/dispel type.\n - SET `duration` to duration.\n - SET `probability1` to probability 1 (default 100).\n - SET `probability2` to probability 2.\n - SPRINT `resource` to resource (8 chars max).\n - SPRINT `resource2` to second resource (8 chars max).\n - SPRINT `vvcresource` to VVC resource (8 chars max).\n - SPRINT `effsource` to effect source.\n - SPRINT `effvar` to effect variable.\n - SET `dicenumber` to number of dices to be thrown.\n - SET `dicesize` to size of dices to be thrown.\n - SET `savingthrow` to type of savingthrow to be allowed against the effect.\n - SET `savebonus` to saving throw bonus.\n - SET `school` to magical school.\n - SET `special` to the special parameter (only valid for functions; not macros).\n - SET `lowestafflvl` to lowest affected level.\n - SET `highestafflvl` to highest affected level.\n - SET `casterx` to caster X position.\n - SET `castery` to caster Y position.\n - SET `targetx` to target X position.\n - SET `targety` to target Y position.\n - SET `restype` to source resource type.\n - SET `sourceslot` to source resource slot.\n - SET `casterlvl` to caster level.\n - SET `sectype` to secondary type.\n - SET `insert_point` to the index at which the new effect is to be inserted. 0 is first and negative values or values equal to or exceeding the existing number of effects are last."
3480
+ }
3481
+ },
3482
+ "ADD_CRE_ITEM_FLAGS": {
3483
+ "contents": {
3484
+ "kind": "markdown",
3485
+ "value": "```weidu-tp2-tooltip\nADD_CRE_ITEM_FLAGS\n```\nAdds flags to all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item the flags should be added to\n - SPRINT `flags to flags` you need to add (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
3486
+ }
3487
+ },
3488
+ "ADD_CRE_SCRIPT": {
3489
+ "contents": {
3490
+ "kind": "markdown",
3491
+ "value": "```weidu-tp2-tooltip\nADD_CRE_SCRIPT\n```\nAssigns a script to a creature in the first available slot. This is a PATCH function. By default, the function will try all 5 script slots from SCRIPT_OVERRIDE to SCRIPT_DEFAULT.\n The function will fail with an error if the file being patched does not have a signature (first 3 bytes) that case-sensitively equals CRE, if either `offset_start` or `offset_end` are negative, if `offset_end` is less than `offset_start` or if `offset_end` is greater than the size of the file being patched.\n - INT_VAR `offset_start` to the offset from which the search for an empty slot should start. (default SCRIPT_OVERRIDE)\n - INT_VAR `offset_end` to the offset at which the search should end. (default SCRIPT_DEFAULT)\n - STR_VAR `script` to the resource reference of the script to be assigned.\n - RET `success` a return value indicating whether the script was successfully assigned. 1 signifies success and 0 signifies that no empty slot was found. A harmless warning will be printed if the function was unsuccessful."
3492
+ }
3493
+ },
3494
+ "ADD_ITEM_EFFECT": {
3495
+ "contents": {
3496
+ "kind": "markdown",
3497
+ "value": "```weidu-tp2-tooltip\nADD_ITEM_EFFECT\n```\nAdds an extended effect to an item. All variables except `probability1`, type and `insert_point` are 0 by default. This is a PATCH macro and function.- SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `type` to the type of header to which the effect should be added or 99 for all types. Defaults to 3 (magic).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the last effect by default."
3498
+ }
3499
+ },
3500
+ "ADD_ITEM_EQEFFECT": {
3501
+ "contents": {
3502
+ "kind": "markdown",
3503
+ "value": "```weidu-tp2-tooltip\nADD_ITEM_EQEFFECT\n```\nAdds an equipping effect to an item. All variables except 'probability1' are 0 by default. This is a PATCH macro and function.- SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the first effect by default."
3504
+ }
3505
+ },
3506
+ "ADD_SPELL_CFEFFECT": {
3507
+ "contents": {
3508
+ "kind": "markdown",
3509
+ "value": "```weidu-tp2-tooltip\nADD_SPELL_CFEFFECT\n```\nAdds a casting-feature effect to a spell. All variables except `probability1` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the first effect by default."
3510
+ }
3511
+ },
3512
+ "ADD_SPELL_EFFECT": {
3513
+ "contents": {
3514
+ "kind": "markdown",
3515
+ "value": "```weidu-tp2-tooltip\nADD_SPELL_EFFECT\n```\nAdds an extended effect to a spell. All variables except `probability1` and `insert_point` are 0 by default. This is a PATCH macro and function.\n - SET `opcode` to opcode\n - SET `target` to target type\n - SET `timing` to timing type\n - SET `parameter1` to first parameter\n - SET `parameter2` to second parameter\n - SET `power` to power\n - SET `resist_dispel` to magic resistance/dispel type\n - SET `duration` to duration\n - SET `probability1` to probability 1 (default 100)\n - SET `probability2` to probability 2\n - SPRINT `resource` to resource (8 chars max)\n - SET `dicenumber` to number of dices to be thrown\n - SET `dicesize` to size of dices to be thrown\n - SET `savingthrow` to type of savingthrow to be allowed against the effect\n - SET `savebonus` to saving throw bonus\n - SET `special` to the special parameter (only valid for functions; not macros)\n - SET `header` to number of extended header (starting from 1) the effect should be added to (by default the effect is added to every header).\n - SET `insert_point` to the position of the effect. If this variable is 0 the effect will be inserted as the first effect of the extended header. If this variable is negative or greater than the number of effects, the effect will be inserted as the last effect. The effect is added as the last effect by default."
3516
+ }
3517
+ },
3518
+ "ADD_STORE_ITEM_EX": {
3519
+ "contents": {
3520
+ "kind": "markdown",
3521
+ "value": "```weidu-tp2-tooltip\nADD_STORE_ITEM_EX\n```\nAdds an item to the current STO file. This is a PATCH function.\n - INT_VAR `charge1` to the number of charges of the 1st ability or quantity for stackables. (Default: `0`)\n - INT_VAR `charge2` to the number of charges of the 2nd ability. (Default: `0`)\n - INT_VAR `charge3` to the number of charges of the 3rd ability. (Default: `0`)\n - INT_VAR `stack` to the number of item instances the store carries in the stack. (Default: `1`)\n - INT_VAR `unlimited` to non-zero if the store should carry an inexhaustible stack of the new item. (Default: `0`)\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing sale entry of matching item resref when found. (Default: `0`)\n - INT_VAR `expiration` to the item's expiration time, when it will be replaced with the drained item. (Default: `0`)\n - STR_VAR `item_name` to the resource name (resref) of the item to add.\n - STR_VAR `position` to the desired position of the item in the list of sale entries. The following syntax is supported (Default: `FIRST`):\n - `AFTER resref`: Will place the new item directly behind the item given by `resref`.\n You can list more than one resref, separated by space. The new item will be\n added after the entry of the first matching resref.\n - `BEFORE resref`: Will place the new item directly before the item given by `resref`.\n You can list more than one resref, separated by space. The new item will be\n added before the entry of the first matching resref.\n - `LAST`: Will place the new item after all existing items.\n - `FIRST`: Will place the new item before all existing items.\n - `AT value`: Will place the new item at the position given by the number `value`.\n Use negative values to place the new item relative to the last item position\n in reverse order.\n - STR_VAR `flags` to numeric values or the following constants: `none`, `identified`, `unstealable`, `stolen`. Constants can be combined by using ampersand (`&`) or space as separators (e.g. `identified&unstealable`). (Default: `none`)\n - STR_VAR `sale_trigger` Availability trigger (`STO V1.1` only). The following syntax is supported (Default: `#-1`):\n - `Trigger string`: Example: `GlobalGT(\"MyCondition\",\"GLOBAL\",0)`\n - `Strref value`: Example: `#1234`\n - `Translation reference`: Example: `@1000`\n - RET `index` returns the index of the added item or the last matching index when overwriting items. Returns `-1` if the item could not be added or updated.\n - RET `offset` returns the offset of the added item or the last matching offset when overwriting items. Returns `-1` if the item could not be added or updated."
3522
+ }
3523
+ },
3524
+ "ADD_STORE_DRINK": {
3525
+ "contents": {
3526
+ "kind": "markdown",
3527
+ "value": "```weidu-tp2-tooltip\nADD_STORE_DRINK\n```\nAdds a drink to the current STO file. This is a PATCH function.\n - INT_VAR `price` to the price of the drink.\n - INT_VAR `rate` to the rate (%) of displaying a rumor.\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing drink of matching `drink_name` when found. (Default: `0`)\n - STR_VAR `drink_name` to the name of the drink. The following syntax is supported:\n - `Literal string`: Example: Elminster's Choice Beer\n - `Strref value`: Example: `#1234`\n - `Translation reference`: Example: `@1000`\n - STR_VAR `position` to the desired position in the list of drinks. Refer to the table below for supported expressions. The following syntax is supported (Default: `FIRST`):\n - `AFTER name`: Will place the new drink directly behind the drink given by `name`. Name can\n either be a strref value (e.g. `#1234`) or a translation reference (e.g. `@1000`).\n You can list more than one name, separated by space. The new drink will be\n added after the entry of the first matching name.\n - `BEFORE name`: Will place the new drink directly before the drink given by `name`. Name can\n either be a strref value (e.g. `#1234`) or a translation reference (e.g. `@1000`).\n You can list more than one name, separated by space. The new drink will be\n added before the entry of the first matching name.\n - `LAST`: Will place the new drink after all existing drinks.\n - `FIRST`: Will place the new drink before all existing drinks.\n - `AT value`: Will place the new drink at the position given by the number \"value\".\n Use negative values to place the new drink relative to the last drink position\n in reverse order.\n - RET `index` returns the index of the added drink or the last matching index when overwriting drinks. Returns `-1` if the drink could not be added or updated.\n - RET `offset` returns the offset of the added drink or the last matching offset when overwriting drinks. Returns `-1` if the drink could not be added or updated."
3528
+ }
3529
+ },
3530
+ "ADD_STORE_CURE": {
3531
+ "contents": {
3532
+ "kind": "markdown",
3533
+ "value": "```weidu-tp2-tooltip\nADD_STORE_CURE\n```\nAdds a cure to the current STO file. This is a PATCH function.\n - INT_VAR `price` to the spell price.\n - INT_VAR `overwrite` to non-zero to overwrite any instances of an existing cure entry of matching spell resref when found. (Default: `0`)\n - STR_VAR `spell_name` to the resource name (resref) of the spell to add.\n - STR_VAR `position` to the desired position in the list of cures. Refer to the table below for supported expressions. The following syntax is supported (Default: `FIRST`):\n - `AFTER resref`: Will place the new spell directly behind the spell given by `resref`.\n You can list more than one resref, separated by space. The new spell will be\n added after the entry of the first matching resref.\n - `BEFORE resref`: Will place the new spell directly before the spell given by `resref`.\n You can list more than one resref, separated by space. The new spell will be\n added before the entry of the first matching resref.\n - `LAST`: Will place the new spell after all existing cures.\n - `FIRST`: Will place the new spell before all existing cures.\n - `AT value`: Will place the new spell at the position given by the number `value`.\n Use negative values to place the new spell relative to the last spell position\n in reverse order.\n - RET `index` returns the index of the added cure or the last matching index when overwriting cure entries. Returns `-1` if the spell could not be added or updated.\n - RET `offset` returns the offset of the added cure or the last matching offset when overwriting cures. Returns `-1` if the spell could not be added or updated."
3534
+ }
3535
+ },
3536
+ "ADD_WORLDMAP_LINKS": {
3537
+ "contents": {
3538
+ "kind": "markdown",
3539
+ "value": "```weidu-tp2-tooltip\nADD_WORLDMAP_LINKS\n```\nAdd links from one worldmap area to another. This is a PATCH function.\n This function add links from one specified area to another. Links can be added from all four directional nodes (north, east, south, west) or from a specific node. If a link already exists, its metadata (distance scale, random encounters, etc.) will be overwritten. Links connecting the areas in the opposite direction will not be added. If either of the areas do not exist in the worldmap, a warning is printed and no links are added.\n - INT_VAR `distance_scale` to the distance scale between the two areas. `distance_scale` * 4 equals the travel time between the areas (in hours).\n - INT_VAR `default_entry` to the default entry location. Legal values for this variable are 1 (northern side), 2 (eastern), 4 (southern) and 8 (western). The default value is 1.\n - INT_VAR `encounter_probability` to the probability of a random encounter occurring.\n - STR_VAR `from_area` to the area from which the links should originate.\n - STR_VAR `from_node` to the directional node from which the links should originate. Legal values for this variable are “north”, “n”, “east”, “e”, “south”, “s”, “west” and “w”. Values are not case sensitive. Links are added to all four nodes by default.\n - STR_VAR `to_area` to the area to which the links should lead.\n - STR_VAR `entry` to the entry point in `to_area`.\n - STR_VAR `random_area1` to the first random-encounter area.\n - STR_VAR `random_area2` to the second random-encounter area.\n - STR_VAR `random_area3` to the third random-encounter area.\n - STR_VAR `random_area4` to the fourth random-encounter area.\n - STR_VAR `random_area5` to the fifth random-encounter area."
3540
+ }
3541
+ },
3542
+ "ALTER_AREA_ACTOR": {
3543
+ "contents": {
3544
+ "kind": "markdown",
3545
+ "value": "```weidu-tp2-tooltip\nALTER_AREA_ACTOR\n```\nPatch area actors. This is a PATCH function. All integer variables, except `expiry`, default to the value -1 and a negative value results in no change to the corresponding field. The variable `expiry` instead has a default value of -2. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except `actor_name` default to the string \"same\", which results in no change to the corresponding field. The variable `actor_name` is required.\n - INT_VAR `x_coord` to the new x coordinate. Unless dest_x is defined, x_coord is used as the x-value of the destination, as well.\n - INT_VAR `y_coord` to the new y coordinate. Unless dest_y is defined, y_coord is used as the y-value of the destination, as well.\n - INT_VAR `dest_x` to the new x destination.\n - INT_VAR `dest_y` to the new y destination.\n - INT_VAR `spawned` to the new spawned value.\n - INT_VAR `animation` to the new animation value.\n - INT_VAR `orient` to the new facing direction.\n - INT_VAR `expiry` to the new expiration time.\n - INT_VAR `wander` to the new wander-distance value.\n - INT_VAR `follow` to the new follow-distance value.\n - INT_VAR `times_talked` to the new number of times the actor has been talked to.\n - INT_VAR `flag_cre_unattached` to the new value of the flag known as CRE attached (bit 0).\n - INT_VAR `flag_seen_party` to the new value of the flag known as has seen party (bit 1).\n - INT_VAR `flag_invulnerable` to the new value of the flag known as invulnerable (bit 2).\n - INT_VAR `flag_override_script_name` to the new value of the flag known as override script name (bit 3).\n - INT_VAR `flag_time_0` through `flag_time_23` to the new values of the actor's appearance schedule.\n - STR_VAR `actor_name` to the name of the actor to be patched. This variable is required.\n - STR_VAR `dlg_file` to the resref of the new dialogue file.\n - STR_VAR `script_override` to the resref of the new override script.\n - STR_VAR `script_general` to the resref of the new general script.\n - STR_VAR `script_class` to the resref of the new class script.\n - STR_VAR `script_race` to the resref of the new race script.\n - STR_VAR `script_default` to the resref of the new default script.\n - STR_VAR `script_specifics` to the resref of the new specifics script.\n - STR_VAR `cre_file` to the resref of the new creature file."
3546
+ }
3547
+ },
3548
+ "ALTER_AREA_CONTAINER": {
3549
+ "contents": {
3550
+ "kind": "markdown",
3551
+ "value": "```weidu-tp2-tooltip\nALTER_AREA_CONTAINER\n```\nPatch area containers, but not their contents. This is a PATCH function. All integer variables default to -1 and negative values result in no change to the corresponding field. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except container_name default to the string \"same\", which results in no change to the corresponding field. The variable container_name is required.\n - INT_VAR `coord_x` to the new x coordinate.\n - INT_VAR `coord_y` to the new y coordinate.\n - INT_VAR `container_type` to the new type of the container.\n - INT_VAR `trapped` to whether the container should be trapped.\n - INT_VAR `detected` to whether the container trap should be detected.\n - INT_VAR `launch_x` to the new x coordinate of the launch point.\n - INT_VAR `launch_y` to the new y coordinate of the launch point.\n - INT_VAR `bounding_left` to the new value of the left edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_top` to the new value of the top edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_right` to the new value of the right edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_bottom` to the new value of the bottom edge of the bounding box. The vertices remain unchanged.\n - INT_VAR `range` to the new trigger-range value.\n - INT_VAR `lockpick_strref` to the new strref of the lockpick string.\n - INT_VAR `lock_difficulty` to the new difficulty of the lock.\n - INT_VAR `trap_detect` to the new difficulty of trap detection.\n - INT_VAR `trap_remove` to the new difficulty of trap removal.\n - INT_VAR `flag_locked` to the new value of the flag known as locked (bit 0).\n - INT_VAR `flag_mlocked` to the new value of the flag known as magical lock (bit 2).\n - INT_VAR `flag_resets` to the new value of the flag known as trap resets (bit 3).\n - INT_VAR `flag_disabled` to the new value of the flag known as disabled (bit 5).\n - STR_VAR `container_name` to the name of the container to be patched. This variable is required.\n - STR_VAR `container_script` to the resref of the new container script.\n - STR_VAR `container_key` to the resref of the new container key."
3552
+ }
3553
+ },
3554
+ "ALTER_AREA_DOOR": {
3555
+ "contents": {
3556
+ "kind": "markdown",
3557
+ "value": "```weidu-tp2-tooltip\nALTER_AREA_DOOR\n```\nPatch area doors. This is a PATCH function. All integer variables, except `string_unlock` and `string_speaker`, default to -1 and negative values result in no change to the corresponding field. The variables `string_unlock` and `string_speaker` instead default to 99999999. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. All string variables except `door_name` default to the string \"same\", which results in no change to the corresponding field. The variable `door_name` is required.\n - INT_VAR `bounding_open_left` to the new value of the left edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_top` to the new value of the top edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_right` to the new value of the right edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_open_bottom` to the new value of the bottom edge of the open-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_left` to the new value of the left edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_top` to the new value of the top edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_right` to the new value of the right edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `bounding_closed_bottom` to the new value of the bottom edge of the closed-state bounding box. The vertices remain unchanged.\n - INT_VAR `door_hp` to the new hit-point value.\n - INT_VAR `door_ac` to the new armor-class value.\n - INT_VAR `cursor` to the new cursor index.\n - INT_VAR `trap_detect` to the new difficulty of trap detection.\n - INT_VAR `trap_remove` to the new difficulty of trap removal.\n - INT_VAR `trapped` to whether the door should be trapped.\n - INT_VAR `detected` to whether the door trap should be detected.\n - INT_VAR `launch_x` to the new x coordinate of the launch point.\n - INT_VAR `launch_y` to the new y coordinate of the launch point.\n - INT_VAR `door_detect` to the new difficulty of door detection.\n - INT_VAR `lock_difficulty` to the new difficulty of the lock.\n - INT_VAR `open_x` to the new x coordinate of the opening point.\n - INT_VAR `open_y` to the new y coordinate of the opening point.\n - INT_VAR `close_x` to the new x coordinate of the closing point.\n - INT_VAR `close_y` to the new y coordinate of the closing point.\n - INT_VAR `string_unlock` to the new string reference of the unlock message.\n - INT_VAR `string_speaker` to the new string reference of the dialogue-speaker name.\n - INT_VAR `flag_open` to the new value of the flag known as door open (bit 0).\n - INT_VAR `flag_locked` to the new value of the flag known as door locked (bit 1).\n - INT_VAR `flag_resets` to the new value of the flag known as reset trap (bit 2).\n - INT_VAR `flag_detectable` to the new value of the flag known as trap detectable (bit 3).\n - INT_VAR `flag_forced` to the new value of the flag known as broken (bit 4).\n - INT_VAR `flag_no_close` to the new value of the flag known as can't close (bit 5).\n - INT_VAR `flag_located` to the new value of the flag known as linked (bit 6).\n - INT_VAR `flag_secret` to the new value of the flag known as door hidden (bit 7).\n - INT_VAR `flag_detected` to the new value of the flag known as door found (bit 8).\n - INT_VAR `flag_no_look` to the new value of the flag known as don't block line of sight.\n - INT_VAR `flag_uses_key` to the new value of the flag known as remove key (bit 10).\n - INT_VAR `flag_sliding` to the new value of the flag known as ignore obstacles when closing (bit 11).\n - STR_VAR `door_name` to the name of the door to be patched. This variable is required.\n - STR_VAR `door_open_sound` to the resource reference of the opening sound.\n - STR_VAR `door_close_sound` to the resource reference of the closing sound.\n - STR_VAR `door_key` to the resref of the new door key.\n - STR_VAR `door_script` to the resref of the new door script.\n - STR_VAR `travel_trigger` to the new travel-trigger name. This field is 24 bytes in length.\n - STR_VAR `dialogue` to the new resource reference of the dialogue file."
3558
+ }
3559
+ },
3560
+ "ALTER_AREA_ENTRANCE": {
3561
+ "contents": {
3562
+ "kind": "markdown",
3563
+ "value": "```weidu-tp2-tooltip\nALTER_AREA_ENTRANCE\n```\nPatch coordinates and orientation of area party entrance points. This is a PATCH function. For all integer variables, a negative value results in no change to that field and the default value is -1. The variable `entrance_name` is required.\n - INT_VAR `x_coord` to the new X coordinate.\n - INT_VAR `y_coord` to the new Y coordinate.\n - INT_VAR `orient` to the new orientation.\n - STR_VAR `entrance_name` to the name of the entrance point to be altered. This variable is required."
3564
+ }
3565
+ },
3566
+ "ALTER_AREA_REGION": {
3567
+ "contents": {
3568
+ "kind": "markdown",
3569
+ "value": "```weidu-tp2-tooltip\nALTER_AREA_REGION\n```\nPatch ''area regions'', also known as area triggers. This is a PATCH function. For all integer variables except `info_point`, a negative value results in no change and the default value is -1. The variable `info_point` results in no change if it has the default value 99999999. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. For all string variables except `region_name`, the default value is the string \"same\", which results in no change to that field. The variable `region_name` is required.\n- INT_VAR `type` to the new type of the region.\n- INT_VAR `cursor` to the new cursor index to be used.\n- INT_VAR `trap_detect` to the new difficulty of trap detection.\n- INT_VAR `trap_remove` to the new difficulty of trap removal.\n- INT_VAR `trapped` to whether the region should be trapped.\n- INT_VAR `detected` to whether the trap should be detected.\n- INT_VAR `flag_locked` to the new value of the flag known as `locked` or `invisible trap` (bit 0).\n- INT_VAR `flag_resets` to the new value of the flag known as `trap resets` (bit 1).\n- INT_VAR `flag_party_required` to the new value of the flag known as `party is required` (bit 2).\n- INT_VAR `flag_trap_detectable` to the new value of the flag known as `trap is detectable` (bit 3).\n- INT_VAR `flag_trap_enemies` to the new value of the flag known as `trap can be set off by enemies` (bit 4).\n- INT_VAR `flag_tutorial` to the new value of the flag known as `tutorial trigger` (bit 5).\n- INT_VAR `flag_trap_npcs` to the new value of the flag known as `trap can be set off by NPCs` (bit 6).\n- INT_VAR `flag_silent` to the new value of the flag known as `silent trigger` (bit 7).\n- INT_VAR `flag_deactivated` to the new value of the flag known as `deactivated` (bit 8).\n- INT_VAR `flag_impassable_npc` to the new value of the flag known as `cannot be passed by NPCs` (bit 9).\n- INT_VAR `flag_activation_point` to the new value of the flag known as `use activation point` (bit 10).\n- INT_VAR `flag_connect_to_door` to the new value of the flag known as `connected to door` (bit 11).\n- INT_VAR `bounding_left` to the new value of the left edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_top` to the new value of the top edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_right` to the new value of the right edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `bounding_bottom` to the new value of the bottom edge of the bounding box. The vertices remain unchanged.\n- INT_VAR `info_point` to the new string reference of the info point.\n- INT_VAR `launch_x` to the new x coordinate of the launch point.\n- INT_VAR `launch_y` to the new y coordinate of the launch point.\n- INT_VAR `activate_x` to the new x coordinate of the activation point.\n- INT_VAR `activate_y` to the new y coordinate of the activation point.\n- STR_VAR `region_name` to the name of the region to be patched. This variable is required.\n- STR_VAR `destination_area` to the resref of the new destination area.\n- STR_VAR `entrance_name` to the new entrance name of the destination area.\n- STR_VAR `region_key` to the resref of the key item.\n- STR_VAR `region_script` to the resref of the region script.\n"
3570
+ }
3571
+ },
3572
+ "ALTER_ITEM_EFFECT": {
3573
+ "contents": {
3574
+ "kind": "markdown",
3575
+ "value": "```weidu-tp2-tooltip\nALTER_ITEM_EFFECT\n```\nPatch global (equipping) effects and/or effects on extended headers. This is a PATCH function. All integer variables except `check_globals`, `check_headers`, `header` and `savebonus` default to -1 and negative values result in no change to the corresponding field. The integer variables `check_globals`, `check_headers` and `header` default to 0. The integer variable `savebonus` defaults to -11 and values lower than -10 result in no change to the corresponding field. The string variable `resource` defaults to the string \"same\", which results in no change to the corresponding field.\n Note that both `check_globals` and `check_headers` are 0 by default, so you need to change one or both of these to 1 to perform any patching at all. If you patch headers, you can further target by using `type` to target melee, ranged, or magical headers. `match_opcode` can be left at -1 to match all effects on your targeted range or targeted to a specific opcode. If the opcode itself needs to be changed, you can use `match_opcode` to target the existing effect and `new_opcode` as the new opcode to use. `duration_high` is an alternative to `duration`, mainly for changing the overall duration of an item's effects. The idea is to allow you to mass patch effects to new durations while leaving the one-time only cosmetics and visuals--which are usual instant or only run for a few seconds--unchanged.\n - INT_VAR `check_globals` to whether to check global (on-equip) effects (0 for no, 1 for yes). (default 0)\n - INT_VAR `check_headers` to whether to check effects on extended headers (0 for no, 1 for yes). (default 0)\n - INT_VAR `header` to the number of the ability header that should be altered. A value of 0 matches all headers. (default 0)\n - INT_VAR `header_type` to which type of header that should be checked. If this variable is -1, all header types will be checked.\n - INT_VAR `match_opcode` to which type of opcode to match. If this variable is -1, all opcodes are a match.\n - INT_VAR `new_opcode` to the value the matched opcode should be changed into.\n - INT_VAR `target` to the new target.\n - INT_VAR `power` to the new power.\n - INT_VAR `parameter1` to the new parameter1.\n - INT_VAR `parameter2` to the new parameter2.\n - INT_VAR `timing` to the new timing mode.\n - INT_VAR `resist_dispel` to the new resist/dispel.\n - INT_VAR `duration` to the new duration.\n - INT_VAR `duration_high` to the new duration, but is only written if the existing duration is greater than 5.\n - INT_VAR `probability1` to the new probability1 (the upper bound).\n - INT_VAR `probability2` to the new probability2 (the lower bound).\n - INT_VAR `dicenumber` to the new number of dice. This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `dicesize` to the new size of dice. This field is also instead used for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `savingthrow` to the new saving-throw type.\n - INT_VAR `savebonus` to the new saving-throw bonus/penalty. This variable can take negative values down to -10 while still writing to the corresponding field. (default -11)\n - INT_VAR `special` to the new special parameter.\n - STR_VAR `resource` to the new resource reference."
3576
+ }
3577
+ },
3578
+ "ALTER_ITEM_HEADER": {
3579
+ "contents": {
3580
+ "kind": "markdown",
3581
+ "value": "```weidu-tp2-tooltip\nALTER_ITEM_HEADER\n```\nPatch ability headers on items. This is a PATCH function. All integer variables except `match_icon` and `header` default to -1 and negative values result in no change to the corresponding field. The integer variables `match_icon` and `header` default to 0. In the case of flags, a value of 1 will set the flag and a value of 0 will unset it. The string variable `icon` defaults to the string \\\"same\\\", which results in no change to the corresponding field.\n\n`header_type` is used to limit the scope of matching. The default value of -1 will match all types of headers while values of 0-4 will match headers with those values. If `match_icon` is 1, the icon resource reference will be match with the `icon` variable as an additional qualifier. This is useful for items which have multiple magic abilities. `header` can also be used to limit patching to the Nth header, counting from 1 as the first header. The default is 0, which will match all headers.\n\n- INT_VAR `header_type` to the type of header to be matched. If this variable is -1, all headers will be a match. (default -1)\n- INT_VAR `match_icon` to whether to match the ability icon (0 for no, 1 for yes). (default 0)\n- INT_VAR `header` to the number of the ability header (starting from 1) that should be altered. A value of 0 matches all header. (default 0)\n- INT_VAR `new_header_type` to the value the matched header should be changed into.\n- INT_VAR `identify` to the new identification requirement.\n- INT_VAR `location` to the new new ability location.\n- INT_VAR `target` to the new target.\n- INT_VAR `target_count` to the new target count.\n- INT_VAR `range` to the new range.\n- INT_VAR `launcher` to the new required launcher.\n- INT_VAR `speed` to the new speed factor.\n- INT_VAR `thac0_bonus` to the new THAC0 bonus.\n- INT_VAR `dicesize` to the new dice size.\n- INT_VAR `primary_type` to the new primary type (school).\n- INT_VAR `dicenumber` to the new number of dice.\n- INT_VAR `secondary_type` to the new secondary type.\n- INT_VAR `damage_bonus` to the new damage bonus.\n- INT_VAR `damage_type` to the new damage type.\n- INT_VAR `charges` to the new number of charges.\n- INT_VAR `drained` to the new charge-depletion behaviour.\n- INT_VAR `projectile` to the new projectile.\n- INT_VAR `animation_overhand` to the new overhand animation percentage.\n- INT_VAR `animation_backhand` to the new backhand animation percentage.\n- INT_VAR `animation_thrust` to the new thrust animation percentage.\n- INT_VAR `arrow` to the new arrow qualifier.\n- INT_VAR `bolt` to the new bolt qualifier.\n- INT_VAR `bullet` to the new bullet qualifier.\n- INT_VAR `flag_strength` to the new value of the flag known as `add strength bonus` (bit 0).\n- INT_VAR `flag_break` to the new value of the flag known as `breakable` (bit 1).\n- INT_VAR `flag_strength_damage` to the new value of the flag known as `add strength bonus to damage only` (bit 2). This flag is not available in all games.\n- INT_VAR `flag_strength_thac0` to the new value of the flag known as `add strength bonus to THAC0 only` (bit 3). This flag is not available in all games.\n- INT_VAR `flag_hostile` to the new value of the flag known as `hostile` (bit 10).\n- INT_VAR `flag_recharge` to the new value of the flag known as `recharges` (bit 11).\n- INT_VAR `flag_bypass` to the new value of the flag known as `bypass armor` (bit 16). This flag is not available in all games.\n- INT_VAR `flag_keenedge` to the new value of the flag known as `keen edge` (bit 17). This flag is not available in all games.\n- INT_VAR `flag_backstab` to the new value of the flag known as `toggle backstab` (bit 25). This flag is not available in all games.\n- INT_VAR `flag_noinvisible` to the new value of the flag known as `cannot target invisible` (bit 26). This flag is not available in all games.\n- STR_VAR `icon` to the resource reference to be used for matching if `match_icon` is 1, or the new ability icon if `match_icon` is 0.\n"
3582
+ }
3583
+ },
3584
+ "ALTER_SPELL_EFFECT": {
3585
+ "contents": {
3586
+ "kind": "markdown",
3587
+ "value": "```weidu-tp2-tooltip\nALTER_SPELL_EFFECT\n```\nPatch effects on spells. This is a PATCH function. All integer variables except `check_globals`, `check_headers`, `header` and `savebonus` default to -1 and negative values result in no change to the corresponding field. The integer variables `check_globals` and `header` default to 0. The integer variable `check_headers` defaults to 1. The integer variable `savebonus` defaults to -11 and values lower than -10 result in no change to the corresponding field. The string variable `resource` defaults to the string \"same\", which results in no change to the corresponding field.\n The function will by default only check effects on headers. You can change this by changing the values of the variables `check_globals` and `check_headers`. If you patch headers, you can further target by using `type` to target melee, ranged, or magical headers. `match_opcode` can be left at -1 to match all effects on your targeted range or targeted to a specific opcode. If the opcode itself needs to be changed, you can use `match_opcode` to target the existing effect and `new_opcode` as the new opcode to use. `duration_high` is an alternative to `duration`, mainly for changing the overall duration of an item's effects. The idea is to allow you to mass patch effects to new durations while leaving the one-time only cosmetics and visuals--which are usual instant or only run for a few seconds--unchanged.\n - INT_VAR `check_globals` to whether to check global effects (0 for no, 1 for yes). (default 0)\n - INT_VAR `check_headers` to whether to check effects on extended headers (0 for no, 1 for yes). (default 1)\n - INT_VAR `header` to the number of the ability header that should be altered. A value of 0 matches all headers. (default 0)\n - INT_VAR `header_type` to which type of header that should be checked. If this variable is -1, all header types will be checked.\n - INT_VAR `match_opcode` to which type of opcode to match. If this variable is -1, all opcodes are a match.\n - INT_VAR `new_opcode` to the value the matched opcode should be changed into.\n - INT_VAR `target` to the new target.\n - INT_VAR `power` to the new power.\n - INT_VAR `parameter1` to the new parameter1.\n - INT_VAR `parameter2` to the new parameter2.\n - INT_VAR `timing` to the new timing mode.\n - INT_VAR `resist_dispel` to the new resist/dispel.\n - INT_VAR `duration` to the new duration.\n - INT_VAR `duration_high` to the new duration, but is only written if the existing duration is greater than 5.\n - INT_VAR `probability1` to the new probability1 (the upper bound).\n - INT_VAR `probability2` to the new probability2 (the lower bound).\n - INT_VAR `dicenumber` to the new number of dice. This field is instead used for maximum hit-dice (HD) by some opcodes.\n - INT_VAR `dicesize` to the new size of dice. This field is also instead used for minimum hit-dice (HD) by some opcodes.\n - INT_VAR `savingthrow` to the new saving-throw type.\n - INT_VAR `savebonus` to the new saving-throw bonus/penalty. This variable can take negative values down to -10 while still writing to the corresponding field. (default -11)\n - INT_VAR `special` to the new special parameter.\n - STR_VAR `resource` to the new resource reference."
3588
+ }
3589
+ },
3590
+ "ALTER_SPELL_HEADER": {
3591
+ "contents": {
3592
+ "kind": "markdown",
3593
+ "value": "```weidu-tp2-tooltip\nALTER_SPELL_HEADER\n```\nPatch ability headers on spells. This is a PATCH function.All integer variables except `match_icon` and `header` default to -1 and negative values result in no change to the corresponding field. The integer variables `match_icon` and `header` default to 0. The string variable `icon` defaults to the string \"same\", which results in no change to the corresponding field.\n `header_type` is used to limit the scope of matching. The default value of -1 will match all types of headers while values of 0-4 will match headers with those values. If `match_icon` is 1, the `icon` resource reference will be match with the `icon` variable as an additional qualifier. This is useful for items which have multiple magic abilities. `header` can also be used to limit patching to the Nth header, counting from 1 as the first header. The default is 0, which will match all headers.\n - INT_VAR `header_type` to the type of header to be matched. If this variable is -1, all headers will be a match. (default -1)\n - INT_VAR `match_icon` to whether to match the ability icon (0 for no, 1 for yes). (default 0)\n - INT_VAR `header` to the number of the ability header (starting from 1) that should be altered. A value of 0 matches all header. (default 0)\n - INT_VAR `new_header_type` to the value the matched header should be changed into.\n - INT_VAR `location` to the new new ability location.\n - INT_VAR `target` to the new target.\n - INT_VAR `target_count` to the new target count.\n - INT_VAR `range` to the new range.\n - INT_VAR `min_level` to the new required minimum level.\n - INT_VAR `speed` to the new speed factor.\n - INT_VAR `thac0_bonus` to the new THAC0 bonus.\n - INT_VAR `dicesize` to the new dice size.\n - INT_VAR `dicenumber` to the new number of dice.\n - INT_VAR `damage_bonus` to the new damage bonus.\n - INT_VAR `damage_type` to the new damage type.\n - INT_VAR `charges` to the new number of charges.\n - INT_VAR `projectile` to the new projectile.\n - STR_VAR `icon` to the resource reference to be used for matching if `match_icon` is 1, or the new ability icon if `match_icon` is 0."
3594
+ }
3595
+ },
3596
+ "DELETE_AREA_ITEM": {
3597
+ "contents": {
3598
+ "kind": "markdown",
3599
+ "value": "```weidu-tp2-tooltip\nDELETE_AREA_ITEM\n```\nDeletes all matching items from an area. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
3600
+ }
3601
+ },
3602
+ "DELETE_CRE_EFFECT": {
3603
+ "contents": {
3604
+ "kind": "markdown",
3605
+ "value": "```weidu-tp2-tooltip\nDELETE_CRE_EFFECT\n```\nDeletes all effects with specified opcode from a creature. (Warning\":\" doesn't check EFF version) This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
3606
+ }
3607
+ },
3608
+ "DELETE_CRE_ITEM": {
3609
+ "contents": {
3610
+ "kind": "markdown",
3611
+ "value": "```weidu-tp2-tooltip\nDELETE_CRE_ITEM\n```\nDeletes all matching items from a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
3612
+ }
3613
+ },
3614
+ "DELETE_ITEM_EFFECT": {
3615
+ "contents": {
3616
+ "kind": "markdown",
3617
+ "value": "```weidu-tp2-tooltip\nDELETE_ITEM_EFFECT\n```\nDeletes all extended effects with specified opcode from an item. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
3618
+ }
3619
+ },
3620
+ "DELETE_ITEM_EQEFFECT": {
3621
+ "contents": {
3622
+ "kind": "markdown",
3623
+ "value": "```weidu-tp2-tooltip\nDELETE_ITEM_EQEFFECT\n```\nDeletes all equipping effects with specified opcode from an item. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
3624
+ }
3625
+ },
3626
+ "DELETE_ITEM_HEADER": {
3627
+ "contents": {
3628
+ "kind": "markdown",
3629
+ "value": "```weidu-tp2-tooltip\nDELETE_ITEM_HEADER\n```\nDelete ability headers, also known as extended headers, from items. This is a PATCH function. All integer variables default to 0.\n This function will delete one or more ability headers, along with all of their associated effects, and properly re-index the file.\n - INT_VAR `header_type` to the header type to delete. If this variable is -1, all header types will be a match. (default 0)"
3630
+ }
3631
+ },
3632
+ "DELETE_SPELL_EFFECT": {
3633
+ "contents": {
3634
+ "kind": "markdown",
3635
+ "value": "```weidu-tp2-tooltip\nDELETE_SPELL_EFFECT\n```\nDeletes all extended effects with specified opcode from a spell. This is a PATCH macro and function.\n - SET `opcode_to_delete` to the opcode of the effect you want to delete. Opcode of (-1) will match all effects."
3636
+ }
3637
+ },
3638
+ "DELETE_SPELL_HEADER": {
3639
+ "contents": {
3640
+ "kind": "markdown",
3641
+ "value": "```weidu-tp2-tooltip\nDELETE_SPELL_HEADER\n```\nDelete ability headers, also known as extended headers, from spells. This is a PATCH function. The integer variable `header_type` defaults to 0. The integer variable `min_level` defaults to -1 and if this variable is 0 or greater, only headers with a matching minimum level will be deleted.\n This function will delete one or more ability headers, along with all of their associated effects, and properly re-index the file.\n - INT_VAR `header_type` to the header type to delete. If this variable is -1, all header types will be a match. (default 0)\n - INT_VAR `min_level` to the minimum level to be matched. If this variable is negative, it will not be used for matching. (default -1)"
3642
+ }
3643
+ },
3644
+ "DELETE_STORE_ITEM": {
3645
+ "contents": {
3646
+ "kind": "markdown",
3647
+ "value": "```weidu-tp2-tooltip\nDELETE_STORE_ITEM\n```\nDeletes all matching items from a store. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_delete` to the item you want to delete."
3648
+ }
3649
+ },
3650
+ "DELETE_WORLDMAP_LINKS": {
3651
+ "contents": {
3652
+ "kind": "markdown",
3653
+ "value": "```weidu-tp2-tooltip\nDELETE_WORLDMAP_LINKS\n```\nDelete all links from one worldmap area to another. This is a PATCH function.\n This function will delete links from one specified area to another. Links can be deleted from all four directional nodes (north, east, south, west) or from a specific node. Links connecting the areas in the opposite direction will not be deleted.\n - STR_VAR `from_area` to the area from which the links that are to be deleted originate.\n - STR_VAR `from_node` to the directional node from which the links that are to be deleted originate. Legal values for this variable are \"north\", \"n\", \"east\", \"e\", \"south\", \"s\", \"west\", \"w\". Values are not case sensitive. Links are deleted from all four nodes by default.\n - STR_VAR `to_area` to the area to which the links that are to be deleted lead."
3654
+ }
3655
+ },
3656
+ "FJ_CRE_EFF_V2": {
3657
+ "contents": {
3658
+ "kind": "markdown",
3659
+ "value": "```weidu-tp2-tooltip\nFJ_CRE_EFF_V2\n```\nConverts creatures using version 1 effects to version 2. Called by FJ_CRE_VALIDITY or FJ_CRE_REINDEX automatically if relevant.\n This is a PATCH function."
3660
+ }
3661
+ },
3662
+ "FJ_CRE_REINDEX": {
3663
+ "contents": {
3664
+ "kind": "markdown",
3665
+ "value": "```weidu-tp2-tooltip\nFJ_CRE_REINDEX\n```\nReorders creatures with nonstandard offset orders. Called by FJ_CRE_VALIDITY automatically if relevant.\n This is a PATCH function.\n - INT_VAR `do_reindex` to 0 if you don't want the creature file to be reindexed. Defaults to 1.\n - INT_VAR `do_eff` to 0 if you don't want EFFv1 <-> EFFv2 conversion to be applied. Defaults to 1."
3666
+ }
3667
+ },
3668
+ "FJ_CRE_VALIDITY": {
3669
+ "contents": {
3670
+ "kind": "markdown",
3671
+ "value": "```weidu-tp2-tooltip\nFJ_CRE_VALIDITY\n```\nChecks whether a CRE file is well-formed or not, fixes some common bugs, and reports whether the CRE file is still broken or not. In particular\\\":\\\"\n\n- reports invalidity if it is charbase.cre, shorter than the minimum size, the signature mismatches, or a sub-structure has members and its offset is in the header.\n- if a empty sub-structure's offset is in the header, point them to the end of the header.\n- if the cre is valid, force it to use proper order (known spells, spell memorization info, memorized spells, effects, items, item slot).\n- forces the CRE file to use EFF V2 effects internally (or EFF V1 if on BG1).\n\nThis is a PATCH function.\n\n- INT_VAR `do_message` to 1 if you want explicit an explicit message regarding the cre invalidity. Defaults to 0.\n- INT_VAR `do_reindex` to 0 if you don't want the creature file to be reindexed. Defaults to 1.\n- INT_VAR `do_eff` to 0 if you don't want EFFv1 <-> EFFv2 conversion to be applied. Defaults to 1.\n- RET `valid` returns 1 if the CRE is well-formed, 0 otherwise.\n"
3672
+ }
3673
+ },
3674
+ "FL#FJ_CRE_REINDEX": {
3675
+ "contents": {
3676
+ "kind": "markdown",
3677
+ "value": "```weidu-tp2-tooltip\nFL#FJ_CRE_REINDEX\n```\nThis function is a wrapper around `FJ_CRE_REINDEX` and allows you to use the conventional function interface together with `MODDER fun_args`."
3678
+ }
3679
+ },
3680
+ "FL#FJ_CRE_VALIDITY": {
3681
+ "contents": {
3682
+ "kind": "markdown",
3683
+ "value": "```weidu-tp2-tooltip\nFL#FJ_CRE_VALIDITY\n```\nThis function is a wrapper around `FJ_CRE_VALIDITY` and allows you to use the conventional function interface together with `MODDER fun_args`."
3684
+ }
3685
+ },
3686
+ "ITEM_EFFECT_TO_SPELL": {
3687
+ "contents": {
3688
+ "kind": "markdown",
3689
+ "value": "```weidu-tp2-tooltip\nITEM_EFFECT_TO_SPELL\n```\nCopies all extended effects from the current item to the first extended header of a spell. This is a PATCH macro and function.\n - SET `type` to the header type to copy the effect from (use 99 to specify 'all types').\n - SET `header` to number of extended header the effect should be copied from (use 99 to specify 'every header').\n - SET `insert_point` to the index into the spell file at which the effects should be inserted. A value of 0 will have the effects inserted as the first effects of the spell. Effects are inserted as the last effects by default.\n - SPRINT `new_itm_spl` to a spell you want to copy effects to."
3690
+ }
3691
+ },
3692
+ "REMOVE_CRE_ITEM_FLAGS": {
3693
+ "contents": {
3694
+ "kind": "markdown",
3695
+ "value": "```weidu-tp2-tooltip\nREMOVE_CRE_ITEM_FLAGS\n```\nRemoves flags from all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item the flags should be removed from\n - SPRINT `flags` to flags you need to remove (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
3696
+ }
3697
+ },
3698
+ "REPLACE_AREA_ITEM": {
3699
+ "contents": {
3700
+ "kind": "markdown",
3701
+ "value": "```weidu-tp2-tooltip\nREPLACE_AREA_ITEM\n```\nReplaces all matching items in an area with another item. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `old_item` to the item you want to be replaced\n - SPRINT `new_item` to the new item\n - SPRINT `flags` to flags the new item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to amount in stock/number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
3702
+ }
3703
+ },
3704
+ "REPLACE_STORE_ITEM": {
3705
+ "contents": {
3706
+ "kind": "markdown",
3707
+ "value": "```weidu-tp2-tooltip\nREPLACE_STORE_ITEM\n```\nReplaces all matching items in a store with another item. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `old_item` to the item you want to be replaced\n - SPRINT `new_item` to the new item\n - SET `number_in_stock` to number of new items in stock (default 0)\n - SPRINT `flags` to flags new item should have (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc). Default - no flags.\n - SET `charges1` to number of charges of first magical ability (default 0)\n - SET `charges2` to number of charges of second magical ability (default 0)\n - SET `charges3` to number of charges of third magical ability (default 0)"
3708
+ }
3709
+ },
3710
+ "SET_CRE_ITEM_FLAGS": {
3711
+ "contents": {
3712
+ "kind": "markdown",
3713
+ "value": "```weidu-tp2-tooltip\nSET_CRE_ITEM_FLAGS\n```\nSet flags to all matching items possessed by a creature. Regexp allowed. This is a PATCH macro and function.\n - SPRINT `item_to_change` to the item which flags should be set\n - SPRINT `flags` to flags you need to set (usual weidu syntax: STOLEN, IDENTIFIEDSTOLEN, etc)."
3714
+ }
3715
+ },
3716
+ "T-CRE_EFF_V1": {
3717
+ "contents": {
3718
+ "kind": "markdown",
3719
+ "value": "```weidu-tp2-tooltip\nT-CRE_EFF_V1\n```\nConverts creatures using version 2 effects to version 1. Called by FJ_CRE_VALIDITY or FJ_CRE_REINDEX automatically if relevant.\n This is a PATCH function."
3720
+ }
3721
+ },
3722
+ "UPDATE_PVRZ_INDICES": {
3723
+ "contents": {
3724
+ "kind": "markdown",
3725
+ "value": "```weidu-tp2-tooltip\nUPDATE_PVRZ_INDICES\n```\nUpdate the PVRZ references in a BAM V2 or MOS V2 resource. This is a PATCH function.\n This function will update the PVRZ references in a BAM V2 or MOS V2 resource with the next contiguous block of free PVRZ indices. This function is intended to be used in combination with the action function INSTALL_PVRZ.\n - INT_VAR `target_base_index` is an optional parameter. When specified, the function attempts to use a block of free PVRZ indices starting at the specified value. The default value is 1000.\n - RET `original_base_index` returns the lowest PVRZ index used by the source BAM or MOS. Returns -1 on error.\n - RET `new_base_index` returns the lowest PVRZ index used by the target BAM or MOS. Returns -1 on error.\n - RET `index_range` returns the range of reserved PVRZ indices, i.e., the difference between the smallest and biggest PVRZ index, inclusive. Returns 0 on error."
3726
+ }
3727
+ },
3728
+ "fj_are_structure": {
3729
+ "contents": {
3730
+ "kind": "markdown",
3731
+ "value": "```weidu-tp2-tooltip\nfj_are_structure\n```\nAdds a structure to an area file. All variables are zero or blank by default unless otherwise indicated. Fields designated by an asterisk are typically required; all others are optional. This is a PATCH function.\nUniversal structure variables\\\":\\\"\n\n- STR_VAR `fj_structure_type` to the type of area structure to be added (actor, region, spawn, entrance, container, itm, ambient, variable, door, animation, explored bitmask, songlist, rest interrupt table, note or projectile)^*^;\n- INT_VAR `fj_delete_mode` to the index of the structure to be deleted (if deleting rather than adding a new structure);\n- INT_VAR `fj_debug` to 1 to enable feedback;\n- RET `fj_return_offset` returns the position of the structure in the area file;\n\n Actor structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the actor's name^*^;\n- INT_VAR `fj_loc_x` to the starting X (horizontal) coordinate^*^;\n- INT_VAR `fj_loc_y` to the starting Y (vertical) coordinate^*^;\n- INT_VAR `fj_dest_x` to the destination X coordinate (by default the same as `fj_loc_x`);\n- INT_VAR `fj_dest_y` to the destination Y coordinate (by default the same as `fj_loc_y`);\n- INT_VAR `fj_loading` to whether the .cre file is loaded (0=attached, 1=loaded, default 1);\n- INT_VAR `fj_spawned` to whether the creature has been spawned (0=no, 1=yes, default 0);\n- INT_VAR `fj_animation` to the actor's animation number (from animate.ids, though the engine uses the animation set on the .cre file);\n- INT_VAR `fj_orientation` to the facing direction (0-15 where 0=south, 4=west, 8=north, 12=east, default 0);\n- INT_VAR `fj_expiry` to the actor removal timer in absolute ticks (default -1 to avoid removal);\n- INT_VAR `fj_wander_dist_actor` to the actor's random walk distance limit;\n- INT_VAR `fj_mvmt_dist_actor` to the actor's movement distance limit;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_num_talked` to the NumTimesTalkedTo (in .sav files);\n- STR_VAR `fj_dlg_resref` to the actor's dialogue file (normally obtained from .cre files);\n- STR_VAR `fj_bcs_override` to the actor's override script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_general` to the actor's general script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_class` to the actor's class script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_race` to the actor's race script (normally obtained from .cre files);\n- STR_VAR `fj_bcs_default` to the actor's default script (normally obtained from .cre files);\n- STR_VAR `fj_cre_resref` to the actor's resource reference (creature filename)^*^;\n- STR_VAR `fj_cre_embedded` to path/to/file.cre if embedding a new creature (defaults to `fj_cre_resref` if not set);\n\nRegion structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the region's name^*^;\n- INT_VAR `fj_type` to the region type (0=trap, 1=info, 2=travel)^*^;\n- INT_VAR `fj_box_left` to the leftmost X coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_top` to the topmost Y coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_right` to the rightmost X coordinate of the region's bounding box^*^;\n- INT_VAR `fj_box_bottom` to the bottommost Y coordinate of the region's bounding box^*^;\n- INT_VAR `fj_cursor_idx` to the region's mouse cursor index (from cursors.bam)^*^;\n- STR_VAR `fj_destination_area` to the destination area resource reference (for travel regions);\n- STR_VAR `fj_destination_name` to the entrance name in the destination area (for travel regions);\n- INT_VAR `fj_flags` to the bitwise region flags;\n- INT_VAR `fj_info_point_strref` to the information text string reference (for info points, default -1);\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove` to the trap removal difficulty percentage;\n- INT_VAR `fj_trap_active` to whether the region is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_loc_y` to the trap launch Y coordinate^*^;\n- STR_VAR `fj_key_resref` to the filename of the region's key;\n- STR_VAR `fj_reg_script` to the region script;\n- INT_VAR `fj_alt_x` to the activation point X coordinate;\n- INT_VAR `fj_alt_y` to the activation point Y coordinate;\n- STR_VAR `fj_sound` to the sound resource reference (ONLY for PST);\n- INT_VAR `fj_talk_loc_x` to the talk location point X coordinate (ONLY for PST);\n- INT_VAR `fj_talk_loc_y` to the talk location point Y coordinate (ONLY for PST);\n- INT_VAR `fj_speaker_strref` to the speaker's name string reference (default -1; ONLY for PST);\n- STR_VAR `fj_dialog` to the region's dialogue file (ONLY for PST);\n- INT_VAR `fj_vertex_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair^*^;\n\nSpawn structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the spawn point's name^*^;\n- INT_VAR `fj_loc_x` to the spawning X coordinate^*^;\n- INT_VAR `fj_loc_y` to the spawning Y coordinate^*^;\n- STR_VAR `fj_cre_resref0` to the resource reference of each creature spawned (0-9)^*^;\n- INT_VAR `fj_spawn_num` to the count of spawn creatures^*^;\n- INT_VAR `fj_difficulty` to the base number of creatures to spawn (encounter difficulty)^*^;\n- INT_VAR `fj_delay` to the number of seconds between spawning (default 10);\n- INT_VAR `fj_method` to the spawn method;\n- INT_VAR `fj_duration` to the creature duration (default 1000);\n- INT_VAR `fj_wander_dist_spawn` to the creature's random walk distance limit (default 1000);\n- INT_VAR `fj_mvmt_dist_spawn` to the creature's movement distance limit (default 1000);\n- INT_VAR `fj_max_num` to the maximum number of creatures to spawn^*^;\n- INT_VAR `fj_enable` to the spawn point status (0=inactive, 1=active, default 1);\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_day_prob` to the spawn point daytime probability (default 100);\n- INT_VAR `fj_night_prob` to the spawn point nighttime probability (default 100);\n\nEntrance structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the entrance's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_orientation` to the facing direction (0-15 where 0=south, 4=west, 8=north, 12=east)^*^;\n\nContainer structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the container's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_type` to the container type (1=bag, 2=chest, 3=drawer, 4=pile, 5=table, 6=shelf, 7=altar, 8=nonvisible, 9=spellbook, 10=body, 11=barrel, 12=crate)^*^;\n- INT_VAR `fj_lock_diff` to the lock difficulty (default 100);\n- INT_VAR `fj_flags` to the bitwise container flags (bit0=locked, bit3=trap resets, bit5=disabled);\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove_diff` to the trap removal difficulty percentage (default 100);\n- INT_VAR `fj_trap_active` to whether the container is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_trap_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_trap_loc_y` to the trap launch Y coordinate^*^;\n- INT_VAR `fj_box_left` to the leftmost X coordinate of the trap's bounding box;\n- INT_VAR `fj_box_top` to the topmost Y coordinate of the trap's bounding box;\n- INT_VAR `fj_box_right` to the rightmost X coordinate of the trap's bounding box;\n- INT_VAR `fj_box_bottom` to the bottommost Y coordinate of the trap's bounding box;\n- STR_VAR `fj_trap_script` to the trap's script;\n- INT_VAR `fj_vertex_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair^*^;\n- STR_VAR `fj_key_resref` to the filename of the container's key;\n- INT_VAR `fj_lockpick_strref` to the lockpick string reference (default -1);\n\nItem structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the item's resource reference (filename)^*^;\n- INT_VAR `fj_con_itm_idx` to the index of the container to which the item is added^*^;\n- INT_VAR `fj_itm_expiry` to the item expiration time (default 0);\n- INT_VAR `fj_charge0` to the charges of the 1st ability (item quantity for stackables, default 0);\n- INT_VAR `fj_charge1` to the charges of the 2nd ability (default 0);\n- INT_VAR `fj_charge2` to the charges of the 3rd ability (default 0);\n- INT_VAR `fj_flags` to the bitwise item flags (bit0=identified, bit1=unstealable, bit2=stolen, bit3=undroppable, default 0);\n\nAmbient structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the ambient's name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_radius` to the sound radius (default 500);\n- INT_VAR `fj_loc_z` to the Z coordinate (height);\n- INT_VAR `fj_pitch_variance` to the pitch variance;\n- INT_VAR `fj_volume_variance` to the volume variance;\n- INT_VAR `fj_volume` to the volume percentage (default 80);\n- STR_VAR `fj_wav_resref0` to the resource reference of each sound (0-9)^*^;\n- INT_VAR `fj_sound_num` to the number of sounds^*^;\n- INT_VAR `fj_delay` to the base interval in seconds between sounds from this ambient list;\n- INT_VAR `fj_variation` to the base deviation from the base interval;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- INT_VAR `fj_flags` to the bitwise ambient flags^*^;\n\nVariable structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the variable's name^*^;\n- INT_VAR `fj_variable_value` to the variable's value^*^;\n\nDoor structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the door's name^*^;\n- STR_VAR `fj_door_wed_id` to the door ID linked to the .wed file^*^;\n- INT_VAR `fj_flags` to the bitwise door flags^*^;\n- INT_VAR `fj_open_box_left` to the leftmost X coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_top` to the topmost Y coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_right` to the rightmost X coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_open_box_bottom` to the bottommost Y coordinate of the open door's bounding box^*^;\n- INT_VAR `fj_closed_box_left` to the leftmost X coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_top` to the topmost Y coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_right` to the rightmost X coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_closed_box_bottom` to the bottommost Y coordinate of the closed door's bounding box^*^;\n- INT_VAR `fj_door_open_vert_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair of the open door^*^;\n- INT_VAR `fj_door_closed_vert_0` to (X coordinate + (Y coordinate << 16)) for each vertex pair of the closed door^*^;\n- INT_VAR `fj_cell_open_vert_0` to (X coordinate + (Y coordinate << 16)) for each impeded search map cell of the open door^*^;\n- INT_VAR `fj_cell_closed_vert_0` to (X coordinate + (Y coordinate << 16)) for each impeded search map cell of the closed door^*^;\n- STR_VAR `fj_door_open_wav` to the door open sound;\n- STR_VAR `fj_door_close_wav` to the door closed sound;\n- INT_VAR `fj_cursor_idx` to the door's mouse cursor index (from cursors.bam)^*^;\n- INT_VAR `fj_trap_detect` to the trap detection difficulty percentage;\n- INT_VAR `fj_trap_remove` to the trap removal difficulty percentage;\n- INT_VAR `fj_trap_active` to whether the door is trapped (0=no, 1=yes);\n- INT_VAR `fj_trap_status` to whether the trap is detected (0=no, 1=yes);\n- INT_VAR `fj_trap_loc_x` to the trap launch X coordinate^*^;\n- INT_VAR `fj_trap_loc_y` to the trap launch Y coordinate^*^;\n- STR_VAR `fj_key_resref` to the filename of the door's key;\n- STR_VAR `fj_door_script` to the door script;\n- INT_VAR `fj_detect_diff` to the detection difficulty (for secret doors);\n- INT_VAR `fj_locked_diff` to the lock difficulty;\n- INT_VAR `fj_open_loc_x` to the X coordinate for toggling the door's open state^*^;\n- INT_VAR `fj_open_loc_y` to the Y coordinate for toggling the door's open state^*^;\n- INT_VAR `fj_closed_loc_x` to the X coordinate for toggling the door's closed state^*^;\n- INT_VAR `fj_closed_loc_y` to the Y coordinate for toggling the door's closed state^*^;\n- INT_VAR `fj_lockpick_strref` to the lockpick string reference (default -1);\n- STR_VAR `fj_travel_trigger` to the travel region name^*^;\n- INT_VAR `fj_dlg_strref` to the dialogue string reference (default -1);\n- STR_VAR `fj_dlg_resref` to the door's dialogue file;\n\nAnimation structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the animation name^*^;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_schedule` to the hourly appearance schedule (bits 0-23, default -1 or always);\n- STR_VAR `fj_bam_resref` to the animation resource reference (filename)^*^;\n- INT_VAR `fj_bam_seq` to the BAM sequence number;\n- INT_VAR `fj_bam_frame` to the BAM frame number;\n- INT_VAR `fj_flags` to the bitwise animation flags^*^;\n- INT_VAR `fj_loc_z` to the height;\n- INT_VAR `fj_transparent` to the BAM transparency;\n- INT_VAR `fj_init_frame` to the starting frame;\n- INT_VAR `fj_loop_chance` to the chance of looping;\n- INT_VAR `fj_skip_cycles` to start delay in frames;\n- STR_VAR `fj_bmp_resref` to the palette bitmap;\n\nBitmask structure variables\\\":\\\"\n\n- STR_VAR `fj_bitmask` to path/to/binary.file ^*^;\n\nSonglist structure variables\\\":\\\"\n\n- INT_VAR `fj_song_day` to the day SONGLIST.2DA entry;\n- INT_VAR `fj_song_night` to the night SONGLIST.2DA entry;\n- INT_VAR `fj_song_victory` to the victory SONGLIST.2DA entry;\n- INT_VAR `fj_song_battle` to the battle SONGLIST.2DA entry;\n- INT_VAR `fj_song_defeat` to the defeat SONGLIST.2DA entry;\n- STR_VAR `fj_song_day0` to the day song WAV resref;\n- STR_VAR `fj_song_day1` to the night song WAV resref;\n- INT_VAR `fj_song_day_vol` to the day songs volume (default 100);\n- STR_VAR `fj_song_night0` to the night song WAV resref;\n- STR_VAR `fj_song_night1` to the second night song WAV resref;\n- INT_VAR `fj_song_night_vol` to the night songs volume (default 100);\n\nRest interrupt structure variables\\\":\\\"\n\n- STR_VAR `fj_name` to the name of the rest interrupts (for editor use only);\n- INT_VAR `fj_cre_strref0...fj_cre_strref9` to string displayed upon party ambush (default -1);\n- STR_VAR `fj_cre_resref0...fj_cre_resref9` to creature resref;\n- STR_VAR `fj_spawn_num` to the number of spawned attackers;\n- STR_VAR `fj_difficulty` to the difficulty of the encounter;\n- STR_VAR `fj_duration` to the creature's duration (default 1000);\n- STR_VAR `fj_wander_distance` to the creature's random walk distance limit (default 1000);\n- STR_VAR `fj_mvmt_distance` to the creature's movement distance limit (default 1000);\n- STR_VAR `fj_max_num` to maximum number of spawned creatures;\n- STR_VAR `fj_enable` to whether rest interrupts are enabled (0=no, 1=yes);\n- STR_VAR `fj_day_prob` to probability of daytime ambush;\n- STR_VAR `fj_night_prob` to probability of nightime ambush;\n\nMap note structure variables\\\":\\\"\n\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_note_strref` to the note string reference (default -1, BGII only)^*^;\n- STR_VAR `fj_note_text` to the note text (PST only)^*^;\n- INT_VAR `fj_strref_loc` to the strref location (0=external, 1=dialog.tlk, default 1);\n- INT_VAR `fj_color` to the map marker color (0-7);\n- INT_VAR `fj_note_id` to the note ID;\n\nProjectile trap structure variables (not available on PST)\\\":\\\"\n\n- STR_VAR `fj_name` to the projectile filename^*^;\n- INT_VAR `fj_eff_off` to the effect block offset;\n- INT_VAR `fj_eff_size` to the effect block size;\n- INT_VAR `fj_missile_num` to the missile.ids reference (projectl.ids - 1);\n- INT_VAR `fj_frequency` to the explosion length (in frames);\n- INT_VAR `fj_duration` to the number of explosions;\n- INT_VAR `fj_loc_x` to the X coordinate^*^;\n- INT_VAR `fj_loc_y` to the Y coordinate^*^;\n- INT_VAR `fj_loc_z` to the height;\n- INT_VAR `fj_target` to the target ID;\n- STR_VAR `fj_embedded_eff0` to path/to/v2.eff or eff resref containing to projectile's effects^*^;\n"
3732
+ }
3733
+ },
3734
+ "DIRECTORY_OF_FILESPEC": {
3735
+ "contents": {
3736
+ "kind": "markdown",
3737
+ "value": "```weidu-tp2-tooltip\nDIRECTORY_OF_FILESPEC\n```\nReturns the directory of a file specification. Compare to SOURCE_DIRECTORY. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable directory, or a warning will be raised.\n - RET `directory` returns the directory of the file specification."
3738
+ }
3739
+ },
3740
+ "EXT_OF_FILESPEC": {
3741
+ "contents": {
3742
+ "kind": "markdown",
3743
+ "value": "```weidu-tp2-tooltip\nEXT_OF_FILESPEC\n```\nReturns the resource extension of a file specification. Compare to SOURCE_EXT. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable resource extension, or a warning will be raised.\n - RET `ext` returns the resource extension of the file specification."
3744
+ }
3745
+ },
3746
+ "FILE_OF_FILESPEC": {
3747
+ "contents": {
3748
+ "kind": "markdown",
3749
+ "value": "```weidu-tp2-tooltip\nFILE_OF_FILESPEC\n```\nReturns the file of a file specification. Compare to SOURCE_FILE. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which may or may not include a directory.\n - RET `file` returns the file of the file specification."
3750
+ }
3751
+ },
3752
+ "FIND_FREE_PVRZ_INDEX": {
3753
+ "contents": {
3754
+ "kind": "markdown",
3755
+ "value": "```weidu-tp2-tooltip\ndimorphic function FIND_FREE_PVRZ_INDEX\n```\n\n---\n\nAttempt to find a contiguous block of free PVRZ indices in the game installation. This is a PATCH and an ACTION function.\nThis function attempts to find the first available free PVRZ index of a contiguous block which guarantees to fit at least `num_to_reserve` indices.\n\n| | | | |\n|-:|:-|:-|:-|\n|**INT**|**vars**|||\n|[int](https://ielib.bgforge.net/types/#int)|num_to_reserve|=&nbsp;1|&nbsp;&nbsp;the minimum required size of the contiguous block of free indices (1-999)|\n|[int](https://ielib.bgforge.net/types/#int)|start_index|=&nbsp;1000|&nbsp;&nbsp;the index the search should begin at|\n|**RET**|**vars**|||\n|[int](https://ielib.bgforge.net/types/#int)|free_index||&nbsp;&nbsp;the first available index matching the specified parameters, -1 on errors|"
3756
+ }
3757
+ },
3758
+ "GET_UNIQUE_FILE_NAME": {
3759
+ "contents": {
3760
+ "kind": "markdown",
3761
+ "value": "```weidu-tp2-tooltip\nGET_UNIQUE_FILE_NAME\n```\nCreates a file name that is currently unallocated. This is a PATCH and ACTION function. This function will create a filename using __ as a prefix. __ is reserved by The Bigg and writeable by anybody, as long as you dynamically create the file name (either by using this function or other code of your devising). The algorithm creates file names in base 36, going from __0000.ext to __zzzz.ext; this allows for 36 ^ 4 = 1679616 unique file names.\n To allow users to reinstall your mod without breaking the identity of these files, you can use the `base` parameter to ensure that the same thing will be mapped to the same file on reinstalls. For instance, if you're iterating through Mages to give each of them a spellbook, base should contain your modder prefix, an identifier for the purpose of the call, and the file name you're working on, for instance\":\" ~tb#spellbooks_%SOURCE_RES%~\n - STR_VAR `extension` to the desired extension (required).\n - STR_VAR `base` to a string unique to your mod and current file (optional).\n - RET `filename` the currently unallocated file name (sans the extension)."
3762
+ }
3763
+ },
3764
+ "NAME_NUM_OF_SPELL_RES": {
3765
+ "contents": {
3766
+ "kind": "markdown",
3767
+ "value": "```weidu-tp2-tooltip\nNAME_NUM_OF_SPELL_RES\n```\nConverts a spell resource name to a spell.ids reference. This is an ACTION and PATCH macro and function.\n - SPRINT `spell_res` to the resource name for the referenced spell.\n - RET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_name` to the IDS symbolic reference of a spell."
3768
+ }
3769
+ },
3770
+ "RES_NAME_OF_SPELL_NUM": {
3771
+ "contents": {
3772
+ "kind": "markdown",
3773
+ "value": "```weidu-tp2-tooltip\nRES_NAME_OF_SPELL_NUM\n```\nConverts a spell.ids reference to resource name. This is an ACTION and PATCH macro and function.\n - SET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_name` to the IDS symbolic reference of a spell.\n - RET `spell_res` to the resource name for the referenced spell."
3774
+ }
3775
+ },
3776
+ "RES_NUM_OF_SPELL_NAME": {
3777
+ "contents": {
3778
+ "kind": "markdown",
3779
+ "value": "```weidu-tp2-tooltip\nRES_NUM_OF_SPELL_NAME\n```\nConverts a spell.ids reference to resource name. This is an ACTION and PATCH macro and function.\n - SPRINT `spell_name` to the IDS symbolic reference of a spell.\n - RET `spell_num` to the IDS numerical reference of that spell.\n - RET `spell_res` to the resource name for the referenced spell."
3780
+ }
3781
+ },
3782
+ "RES_OF_FILESPEC": {
3783
+ "contents": {
3784
+ "kind": "markdown",
3785
+ "value": "```weidu-tp2-tooltip\nRES_OF_FILESPEC\n```\nReturns the resource name of a file specification. Compare to SOURCE_RES. This is an ACTION and PATCH function.\n - STR_VAR `filespec` to the file specification, which must include an identifiable resource name, or a warning will be raised.\n - RET `res` returns the resource name of the file specification."
3786
+ }
3787
+ },
3788
+ "SUBSTRING": {
3789
+ "contents": {
3790
+ "kind": "markdown",
3791
+ "value": "```weidu-tp2-tooltip\ndimorphic function SUBSTRING\n```\n\n---\n\nReturns a substring of the provided string. This is an ACTION and PATCH function. All integer variables default to 0.\nThe function will fail with an error if either `start` or `length` are negative or if any of `start`, `length` or the sum of the two is greater than the length of `string`.\n\n| | | | |\n|-:|:-|:-|:-|\n|**INT**|**vars**|||\n|[int](https://ielib.bgforge.net/types/#int)|start||&nbsp;&nbsp;the string index (0 based) from which the start of the substring should be read|\n|[int](https://ielib.bgforge.net/types/#int)|length||&nbsp;&nbsp;the length of the substring to be read|\n|**STR**|**vars**|||\n|[string](https://ielib.bgforge.net/types/#string)|string||&nbsp;&nbsp;the string the substring should be read from|\n|**RET**|**vars**|||\n|[string](https://ielib.bgforge.net/types/#string)|substring||&nbsp;&nbsp;the substring read from the provided string|"
3792
+ }
3793
+ },
3794
+ "READ_SOUNDSET": {
3795
+ "contents": {
3796
+ "kind": "markdown",
3797
+ "value": "```weidu-tp2-tooltip\nREAD_SOUNDSET\n```\nReads soundset of a creature and stores it as an array of string references This is an ACTION macro.\n - SPRINT `npc` to the target creature (with .cre extension)\n - SPRINT `soundset` to the name of soundset you want."
3798
+ }
3799
+ },
3800
+ "WRITE_SOUNDSET": {
3801
+ "contents": {
3802
+ "kind": "markdown",
3803
+ "value": "```weidu-tp2-tooltip\nWRITE_SOUNDSET\n```\nWrites soundset to all matching creatures. Regexp allowed. This is an ACTION macro.\n - SPRINT `npc` to a creature in question (with .cre extension)\n - SPRINT `soundset` to name of soundset you have.\n - SET `overwrite` to 2 if you want new soundset to overwrite the old one completely. Set it to 1 if you want to overwrite old string references only with non-empty new references (may keep some old). Set it to 0 it you want to overwrite only empty old references with new ones."
3804
+ }
3805
+ },
3806
+ "tb#fix_file_size": {
3807
+ "contents": {
3808
+ "kind": "markdown",
3809
+ "value": "```weidu-tp2-tooltip\ntb#fix_file_size\n```\nOverwrites all files matching a certain regexp with a certain standard file, if they are under a certain size.\n This is an ACTION macro.\n - SET `tb#fix_file_size_min` to the maximum allowed size (files whose size is exactly this value are NOT overwritten).\n - SPRINT `tb#fix_file_size_target` to the standard file used to replace file(s) that match the regexp.\n - SPRINT `tb#fix_file_size_category` to a descriptive name.\n - SPRINT `tb#fix_file_size_regexp` to the regexp for the file(s) to be checked for a match."
3810
+ }
3811
+ },
3812
+ "tb#factorial": {
3813
+ "contents": {
3814
+ "kind": "markdown",
3815
+ "value": "```weidu-tp2-tooltip\ntb#factorial\n```\nComputes the factorial of a number.\n This is a PATCH macro.\n - SET `tb#factorial_index` to the factorial you'd like to compute.\n - SET `tb#factorial_result` to 1;\n - The result is `tb#factorial_result`."
3816
+ }
3817
+ }
3818
+ }