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 pathPlayer.html
More file actions
292 lines (283 loc) · 13.6 KB
/
Player.html
File metadata and controls
292 lines (283 loc) · 13.6 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
The static global Player class contains representations of all players as colors, i.e. "White". This class has member variables and functions related to the Players' pointers, hands, blindfolds, etc. For example, to get a reference to Player White, use <font face="monospace">Player.White</font> or <font face="monospace">Player["White"]</font>. If a player is seated at color White, then <font face="monospace">Player.White.seated</font> will be <font face="monospace">true</font>.
<br /><a href="http://berserk-games.com/knowledgebase/player-colors/">List of Player Colors</a>
<a class="anchor" name="Member Variables"></a>
<table width="100%">
<caption><strong><h3>Member Variables</h3></strong></caption>
<tr>
<th class="table_column_rv">Type</th>
<th class="table_column_fn">Variable Name</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">admin</font></td>
<td><a class="anchor" name="admin"></a>Is the player currently promoted or hosting the game? Read only.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">blindfolded</font></td>
<td><a class="anchor" name="blindfolded"></a>Is the player blindfolded? Setting this will blindfold or remove the blindfold on the player.</td>
</tr>
<tr>
<td><font face="monospace">string</font></td>
<td><font face="monospace">color</font></td>
<td><a class="anchor" name="color"></a>The player's <a href="http://berserk-games.com/knowledgebase/player-colors/">player_color</a>. Read only.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">host</font></td>
<td><a class="anchor" name="host"></a> Is the player the host?</td>
</tr>
<tr>
<td><font face="monospace">float</font></td>
<td><font face="monospace">lift_height</font></td>
<td><a class="anchor" name="lift_height"></a>The player's lift height from 0 to 1.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">promoted</font></td>
<td><a class="anchor" name="promoted"></a>Is the player currently promoted?</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">seated</font></td>
<td><a class="anchor" name="seated"></a>Is the player currently seated at the table? Read only.</td>
</tr>
<tr>
<td><font face="monospace">string</font></td>
<td><font face="monospace">steam_id</font></td>
<td><a class="anchor" name="steam_id"></a>The player's Steam ID. Read only.</td>
</tr>
<tr>
<td><font face="monospace">string</font></td>
<td><font face="monospace">steam_name</font></td>
<td><a class="anchor" name="steam_name"></a>The player's Steam name. Read only.</td>
</tr>
<tr>
<td><font face="monospace">string</font></td>
<td><font face="monospace">team</font></td>
<td><a class="anchor" name="team"></a>The player's team. (None, Clubs, Diamonds, Hearts, Spades, Jokers)</td>
</tr>
</table>
<a class="anchor" name="Functions"></a>
<table width="100%">
<caption><strong><h3>Functions</h3></strong></caption>
<tr>
<th class="table_column_rv">Return Value</th>
<th class="table_column_fn">Function Name</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">attachCameraToObject(Table parameters)</font></td>
<td>
<a class="anchor" name="attachCameraToObject"></a>Makes a player's camera follow an <a href="http://berserk-games.com/knowledgebase/object">Object</a>.
<br />Parameters Table:
<br /><font face="monospace">
local parameters = {}<br />
parameters.object = <a href="http://berserk-games.com/knowledgebase/object">Object</a> object_to_attach_to<br />
parameters.offset = <a href="http://berserk-games.com/knowledgebase/vector">Vector</a> <font color="#3d8b40">--Optional</font><br />
</font>
</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">broadcast(string message)</font></td>
<td><a class="anchor" name="broadcast"></a>Broadcasts a message to the player. This also sends a message to the top center of the screen.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">broadcast(string message, <a href="http://berserk-games.com/knowledgebase/color/">Color</a>)</font></td>
<td><a class="anchor" name="broadcast"></a>Broadcasts a message to the player with <a href="http://berserk-games.com/knowledgebase/color/">Color</a>. This also sends a message to the top center of the screen.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">changeColor(<a href="http://berserk-games.com/knowledgebase/color/">Color</a>)</font></td>
<td><a class="anchor" name="changeColor"></a>Change the player to this <a href="http://berserk-games.com/knowledgebase/color/">Color</a>.</td>
</tr>
<tr>
<td><font face="monospace">int</font></td>
<td><font face="monospace">getHandCount()</font></td>
<td><a class="anchor" name="getHandCount"></a>Returns the number of hands that exist for this player color.</td>
</tr>
<tr>
<td><font face="monospace">Table</font></td>
<td><font face="monospace">getHandObjects(int hand_index = 1)</font></td>
<td><a class="anchor" name="getHandObjects"></a>Returns a Lua Table as a list of all the <a href="http://berserk-games.com/knowledgebase/object">Object</a> in the player's hand. hand_index lets get objects from a specific hand.</td>
</tr>
<tr>
<td><font face="monospace">Table</font></td>
<td><font face="monospace">getHandTransform(int hand_index = 1)</font></td>
<td><a class="anchor" name="getHandTransform"></a> Returns the Transform of the player's hand. hand_index lets you edit multiple hands of the same color.
<table>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>position</td>
<td>World position.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>rotation</td>
<td>World rotation.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>scale</td>
<td>Local scale.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>forward</td>
<td>Forward direction.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>right</td>
<td>Right direction.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>up</td>
<td>Up direction.</td>
</tr>
</table>
The directional vectors are a coordinate system taking into account the rotation of the player's hand. This is useful when you want to get a position right in front or next to a player's hand. See the <a href="http://steamcommunity.com/sharedfiles/filedetails/?id=620967608">BlackJack</a> example and how the cards are dealt and how the poker chips are spawned. Returns <font face="monospace">nil</font> if there is no player assigned to that color.
</td>
</tr>
<tr>
<td><font face="monospace">Table</font></td>
<td><font face="monospace">getHoldingObjects()</font></td>
<td><a class="anchor" name="getHoldingObjects"></a>Returns a Lua Table as a list of all the <a href="http://berserk-games.com/knowledgebase/object">Object</a> a player is holding.</td>
</tr>
<tr>
<td><font face="monospace"><a href="http://berserk-games.com/knowledgebase/object">Object</a></font></td>
<td><font face="monospace">getHoverObject()</font></td>
<td><a class="anchor" name="getHoverObject"></a>Returns the object that this player is hovering their pointer over.</td>
</tr>
<tr>
<td><font face="monospace"><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></font></td>
<td><font face="monospace">getPointerPosition()</font></td>
<td><a class="anchor" name="getPointerPosition"></a>Returns the position of the given player color's pointer. Returns <font face="monospace">nil</font> if the color there is no player assigned to that color.</td>
</tr>
<tr>
<td><font face="monospace">float</font></td>
<td><font face="monospace">getPointerRotation()</font></td>
<td><a class="anchor" name="getPointerRotation"></a>Returns the y-axis rotation of the given player color's pointer in degrees. This is also essentially the y-axis direction that the player's camera is facing. Returns <font face="monospace">nil</font> if there is no player assigned to that color.</td>
</tr>
<tr>
<td><font face="monospace">Table</font></td>
<td><font face="monospace">getSelectedObjects()</font></td>
<td><a class="anchor" name="getSelectedObjects"></a>Returns a Lua Table as a list of all the <a href="http://berserk-games.com/knowledgebase/object">Object</a> a player has selected.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">kick()</font></td>
<td><a class="anchor" name="kick"></a>Kicks a player.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">lookAt(Table parameters)</font></td>
<td>
<a class="anchor" name="lookAt"></a>Moves the Player's camera to look at a specific point. This function forces the Player into the third person mode.
<br />Parameters Table:
<br /><font face="monospace">
local parameters = {}<br />
parameters.position = <a href="http://berserk-games.com/knowledgebase/vector">Vector</a><br />
parameters.pitch = float pitch <font color="#3d8b40">--Optional</font><br />
parameters.yaw = float yaw <font color="#3d8b40">--Optional</font><br />
parameters.distance = float distance <font color="#3d8b40">--Optional</font><br />
</font>
</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">mute()</font></td>
<td><a class="anchor" name="mute"></a>Mutes a player so they cannot use voice chat. Call again to unmute.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">print(string message)</font></td>
<td><a class="anchor" name="print"></a>Prints a message to the player.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">print(string message, <a href="http://berserk-games.com/knowledgebase/color/">Color</a>)</font></td>
<td><a class="anchor" name="print"></a>Prints a message to the player with <a href="http://berserk-games.com/knowledgebase/color/">Color</a>.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">promote()</font></td>
<td><a class="anchor" name="promote"></a>Promotes a player. Call again to demote.</td>
</tr>
<tr>
<td><font face="monospace">bool</font></td>
<td><font face="monospace">setHandTransform(Table Transform, int hand_index = 1)</font></td>
<td><a class="anchor" name="setHandTransform"></a> Sets the Transform of the player's hand. hand_index lets you edit multiple hands of the same color.
<table>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>position</td>
<td>World position.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>rotation</td>
<td>World rotation.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>scale</td>
<td>Local scale.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>forward</td>
<td>Forward direction.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>right</td>
<td>Right direction.</td>
</tr>
<tr>
<td><a href="http://berserk-games.com/knowledgebase/vector">Vector</a></td>
<td>up</td>
<td>Up direction.</td>
</tr>
</table>
</td>
</tr>
</table>
<a class="anchor" name="Class Functions (Player.getSpectators())"></a>
<table width="100%">
<caption><strong><h3>Class Functions (Player.getSpectators())"</</h3></strong></caption>
<tr>
<th class="table_column_rv">Return Value</th>
<th class="table_column_fn">Function Name</th>
<th>Description</th>
</tr>
<tr>
<td><font face="monospace">Table</font></td>
<td><font face="monospace">getPlayers()</font></td>
<td>
<a class="anchor" name="getSpectators"></a>Returns a Table as list of all Players.</a>
</td>
</tr>
<tr>
<td><font face="monospace">Table</font></td>
<td><font face="monospace">getSpectators()</font></td>
<td>
<a class="anchor" name="getSpectators"></a>Returns a Table as list of spectator Players.</a>
</td>
</tr>
</table>