This repository was archived by the owner on Mar 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSpawnable Objects.html
More file actions
535 lines (529 loc) · 13 KB
/
Spawnable Objects.html
File metadata and controls
535 lines (529 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
Objects can be spawned from any script using the <a href="http://berserk-games.com/knowledgebase/api/#spawnObject"><font face="monospace">spawnObject()</font></a> function. The <font face="monospace">string type</font> in <a href="http://berserk-games.com/knowledgebase/api/#spawnObject"><font face="monospace">spawnObject()</font></a> should be one of the following:
<br />
<a href="#Custom_Objects">Spawning Custom Objects</a>
<br /><strong>Boards</strong>
<ul><li>backgammon_board</li>
<li>CardBot_Board</li>
<li>Checker_Board</li>
<li>Chess_Board</li>
<li>Chinese_Checkers_Board</li>
<li>Go_Board</li>
<li>Pachisi_Board</li>
<li>reversi_board</li>
</ul>
<br /><strong>Containers</strong>
<ul>
<li>Bag</li>
<li>Bowl</li>
<li>Cup</li>
<li>go_game_bowl_black</li>
<li>go_game_bowl_white</li>
<li>Infinite_Bag</li>
</ul>
<br /><a href="#Custom_Objects"><strong>Custom</strong></a>
<ul>
<li><a href="#Custom_Assetbundle">Custom_Board</a></li>
<li><a href="#Custom_Board">Custom_Board</a></li>
<li><a href="#Custom_Dice">Custom_Dice</a></li>
<li>DeckCustom <font color="#3d8b40">--Not implemented yet.</font></li>
<li><a href="#Figurine_Custom">Figurine_Custom</a></li>
<li><a href="#Custom_Model">Custom_Model</a></li>
<li><a href="#Custom_Tile">Custom_Tile</a></li>
<li><a href="#Custom_Token">Custom_Token</a></li>
</ul>
<br /><strong>Figurines</strong>
<ul>
<li>Figurine_Card_Bot</li>
<li>Figurine_Kimi_Kat</li>
<li>Figurine_Knil</li>
<li>Figurine_Mara</li>
<li>Figurine_Sir_Loin</li>
<li>Figurine_Zeke</li>
<li>Figurine_Zomblor</li>
</ul>
<br /><strong>Game Pieces</strong>
<ul>
<li>backgammon_piece_brown</li>
<li>backgammon_piece_white</li>
<li>BlockRectangle</li>
<li>BlockSquare</li>
<li>BlockTriangle</li>
<li>Card</li>
<li>Checker_black</li>
<li>Checker_red</li>
<li>Checker_white</li>
<li>Chess_Bishop</li>
<li>Chess_King</li>
<li>Chess_Knight</li>
<li>Chess_Pawn</li>
<li>Chess_Queen</li>
<li>Chess_Rook</li>
<li>Chinese_Checkers_Piece</li>
<li>Chip_10</li>
<li>Chip_50</li>
<li>Chip_100</li>
<li>Chip_500</li>
<li>Chip_1000</li>
<li>Deck</li>
<li>Die_4</li>
<li>Die_6</li>
<li>Die_6_Rounded</li>
<li>Die_8</li>
<li>Die_10</li>
<li>Die_12</li>
<li>Die_20</li>
<li>Die_Piecepack</li>
<li>Domino</li>
<li>go_game_piece_black</li>
<li>go_game_piece_white</li>
<li>Mahjong_Coin</li>
<li>Mahjong_Stick</li>
<li>Mahjong_Tile</li>
<li>Metal Ball</li>
<li>PiecePack_Arms</li>
<li>PiecePack_Crowns</li>
<li>PiecePack_Moons</li>
<li>PiecePack_Suns</li>
<li>PlayerPawn</li>
<li>Quarter</li>
<li>reversi_chip</li>
</ul>
<br /><strong>RPG Figures</strong>
<ul>
<li>rpg_BARGHEST</li>
<li>rpg_BASILISK</li>
<li>rpg_BEAR</li>
<li>rpg_BLACK_DRAGON</li>
<li>rpg_CENTAUR</li>
<li>rpg_CERBERUS</li>
<li>rpg_CHIMERA</li>
<li>rpg_CRASC</li>
<li>rpg_CYCLOP</li>
<li>rpg_DARKNESS_WARLORD</li>
<li>rpg_DRAGONIDE</li>
<li>rpg_EVIL_WATCHER</li>
<li>rpg_GHOUL</li>
<li>rpg_GIANT_VIPER</li>
<li>rpg_GOBLIN</li>
<li>rpg_GOLEM</li>
<li>rpg_GRIFFON</li>
<li>rpg_HYDRA</li>
<li>rpg_KNIGHT</li>
<li>rpg_KOBOLD</li>
<li>rpg_LIZARD_WARRIOR</li>
<li>rpg_MAGE</li>
<li>rpg_MANTICORA</li>
<li>rpg_MUMMY</li>
<li>rpg_OGRE</li>
<li>rpg_ORC</li>
<li>rpg_RANGER</li>
<li>rpg_RAT</li>
<li>rpg_SKELETON_KNIGHT</li>
<li>rpg_TEMPLATE</li>
<li>rpg_THIEF</li>
<li>rpg_TREE_ENT</li>
<li>rpg_TROLL</li>
<li>rpg_VAMPIRE</li>
<li>rpg_WARRIOR</li>
<li>rpg_WEREWOLF</li>
<li>rpg_WYVERN</li>
</ul>
<br /><strong>Tilesets</strong>
<ul>
<li>Tileset_Barrel</li>
<li>Tileset_Chair</li>
<li>Tileset_Chest</li>
<li>Tileset_Corner</li>
<li>Tileset_Floor</li>
<li>Tileset_Rock</li>
<li>Tileset_Table</li>
<li>Tileset_Tree</li>
<li>Tileset_Wall</li>
</ul>
<br /><strong>Tools</strong>
<ul>
<li>Calculator</li>
<li>Counter</li>
<li>Digital_Clock</li>
<li>Notecard</li>
<li>Tablet</li>
</ul>
<br /><strong>Triggers</strong>
<ul>
<li>ScriptingTrigger</li>
<li>FogOfWarTrigger</li>
</ul>
<br /><strong>Other</strong>
<ul>
<li>3DText</li>
</ul>
<a name="Custom_Objects"></a>
<h2>Spawning Custom Objects</h2>
Immediately after spawning a Custom Object, you should call <a href="http://berserk-games.com/knowledgebase/object/#setCustomObject"><font face="monospace">setCustomObject()</font></a> with the appropriate parameters as a Table for the type of Custom Object spawned.
<br />For example, to spawn a Custom Model:
<blockquote><font face="monospace">
obj_parameters = {}
obj_parameters.type = 'Custom_Model'
obj = spawnObject(obj_parameters)
custom = {}
custom.mesh = 'http://example.com/model.obj'
custom.diffuse = 'http://example.com/diffuse.png'
obj.setCustomObject(custom)
</font></blockquote>
<a name="Custom_Board"></a>
<table width="100%">
<caption><strong><h3>Custom Board</h3></strong></caption>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">string image</font></td>
<td>The image for the Custom Board. The Custom Board model will automatically scale to match the dimensions of the image.</td>
</tr>
</table>
<a name="Custom_Dice"></a>
<table width="100%">
<caption><strong><h3>Custom Dice</h3></strong></caption>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">string image</font></td>
<td>The image for the Custom Dice.</td>
</tr>
<tr>
<td><font face="monospace">int type</font></td>
<td>
<font color="#3d8b40">Optional.</font> The type of Custom Dice. This is typically the number of sides on the Dice. Defaults to 6-sided Dice.
<table>
<tr>
<th>Dice Type</th>
<th>Value</th>
</tr>
<tr>
<td>4-Sided</td>
<td>0</td>
</tr>
<tr>
<td>6-Sided</td>
<td>1</td>
</tr>
<tr>
<td>8-Sided</td>
<td>2</td>
</tr>
<tr>
<td>10-Sided</td>
<td>3</td>
</tr>
<tr>
<td>12-Sided</td>
<td>4</td>
</tr>
<tr>
<td>20-Sided</td>
<td>5</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Deck Custom -->
<a name="Figurine_Custom"></a>
<table width="100%">
<caption><strong><h3>Custom Figurine</h3></strong></caption>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">string image</font></td>
<td>The image for the Custom Figurine.</td>
</tr>
<tr>
<td><font face="monospace">string image_secondary</font></td>
<td><font color="#3d8b40">Optional.</font> The back image for the Custom Figurine.</td>
</tr>
</table>
<a name="Custom_Model"></a>
<table width="100%">
<caption><strong><h3>Custom Model</h3></strong></caption>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">string mesh</font></td>
<td>The mesh URL for the Custom Model.</td>
</tr>
<tr>
<td><font face="monospace">string diffuse</font></td>
<td>The diffuse image URL for the Custom Model.</td>
</tr>
<tr>
<td><font face="monospace">string normal</font></td>
<td><font color="#3d8b40">Optional.</font> The normals image URL for the Custom Model.</td>
</tr>
<tr>
<td><font face="monospace">string collider</font></td>
<td><font color="#3d8b40">Optional.</font> The collider mesh URL for the Custom Model. Defaults to a box collider.</td>
</tr>
<tr>
<td><font face="monospace">bool convex</font></td>
<td><font color="#3d8b40">Optional.</font> Is the Custom Model convex? Defaults to false.</td>
</tr>
<tr>
<td><font face="monospace">int type</font></td>
<td>
<font color="#3d8b40">Optional.</font> The type of the Custom Model. Defaults to Generic.
<table>
<tr>
<th>Type</th>
<th>Value</th>
</tr>
<tr>
<td>Generic</td>
<td>0</td>
</tr>
<tr>
<td>Figurine</td>
<td>1</td>
</tr>
<tr>
<td>Dice</td>
<td>2</td>
</tr>
<tr>
<td>Coin</td>
<td>3</td>
</tr>
<tr>
<td>Board</td>
<td>4</td>
</tr>
<tr>
<td>Chip</td>
<td>5</td>
</tr>
<tr>
<td>Bag</td>
<td>6</td>
</tr>
<tr>
<td>Infinite</td>
<td>7</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><font face="monospace">int material</font></td>
<td>
<font color="#3d8b40">Optional.</font> The material of the Custom Model. Defaults to Plastic.
<table>
<tr>
<th>Material</th>
<th>Value</th>
</tr>
<tr>
<td>Plastic</td>
<td>0</td>
</tr>
<tr>
<td>Wood</td>
<td>1</td>
</tr>
<tr>
<td>Metal</td>
<td>2</td>
</tr>
<tr>
<td>Cardboard</td>
<td>3</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><font face="monospace">float specular_intensity</font></td>
<td><font color="#3d8b40">Optional.</font> The specular intensity of the Custom Model. Defaults to 0.1.</td>
</tr>
<tr>
<td><font face="monospace">Table specular_color</font></td>
<td><font color="#3d8b40">Optional.</font> The specular color of the Custom Model. Color values are 0 to 1. Defaults to {1, 1, 1}.</td>
</tr>
<tr>
<td><font face="monospace">float specular_sharpness</font></td>
<td><font color="#3d8b40">Optional.</font> The specular sharpness of the Custom Model. Defaults to 3.</td>
</tr>
<tr>
<td><font face="monospace">float fresnel_strength</font></td>
<td><font color="#3d8b40">Optional.</font> The fresnel strength of the Custom Model. Defaults to 0.1.</td>
</tr>
<tr>
<td><font face="monospace">bool cast_shadows</font></td>
<td><font color="#3d8b40">Optional.</font> Should the Custom Model cast shadows? Defaults to true.</td>
</tr>
</table>
<a name="Custom_Tile"></a>
<table width="100%">
<caption><strong><h3>Custom Tile</h3></strong></caption>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">string image</font></td>
<td>The image for the Custom Tile.</td>
</tr>
<tr>
<td><font face="monospace">int type</font></td>
<td>
<font color="#3d8b40">Optional.</font> The type of the Custom Tile. This is the shape of the Custom Tile. Defaults to rectangle.
<table>
<tr>
<th>Tile Type</th>
<th>Value</th>
</tr>
<tr>
<td>Box</td>
<td>0</td>
</tr>
<tr>
<td>Hex</td>
<td>1</td>
</tr>
<tr>
<td>Round</td>
<td>2</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><font face="monospace">string image_bottom</font></td>
<td><font color="#3d8b40">Optional.</font> The bottom image for the Custom Tile. Defaults to the top image.</td>
</tr>
<tr>
<td><font face="monospace">float thickness</font></td>
<td><font color="#3d8b40">Optional.</font> The thickness of the Custom Tile. Defaults to 0.5.</td>
</tr>
<tr>
<td><font face="monospace">bool stackable</font></td>
<td><font color="#3d8b40">Optional.</font> Is this Custom Tile stackable? Defaults to false.</td>
</tr>
</table>
<a name="Custom_Token"></a>
<table width="100%">
<caption><strong><h3>Custom Token</h3></strong></caption>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">string image</font></td>
<td>The image for the Custom Token.</td>
</tr>
<tr>
<td><font face="monospace">float thickness</font></td>
<td><font color="#3d8b40">Optional.</font> The thickness of the Custom Token. Defaults to 0.2.</td>
</tr>
<tr>
<td><font face="monospace">float merge_distance</font></td>
<td><font color="#3d8b40">Optional.</font> How accurate the edges of the Custom Token are to the image. Defaults to 15.</td>
</tr>
<tr>
<td><font face="monospace">bool stackable</font></td>
<td><font color="#3d8b40">Optional.</font> Is this Custom Token stackable? Defaults to false.</td>
</tr>
</table>
<a name="Custom_Assetbundle"></a>
<table width="100%">
<caption><strong><h3>Custom AssetBundle</h3></strong></caption>
<tr>
<th>Parameter</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">string assetbundle</font></td>
<td>The assetbundle for the Custom AssetBundle.</td>
</tr>
<tr>
<td><font face="monospace">string assetbundle_secondary</font></td>
<td><font color="#3d8b40">Optional.</font> The secondary assetbundle for the Custom AssetBundle.</td>
</tr>
<tr>
<td><font face="monospace">int type</font></td>
<td>
<font color="#3d8b40">Optional.</font> The type of the Custom AssetBundle. Defaults to Generic.
<table>
<tr>
<th>Type</th>
<th>Value</th>
</tr>
<tr>
<td>Generic</td>
<td>0</td>
</tr>
<tr>
<td>Figurine</td>
<td>1</td>
</tr>
<tr>
<td>Dice</td>
<td>2</td>
</tr>
<tr>
<td>Coin</td>
<td>3</td>
</tr>
<tr>
<td>Board</td>
<td>4</td>
</tr>
<tr>
<td>Chip</td>
<td>5</td>
</tr>
<tr>
<td>Bag</td>
<td>6</td>
</tr>
<tr>
<td>Infinite</td>
<td>7</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><font face="monospace">int material</font></td>
<td>
<font color="#3d8b40">Optional.</font> The material of the Custom AssetBundle. Defaults to Plastic.
<table>
<tr>
<th>Material</th>
<th>Value</th>
</tr>
<tr>
<td>Plastic</td>
<td>0</td>
</tr>
<tr>
<td>Wood</td>
<td>1</td>
</tr>
<tr>
<td>Metal</td>
<td>2</td>
</tr>
<tr>
<td>Cardboard</td>
<td>3</td>
</tr>
</table>
</td>
</tr>
</table>