@tlua/gmod 1.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.
Files changed (278) hide show
  1. package/README.md +28 -0
  2. package/__metadata.json +4 -0
  3. package/_globals.d.tlua +178 -0
  4. package/_gmod-std.d.tlua +35 -0
  5. package/achievementicon.d.tlua +12 -0
  6. package/achievements.d.tlua +162 -0
  7. package/ai.d.tlua +65 -0
  8. package/ai_schedule.d.tlua +17 -0
  9. package/ai_task.d.tlua +17 -0
  10. package/angle.d.tlua +197 -0
  11. package/avatarimage.d.tlua +10 -0
  12. package/awesomium.d.tlua +14 -0
  13. package/baseclass.d.tlua +42 -0
  14. package/bf_read.d.tlua +110 -0
  15. package/bit.d.tlua +121 -0
  16. package/button.d.tlua +13 -0
  17. package/cam.d.tlua +220 -0
  18. package/ceffectdata.d.tlua +337 -0
  19. package/chat.d.tlua +62 -0
  20. package/checkbutton.d.tlua +14 -0
  21. package/cleanup.d.tlua +88 -0
  22. package/cluaemitter.d.tlua +119 -0
  23. package/clualocomotion.d.tlua +383 -0
  24. package/cluaparticle.d.tlua +426 -0
  25. package/cmovedata.d.tlua +476 -0
  26. package/cnavarea.d.tlua +845 -0
  27. package/cnavladder.d.tlua +209 -0
  28. package/cnewparticleeffect.d.tlua +259 -0
  29. package/color.d.tlua +339 -0
  30. package/concommand.d.tlua +69 -0
  31. package/constraint.d.tlua +311 -0
  32. package/construct.d.tlua +26 -0
  33. package/contentheader.d.tlua +32 -0
  34. package/contenticon.d.tlua +86 -0
  35. package/contentsidebar.d.tlua +45 -0
  36. package/contentsidebartoolbox.d.tlua +13 -0
  37. package/contextbase.d.tlua +37 -0
  38. package/controlpanel.d.tlua +140 -0
  39. package/controlpresets.d.tlua +118 -0
  40. package/convar.d.tlua +162 -0
  41. package/cookie.d.tlua +60 -0
  42. package/coroutine.d.tlua +90 -0
  43. package/crecipientfilter.d.tlua +152 -0
  44. package/csent.d.tlua +10 -0
  45. package/csoundpatch.d.tlua +150 -0
  46. package/ctakedamageinfo.d.tlua +366 -0
  47. package/ctrllistbox.d.tlua +12 -0
  48. package/ctrlnumpad.d.tlua +73 -0
  49. package/cusercmd.d.tlua +320 -0
  50. package/custom_classes.d.tlua +65 -0
  51. package/custom_entity_fields.d.tlua +96 -0
  52. package/cvars.d.tlua +80 -0
  53. package/dadjustablemodelpanel.d.tlua +81 -0
  54. package/dalphabar.d.tlua +27 -0
  55. package/dbinder.d.tlua +37 -0
  56. package/dbubblecontainer.d.tlua +18 -0
  57. package/dbutton.d.tlua +88 -0
  58. package/dcategoryheader.d.tlua +13 -0
  59. package/dcategorylist.d.tlua +11 -0
  60. package/dcheckbox.d.tlua +46 -0
  61. package/dcheckboxlabel.d.tlua +90 -0
  62. package/dcollapsiblecategory.d.tlua +240 -0
  63. package/dcolorbutton.d.tlua +73 -0
  64. package/dcolorcombo.d.tlua +54 -0
  65. package/dcolorcube.d.tlua +137 -0
  66. package/dcolormixer.d.tlua +303 -0
  67. package/dcolorpalette.d.tlua +294 -0
  68. package/dcolumnsheet.d.tlua +49 -0
  69. package/dcombobox.d.tlua +161 -0
  70. package/ddragbase.d.tlua +151 -0
  71. package/ddrawer.d.tlua +72 -0
  72. package/debug.d.tlua +236 -0
  73. package/debugoverlay.d.tlua +193 -0
  74. package/dentityproperties.d.tlua +63 -0
  75. package/derma.d.tlua +119 -0
  76. package/dexpandbutton.d.tlua +30 -0
  77. package/dfilebrowser.d.tlua +228 -0
  78. package/dform.d.tlua +176 -0
  79. package/dframe.d.tlua +261 -0
  80. package/dgrid.d.tlua +113 -0
  81. package/dhorizontaldivider.d.tlua +196 -0
  82. package/dhorizontalscroller.d.tlua +104 -0
  83. package/dhscrollbar.d.tlua +109 -0
  84. package/dhtml.d.tlua +91 -0
  85. package/dhtmlcontrols.d.tlua +62 -0
  86. package/diconbrowser.d.tlua +113 -0
  87. package/diconlayout.d.tlua +190 -0
  88. package/dimage.d.tlua +221 -0
  89. package/dimagebutton.d.tlua +103 -0
  90. package/dkillicon.d.tlua +9 -0
  91. package/dlabel.d.tlua +385 -0
  92. package/dlabeleditable.d.tlua +51 -0
  93. package/dlabelurl.d.tlua +100 -0
  94. package/dlistbox.d.tlua +82 -0
  95. package/dlistboxitem.d.tlua +42 -0
  96. package/dlistlayout.d.tlua +14 -0
  97. package/dlistview.d.tlua +360 -0
  98. package/dlistview_column.d.tlua +135 -0
  99. package/dlistview_columnplain.d.tlua +11 -0
  100. package/dlistview_draggerbar.d.tlua +11 -0
  101. package/dlistview_line.d.tlua +140 -0
  102. package/dlistviewheaderlabel.d.tlua +11 -0
  103. package/dlistviewlabel.d.tlua +11 -0
  104. package/dlistviewline.d.tlua +11 -0
  105. package/dmenu.d.tlua +266 -0
  106. package/dmenubar.d.tlua +42 -0
  107. package/dmenuoption.d.tlua +135 -0
  108. package/dmenuoptioncvar.d.tlua +64 -0
  109. package/dmodelpanel.d.tlua +207 -0
  110. package/dmodelselect.d.tlua +20 -0
  111. package/dmodelselectmulti.d.tlua +19 -0
  112. package/dnotify.d.tlua +93 -0
  113. package/dnumberscratch.d.tlua +284 -0
  114. package/dnumberwang.d.tlua +147 -0
  115. package/dnumpad.d.tlua +11 -0
  116. package/dnumslider.d.tlua +182 -0
  117. package/dpanel.d.tlua +152 -0
  118. package/dpanellist.d.tlua +109 -0
  119. package/dpaneloverlay.d.tlua +65 -0
  120. package/dpanelselect.d.tlua +13 -0
  121. package/dpanpanel.d.tlua +64 -0
  122. package/dprogress.d.tlua +27 -0
  123. package/dproperties.d.tlua +52 -0
  124. package/dproperty_boolean.d.tlua +12 -0
  125. package/dproperty_combo.d.tlua +31 -0
  126. package/dproperty_entity.d.tlua +12 -0
  127. package/dproperty_float.d.tlua +12 -0
  128. package/dproperty_generic.d.tlua +50 -0
  129. package/dproperty_int.d.tlua +12 -0
  130. package/dproperty_vectorcolor.d.tlua +14 -0
  131. package/dpropertysheet.d.tlua +167 -0
  132. package/dragndrop.d.tlua +123 -0
  133. package/draw.d.tlua +162 -0
  134. package/drgbpicker.d.tlua +49 -0
  135. package/drive.d.tlua +159 -0
  136. package/dscrollbargrip.d.tlua +13 -0
  137. package/dscrollpanel.d.tlua +110 -0
  138. package/dshape.d.tlua +72 -0
  139. package/dsizetocontents.d.tlua +46 -0
  140. package/dslider.d.tlua +302 -0
  141. package/dsprite.d.tlua +84 -0
  142. package/dtab.d.tlua +81 -0
  143. package/dtextentry.d.tlua +442 -0
  144. package/dtilelayout.d.tlua +218 -0
  145. package/dtooltip.d.tlua +76 -0
  146. package/dtree.d.tlua +185 -0
  147. package/dtree_node.d.tlua +793 -0
  148. package/dtree_node_button.d.tlua +13 -0
  149. package/duplicator.d.tlua +338 -0
  150. package/dverticaldivider.d.tlua +223 -0
  151. package/dvscrollbar.d.tlua +109 -0
  152. package/editablepanel.d.tlua +10 -0
  153. package/effect.d.tlua +121 -0
  154. package/effects.d.tlua +77 -0
  155. package/engine.d.tlua +248 -0
  156. package/entity.d.tlua +8295 -0
  157. package/ents.d.tlua +267 -0
  158. package/enums.d.tlua +7082 -0
  159. package/file.d.tlua +419 -0
  160. package/file_class.d.tlua +7 -0
  161. package/fingerposer.d.tlua +12 -0
  162. package/fingervar.d.tlua +13 -0
  163. package/frame.d.tlua +11 -0
  164. package/frame_blend.d.tlua +105 -0
  165. package/game.d.tlua +482 -0
  166. package/gameevent.d.tlua +968 -0
  167. package/gamemode.d.tlua +48 -0
  168. package/global.d.tlua +3156 -0
  169. package/gm.d.tlua +3218 -0
  170. package/gmod.d.tlua +20 -0
  171. package/gmsave.d.tlua +53 -0
  172. package/gui.d.tlua +232 -0
  173. package/gwen.d.tlua +55 -0
  174. package/halo.d.tlua +42 -0
  175. package/hammer.d.tlua +17 -0
  176. package/hook.d.tlua +64 -0
  177. package/html.d.tlua +22 -0
  178. package/http.d.tlua +72 -0
  179. package/iconeditor.d.tlua +130 -0
  180. package/igmodaudiochannel.d.tlua +419 -0
  181. package/imagecheckbox.d.tlua +48 -0
  182. package/imaterial.d.tlua +288 -0
  183. package/imesh.d.tlua +70 -0
  184. package/index.d.tlua +277 -0
  185. package/input.d.tlua +252 -0
  186. package/invalidateinternalentitycache.d.tlua +13 -0
  187. package/irestore.d.tlua +94 -0
  188. package/isave.d.tlua +94 -0
  189. package/itexture.d.tlua +108 -0
  190. package/ivideowriter.d.tlua +53 -0
  191. package/jit.d.tlua +243 -0
  192. package/killicon.d.tlua +84 -0
  193. package/label.d.tlua +20 -0
  194. package/language.d.tlua +26 -0
  195. package/list.d.tlua +112 -0
  196. package/makeballoon.d.tlua +15 -0
  197. package/markup.d.tlua +38 -0
  198. package/markupobject.d.tlua +53 -0
  199. package/material.d.tlua +9 -0
  200. package/math.d.tlua +899 -0
  201. package/matproxy.d.tlua +60 -0
  202. package/matselect.d.tlua +106 -0
  203. package/menu.d.tlua +20 -0
  204. package/menubar.d.tlua +39 -0
  205. package/mesh.d.tlua +183 -0
  206. package/modelimage.d.tlua +12 -0
  207. package/motionsensor.d.tlua +115 -0
  208. package/navmesh.d.tlua +274 -0
  209. package/net.d.tlua +639 -0
  210. package/nextbot.d.tlua +380 -0
  211. package/notification.d.tlua +35 -0
  212. package/npc.d.tlua +1787 -0
  213. package/numpad.d.tlua +89 -0
  214. package/os.d.tlua +56 -0
  215. package/package.d.tlua +15 -0
  216. package/package.json +18 -0
  217. package/panel.d.tlua +3650 -0
  218. package/panellist.d.tlua +13 -0
  219. package/pathfollower.d.tlua +301 -0
  220. package/permissions.d.tlua +77 -0
  221. package/physcollide.d.tlua +40 -0
  222. package/physenv.d.tlua +136 -0
  223. package/physobj.d.tlua +799 -0
  224. package/pixelvis_handle_t.d.tlua +9 -0
  225. package/player.d.tlua +3320 -0
  226. package/player_manager.d.tlua +147 -0
  227. package/preseteditor.d.tlua +13 -0
  228. package/presets.d.tlua +79 -0
  229. package/projectedtexture.d.tlua +553 -0
  230. package/properties.d.tlua +65 -0
  231. package/propselect.d.tlua +50 -0
  232. package/radiobutton.d.tlua +13 -0
  233. package/render.d.tlua +1700 -0
  234. package/resource.d.tlua +73 -0
  235. package/richtext.d.tlua +17 -0
  236. package/sandbox.d.tlua +576 -0
  237. package/saverestore.d.tlua +148 -0
  238. package/schedule.d.tlua +69 -0
  239. package/scripted_ents.d.tlua +124 -0
  240. package/search.d.tlua +26 -0
  241. package/serverlist.d.tlua +85 -0
  242. package/slidebar.d.tlua +12 -0
  243. package/slider.d.tlua +11 -0
  244. package/sound.d.tlua +140 -0
  245. package/spawnicon.d.tlua +95 -0
  246. package/spawnmenu.d.tlua +286 -0
  247. package/spawnmenucontentpanel.d.tlua +52 -0
  248. package/sql.d.tlua +154 -0
  249. package/stack.d.tlua +57 -0
  250. package/steamworks.d.tlua +208 -0
  251. package/string.d.tlua +535 -0
  252. package/structures.d.tlua +4442 -0
  253. package/surface.d.tlua +463 -0
  254. package/surfaceinfo.d.tlua +70 -0
  255. package/system.d.tlua +134 -0
  256. package/table.d.tlua +533 -0
  257. package/task.d.tlua +92 -0
  258. package/team.d.tlua +195 -0
  259. package/textentry.d.tlua +12 -0
  260. package/tgaimage.d.tlua +11 -0
  261. package/timer.d.tlua +198 -0
  262. package/tool.d.tlua +466 -0
  263. package/ugcpublishwindow.d.tlua +83 -0
  264. package/umsg.d.tlua +147 -0
  265. package/undo.d.tlua +122 -0
  266. package/urllabel.d.tlua +13 -0
  267. package/usermessage.d.tlua +48 -0
  268. package/utf8.d.tlua +89 -0
  269. package/util.d.tlua +1087 -0
  270. package/vector.d.tlua +413 -0
  271. package/vehicle.d.tlua +472 -0
  272. package/vgui.d.tlua +201 -0
  273. package/video.d.tlua +17 -0
  274. package/vmatrix.d.tlua +392 -0
  275. package/weapon.d.tlua +913 -0
  276. package/weapons.d.tlua +90 -0
  277. package/widgets.d.tlua +29 -0
  278. package/workshopfilebase.d.tlua +68 -0
@@ -0,0 +1,4442 @@
1
+ // AUTO-GENERATED tlua declarations. Do not edit by hand.
2
+
3
+ /**
4
+ * Table structure that describes a Source Engine ammo type.
5
+ *
6
+ *
7
+ * See [game.AddAmmoType](https://wiki.facepunch.com/gmod/game.AddAmmoType) and [game.GetAmmoData](https://wiki.facepunch.com/gmod/game.GetAmmoData).
8
+ *
9
+ * @realm shared
10
+ * @source https://wiki.facepunch.com/gmod/Structures/AmmoData
11
+ */
12
+ interface AmmoData {
13
+ /**
14
+ * Damage type using Enums/DMG.
15
+ *
16
+ * Related function is game.GetAmmoDamageType.
17
+ * @default `DMG_BULLET`
18
+ */
19
+ dmgtype: DMG;
20
+ /**
21
+ * The force of the ammo.
22
+ *
23
+ * Related function is game.GetAmmoForce.
24
+ * @default `1000`
25
+ */
26
+ force: number;
27
+ /**
28
+ * The maximum water splash size.
29
+ * @default `0`
30
+ */
31
+ maxsplash: number;
32
+ /**
33
+ * The minimum water splash size.
34
+ * @default `0`
35
+ */
36
+ minsplash: number;
37
+ /**
38
+ * Name of the ammo.
39
+ *
40
+ * Related functions are game.GetAmmoName and game.GetAmmoID.
41
+ */
42
+ name: string;
43
+ /**
44
+ * The damage dealt to NPCs.
45
+ *
46
+ * Related function is game.GetAmmoNPCDamage.
47
+ *
48
+ * Can also be a string with the name of a convar. The value will automatically update with the convar's.
49
+ *
50
+ * @default `10`
51
+ */
52
+ npcdmg: number;
53
+ /**
54
+ * The damage dealt to players.
55
+ *
56
+ * Related function is game.GetAmmoPlayerDamage.
57
+ *
58
+ * Can also be a string with the name of a convar. The value will automatically update with the convar's.
59
+ * @default `10`
60
+ */
61
+ plydmg: number;
62
+ /**
63
+ * Tracer type using Enums/TRACER.
64
+ * @default `TRACER_NONE`
65
+ */
66
+ tracer: TRACER;
67
+ /**
68
+ * Maximum amount of ammo of this type the player should be able to carry in reserve. `-2` makes this ammo type infinite.
69
+ *
70
+ * Related function is game.GetAmmoMax.
71
+ *
72
+ * Can also be a string with the name of a convar. The value will automatically update with the convar's.
73
+ * `gmod_maxammo` convar will override this value if set to above 0, **which it is by default**.
74
+ * @default `9999`
75
+ */
76
+ maxcarry: number;
77
+ /**
78
+ * Flags for the ammo type using Enums/AMMO.
79
+ * @default `0`
80
+ */
81
+ flags: AMMO;
82
+ }
83
+
84
+ /**
85
+ * Table used by various functions, such as [Entity:GetAttachment](https://wiki.facepunch.com/gmod/Entity:GetAttachment).
86
+ * @realm shared
87
+ * @source https://wiki.facepunch.com/gmod/Structures/AngPos
88
+ */
89
+ interface AngPos {
90
+ /**
91
+ * An Angle object.
92
+ */
93
+ Ang: Angle;
94
+ /**
95
+ * An Vector object.
96
+ */
97
+ Pos: Vector;
98
+ /**
99
+ * The bone ID the attachment point is parented to.
100
+ */
101
+ Bone: number;
102
+ }
103
+
104
+ /**
105
+ * Table used by panel animation methods, primarily [Panel:AnimationThinkInternal](https://wiki.facepunch.com/gmod/Panel:AnimationThinkInternal), and returned by [Panel:NewAnimation](https://wiki.facepunch.com/gmod/Panel:NewAnimation).
106
+ * @realm client
107
+ * @source https://wiki.facepunch.com/gmod/Structures/AnimationData
108
+ */
109
+ interface AnimationData {
110
+ /**
111
+ * The system time value returned by Global.SysTime when the animation starts/will start.
112
+ */
113
+ StartTime: number;
114
+ /**
115
+ * The system time value returned by Global.SysTime when the animation ends/will end.
116
+ */
117
+ EndTime: number;
118
+ /**
119
+ * The ease in/out level of the animation.
120
+ * @default `-1`
121
+ */
122
+ Ease: number;
123
+ /**
124
+ * The callback function that will be called upon completion of the animation.
125
+ *
126
+ *
127
+ *
128
+ * Function argument(s):
129
+ * * table `animData` - This structure.
130
+ * * Panel `tgtPanel` - The panel the animation was run on.
131
+ */
132
+ OnEnd: (animData: table, tgtPanel: Panel) => void;
133
+ /**
134
+ * The `think` function called every frame that will animate the panel object. This varies based on the animation. You can create a custom function for this if you aren't using the stock panel methods.
135
+ *
136
+ *
137
+ *
138
+ * Function argument(s):
139
+ * * table `animData` - This structure.
140
+ * * Panel `tgtPanel` - The panel the animation is being run on.
141
+ *
142
+ * The progress fraction of the animation, between 0 and 1. The change rate of this number will not be linear if you are easing.
143
+ */
144
+ Think: (animData: table, tgtPanel: Panel) => void;
145
+ /**
146
+ * The target position, or target translation of the panel object. Used by Panel:MoveTo and Panel:MoveBy respectively.
147
+ */
148
+ Pos: Vector;
149
+ /**
150
+ * The position of the panel object when the animation started. Used by Panel:MoveTo and Panel:MoveBy.
151
+ */
152
+ StartPos: Vector;
153
+ /**
154
+ * Whether to resize the panel horizontally or not. Only used by Panel:SizeTo.
155
+ */
156
+ SizeX: boolean;
157
+ /**
158
+ * Whether to resize the panel vertically or not. Only used by Panel:SizeTo.
159
+ */
160
+ SizeY: boolean;
161
+ /**
162
+ * The target size of the panel object. Only used by Panel:SizeTo.
163
+ * @default `(0, 0, 0)`
164
+ */
165
+ Size: Vector;
166
+ /**
167
+ * The size of the panel object when the animation started. Only used by Panel:SizeTo.
168
+ */
169
+ StartSize: Vector;
170
+ /**
171
+ * The target colour of the panel object. Only used by Panel:ColorTo.
172
+ */
173
+ Color: Color;
174
+ /**
175
+ * The colour of the panel object when the animation started. Only used by Panel:ColorTo.
176
+ */
177
+ StartColor: Color;
178
+ /**
179
+ * The target alpha (0-255) of the panel object. Only used by Panel:AlphaTo.
180
+ */
181
+ Alpha: number;
182
+ /**
183
+ * The alpha (0-255) of the panel object when the animation started. Only used by Panel:AlphaTo.
184
+ */
185
+ StartAlpha: number;
186
+ /**
187
+ * The speed to use for transitions when using linear interpolation (Lerp) animations. Only used by Panel:LerpPositions.
188
+ */
189
+ Speed: number;
190
+ /**
191
+ * Whether or not to use easing to make the panel 'jump' at its target, slowing as it approaches. Only used by Panel:LerpPositions.
192
+ */
193
+ UseGravity: boolean;
194
+ }
195
+
196
+ /**
197
+ * Table returned by [Entity:GetAttachments](https://wiki.facepunch.com/gmod/Entity:GetAttachments).
198
+ * @realm shared
199
+ * @source https://wiki.facepunch.com/gmod/Structures/AttachmentData
200
+ */
201
+ interface AttachmentData {
202
+ /**
203
+ * Index of the attachment.
204
+ */
205
+ id: number;
206
+ /**
207
+ * Name of the attachment.
208
+ */
209
+ name: string;
210
+ }
211
+
212
+ /**
213
+ * Table structure used as balloon spawn data. Default values are applied when the trace hits nothing. This data is required for correctly spawning the balloon.
214
+ *
215
+ * See [MakeBalloon](https://wiki.facepunch.com/gmod/MakeBalloon).
216
+ *
217
+ * @realm server
218
+ * @source https://wiki.facepunch.com/gmod/Structures/BalloonData
219
+ */
220
+ interface BalloonData {
221
+ /**
222
+ * Where the balloon will spawn.
223
+ * @default `Vector(0, 0, 0)`
224
+ */
225
+ Pos: Vector;
226
+ /**
227
+ * The balloon’s model.
228
+ * @default `models/error.mdl`
229
+ */
230
+ Model: string;
231
+ /**
232
+ * The balloon’s skin.
233
+ * @default `0`
234
+ */
235
+ Skin: number;
236
+ }
237
+
238
+ /**
239
+ * The tables that make up the values of the table returned by [Entity:GetBodyGroups](https://wiki.facepunch.com/gmod/Entity:GetBodyGroups).
240
+ *
241
+ * @realm shared
242
+ * @source https://wiki.facepunch.com/gmod/Structures/BodyGroupData
243
+ */
244
+ interface BodyGroupData {
245
+ /**
246
+ * The Body Group's ID.
247
+ * Body Group IDs start at `0`.
248
+ */
249
+ id: number;
250
+ /**
251
+ * The name of the Body Group.
252
+ */
253
+ name: string;
254
+ /**
255
+ * The number of Sub Models in this Body Group, and the length of the `submodels` table.
256
+ */
257
+ num: number;
258
+ /**
259
+ * A table of the names of the Sub Models within this Body Group.
260
+ * Sub Model IDs start at `0`.
261
+ */
262
+ submodels: string[];
263
+ }
264
+
265
+ /**
266
+ * A [table](https://wiki.facepunch.com/gmod/table) structure representing a single bone's orientation when its mesh is in its baseline (or "bind") pose before any animation is played.
267
+ *
268
+ * This structure does not contain the bone ID for the bone it represents and instead relies on the structure's index within the [table](https://wiki.facepunch.com/gmod/table) returned by [util.GetModelMeshes](https://wiki.facepunch.com/gmod/util.GetModelMeshes) to identify the bone it corresponds to.
269
+ *
270
+ * @realm shared
271
+ * @source https://wiki.facepunch.com/gmod/Structures/BoneBindPose
272
+ */
273
+ interface BoneBindPose {
274
+ /**
275
+ * The bone ID of this bone's parent bone.
276
+ */
277
+ parent: number;
278
+ /**
279
+ * A VMatrix containing this bone's position and rotation in local space relative to the model's origin.
280
+ */
281
+ matrix: VMatrix;
282
+ }
283
+
284
+ /**
285
+ * Structure used for storing/restoring bone manipulations.
286
+ * Data is stored from [Entity:GetManipulateBoneScale](https://wiki.facepunch.com/gmod/Entity:GetManipulateBoneScale), [Entity:GetManipulateBoneAngles](https://wiki.facepunch.com/gmod/Entity:GetManipulateBoneAngles), and [Entity:GetManipulateBonePosition](https://wiki.facepunch.com/gmod/Entity:GetManipulateBonePosition).
287
+ * Data is restored using [Entity:ManipulateBoneScale](https://wiki.facepunch.com/gmod/Entity:ManipulateBoneScale), [Entity:ManipulateBoneAngles](https://wiki.facepunch.com/gmod/Entity:ManipulateBoneAngles), and [Entity:ManipulateBonePosition](https://wiki.facepunch.com/gmod/Entity:ManipulateBonePosition).
288
+ *
289
+ * The function [duplicator.DoBoneManipulator](https://wiki.facepunch.com/gmod/duplicator.DoBoneManipulator) and [Structures/EntityCopyData](https://wiki.facepunch.com/gmod/Structures/EntityCopyData) use a table
290
+ * containing a BoneManipulationData structure for each bone (that has manipulations applied) with the bone ID as the struct index in the table.
291
+ *
292
+ * Fields **s**, **a**, and **p** are set if they don't equal **Vector( 1, 1, 1 )**, **Angle( 0, 0, 0 )**, and **Vector( 0, 0, 0 )** respectively.
293
+ *
294
+ * @realm shared
295
+ * @source https://wiki.facepunch.com/gmod/Structures/BoneManipulationData
296
+ */
297
+ interface BoneManipulationData {
298
+ /**
299
+ * The entity's scale manipulation of the bone.
300
+ * @default `nil`
301
+ */
302
+ s?: Vector;
303
+ /**
304
+ * The entity's angle manipulation of the bone.
305
+ * @default `nil`
306
+ */
307
+ a?: Angle;
308
+ /**
309
+ * The entity's position manipulation of the given bone.
310
+ * @default `nil`
311
+ */
312
+ p?: Vector;
313
+ }
314
+
315
+ /**
316
+ * A [table](https://wiki.facepunch.com/gmod/table) structure representing the amount that a bone's transformation [VMatrix](https://wiki.facepunch.com/gmod/VMatrix) should affect its vertex.
317
+ *
318
+ * A single vertex may have multiple BoneWeight structures affecting it, but each BoneWeight structure belongs to only one vertex.
319
+ *
320
+ * Added to the [Structures/MeshVertex](https://wiki.facepunch.com/gmod/Structures/MeshVertex) by [util.GetModelMeshes](https://wiki.facepunch.com/gmod/util.GetModelMeshes).
321
+ *
322
+ * To find a bone's transformation [VMatrix](https://wiki.facepunch.com/gmod/VMatrix), see [Entity:GetBoneMatrix](https://wiki.facepunch.com/gmod/Entity:GetBoneMatrix).
323
+ *
324
+ * @realm shared
325
+ * @source https://wiki.facepunch.com/gmod/Structures/BoneWeight
326
+ */
327
+ interface BoneWeight {
328
+ /**
329
+ * The ID of the bone affecting the vertex.
330
+ */
331
+ bone: number;
332
+ /**
333
+ * A percentage between `0` and `1` indicating how much influence this bone's VMatrix should have on the the vertex.
334
+ */
335
+ weight: number;
336
+ }
337
+
338
+ /**
339
+ * Tables used for bullets see [Entity:FireBullets](https://wiki.facepunch.com/gmod/Entity:FireBullets) and [GM:EntityFireBullets](https://wiki.facepunch.com/gmod/GM:EntityFireBullets).
340
+ * @realm shared
341
+ * @source https://wiki.facepunch.com/gmod/Structures/Bullet
342
+ */
343
+ interface Bullet {
344
+ /**
345
+ * The entity that should be reported as attacker. (eg. a player)
346
+ *
347
+ * By default this would be set to the entity Entity:FireBullets is called on.
348
+ * @default `self`
349
+ */
350
+ Attacker: Entity;
351
+ /**
352
+ * The entity that should be reported as inflictor eg. a weapon or something similar.
353
+ *
354
+ * Also defines CTakeDamageInfo:GetWeapon for Weapon.
355
+ * @default `NULL`
356
+ */
357
+ Inflictor: Entity;
358
+ /**
359
+ * Function to be called **after** the bullet was fired but **before** the damage is applied (the callback is called even if no damage is applied).
360
+ *
361
+ *
362
+ *
363
+ * Function argument(s):
364
+ * * Entity `attacker` -
365
+ * * table `tr` - See Structures/TraceResult
366
+ * * CTakeDamageInfo `dmgInfo` -
367
+ *
368
+ * Function return value(s):
369
+ * * table `undefined` -
370
+ * The return value can be a table with following keys:
371
+ * * boolean effects - `false` to not do any of the effects.
372
+ * * boolean damage - `false` to not do any damage.
373
+ *
374
+ *
375
+ *
376
+ *
377
+ * @default `nil`
378
+ */
379
+ Callback?: (attacker: Entity, tr: table, dmgInfo: CTakeDamageInfo) => table;
380
+ /**
381
+ * The damage dealt by the bullet.
382
+ *
383
+ * If set to `0`, it means the damage should be calculated from the ammo type's ConVars if the ammo type has `AMMO_INTERPRET_PLRDAMAGE_AS_DAMAGE_TO_PLAYER` flag set.
384
+ * See Structures/AmmoData.
385
+ *
386
+ * @default `1`
387
+ */
388
+ Damage: number;
389
+ /**
390
+ * The force of the bullets.
391
+ * @default `1`
392
+ */
393
+ Force: number;
394
+ /**
395
+ * Maximum distance the bullet can travel.
396
+ * @default `56756`
397
+ */
398
+ Distance: number;
399
+ /**
400
+ * The hull size of the bullet
401
+ *
402
+ * @default `0`
403
+ */
404
+ HullSize: number;
405
+ /**
406
+ * The amount of bullets to fire.
407
+ * @default `1`
408
+ */
409
+ Num: number;
410
+ /**
411
+ * Show tracer for every x bullets.
412
+ * @default `1`
413
+ */
414
+ Tracer: number;
415
+ /**
416
+ * The ammunition name.
417
+ *
418
+ * @default `<empty string>`
419
+ */
420
+ AmmoType: string;
421
+ /**
422
+ * The tracer name. You can find a list of default effects Default_Effects.
423
+ * @default `nil`
424
+ */
425
+ TracerName?: string;
426
+ /**
427
+ * The fire direction.
428
+ * @default `Vector( 0, 0, 0 )`
429
+ */
430
+ Dir: Vector;
431
+ /**
432
+ * The spread, only x and y are needed.
433
+ * @default `Vector( 0, 0, 0 )`
434
+ */
435
+ Spread: Vector;
436
+ /**
437
+ * The position to fire the bullets from.
438
+ * @default `Vector( 0, 0, 0 )`
439
+ */
440
+ Src: Vector;
441
+ /**
442
+ * The entity that the bullet will ignore when it will be shot.
443
+ * @default `NULL`
444
+ */
445
+ IgnoreEntity: Entity;
446
+ }
447
+
448
+ /**
449
+ * Table structure used [GM:CalcView](https://wiki.facepunch.com/gmod/GM:CalcView) and [GM:CalcVehicleView](https://wiki.facepunch.com/gmod/GM:CalcVehicleView) hook.
450
+ * @realm client
451
+ * @source https://wiki.facepunch.com/gmod/Structures/CamData
452
+ */
453
+ interface CamData {
454
+ /**
455
+ * The camera's position.
456
+ */
457
+ origin: Vector;
458
+ /**
459
+ * The camera's angles.
460
+ */
461
+ angles: Angle;
462
+ /**
463
+ * The camera's FOV.
464
+ */
465
+ fov: number;
466
+ /**
467
+ * Distance to near clipping plane.
468
+ */
469
+ znear: number;
470
+ /**
471
+ * Distance to far clipping plane.
472
+ */
473
+ zfar: number;
474
+ /**
475
+ * Set true to draw local players player model.
476
+ * @default `false`
477
+ */
478
+ drawviewer: boolean;
479
+ /**
480
+ * If set, enables orthographic mode. The table has following arguments:
481
+ * * number left.
482
+ * * number right.
483
+ * * number top.
484
+ * * number bottom.
485
+ *
486
+ * Each describes where their border starts, (`left`+`right`) and (`top`+`bottom`) should equal `0` to center on the view position.
487
+ *
488
+ * @default `nil`
489
+ */
490
+ ortho?: table;
491
+ }
492
+
493
+ /**
494
+ * Passed as argument of [ENTITY:PhysicsCollide](https://wiki.facepunch.com/gmod/ENTITY:PhysicsCollide), [EFFECT:PhysicsCollide](https://wiki.facepunch.com/gmod/EFFECT:PhysicsCollide) and used with [Entity:AddCallback](https://wiki.facepunch.com/gmod/Entity:AddCallback).
495
+ *
496
+ * **NOTE**: Sometimes, the value of `Speed` can be different from getting the length calculated from `OurOldVelocity`, even though they should be the same, or close to same. It's recommended to do `OurOldVelocity:Length()` instead.
497
+ *
498
+ * ```
499
+ * function ENT:PhysicsCollide( colData, collider )
500
+ * -- you may get two completely different values, and the second one should be more accurate.
501
+ * print(colData.Speed)
502
+ * print(colData.OurOldVelocity:Length())
503
+ * end
504
+ * ```
505
+ *
506
+ *
507
+ * @realm shared
508
+ * @source https://wiki.facepunch.com/gmod/Structures/CollisionData
509
+ */
510
+ interface CollisionData {
511
+ /**
512
+ * The collision position.
513
+ */
514
+ HitPos: Vector;
515
+ /**
516
+ * The other collision entity.
517
+ */
518
+ HitEntity: Entity;
519
+ /**
520
+ * The entity's velocity before the collision.
521
+ */
522
+ OurOldVelocity: Vector;
523
+ /**
524
+ * Other entity's physics object.
525
+ */
526
+ HitObject: PhysObj;
527
+ /**
528
+ * Time since the last collision with the `HitEntity`.
529
+ */
530
+ DeltaTime: number;
531
+ /**
532
+ * Speed of the other entity before the collision.
533
+ */
534
+ TheirOldVelocity: Vector;
535
+ /**
536
+ * The speed of the entity before the collision.
537
+ */
538
+ Speed: number;
539
+ /**
540
+ * Normal of the surface that hit the other entity.
541
+ */
542
+ HitNormal: Vector;
543
+ /**
544
+ * Entity's physics object.
545
+ */
546
+ PhysObject: PhysObj;
547
+ /**
548
+ * Surface Property ID of `this` entity.
549
+ */
550
+ OurSurfaceProps: number;
551
+ /**
552
+ * Surface Property ID of the entity we collided with.
553
+ */
554
+ TheirSurfaceProps: number;
555
+ /**
556
+ * The speed at which the impact happened.
557
+ */
558
+ HitSpeed: Vector;
559
+ /**
560
+ * Our new velocity after the impact.
561
+ */
562
+ OurNewVelocity: Vector;
563
+ /**
564
+ * The new velocity after the impact of the entity we collided with.
565
+ */
566
+ TheirNewVelocity: Vector;
567
+ /**
568
+ * Old angular velocity of this entity.
569
+ */
570
+ OurOldAngularVelocity: Vector;
571
+ /**
572
+ * Old angular velocity of the entity we collided with.
573
+ */
574
+ TheirOldAngularVelocity: Vector;
575
+ }
576
+
577
+ /**
578
+ * Table created by the [Global.Color](https://wiki.facepunch.com/gmod/Global.Color) function and used in various situations.
579
+ * @realm shared
580
+ * @source https://wiki.facepunch.com/gmod/Structures/Color
581
+ */
582
+ interface Color {
583
+ /**
584
+ * The red channel.
585
+ */
586
+ r: number;
587
+ /**
588
+ * The green channel.
589
+ */
590
+ g: number;
591
+ /**
592
+ * The blue channel.
593
+ */
594
+ b: number;
595
+ /**
596
+ * The alpha channel.
597
+ */
598
+ a: number;
599
+ }
600
+
601
+ /**
602
+ * Table that maintains information on the creation menu tabs. Each key of the table represents the name of the tab. See [spawnmenu.AddCreationTab](https://wiki.facepunch.com/gmod/spawnmenu.AddCreationTab) and [spawnmenu.GetCreationTabs](https://wiki.facepunch.com/gmod/spawnmenu.GetCreationTabs).
603
+ * @realm client
604
+ * @source https://wiki.facepunch.com/gmod/Structures/CreationMenus
605
+ */
606
+ interface CreationMenus {
607
+ /**
608
+ * The function used to generate the content of the tab.
609
+ *
610
+ *
611
+ * Function return value(s):
612
+ * * Panel `content` - A container panel that holds all of the content for the new tab.
613
+ */
614
+ Function: () => Panel;
615
+ /**
616
+ * The icon material that will accompany the title of the tab.
617
+ */
618
+ Icon: string;
619
+ /**
620
+ * The order in which a tab will be displayed relative to the other tabs.
621
+ */
622
+ Order: number;
623
+ /**
624
+ * The tooltip to be shown with the tab.
625
+ */
626
+ Tooltip: string;
627
+ }
628
+
629
+ /**
630
+ * Table returned by [os.date](https://wiki.facepunch.com/gmod/os.date) and used by [os.time](https://wiki.facepunch.com/gmod/os.time).
631
+ * @realm shared and menu
632
+ * @source https://wiki.facepunch.com/gmod/Structures/DateData
633
+ */
634
+ interface DateData {
635
+ /**
636
+ * Day of the month
637
+ */
638
+ day: number;
639
+ /**
640
+ * Hour
641
+ */
642
+ hour: number;
643
+ /**
644
+ * Daylight saving enabled
645
+ */
646
+ isdst: boolean;
647
+ /**
648
+ * Minute
649
+ */
650
+ min: number;
651
+ /**
652
+ * Month
653
+ * January: 1, December: 12
654
+ */
655
+ month: number;
656
+ /**
657
+ * Second
658
+ */
659
+ sec: number;
660
+ /**
661
+ * Day of the week
662
+ * Sunday: 1, Saturday: 7
663
+ */
664
+ wday: number;
665
+ /**
666
+ * Day of the year
667
+ */
668
+ yday: number;
669
+ /**
670
+ * Year
671
+ */
672
+ year: number;
673
+ }
674
+
675
+ /**
676
+ * Table returned by [debug.getinfo](https://wiki.facepunch.com/gmod/debug.getinfo).
677
+ *
678
+ * **NOTE**: If a filter is applied to [debug.getinfo](https://wiki.facepunch.com/gmod/debug.getinfo), some members may not exist!
679
+ *
680
+ *
681
+ * For functions defined in C/C++, the following members will always have the given values:
682
+ * * what = "C"
683
+ * * source = "[C]"
684
+ * * nparams = 0
685
+ * * isvararg = true
686
+ * * namewhat = ""
687
+ * * short_src = "[C]"
688
+ * * linedefined = -1
689
+ * * currentline = -1
690
+ * * lastlinedefined = -1
691
+ *
692
+ * @realm shared and menu
693
+ * @source https://wiki.facepunch.com/gmod/Structures/DebugInfo
694
+ */
695
+ interface DebugInfo {
696
+ /**
697
+ * Reference to the function that was passed in. If a stack level was specified, this will be the function at that stack level. 0 = debug.getinfo, 1 = function that called debug.getinfo, etc.
698
+ *
699
+ * **Option: f**
700
+ */
701
+ func: function;
702
+ /**
703
+ * The line where the function definiton starts (where "function" is located).
704
+ *
705
+ * **Option: S**
706
+ */
707
+ linedefined: number;
708
+ /**
709
+ * The line the function definition ended (where "end" is located).
710
+ *
711
+ * **Option: S**
712
+ */
713
+ lastlinedefined: number;
714
+ /**
715
+ * The path to the file where the passed function is defined prepended by an @ (ex. "@lua/autorun/mytestfile.lua"). This will be the Global.CompileString or Global.RunString identifier if the function wasn't defined in a file, also prepended by an @.
716
+ *
717
+ * **Option: S**
718
+ */
719
+ source: string;
720
+ /**
721
+ * The shortened name of the source (without the @). May be truncated if the source path is long.
722
+ *
723
+ * **Option: S**
724
+ */
725
+ short_src: string;
726
+ /**
727
+ * The language used. Either "Lua" or "C".
728
+ *
729
+ * **Option: S**
730
+ */
731
+ what: string;
732
+ /**
733
+ * The current line. This will be -1 if the code is not executed from a file.
734
+ *
735
+ * **Option: l** (lowercase L)
736
+ */
737
+ currentline: number;
738
+ /**
739
+ * The function name. This will be nil if the name cannot be found. Only works if stack level is passed rather than function pointer.
740
+ *
741
+ * **Option: n**
742
+ */
743
+ name: string;
744
+ /**
745
+ * The function "type". This will be "global", "local", "method", "field". Can also be an empty string if the function name could not be found. Only works if stack level is passed rather than function pointer.
746
+ *
747
+ * **Option: n**
748
+ */
749
+ namewhat: string;
750
+ /**
751
+ * Whether the function is variadic (has a `...` argument).
752
+ *
753
+ * **Option: u**
754
+ */
755
+ isvararg: boolean;
756
+ /**
757
+ * The number of arguments the function uses excluding varargs.
758
+ *
759
+ * **Option: u**
760
+ */
761
+ nparams: number;
762
+ /**
763
+ * Upvalue count. Max index that can be used with debug.getupvalue. C functions can have upvalues but they cannot be accessed from Lua.
764
+ *
765
+ * **Option: u**
766
+ */
767
+ nups: number;
768
+ /**
769
+ * A table of all the active lines in the function - that is, lines with code that actually does something (not blank lines or lines with comments only).
770
+ *
771
+ * The table keys will be line numbers, and their values will all be true. Lines that are inactive are simply not included in the table - they have the value nil.
772
+ *
773
+ * It doesn't check for activeline in subfunctions.
774
+ *
775
+ * **Option: L**
776
+ */
777
+ activelines: table;
778
+ }
779
+
780
+ /**
781
+ * Structure for [Global.DynamicLight](https://wiki.facepunch.com/gmod/Global.DynamicLight).
782
+ * All members are case insensitive.
783
+ *
784
+ * **NOTE**: This is an actual class named **dlight_t**, not a table.
785
+ *
786
+ *
787
+ * @realm client
788
+ * @source https://wiki.facepunch.com/gmod/Structures/DynamicLight
789
+ */
790
+ interface DynamicLight {
791
+ /**
792
+ * The brightness of the light.
793
+ */
794
+ brightness: number;
795
+ /**
796
+ * Fade out speed.
797
+ * Here's a formula for calculating Decay for your light: 1000 / fadeOutTimeInSeconds. For example setting decay to 1000 would fade out the light in 1 second, 2000 - 0.5 seconds.
798
+ */
799
+ decay: number;
800
+ /**
801
+ * Time after which light will be removed.
802
+ *
803
+ * This is relative to Global.CurTime. If you put in a value that is less than or equal to Global.CurTime, the light will not behave properly.
804
+ *
805
+ * Note, that it does not affect fading out. Light will be removed regardless of it being fully faded out or not.
806
+ */
807
+ dietime: number;
808
+ /**
809
+ * The light direction. Used with **InnerAngle** and **OuterAngle**.
810
+ * @default `Vector( 0, 0, 0 )`
811
+ */
812
+ dir: Vector;
813
+ /**
814
+ * The closer this is to zero, the smoother the light will be. Requires **Dir** and **OuterAngle** to be set.
815
+ * @default `0`
816
+ */
817
+ innerangle: number;
818
+ /**
819
+ * The angle of the Dynamic Light. Requires **Dir** to be set.
820
+ * @default `0`
821
+ */
822
+ outerangle: number;
823
+ /**
824
+ * The entity index the light belongs to. Set automatically by Global.DynamicLight. Probably don't touch it.
825
+ */
826
+ key: number;
827
+ /**
828
+ * Minimum light
829
+ * @default `0`
830
+ */
831
+ minlight: number;
832
+ /**
833
+ * Don't light the world. Has no effect for elights since they never light the world.
834
+ * @default `false`
835
+ */
836
+ noworld: boolean;
837
+ /**
838
+ * Don't light models
839
+ * @default `false`
840
+ */
841
+ nomodel: boolean;
842
+ /**
843
+ * Position of the light
844
+ */
845
+ pos: Vector;
846
+ /**
847
+ * Radius of the light
848
+ */
849
+ size: number;
850
+ /**
851
+ * Flicker style, see [this page](https://developer.valvesoftware.com/wiki/Light_dynamic#Appearances) for examples.
852
+ */
853
+ style: number;
854
+ /**
855
+ * The blue part of the color
856
+ */
857
+ b: number;
858
+ /**
859
+ * The green part of the color
860
+ */
861
+ g: number;
862
+ /**
863
+ * The red part of the color
864
+ */
865
+ r: number;
866
+ }
867
+
868
+ /**
869
+ * Information about the ENT structure, which represents a Scripted Entity class definition.
870
+ *
871
+ * To learn more about scripted entities, [see this page](https://wiki.facepunch.com/gmod/Scripted_Entities).
872
+ *
873
+ * See also [ENTITY Hooks](https://wiki.facepunch.com/gmod/ENTITY_Hooks) for a list of events scripted entities can have. See [Custom Entity Fields](https://wiki.facepunch.com/gmod/Custom_Entity_Fields) for a list of events and fields all entities can have.
874
+ *
875
+ * While some of the fields may be serverside or clientside only, it is recommended to provide them on both so addons could use their values.
876
+ *
877
+ * **NOTE**: Values defined in ENT table can't be changed per instance. Initialize default values in [ENTITY:Initialize](https://wiki.facepunch.com/gmod/ENTITY:Initialize) or other hook.
878
+ *
879
+ *
880
+ * @realm shared
881
+ * @source https://wiki.facepunch.com/gmod/Structures/ENT
882
+ */
883
+ interface ENT {
884
+ /**
885
+ * The base entity to derive from. This **must** be a valid Lua entity
886
+ */
887
+ Base: string;
888
+ /**
889
+ * Type of the entity. This **must** be one of these:
890
+ * * **anim**
891
+ * * **brush**
892
+ * * **point**
893
+ * * **ai**
894
+ * * **nextbot**
895
+ * * **filter**
896
+ *
897
+ * See Scripted Entities for a more detailed explanation of what each one is.
898
+ */
899
+ Type: string;
900
+ /**
901
+ * The class name of the entity (File or folder name of your entity).
902
+ * **This is set automatically _after_ the entity file is loaded.**
903
+ */
904
+ ClassName: string;
905
+ /**
906
+ * If set, overrides the classname of the SWEP.
907
+ */
908
+ ClassNameOverride: string;
909
+ /**
910
+ * The folder from where the entity was loaded. This should always be "entity/ent_myentity", regardless whether your entity is stored as a file, or multiple files in a folder. **This is set automatically _before_ the entity file is loaded.**
911
+ */
912
+ Folder: string;
913
+ /**
914
+ * Set this to true if your entity has animations. You should also apply changes to the ENTITY:Think function from the example on that page.
915
+ * @default `false`
916
+ */
917
+ AutomaticFrameAdvance: boolean;
918
+ /**
919
+ * Spawnmenu category to put the entity into
920
+ * @default `Other`
921
+ */
922
+ Category: string;
923
+ /**
924
+ * Whether this entity should be displayed and is spawnable in the spawn menu
925
+ * @default `false`
926
+ */
927
+ Spawnable: boolean;
928
+ /**
929
+ * Whether the entity supports Editing. See Editable Entities for more info.
930
+ * @default `false`
931
+ */
932
+ Editable: boolean;
933
+ /**
934
+ * Whether or not only admins can spawn the entity from their spawn menu
935
+ * @default `false`
936
+ */
937
+ AdminOnly: boolean;
938
+ /**
939
+ * Nice name of the entity to appear in the spawn menu
940
+ * @default ``
941
+ */
942
+ PrintName: string;
943
+ /**
944
+ * The author of the entity
945
+ * @default ``
946
+ */
947
+ Author: string;
948
+ /**
949
+ * The contacts of the entity creator
950
+ * @default ``
951
+ */
952
+ Contact: string;
953
+ /**
954
+ * The purpose of the entity creation
955
+ * @default ``
956
+ */
957
+ Purpose: string;
958
+ /**
959
+ * How to use your entity
960
+ * @default ``
961
+ */
962
+ Instructions: string;
963
+ /**
964
+ * The entity's render group, see Enums/RENDERGROUP. If unset, the engine will decide the render group based on the entity's model.
965
+ */
966
+ RenderGroup: number;
967
+ /**
968
+ * If set and `RenderGroup` is not, will switch the render group to Enums/RENDERGROUP#RENDERGROUP_BOTH when appropriate.
969
+ *
970
+ * Basically, when the default render group of the entity's model is opaque, ENTITY:DrawTranslucent will still be called, for example to render effects and such. This is preferable to forcing translucent models to render in the opaque pass by setting `RenderGroup` to `RENDERGROUP_BOTH` at all times, causing graphical issues.
971
+ * @default `false`
972
+ */
973
+ WantsTranslucency: boolean;
974
+ /**
975
+ * Disable the ability for players to duplicate this entity.
976
+ * @default `false`
977
+ */
978
+ DisableDuplicator: boolean;
979
+ /**
980
+ * Sets the spawnmenu content icon type for the entity, used by spawnmenu in the Sandbox-derived gamemodes.
981
+ * See spawnmenu.AddContentType for more information.
982
+ * @default ``
983
+ */
984
+ ScriptedEntityType: string;
985
+ /**
986
+ * If set, overrides the icon path to be displayed in the Spawnmenu for this entity.
987
+ *
988
+ * Like many functions, this expects a path relative to the `materials/` folder, do not include `materials/` in the provided string.
989
+ *
990
+ * @default `entities/<ClassName>.png`
991
+ */
992
+ IconOverride: string;
993
+ /**
994
+ * If set, a bitflag for the physics solidity of the entity. See Enums/CONTENTS.
995
+ *
996
+ * Can be used to make the entity pass though certain otherwise solid meshes, such as grates, or special clip brushes.
997
+ *
998
+ * This only works for `nextbot`, `anim` and `ai` type SENTs.
999
+ *
1000
+ * @default `nil`
1001
+ */
1002
+ PhysicsSolidMask?: number;
1003
+ /**
1004
+ * For `anim` type entities, if set, enables physics collision sounds.
1005
+ * @default `false`
1006
+ */
1007
+ PhysicsSounds: boolean;
1008
+ }
1009
+
1010
+ /**
1011
+ * Passed as argument of [GM:EntityEmitSound](https://wiki.facepunch.com/gmod/GM:EntityEmitSound).
1012
+ * @realm shared
1013
+ * @source https://wiki.facepunch.com/gmod/Structures/EmitSoundInfo
1014
+ */
1015
+ interface EmitSoundInfo {
1016
+ /**
1017
+ * The file path of the played sound.
1018
+ *
1019
+ * Sounds prefixed with ) tell the sound engine that it is a spatial sound; this allows the sound to emit from a specific location within the world.
1020
+ *
1021
+ * Sounds prefixed with ^ tell the sound engine that it is a distance based sound. The left channel of the .wav is the 'near' sound that will play when the sound originates close to you, and the right channel is the 'far' sound that will play when the sound originates far from you.
1022
+ */
1023
+ SoundName: string;
1024
+ /**
1025
+ * The original file path or soundscript name.
1026
+ *
1027
+ * Even if the SoundName value is changed, the OriginalSoundName value will remain the same.
1028
+ *
1029
+ * Sounds may be returned as soundscripts (for example, "Weapon_357.Single") instead of the sound's file path. You can use sound.GetProperties to retrieve the actual file path.
1030
+ */
1031
+ OriginalSoundName: string;
1032
+ /**
1033
+ * The time at which the sound should be played.
1034
+ *
1035
+ * If equal to 0 or CurTime(), the sound is played immediately. If greater than CurTime(), the sound is played with a delay. If less than CurTime(), part of the sound is skipped.
1036
+ * @default `0`
1037
+ */
1038
+ SoundTime: number;
1039
+ /**
1040
+ * The DSP (digital signal processing) preset applied to the sound.
1041
+ *
1042
+ * There are approximately 134 different presets defined by the Source engine between 0 and 133. These presets represent different types of 'rooms' or environments.
1043
+ *
1044
+ * DSP_Presets
1045
+ * @default `0`
1046
+ */
1047
+ DSP: number;
1048
+ /**
1049
+ * The sound's attenuation, a number between 0 (low) and 511 (high)
1050
+ *
1051
+ * This determines how fast the sound drops away. A higher value means the sound can be heard farther away.
1052
+ *
1053
+ * See Enums/SNDLVL.
1054
+ * @default `75`
1055
+ */
1056
+ SoundLevel: SNDLVL;
1057
+ /**
1058
+ * The pitch of the played sound, a number between 0 (low) and 255 (high), where 100 is the sound's original pitch.
1059
+ * @default `100`
1060
+ */
1061
+ Pitch: number;
1062
+ /**
1063
+ * The bit flags of the played sound. See Enums/SND for available options.
1064
+ * @default `0`
1065
+ */
1066
+ Flags: SND;
1067
+ /**
1068
+ * The sound's channel. See Enums/CHAN for available options.
1069
+ */
1070
+ Channel: CHAN;
1071
+ /**
1072
+ * The volume of the played sound, return as a decimal number between 0 (low) and 1 (high).
1073
+ */
1074
+ Volume: number;
1075
+ /**
1076
+ * The entity that played the sound.
1077
+ */
1078
+ Entity: Entity;
1079
+ /**
1080
+ * The origin of the played sound.
1081
+ */
1082
+ Pos: Vector;
1083
+ }
1084
+
1085
+ /**
1086
+ * Data structure used by the duplicator to store and load entity data. Created by
1087
+ * duplicator.CopyEntTable and loaded by duplicator.CreateEntityFromTable. When used
1088
+ * as input, only the construction fields are required.
1089
+ * @realm server
1090
+ * @source https://wiki.facepunch.com/gmod/Structures/EntityCopyData
1091
+ */
1092
+ interface EntityCopyData {
1093
+ /** The entity's class name, see Entity:GetClass. */
1094
+ Class: string;
1095
+ /** The entity's position, relative to the duplication origin point. */
1096
+ Pos?: Vector;
1097
+ /** The entity's angle, relative to the duplication angle. */
1098
+ Angle?: Angle;
1099
+ /** The entity's name, see Entity:GetName. */
1100
+ Name?: string;
1101
+ /** The entity's Network Vars, see ENTITY:SetupDataTables. */
1102
+ DT?: table;
1103
+ /** The entity's model, see Entity:GetModel. */
1104
+ Model?: string;
1105
+ /** The entity's model scale, see Entity:GetModelScale. */
1106
+ ModelScale?: number;
1107
+ /** The entity's active skin, see Entity:GetSkin. */
1108
+ Skin?: number;
1109
+ /** The entity's collision group. Uses the Enums/COLLISION_GROUP. */
1110
+ ColGroup?: number;
1111
+ /** The entity's collision bound minimums. */
1112
+ Mins?: Vector;
1113
+ /** The entity's collision bound maximums. */
1114
+ Maxs?: Vector;
1115
+ /** Data about the entity's PhysObjs. */
1116
+ PhysicsObjects?: table;
1117
+ /** The entity's Flex Scale, see Entity:GetFlexScale. */
1118
+ FlexScale?: number;
1119
+ /** Each flex bone's flex weight. */
1120
+ Flex?: table;
1121
+ /** The entity's body groups. */
1122
+ BodyG?: table;
1123
+ /** Bone manipulation data. */
1124
+ BoneManip?: table;
1125
+ /** The entity's MapCreationID, only exists for map-created entities. */
1126
+ MapCreationID?: number;
1127
+ /** Deprecated, always 0. See Entity:GetWorkshopID. */
1128
+ WorkshopID?: number;
1129
+ }
1130
+
1131
+
1132
+ /**
1133
+ * The table structure used for bullets that have already been fired.
1134
+ *
1135
+ * See [GM:PostEntityFireBullets](https://wiki.facepunch.com/gmod/GM:PostEntityFireBullets) for more information.
1136
+ *
1137
+ * @realm shared
1138
+ * @source https://wiki.facepunch.com/gmod/Structures/FiredBullet
1139
+ */
1140
+ interface FiredBullet {
1141
+ /**
1142
+ * The type of ammo that was fired.
1143
+ *
1144
+ * Should be one of the values from the game.GetAmmoTypes table.
1145
+ *
1146
+ * @default `<Empty String>`
1147
+ */
1148
+ AmmoType: string;
1149
+ /**
1150
+ * The Entity that fired the bullet.
1151
+ *
1152
+ * This is usually the Player that is holding the Weapon.
1153
+ */
1154
+ Attacker: Entity;
1155
+ /**
1156
+ * The amount of damage dealt by the bullet.
1157
+ *
1158
+ * When set to `0`, damage should be determined based on the values set in the Structures/AmmoData of the bullet's Ammo Type.
1159
+ */
1160
+ Damage: number;
1161
+ /**
1162
+ * The physics impact force of the bullet.
1163
+ */
1164
+ Force: number;
1165
+ /**
1166
+ * A whole integer number that controls the frequency of visible bullet tracers.
1167
+ *
1168
+ * A tracer will be fired once after this many non-tracer bullets have been fired.
1169
+ *
1170
+ * Set to `1` to always fire a tracer.
1171
+ */
1172
+ Tracer: number;
1173
+ /**
1174
+ * The Structures/TraceResult from the util.TraceLine that determined where and what the bullet hit.
1175
+ */
1176
+ Trace: TraceResult;
1177
+ }
1178
+
1179
+ /**
1180
+ * Used for [surface.CreateFont](https://wiki.facepunch.com/gmod/surface.CreateFont).
1181
+ * @realm client and menu
1182
+ * @source https://wiki.facepunch.com/gmod/Structures/FontData
1183
+ */
1184
+ interface FontData {
1185
+ /**
1186
+ * The font source. Custom font files are stored in `resource/fonts/`.
1187
+ *
1188
+ * The length is limited to 31 characters maximum.
1189
+ *
1190
+ * This must be the actual 'nice' font, not a file name. Unless the client is running Linux or macOS. ([Finding the Font Name](https://wiki.facepunch.com/gmod/Finding_the_Font_Name))
1191
+ *
1192
+ * This also cannot be an already registered font, i.e. you cannot base your font from any of the [Default Fonts](https://wiki.facepunch.com/gmod/Default_Fonts)
1193
+ * @default `Arial`
1194
+ */
1195
+ font: string;
1196
+ /**
1197
+ * Allow the font to display glyphs that are outside of the Latin-1 range. Unicode code points above 0xFFFF are not supported.
1198
+ * This currently has no effect on Linux, the value is capped at just 0xFF on the Linux client
1199
+ *
1200
+ * @default `false`
1201
+ */
1202
+ extended: boolean;
1203
+ /**
1204
+ * The font height in pixels
1205
+ *
1206
+ * `Range:` 4 - 255
1207
+ * @default `13`
1208
+ */
1209
+ size: number;
1210
+ /**
1211
+ * The font boldness
1212
+ * @default `500`
1213
+ */
1214
+ weight: number;
1215
+ /**
1216
+ * The strength of the font blurring
1217
+ *
1218
+ * `Range:` 0 - 80
1219
+ * @default `0`
1220
+ */
1221
+ blursize: number;
1222
+ /**
1223
+ * The "scanline" interval
1224
+ * Must be > 1 to work. This setting is per blursize per font - so if you create a font using "Arial" without scanlines, you cannot create an Arial font using scanlines with the same blursize
1225
+ * @default `0`
1226
+ */
1227
+ scanlines: number;
1228
+ /**
1229
+ * Smooth the font
1230
+ * @default `true`
1231
+ */
1232
+ antialias: boolean;
1233
+ /**
1234
+ * Add an underline to the font
1235
+ * @default `false`
1236
+ */
1237
+ underline: boolean;
1238
+ /**
1239
+ * Make the font italic
1240
+ * @default `false`
1241
+ */
1242
+ italic: boolean;
1243
+ /**
1244
+ * Add a strike through
1245
+ * @default `false`
1246
+ */
1247
+ strikeout: boolean;
1248
+ /**
1249
+ * Enables the use of symbolic fonts such as Webdings
1250
+ * @default `false`
1251
+ */
1252
+ symbol: boolean;
1253
+ /**
1254
+ * Seems to add a line in the middle of each letter
1255
+ * @default `false`
1256
+ */
1257
+ rotary: boolean;
1258
+ /**
1259
+ * Add shadow casting to the font
1260
+ * @default `false`
1261
+ */
1262
+ shadow: boolean;
1263
+ /**
1264
+ * Additive rendering
1265
+ * @default `false`
1266
+ */
1267
+ additive: boolean;
1268
+ /**
1269
+ * Add a black outline to the font.
1270
+ *
1271
+ * This does not work well with antialias, and only allows black 1-pixel outlines. It may be preferable to not use this parameter, and instead use draw.SimpleTextOutlined when drawing text that you want outlined.
1272
+ * @default `false`
1273
+ */
1274
+ outline: boolean;
1275
+ }
1276
+
1277
+ /**
1278
+ * Table created by the [string.FormattedTime](https://wiki.facepunch.com/gmod/string.FormattedTime) function if no format is given to it.
1279
+ * @realm shared and menu
1280
+ * @source https://wiki.facepunch.com/gmod/Structures/FormattedTime
1281
+ */
1282
+ interface FormattedTime {
1283
+ /**
1284
+ * milliseconds
1285
+ */
1286
+ ms: number;
1287
+ /**
1288
+ * seconds
1289
+ */
1290
+ s: number;
1291
+ /**
1292
+ * minutes
1293
+ */
1294
+ m: number;
1295
+ /**
1296
+ * hours
1297
+ */
1298
+ h: number;
1299
+ }
1300
+
1301
+ /**
1302
+ * Information about a gamemode.
1303
+ *
1304
+ * While some of the fields may be serverside or clientside only, it is recommended to provide them on both so addons could use their values.
1305
+ *
1306
+ * @realm shared
1307
+ * @source https://wiki.facepunch.com/gmod/Structures/GM
1308
+ */
1309
+ interface GM {
1310
+ /**
1311
+ * The fancy name of your gamemode.
1312
+ */
1313
+ Name: string;
1314
+ /**
1315
+ * The name/contact info of the gamemode author.
1316
+ */
1317
+ Author: string;
1318
+ /**
1319
+ * The contact email associated with the gamemode.
1320
+ */
1321
+ Email: string;
1322
+ /**
1323
+ * The website associated with the gamemode.
1324
+ */
1325
+ Website: string;
1326
+ /**
1327
+ * The name of the gamemode folder, automatically set.
1328
+ */
1329
+ FolderName: string;
1330
+ /**
1331
+ * The name of the gamemode folder prepended with "gamemodes/" (such as "gamemodes/sandbox"), automatically set.
1332
+ */
1333
+ Folder: string;
1334
+ /**
1335
+ * Set this to true if your gamemode is team-based. Used to enable/disable the base gamemode team system.
1336
+ */
1337
+ TeamBased: boolean;
1338
+ /**
1339
+ * The name of the gamemode folder prepended with "gamemode_" (such as "gamemode_sandbox"), automatically set.
1340
+ */
1341
+ ThisClass: string;
1342
+ /**
1343
+ * The table of the base gamemode to derive from, set automatically by Global.DeriveGamemode.
1344
+ *
1345
+ * It is recommended to use [Global.DEFINE_BASECLASS](https://wiki.facepunch.com/gmod/Global.DEFINE_BASECLASS) when referencing the gamemode's BaseClass to prevent unintended behavior
1346
+ *
1347
+ * [Global.DeriveGamemode](https://wiki.facepunch.com/gmod/Global.DeriveGamemode) modifies the main gamemode's BaseClass, which is shared with parent gamemodes. Because of this, in parent gamemodes the BaseClass can be incorrect, so for instance you need to use `self.BaseClass.BaseClass` in the 1st parent instead
1348
+ */
1349
+ BaseClass: table;
1350
+ /**
1351
+ * Whether the gamemode is Sandbox, or derived from Sandbox. This is not really part of the `GM` structure, and listed here only for convenience.
1352
+ */
1353
+ IsSandboxDerived: boolean;
1354
+ }
1355
+
1356
+ type HTTPRequestHeaderValue = string;
1357
+ type HTTPRequestHeaders = Table<string, HTTPRequestHeaderValue>;
1358
+
1359
+ type HTTPResponseHeaderValue = string;
1360
+ type HTTPResponseHeaders = Table<string, HTTPResponseHeaderValue>;
1361
+
1362
+ type HTTPRequestParameterValue = string | number | boolean;
1363
+ type HTTPRequestParameters = Table<string, HTTPRequestParameterValue>;
1364
+
1365
+ type HTTPRequestFailureCallback = (reason: string) => void;
1366
+ type HTTPRequestSuccessCallback = (code: number, body: string, headers: HTTPResponseHeaders) => void;
1367
+
1368
+ type HTTPRequestMethodWithParameters = "GET" | "POST" | "HEAD" | "get" | "post" | "head";
1369
+ type HTTPRequestMethodWithoutParameters = "PUT" | "DELETE" | "PATCH" | "OPTIONS" | "put" | "delete" | "patch" | "options";
1370
+ type HTTPRequestMethod = HTTPRequestMethodWithParameters | HTTPRequestMethodWithoutParameters;
1371
+
1372
+ /**
1373
+ * Table used by the Global.HTTP function. Common request fields shared by all
1374
+ * supported HTTP methods.
1375
+ * @realm shared
1376
+ * @realm menu
1377
+ * @source https://wiki.facepunch.com/gmod/Structures/HTTPRequest
1378
+ */
1379
+ interface HTTPRequest {
1380
+ /** Function to be called on failure. */
1381
+ failed?: HTTPRequestFailureCallback;
1382
+ /** Function to be called on success. */
1383
+ success?: HTTPRequestSuccessCallback;
1384
+ /** Request method, case insensitive. Default: `GET`. */
1385
+ method?: string;
1386
+ /** The target url. */
1387
+ url: string;
1388
+ /** KeyValue table for URL parameters. Valid only for `GET`, `POST`, and `HEAD`. */
1389
+ parameters?: HTTPRequestParameters;
1390
+ /** KeyValue table for headers. */
1391
+ headers?: HTTPRequestHeaders;
1392
+ /** Body string for request data. Supported by `POST`, `PUT`, `PATCH`, `DELETE`. */
1393
+ body?: string;
1394
+ /** Content type for body. Default: `text/plain; charset=utf-8`. */
1395
+ type?: string;
1396
+ /** The timeout for the connection. Default: `60`. */
1397
+ timeout?: number;
1398
+ }
1399
+
1400
+ /** `GET`, `POST`, and `HEAD` requests may include URL parameters. */
1401
+ interface HTTPRequestWithParameters extends HTTPRequest {
1402
+ method?: HTTPRequestMethodWithParameters;
1403
+ parameters?: HTTPRequestParameters;
1404
+ }
1405
+
1406
+ /** Methods that do not support the `parameters` field. */
1407
+ interface HTTPRequestWithoutParameters extends HTTPRequest {
1408
+ method: HTTPRequestMethodWithoutParameters;
1409
+ parameters: nil;
1410
+ }
1411
+
1412
+
1413
+ /**
1414
+ * Table used by util.TraceHull.
1415
+ * @realm shared
1416
+ * @source https://wiki.facepunch.com/gmod/Structures/HullTrace
1417
+ */
1418
+ interface HullTrace {
1419
+ /** The start position of the trace. */
1420
+ start: Vector;
1421
+ /** The end position of the trace. */
1422
+ endpos: Vector;
1423
+ /** The 3D vector local to the start/endpos with the highest values (upper bounds corner). */
1424
+ maxs: Vector;
1425
+ /** The 3D vector local to the start/endpos with the lowest (often negative) values (lower bounds corner). */
1426
+ mins: Vector;
1427
+ /**
1428
+ * Things the trace should not hit. Can be an entity, a table of entities, a
1429
+ * table of entity classes, a mixed table, or a function. Using a function
1430
+ * here is super slow; try to avoid it.
1431
+ */
1432
+ filter: any;
1433
+ /** The trace mask. Determines what the trace should and shouldn't hit. */
1434
+ mask?: MASK;
1435
+ /** The collision group. Determines what the trace should hit for the entity's collision group. */
1436
+ collisiongroup?: COLLISION_GROUP;
1437
+ /** Should the trace ignore world or not. */
1438
+ ignoreworld?: boolean;
1439
+ /** If set, the trace result is written to the supplied table instead of returning a new table. */
1440
+ output?: TraceResult | table;
1441
+ /** Turns the `filter` field into a whitelist, if it is a table. */
1442
+ whitelist?: boolean;
1443
+ /** Enables traces to hit clientside only entities. */
1444
+ hitclientonly?: boolean;
1445
+ }
1446
+
1447
+
1448
+ /**
1449
+ * Table structure used for [render.SetLocalModelLights](https://wiki.facepunch.com/gmod/render.SetLocalModelLights).
1450
+ * @realm client
1451
+ * @source https://wiki.facepunch.com/gmod/Structures/LocalLight
1452
+ */
1453
+ interface LocalLight {
1454
+ /**
1455
+ * The type of the light source, see Enums/MATERIAL_LIGHT.
1456
+ * @default `MATERIAL_LIGHT_POINT`
1457
+ */
1458
+ type: MATERIAL_LIGHT;
1459
+ /**
1460
+ * The color of the light source (x is red, y is green, z is blue). Values are not restricted to a specific range, higher values will result in a brighter light.
1461
+ * @default `vector_origin`
1462
+ */
1463
+ color: Vector;
1464
+ /**
1465
+ * The origin of the light in world coordinates.
1466
+ * @default `vector_origin`
1467
+ */
1468
+ pos: Vector;
1469
+ /**
1470
+ * The direction of the light. Only required for directional and spot lights.
1471
+ * @default `vector_origin`
1472
+ */
1473
+ dir: Vector;
1474
+ /**
1475
+ * The maximum range of the light source. Does not actually control light attenuation. Usually left at 0 for infinite range.
1476
+ * @default `0`
1477
+ */
1478
+ range: number;
1479
+ /**
1480
+ * Angular falloff exponent for spot lights. Higher values result in a sharper transition between the inner cone and the outer cone.
1481
+ * @default `5`
1482
+ */
1483
+ angularFalloff: number;
1484
+ /**
1485
+ * The inner cone angle for spot lights, in degrees. No angular falloff will occur inside that cone.
1486
+ * @default `45`
1487
+ */
1488
+ innerAngle: number;
1489
+ /**
1490
+ * The outer cone angle for spot lights, in degrees.
1491
+ * @default `45`
1492
+ */
1493
+ outerAngle: number;
1494
+ /**
1495
+ * The distance at which the light will fade to 50% of its brightness.
1496
+ */
1497
+ fiftyPercentDistance: number;
1498
+ /**
1499
+ * The distance at which the light will completely fade out.
1500
+ */
1501
+ zeroPercentDistance: number;
1502
+ /**
1503
+ * The quadratic term of the light falloff. This will only be used if fiftyPercentDistance and zeroPercentDistance are not supplied, and allows finer control over light attenuation.
1504
+ * @default `0`
1505
+ */
1506
+ quadraticFalloff: number;
1507
+ /**
1508
+ * The linear term of the light falloff. This will only be used if fiftyPercentDistance and zeroPercentDistance are not supplied, and allows finer control over light attenuation.
1509
+ * @default `0`
1510
+ */
1511
+ linearFalloff: number;
1512
+ /**
1513
+ * The constant term of the light falloff. This will only be used if fiftyPercentDistance and zeroPercentDistance are not supplied, and allows finer control over light attenuation.
1514
+ * @default `1`
1515
+ */
1516
+ constantFalloff: number;
1517
+ }
1518
+
1519
+ /**
1520
+ * Table structure used by [matproxy.Add](https://wiki.facepunch.com/gmod/matproxy.Add).
1521
+ * @realm client
1522
+ * @source https://wiki.facepunch.com/gmod/Structures/MatProxyData
1523
+ */
1524
+ interface MatProxyData {
1525
+ /**
1526
+ * The name of the material proxy
1527
+ */
1528
+ name: string;
1529
+ /**
1530
+ * The function used to get variables from the ".vmt". Called once per each ".vmt".
1531
+ *
1532
+ *
1533
+ *
1534
+ * Function argument(s):
1535
+ * * table `self` - The table structure itself
1536
+ * * string `name` - The material name
1537
+ * * table `values` - The material key values
1538
+ */
1539
+ init: (self: table, name: string, values: table) => void;
1540
+ /**
1541
+ * The function used to apply the proxy. This is called every frame while any materials with this proxy are used in world.
1542
+ *
1543
+ *
1544
+ *
1545
+ * Function argument(s):
1546
+ * * table `self` - The table structure itself.
1547
+ * * string `name` - The material name.
1548
+ * * Entity `ent` - The entity the material instance is applied to, if any.
1549
+ */
1550
+ bind: (self: table, name: string, ent: Entity) => void;
1551
+ }
1552
+
1553
+ /**
1554
+ * A [table](https://wiki.facepunch.com/gmod/table) structure representing the data stored by a single vertex of a mesh.
1555
+ *
1556
+ * MeshVertex structures are usually grouped together in sets of 3 to define the corners of a triangle.
1557
+ *
1558
+ * **NOTE**: Not all MeshVertex will contain all fields and not all fields are used by all shaders
1559
+ *
1560
+ * Information on the fields used by most Source Engine shaders (Like `VertexLitGeneric`, `UnlitGeneric`, etc.) can be found [on the Valve Developer Wiki here.](https://developer.valvesoftware.com/wiki/Category:Shaders)
1561
+ *
1562
+ *
1563
+ * Returned by:
1564
+ * * [util.GetModelMeshes](https://wiki.facepunch.com/gmod/util.GetModelMeshes)
1565
+ * * [PhysObj:GetMesh](https://wiki.facepunch.com/gmod/PhysObj:GetMesh)
1566
+ *
1567
+ * Used by:
1568
+ * * [IMesh:BuildFromTriangles](https://wiki.facepunch.com/gmod/IMesh:BuildFromTriangles)
1569
+ * * [Entity:PhysicsFromMesh](https://wiki.facepunch.com/gmod/Entity:PhysicsFromMesh) (only uses `pos` field)
1570
+ *
1571
+ * @realm shared
1572
+ * @source https://wiki.facepunch.com/gmod/Structures/MeshVertex
1573
+ */
1574
+ interface MeshVertex {
1575
+ /**
1576
+ * The Color that the area around this corner of a triangle should be tinted.
1577
+ */
1578
+ color: Color;
1579
+ /**
1580
+ * A normalized Vector representing a direction facing away from (perpendicular to) the surface of the triangle that this vertex is a part of.
1581
+ *
1582
+ * Many shaders use this to calculate lighting.
1583
+ */
1584
+ normal: Vector;
1585
+ /**
1586
+ * A normalized Vector representing a direction facing along (parallel with) the surface of the triangle that this vertex is a part of.
1587
+ */
1588
+ tangent: Vector;
1589
+ /**
1590
+ * A normalized Vector representing a direction facing away from (perpendicular to) both the vertex's normal and tangent directions.
1591
+ *
1592
+ * This is the result of a Vector:Cross between the vertex's normal and tangent directions.
1593
+ */
1594
+ binormal: Vector;
1595
+ /**
1596
+ * The position of the vertex in local space.
1597
+ */
1598
+ pos: Vector;
1599
+ /**
1600
+ * The horizontal coordinate of a position on the texture of the triangle that this vertex is a part of.
1601
+ * This controls which part of the texture is drawn at this vertex.
1602
+ *
1603
+ * In the range `0` (the texture's left edge) to `1` (the texture's right edge)
1604
+ */
1605
+ u: number;
1606
+ /**
1607
+ * The vertical coordinate of a position on the texture of the triangle that this vertex is a part of.
1608
+ * This controls which part of the texture is drawn at this vertex.
1609
+ *
1610
+ * In the range `0` (the texture's top edge) to `1` (the texture's bottom edge)
1611
+ */
1612
+ v: number;
1613
+ /**
1614
+ * A secondary U texture coordinate used by some shaders like `LightmappedGeneric`.
1615
+ *
1616
+ * Currently used exclusively by IMesh:BuildFromTriangles.
1617
+ */
1618
+ u1: number;
1619
+ /**
1620
+ * A secondary V texture coordinate used by some shaders like `LightmappedGeneric`.
1621
+ *
1622
+ * Currently used exclusively by IMesh:BuildFromTriangles.
1623
+ */
1624
+ v1: number;
1625
+ /**
1626
+ * A sequential table of four numbers whose purpose and expected values are determined by the shader.
1627
+ *
1628
+ * Many Source Engine shaders to hold tangent information of the vertex in the order `tangentX`, `tangentY`, `tangentZ`, `tangentHandedness`.
1629
+ */
1630
+ userdata: number[];
1631
+ /**
1632
+ * A sequential table of all the Structures/BoneWeight that affect this vertex.
1633
+ *
1634
+ * The total sum of their `weight` values should be `1`
1635
+ *
1636
+ * Currently added exclusively by util.GetModelMeshes
1637
+ */
1638
+ weights: table[];
1639
+ }
1640
+
1641
+ /**
1642
+ * Table returned by [util.GetModelInfo](https://wiki.facepunch.com/gmod/util.GetModelInfo).
1643
+ *
1644
+ * @realm shared
1645
+ * @source https://wiki.facepunch.com/gmod/Structures/ModelInfo
1646
+ */
1647
+ interface ModelInfo {
1648
+ /**
1649
+ * Identical to Entity:SkinCount.
1650
+ */
1651
+ SkinCount: number;
1652
+ /**
1653
+ * Valve key-value formatted info about the model's physics (Constraint Info, etc). This is limited to 4096 characters.
1654
+ *
1655
+ * This data can be parsed into a Lua table via util.KeyValuesToTablePreserveOrder
1656
+ */
1657
+ KeyValues: string;
1658
+ /**
1659
+ * Valve key-value formatted info about the model (`$keyvalues` command in the `.qc` of the model), if present.
1660
+ *
1661
+ * Can describe things like health of a prop, flammability, etc.
1662
+ */
1663
+ ModelKeyValues: string;
1664
+ /**
1665
+ * Number of meshes the model has. This could be 0 for animation only models.
1666
+ */
1667
+ MeshCount: number;
1668
+ /**
1669
+ * Number of bones the model has.
1670
+ */
1671
+ BoneCount: number;
1672
+ /**
1673
+ * Model flags. See [this page on Valve Developer Wiki](https://developer.valvesoftware.com/wiki/MDL#Model_flags) for explanation of each one.
1674
+ */
1675
+ Flags: number;
1676
+ /**
1677
+ * Whether the model is meant to be a static prop (checks a specific model flag)
1678
+ */
1679
+ StaticProp: boolean;
1680
+ /**
1681
+ * Number of materials used by this model.
1682
+ */
1683
+ MaterialCount: number;
1684
+ /**
1685
+ * Number of sequences the model has.
1686
+ */
1687
+ SequenceCount: number;
1688
+ /**
1689
+ * Number of attachments the model has.
1690
+ */
1691
+ AttachmentCount: number;
1692
+ /**
1693
+ * Name of the model, as embedded in the model file itself. This may be different from the model path of the model on disk.
1694
+ */
1695
+ ModelName: string;
1696
+ /**
1697
+ * Model version. This should be 48 most of the time, but can be different from mountable games.
1698
+ */
1699
+ Version: number;
1700
+ /**
1701
+ * Checksum (CRC32) of the model. This value should be identical across all files for the same model. (.vtx, .mdl, .vvd, etc.)
1702
+ */
1703
+ Checksum: number;
1704
+ /**
1705
+ * Name of the surface property for this model. See util.GetSurfaceData for more details about what they are.
1706
+ */
1707
+ SurfacePropName: string;
1708
+ /**
1709
+ * If present, position of the eyes of the model, for NPCs.
1710
+ */
1711
+ EyePosition: Vector;
1712
+ /**
1713
+ * Illumination position for the model, for cases where the model root would be potentially outside of the world.
1714
+ */
1715
+ IllumPosition: Vector;
1716
+ /**
1717
+ * Mins of the model's bounding box.
1718
+ */
1719
+ HullMin: Vector;
1720
+ /**
1721
+ * Maxs of the model's bounding box.
1722
+ */
1723
+ HullMax: Vector;
1724
+ /**
1725
+ * A list of attachments the model has.
1726
+ *
1727
+ * Each attachment is a table with the following info:
1728
+ * * Name
1729
+ * * Bone
1730
+ * * Offset
1731
+ */
1732
+ Attachments: table[];
1733
+ /**
1734
+ * A list of bones the model has. Please node that the keys of this table are **not** bone IDs, it's just a list, but it might be safe to assume the keys are (BoneID-1) due to Lua table indexes starting at 1..
1735
+ *
1736
+ * Each bone in the list has the following fields:
1737
+ * * Name
1738
+ * * Parent
1739
+ * * Flags
1740
+ * * PhysObj
1741
+ * * SurfacePropName
1742
+ * * Position
1743
+ * * Angle
1744
+ */
1745
+ Bones: table[];
1746
+ /**
1747
+ * A list of sequences the model has, including the ones from `$includemodel`s.
1748
+ *
1749
+ * Each sequence is a table with the following info:
1750
+ * * string Name
1751
+ * * string Activity
1752
+ * * number ActivityID
1753
+ * * number ActivityWeight
1754
+ * * table Events
1755
+ *
1756
+ * `Events` table is a list of tables with following members:
1757
+ * * number Cycle
1758
+ * * number Event
1759
+ * * string Name
1760
+ * * number Type
1761
+ * * string Options
1762
+ */
1763
+ Sequences: table[];
1764
+ /**
1765
+ * A list of materials the model uses, across all its meshes.
1766
+ */
1767
+ Materials: string[];
1768
+ /**
1769
+ * A list of folders the game will look in for the **Materials**.
1770
+ */
1771
+ MaterialDirectories: string[];
1772
+ /**
1773
+ * Number of other models this model includes for their animations.
1774
+ */
1775
+ IncludeModelCount: number;
1776
+ /**
1777
+ * The list of models this model includes for their animations.
1778
+ */
1779
+ IncludeModels: string[];
1780
+ /**
1781
+ * A list of hitbox sets this model has. Each hitbox set has the following structure:
1782
+ * * Name
1783
+ * * Count
1784
+ * * HitBoxes - a table of hitboxes within this set
1785
+ *
1786
+ * Each hitbox has the following format:
1787
+ * * Mins
1788
+ * * Maxs
1789
+ * * Bone
1790
+ */
1791
+ HitBoxSets: table[];
1792
+ }
1793
+
1794
+ /**
1795
+ * A [table](https://wiki.facepunch.com/gmod/table) structure containing the information required to create a mesh.
1796
+ *
1797
+ * Returned by [util.GetModelMeshes](https://wiki.facepunch.com/gmod/util.GetModelMeshes)
1798
+ *
1799
+ * @realm shared
1800
+ * @source https://wiki.facepunch.com/gmod/Structures/ModelMeshData
1801
+ */
1802
+ interface ModelMeshData {
1803
+ /**
1804
+ * The name or path of this mesh's material.
1805
+ */
1806
+ material: string;
1807
+ /**
1808
+ * A sequential table of Structures/MeshVertex that represents the triangles of this mesh.
1809
+ *
1810
+ * These triangles are created from the contents of the `verticies` field.
1811
+ *
1812
+ * This can be used as an input to IMesh:BuildFromTriangles
1813
+ */
1814
+ triangles: table[];
1815
+ /**
1816
+ * A sequential table of Structures/MeshVertex that represents each vertex of the mesh.
1817
+ *
1818
+ *
1819
+ * This field has a typo in its name and should be named "vertices"
1820
+ */
1821
+ verticies: table[];
1822
+ }
1823
+
1824
+ /**
1825
+ * Information about the NPC data structure, used to define spawnable NPCs for the Sandbox gamemode.
1826
+ *
1827
+ * Example usage:
1828
+ * ```
1829
+ * list.Set( "NPC", "npc_tf2_ghost", {
1830
+ * Name = "Example NPC",
1831
+ * Class = "npc_tf2_ghost",
1832
+ * Category = "Nextbot"
1833
+ * } )
1834
+ * ```
1835
+ *
1836
+ * @realm shared
1837
+ * @source https://wiki.facepunch.com/gmod/Structures/NPCData
1838
+ */
1839
+ interface NPCData {
1840
+ /**
1841
+ * The nice name of the NPC for UI display.
1842
+ */
1843
+ Name: string;
1844
+ /**
1845
+ * Class name of the entity to spawn.
1846
+ */
1847
+ Class: string;
1848
+ /**
1849
+ * Spawnmenu category to put the NPCinto.
1850
+ * @default `Other`
1851
+ */
1852
+ Category: string;
1853
+ /**
1854
+ * A list of weapons this NPC is typically meant to use. One will be picked on spawn at random, unless overwritten by the player.
1855
+ * @default `{}`
1856
+ */
1857
+ Weapons: table;
1858
+ /**
1859
+ * Key-value pairs to apply to the NPC on spawn. See Entity:SetKeyValue.
1860
+ * @default `{}`
1861
+ */
1862
+ KeyValues: table;
1863
+ /**
1864
+ * Model override for this NPC.
1865
+ * @default `nil`
1866
+ */
1867
+ Model?: string;
1868
+ /**
1869
+ * Additional spawnflags for this NPC. See Entity:GetSpawnFlags.
1870
+ *
1871
+ * Ignored if `TotalSpawnFlags` key is present.
1872
+ * @default `0`
1873
+ */
1874
+ SpawnFlags: number;
1875
+ /**
1876
+ * Total spawnflags override for this NPC.
1877
+ * @default `nil`
1878
+ */
1879
+ TotalSpawnFlags?: number;
1880
+ /**
1881
+ * If set to `true`, this NPC can only be spawned on the ceiling. Stacks with `OnFloor`.
1882
+ * @default `false`
1883
+ */
1884
+ OnCeiling: boolean;
1885
+ /**
1886
+ * If set to `true`, this NPC can only be spawned on the floor. Stacks with `OnCeiling`.
1887
+ * @default `false`
1888
+ */
1889
+ OnFloor: boolean;
1890
+ /**
1891
+ * Offset, in Hammer units, away from the surface where the player is looking at for the NPC spawn position.
1892
+ * @default `0`
1893
+ */
1894
+ Offset: number;
1895
+ /**
1896
+ * Material override for this NPC. See Entity:SetMaterial.
1897
+ * @default ``
1898
+ */
1899
+ Material: string;
1900
+ /**
1901
+ * Skin override for the NPC. See Entity:SetSkin.
1902
+ * @default `nil`
1903
+ */
1904
+ Skin?: number;
1905
+ /**
1906
+ * If set to `true`, do not try to teleport the NPC to the ground.
1907
+ * @default `false`
1908
+ */
1909
+ NoDrop: boolean;
1910
+ /**
1911
+ * Used to add additional rotation the NPC post spawn. Usually all NPCs would be facing the player on spawn. Value of `Angle( 0, 180, 0 )` would make the NPC face away from the player.
1912
+ * @default `Angle( 0, 0, 0 )`
1913
+ */
1914
+ Rotate: Angle;
1915
+ /**
1916
+ * Health override for this NPC. Also sets Entity:SetMaxHealth.
1917
+ * @default `nil`
1918
+ */
1919
+ Health?: number;
1920
+ /**
1921
+ * If set, a function to be called when the NPC is pasted using the duplicator library.
1922
+ * @default `nil`
1923
+ */
1924
+ OnDuplicated?: function;
1925
+ }
1926
+
1927
+ /**
1928
+ * The structure used by [Vehicle:GetOperatingParams](https://wiki.facepunch.com/gmod/Vehicle:GetOperatingParams).
1929
+ * @realm server
1930
+ * @source https://wiki.facepunch.com/gmod/Structures/OperatingParams
1931
+ */
1932
+ interface OperatingParams {
1933
+ /**
1934
+ * The current RPM of the vehicle
1935
+ */
1936
+ RPM: number;
1937
+ /**
1938
+ * The current gear of the vehicle, starting from 0
1939
+ */
1940
+ gear: number;
1941
+ /**
1942
+ * Is the vehicle boosting?
1943
+ */
1944
+ isTorqueBoosting: boolean;
1945
+ /**
1946
+ * The current speed, in inches per second
1947
+ */
1948
+ speed: number;
1949
+ /**
1950
+ * Steering angle
1951
+ */
1952
+ steeringAngle: number;
1953
+ /**
1954
+ * Wheels on ground
1955
+ */
1956
+ wheelsInContact: number;
1957
+ }
1958
+
1959
+ /**
1960
+ * This page describes all **default** fields for a [player class](https://wiki.facepunch.com/gmod/Player_Classes).
1961
+ * @realm shared
1962
+ * @source https://wiki.facepunch.com/gmod/Structures/PLAYER
1963
+ */
1964
+ interface PLAYER {
1965
+ /**
1966
+ * The 'nice' name of the player class for display in User Interface and such.
1967
+ */
1968
+ DisplayName: string;
1969
+ /**
1970
+ * How fast to move when not running
1971
+ * @default `400`
1972
+ */
1973
+ WalkSpeed: number;
1974
+ /**
1975
+ * How fast to move when running/sprinting
1976
+ * @default `600`
1977
+ */
1978
+ RunSpeed: number;
1979
+ /**
1980
+ * How fast to move when slow walking, which is activated via the +WALK keybind.
1981
+ * @default `200`
1982
+ */
1983
+ SlowWalkSpeed: number;
1984
+ /**
1985
+ * Multiply walk speed by this when crouching
1986
+ * @default `0.3`
1987
+ */
1988
+ CrouchedWalkSpeed: number;
1989
+ /**
1990
+ * How fast to go from not ducking, to ducking
1991
+ * @default `0.3`
1992
+ */
1993
+ DuckSpeed: number;
1994
+ /**
1995
+ * How fast to go from ducking, to not ducking
1996
+ * @default `0.3`
1997
+ */
1998
+ UnDuckSpeed: number;
1999
+ /**
2000
+ * How powerful a jump should be
2001
+ * @default `200`
2002
+ */
2003
+ JumpPower: number;
2004
+ /**
2005
+ * Can the player use the flashlight
2006
+ * @default `true`
2007
+ */
2008
+ CanUseFlashlight: boolean;
2009
+ /**
2010
+ * Max health we can have
2011
+ * @default `100`
2012
+ */
2013
+ MaxHealth: number;
2014
+ /**
2015
+ * Max armor the player can have
2016
+ * @default `0`
2017
+ */
2018
+ MaxArmor: number;
2019
+ /**
2020
+ * How much health we start with
2021
+ * @default `100`
2022
+ */
2023
+ StartHealth: number;
2024
+ /**
2025
+ * How much armour we start with
2026
+ * @default `0`
2027
+ */
2028
+ StartArmor: number;
2029
+ /**
2030
+ * Do we drop our weapon when we die
2031
+ * @default `false`
2032
+ */
2033
+ DropWeaponOnDie: boolean;
2034
+ /**
2035
+ * Do we collide with teammates or run straight through them
2036
+ * @default `true`
2037
+ */
2038
+ TeammateNoCollide: boolean;
2039
+ /**
2040
+ * Automatically swerves around other players
2041
+ * @default `true`
2042
+ */
2043
+ AvoidPlayers: boolean;
2044
+ /**
2045
+ * Uses viewmodel hands
2046
+ * @default `true`
2047
+ */
2048
+ UseVMHands: boolean;
2049
+ }
2050
+
2051
+ /**
2052
+ * This table is returned by [surface.GetPanelPaintState](https://wiki.facepunch.com/gmod/surface.GetPanelPaintState).
2053
+ *
2054
+ * @realm client
2055
+ * @source https://wiki.facepunch.com/gmod/Structures/PanelPaintState
2056
+ */
2057
+ interface PanelPaintState {
2058
+ /**
2059
+ * The X coordinate for the top-left corner of the Panel currently being drawn.
2060
+ */
2061
+ translate_x: number;
2062
+ /**
2063
+ * The Y coordinate for the top-left corner of the Panel currently being drawn.
2064
+ */
2065
+ translate_y: number;
2066
+ /**
2067
+ * The X coordinate for the left edge of the render.SetScissorRect that surrounds the Panel that is currently being drawn.
2068
+ */
2069
+ scissor_left: number;
2070
+ /**
2071
+ * The Y coordinate for the top edge of the render.SetScissorRect that surrounds the Panel that is currently being drawn.
2072
+ */
2073
+ scissor_top: number;
2074
+ /**
2075
+ * The X coordinate for the right edge of the render.SetScissorRect that surrounds the Panel that is currently being drawn.
2076
+ */
2077
+ scissor_right: number;
2078
+ /**
2079
+ * The Y coordinate for the bottom edge of the render.SetScissorRect that surrounds the Panel that is currently being drawn.
2080
+ */
2081
+ scissor_bottom: number;
2082
+ /**
2083
+ * Whether or not the Panel currently being drawn has render.SetScissorRect active.
2084
+ */
2085
+ scissor_enabled: boolean;
2086
+ }
2087
+
2088
+ /**
2089
+ * Structure represents a path segment, returned by [PathFollower:GetCurrentGoal](https://wiki.facepunch.com/gmod/PathFollower:GetCurrentGoal), [PathFollower:FirstSegment](https://wiki.facepunch.com/gmod/PathFollower:FirstSegment) and [PathFollower:LastSegment](https://wiki.facepunch.com/gmod/PathFollower:LastSegment).
2090
+ * @realm server
2091
+ * @source https://wiki.facepunch.com/gmod/Structures/PathSegment
2092
+ */
2093
+ interface PathSegment {
2094
+ /**
2095
+ * The navmesh area this segment occupies.
2096
+ */
2097
+ area: CNavArea;
2098
+ /**
2099
+ * How much of a curve should the bot execute when navigating this segment. 0 = none, 1 = 180°
2100
+ */
2101
+ curvature: number;
2102
+ /**
2103
+ * Distance of this segment from the start of the path.
2104
+ */
2105
+ distanceFromStart: number;
2106
+ /**
2107
+ * The direction of travel to reach the end of this segment from the start, represented as a normalised vector.
2108
+ */
2109
+ forward: Vector;
2110
+ /**
2111
+ * The direction of travel to reach the end of this segment from the start, represented as a cardinal direction integer 0 to 3, or 9 for vertical movement.
2112
+ */
2113
+ how: number;
2114
+ /**
2115
+ * The navmesh ladder this segment occupies, if any.
2116
+ */
2117
+ ladder: CNavLadder;
2118
+ /**
2119
+ * Length of this segment.
2120
+ */
2121
+ length: number;
2122
+ m_portalCenter: Vector;
2123
+ m_portalHalfWidth: number;
2124
+ /**
2125
+ * The position of the end of this segment.
2126
+ */
2127
+ pos: Vector;
2128
+ /**
2129
+ * The movement type of this segment, indicating how bots are expected to move along this segment.
2130
+ * * 0 is ground movement
2131
+ * * 1 is falling down
2132
+ * * 2 is climbing up or jumping
2133
+ * * 3 is jumping over a gap
2134
+ * * 4 is climbing a ladder up (unused)
2135
+ * * 5 is climbing a ladder down (unused)
2136
+ */
2137
+ type: number;
2138
+ }
2139
+
2140
+ /**
2141
+ * Table used by [physenv.SetPerformanceSettings](https://wiki.facepunch.com/gmod/physenv.SetPerformanceSettings) and [physenv.GetPerformanceSettings](https://wiki.facepunch.com/gmod/physenv.GetPerformanceSettings).
2142
+ *
2143
+ * When setting the settings, omitting any key will fallback to its current value. (can be retrieved via the get function)
2144
+ * @realm shared
2145
+ * @source https://wiki.facepunch.com/gmod/Structures/PhysEnvPerformanceSettings
2146
+ */
2147
+ interface PhysEnvPerformanceSettings {
2148
+ /**
2149
+ * Maximum amount of seconds to precalculate collisions with objects.
2150
+ *
2151
+ * Default value for this setting is `0.5`.
2152
+ * @default `nil`
2153
+ */
2154
+ LookAheadTimeObjectsVsObject?: number;
2155
+ /**
2156
+ * Maximum amount of seconds to precalculate collisions with world.
2157
+ *
2158
+ * Default value for this setting is `1`.
2159
+ * @default `nil`
2160
+ */
2161
+ LookAheadTimeObjectsVsWorld?: number;
2162
+ /**
2163
+ * Maximum collision checks per tick.
2164
+ *
2165
+ * Objects may penetrate after this many collision checks
2166
+ *
2167
+ * Default value for this setting is `50000`.
2168
+ * @default `nil`
2169
+ */
2170
+ MaxCollisionChecksPerTimestep?: number;
2171
+ /**
2172
+ * Maximum collision per object per tick.
2173
+ *
2174
+ * Object will be frozen after this many collisions (visual hitching vs. CPU cost)
2175
+ *
2176
+ * Default value for this setting is `10`.
2177
+ * @default `nil`
2178
+ */
2179
+ MaxCollisionsPerObjectPerTimestep?: number;
2180
+ /**
2181
+ * Maximum world-space speed of an object in inches per second.
2182
+ *
2183
+ * Default value for this setting is `4000`.
2184
+ * @default `nil`
2185
+ */
2186
+ MaxVelocity?: number;
2187
+ /**
2188
+ * Maximum world-space rotational velocity in degrees per second.
2189
+ *
2190
+ * Default value for this setting is `7272.7280273438`.
2191
+ * @default `nil`
2192
+ */
2193
+ MaxAngularVelocity?: number;
2194
+ /**
2195
+ * Minimum mass of an object to be affected by friction.
2196
+ *
2197
+ * Default value for this setting is `10`.
2198
+ *
2199
+ * @default `nil`
2200
+ */
2201
+ MinFrictionMass?: number;
2202
+ /**
2203
+ * Maximum mass of an object to be affected by friction.
2204
+ *
2205
+ * Default value for this setting is `2500`.
2206
+ * @default `nil`
2207
+ */
2208
+ MaxFrictionMass?: number;
2209
+ }
2210
+
2211
+ /**
2212
+ * Structure used by [construct.SetPhysProp](https://wiki.facepunch.com/gmod/construct.SetPhysProp).
2213
+ * @realm server
2214
+ * @source https://wiki.facepunch.com/gmod/Structures/PhysProperties
2215
+ */
2216
+ interface PhysProperties {
2217
+ /**
2218
+ * Enables or disables gravity for the entity
2219
+ * @default `nil`
2220
+ */
2221
+ GravityToggle?: boolean;
2222
+ /**
2223
+ * Sets the physics material for the entity
2224
+ * @default `nil`
2225
+ */
2226
+ Material?: string;
2227
+ }
2228
+
2229
+ /**
2230
+ * Structure used in storing/restoring physics object attributes.
2231
+ * [duplicator.GenericDuplicatorFunction](https://wiki.facepunch.com/gmod/duplicator.GenericDuplicatorFunction) and [duplicator.DoGenericPhysics](https://wiki.facepunch.com/gmod/duplicator.DoGenericPhysics) use a table of **PhysicsObjectSave**s with the struct's index in the table being the physics object ID.
2232
+ *
2233
+ * Pos and Angle are set by the following:
2234
+ *
2235
+ * ```
2236
+ * Pos, Angle = WorldToLocal(phys:GetPos(), phys:GetAngle(), Vector( 0, 0, 0 ), Angle( 0, 0, 0 ))
2237
+ * ```
2238
+ *
2239
+ *
2240
+ * @realm server
2241
+ * @source https://wiki.facepunch.com/gmod/Structures/PhysicsObjectSave
2242
+ */
2243
+ interface PhysicsObjectSave {
2244
+ /**
2245
+ * The entity's world position made local with Global.WorldToLocal
2246
+ */
2247
+ Pos: Vector;
2248
+ /**
2249
+ * The entity's world angles made local with Global.WorldToLocal
2250
+ */
2251
+ Angle: Angle;
2252
+ /**
2253
+ * Whether the entity is moveable. Equal to (`not` PhysObj:IsMoveable)
2254
+ */
2255
+ Frozen: boolean;
2256
+ /**
2257
+ * Whether the entity's gravity is affected by gravity or not. PhysObj:IsGravityEnabled
2258
+ */
2259
+ NoGrav: boolean;
2260
+ /**
2261
+ * Whether the entity is dormant or not. PhysObj:IsAsleep
2262
+ */
2263
+ Sleep: boolean;
2264
+ }
2265
+
2266
+ /**
2267
+ * A structure containing vertex information for use with [surface.DrawPoly](https://wiki.facepunch.com/gmod/surface.DrawPoly).
2268
+ *
2269
+ * UV coordinates describe which part of a given texture should be drawn at a vertex - your graphics card's interpolator will fill in space between vertices. UV coords range from `0-1`, with `0` being top/left and `1` being bottom/right. If you're using a texture these are mandatory.
2270
+ *
2271
+ * **NOTE**: You must pass a table of tables with this structure to the function. **You need to pass at least 3 points.**
2272
+ *
2273
+ * Your points must be defined in a **clockwise order.** Otherwise, your shape will not render properly.
2274
+ *
2275
+ *
2276
+ * @realm client and menu
2277
+ * @source https://wiki.facepunch.com/gmod/Structures/PolygonVertex
2278
+ */
2279
+ interface PolygonVertex {
2280
+ /**
2281
+ * The x coordinate of the vertex.
2282
+ */
2283
+ x: number;
2284
+ /**
2285
+ * The y coordinate of the vertex.
2286
+ */
2287
+ y: number;
2288
+ /**
2289
+ * The u texture coordinate of the vertex. `Can be left blank.`
2290
+ */
2291
+ u: number;
2292
+ /**
2293
+ * The v texture coordinate of the vertex. `Can be left blank.`
2294
+ */
2295
+ v: number;
2296
+ }
2297
+
2298
+ /**
2299
+ * The structure used by [Global.CreateNewAddonPreset](https://wiki.facepunch.com/gmod/Global.CreateNewAddonPreset).
2300
+ * @realm menu
2301
+ * @source https://wiki.facepunch.com/gmod/Structures/Preset
2302
+ */
2303
+ interface Preset {
2304
+ /**
2305
+ * A Table containing all enabled addons.
2306
+ */
2307
+ enabled: table;
2308
+ /**
2309
+ * A Table containing all disabled addons.
2310
+ */
2311
+ disabled: table;
2312
+ /**
2313
+ * The name of the Preset.
2314
+ */
2315
+ name: string;
2316
+ /**
2317
+ * What to do with addons not in the preset. Can be `enable`, `disable` or nothing.
2318
+ */
2319
+ newAction: string;
2320
+ }
2321
+
2322
+ /**
2323
+ * Table used by [Global.FireProblem](https://wiki.facepunch.com/gmod/Global.FireProblem) function.
2324
+ * @realm menu
2325
+ * @source https://wiki.facepunch.com/gmod/Structures/Problem
2326
+ */
2327
+ interface Problem {
2328
+ /**
2329
+ * The Problem ID.
2330
+ */
2331
+ id: string;
2332
+ /**
2333
+ * The Text to Display.
2334
+ */
2335
+ text: string;
2336
+ /**
2337
+ * The Problem severity.
2338
+ */
2339
+ severity: number;
2340
+ /**
2341
+ * The Problem Type. Possible values are:
2342
+ * * config
2343
+ * * hardware
2344
+ * * addons
2345
+ */
2346
+ type: string;
2347
+ /**
2348
+ * a Function that fixes the Problem.
2349
+ */
2350
+ fix: function;
2351
+ }
2352
+
2353
+ /**
2354
+ * Structure used for [properties.Add](https://wiki.facepunch.com/gmod/properties.Add).
2355
+ * @realm shared
2356
+ * @source https://wiki.facepunch.com/gmod/Structures/PropertyAdd
2357
+ */
2358
+ interface PropertyAdd {
2359
+ /**
2360
+ * Can be set to "toggle" to make this property a toggle property.
2361
+ * @default `simple`
2362
+ */
2363
+ Type: string;
2364
+ /**
2365
+ * Label to show on opened menu
2366
+ */
2367
+ MenuLabel: string;
2368
+ /**
2369
+ * Icon to show on opened menu for this item. Optional for simple properties and unused for toggle properties.
2370
+ */
2371
+ MenuIcon: string;
2372
+ /**
2373
+ * Where in the list should the property be positioned, relative to other properties.
2374
+ *
2375
+ * For reference, here are the default properties and their Order values:
2376
+ *
2377
+ * Property | Order |
2378
+ * ---------|-------|
2379
+ * | Bone Manipulate | 500 |
2380
+ * | Bodygroups | 600 |
2381
+ * | Skin | 601 |
2382
+ * | Keep Upright | 900 |
2383
+ * | Ignite/Extinguish | 999 |
2384
+ * | Remove | 1000 |
2385
+ * | Gravity | 1001 |
2386
+ * | Drive | 1100 |
2387
+ * | Collision | 1500 |
2388
+ * | Statue | 1501 |
2389
+ * | NPC Biggify/Smallify | 1799, 1800 |
2390
+ * | Motion Control (Kinect) | 2500 |
2391
+ * | Editable_Entities | 90001 |
2392
+ */
2393
+ Order: number;
2394
+ /**
2395
+ * Whether to add a spacer before this property. This should generally be true for the first property in a group of properties.
2396
+ * @default `false`
2397
+ */
2398
+ PrependSpacer: boolean;
2399
+ /**
2400
+ * Used **clientside** to decide whether this property should be shown for an entity.
2401
+ *
2402
+ * It's good practice to call GM:CanProperty in this hook via gamemode.Call or hook.Run.
2403
+ *
2404
+ *
2405
+ *
2406
+ * Function argument(s):
2407
+ * * table `self` - the property table
2408
+ * * Entity `ent` - the entity the player clicked
2409
+ * * Player `player` - the Global.LocalPlayer
2410
+ *
2411
+ * Function return value(s):
2412
+ * * boolean `check` - Return true if the property should be shown for this entity.
2413
+ */
2414
+ Filter: (self: table, ent: Entity, player: Player) => boolean;
2415
+ /**
2416
+ * Required for toggle properties (clientside).
2417
+ *
2418
+ *
2419
+ *
2420
+ * Function argument(s):
2421
+ * * table `self` - the property table
2422
+ * * Entity `ent` - the entity the player clicked
2423
+ * * table `tr` - the player's eye trace
2424
+ *
2425
+ * Function return value(s):
2426
+ * * boolean `check` - Return true if the property should appear checked in the UI.
2427
+ */
2428
+ Checked: (self: table, ent: Entity, tr: table) => boolean;
2429
+ /**
2430
+ * Called **clientside** when the property is clicked
2431
+ *
2432
+ *
2433
+ * Function argument(s):
2434
+ * * table `self` - the property table
2435
+ * * Entity `ent` - the entity the player clicked
2436
+ * * table `tr` - the player's eye trace
2437
+ *
2438
+ *
2439
+ * When appropriate, within this function you can call `self:MsgStart()`, write data with the net.`Write*` functions, and finish with `self:MsgEnd()`. This will activate the `Receive` function on the server. In most cases, you will want to send the entity to the server, as it's not done by default.
2440
+ */
2441
+ Action: (self: table, ent: Entity, tr: table) => void;
2442
+ /**
2443
+ * Called **serverside** if the client sends a message in the `Action` function (see above).
2444
+ *
2445
+ *
2446
+ *
2447
+ * Function argument(s):
2448
+ * * table `self` - the property table
2449
+ * * number `len` - the net message length, although this includes the property identifier used internally (the name of the property)
2450
+ * * Player `ply` - the player who clicked the property
2451
+ *
2452
+ *
2453
+ * You can read data received from the client with the net.`Read*` functions. It's good practice to check GM:CanProperty here via gamemode.Call or hook.Run.
2454
+ */
2455
+ Receive: (self: table, len: number, ply: Player) => void;
2456
+ /**
2457
+ * Called **clientside** when the property option has been created in the right-click menu. This is not called for toggle properties!
2458
+ *
2459
+ *
2460
+ * Function argument(s):
2461
+ * * table `self` - the property table
2462
+ * * DMenuOption `option` - the menu option
2463
+ * * Entity `ent` - the entity the player right-clicked
2464
+ * * table `tr` - the player's eye trace
2465
+ */
2466
+ MenuOpen: (self: table, option: DMenuOption, ent: Entity, tr: table) => void;
2467
+ /**
2468
+ * Same as `MenuOpen`, but also called for toggle properties and has different arguments. This is called immediately after `MenuOpen`, but nothing happens in between so you should only ever use one or the other.
2469
+ *
2470
+ *
2471
+ * Function argument(s):
2472
+ * * table `self` - the property table
2473
+ * * DMenu `menu` - the property menu
2474
+ * * DMenuOption `option` - the menu option
2475
+ */
2476
+ OnCreate: (self: table, menu: DMenu, option: DMenuOption) => void;
2477
+ }
2478
+
2479
+ /**
2480
+ * Used for [cam.Start](https://wiki.facepunch.com/gmod/cam.Start).
2481
+ *
2482
+ * Unless stated otherwise, the default values for all these keys would be inherited from the engine's current `CViewSetup` and do not have static representations.
2483
+ *
2484
+ * @realm client
2485
+ * @source https://wiki.facepunch.com/gmod/Structures/RenderCamData
2486
+ */
2487
+ interface RenderCamData {
2488
+ /**
2489
+ * The x position of the view port
2490
+ * @default `nil`
2491
+ */
2492
+ x?: number;
2493
+ /**
2494
+ * The y position of the view port
2495
+ * @default `nil`
2496
+ */
2497
+ y?: number;
2498
+ /**
2499
+ * The width of the view port
2500
+ * @default `nil`
2501
+ */
2502
+ w?: number;
2503
+ /**
2504
+ * The height of the view port
2505
+ * @default `nil`
2506
+ */
2507
+ h?: number;
2508
+ /**
2509
+ * The type of cam. Valid types are:
2510
+ * * "2D" - No additional arguments are required
2511
+ * * "3D" - Only origin and angles are needed, all other parameters are optional.
2512
+ * @default `3D`
2513
+ */
2514
+ type: string;
2515
+ /**
2516
+ * The position to render from
2517
+ * @default `nil`
2518
+ */
2519
+ origin?: Vector;
2520
+ /**
2521
+ * The angles to render from
2522
+ * @default `nil`
2523
+ */
2524
+ angles?: Angle;
2525
+ /**
2526
+ * The field of view
2527
+ * @default `nil`
2528
+ */
2529
+ fov?: number;
2530
+ /**
2531
+ * The aspect ratio of the view port (Note that this is NOT set to w/h by default)
2532
+ * @default `nil`
2533
+ */
2534
+ aspect?: number;
2535
+ /**
2536
+ * The distance to the far clipping plane
2537
+ * @default `nil`
2538
+ */
2539
+ zfar?: number;
2540
+ /**
2541
+ * The distance to the near clipping plane
2542
+ * @default `nil`
2543
+ */
2544
+ znear?: number;
2545
+ /**
2546
+ * Set to true if this is to draw into a subrect of the larger screen.
2547
+ * @default `nil`
2548
+ */
2549
+ subrect?: boolean;
2550
+ /**
2551
+ * m_bDoBloomAndToneMapping
2552
+ * @default `false`
2553
+ */
2554
+ bloomtone: boolean;
2555
+ /**
2556
+ * A table having these keys: ( all floats )
2557
+ * * left
2558
+ * * right
2559
+ * * bottom
2560
+ * * top
2561
+ * @default `nil`
2562
+ */
2563
+ offcenter?: table;
2564
+ /**
2565
+ * If set, makes the view/camera orthogonal. A table having these keys: ( all floats )
2566
+ * * left
2567
+ * * right
2568
+ * * bottom
2569
+ * * top
2570
+ * @default `nil`
2571
+ */
2572
+ ortho?: table;
2573
+ }
2574
+
2575
+ /**
2576
+ * Used for [render.Capture](https://wiki.facepunch.com/gmod/render.Capture).
2577
+ * @realm client
2578
+ * @source https://wiki.facepunch.com/gmod/Structures/RenderCaptureData
2579
+ */
2580
+ interface RenderCaptureData {
2581
+ /**
2582
+ * Format of the capture. Valid formats are:
2583
+ * * `jpeg` or `jpg`
2584
+ * * `png`
2585
+ *
2586
+ * As of version 2026.06.19:
2587
+ * * `rgba`, `rgb` and `bgra` - Raw image data in given byte order.
2588
+ * Expected data size is `ImgWidth * ImgHeight * 4` (`ImgWidth * ImgHeight * 3` for `rgb`)
2589
+ * Each 4 (or 3 for `rgb`) bytes is one pixel, top to bottom left to right.
2590
+ */
2591
+ format: string;
2592
+ /**
2593
+ * X coordinate of the capture origin
2594
+ */
2595
+ x: number;
2596
+ /**
2597
+ * Y coordinate of the capture origin
2598
+ */
2599
+ y: number;
2600
+ /**
2601
+ * Width of the capture
2602
+ */
2603
+ w: number;
2604
+ /**
2605
+ * Height of the capture
2606
+ */
2607
+ h: number;
2608
+ /**
2609
+ * The quality of the capture. Affects jpeg only.
2610
+ */
2611
+ quality: number;
2612
+ /**
2613
+ * Set to false to capture an image with alpha channel set to fully opaque. Affects any format with alpha channel support, so not `jpg`.
2614
+ * @default `true`
2615
+ */
2616
+ alpha: boolean;
2617
+ }
2618
+
2619
+ /**
2620
+ * Information about [Scripted Weapons](https://wiki.facepunch.com/gmod/Scripted_Entities) (SWEPs),
2621
+ * used by [SANDBOX:PlayerGiveSWEP](https://wiki.facepunch.com/gmod/SANDBOX:PlayerGiveSWEP) and in SWEP creation.
2622
+ *
2623
+ * For list of callbacks, see [WEAPON Hooks](https://wiki.facepunch.com/gmod/WEAPON_Hooks).
2624
+ *
2625
+ * While some of the fields may be serverside or clientside only, it is recommended to provide them on both so
2626
+ * addons could use their values.
2627
+ *
2628
+ * @realm shared
2629
+ * @source https://wiki.facepunch.com/gmod/Structures/SWEP
2630
+ */
2631
+ interface SWEP {
2632
+ /**
2633
+ * Entity class name of the SWEP (file or folder name of your SWEP). This is
2634
+ * set automatically
2635
+ */
2636
+ ClassName: string;
2637
+ /**
2638
+ * If set, overrides the classname of the SWEP.
2639
+ */
2640
+ ClassNameOverride: string;
2641
+ /**
2642
+ * The spawn menu category that this weapon
2643
+ * resides in.
2644
+ * @default `#spawnmenu.category.other`
2645
+ */
2646
+ Category: string;
2647
+ /**
2648
+ * Whether or not this weapon can be obtained through the
2649
+ * spawn menu.
2650
+ *
2651
+ * @default `false`
2652
+ */
2653
+ Spawnable: boolean;
2654
+ /**
2655
+ * If spawnable, this variable determines whether only
2656
+ * administrators can use the button in the spawn menu.
2657
+ * @default `false`
2658
+ */
2659
+ AdminOnly: boolean;
2660
+ /**
2661
+ * The name of the SWEP displayed in the spawn menu.
2662
+ * @default `Scripted Weapon`
2663
+ */
2664
+ PrintName: string;
2665
+ /**
2666
+ * The weapon's base script, relative to `lua/weapons`.
2667
+ * @default `weapon_base`
2668
+ */
2669
+ Base: string;
2670
+ /**
2671
+ * The deploy speed multiplier. This does not change the
2672
+ * internal deployment speed.
2673
+ * @default `GetConVar('sv_defaultdeployspeed'):GetFloat()`
2674
+ */
2675
+ m_WeaponDeploySpeed: number;
2676
+ /**
2677
+ * Use [Entity:GetOwner](https://wiki.facepunch.com/gmod/Entity:GetOwner)() instead.
2678
+ *
2679
+ * @deprecated Use Entity:GetOwner() instead.
2680
+ */
2681
+ Owner: Entity;
2682
+ /**
2683
+ * Use `SWEP` instead. However, if called in a SWEP method; use `self` instead.
2684
+ *
2685
+ * @deprecated Use `SWEP` instead. However, if called in a SWEP method; use `self` instead.
2686
+ */
2687
+ Weapon: Weapon;
2688
+ /**
2689
+ * The SWEP's author.
2690
+ * @default ``
2691
+ */
2692
+ Author: string;
2693
+ /**
2694
+ * The contact information regarding the SWEP's author.
2695
+ * @default ``
2696
+ */
2697
+ Contact: string;
2698
+ /**
2699
+ * The purpose of the SWEP.
2700
+ * @default ``
2701
+ */
2702
+ Purpose: string;
2703
+ /**
2704
+ * The instructions regarding the SWEP's usage.
2705
+ * @default ``
2706
+ */
2707
+ Instructions: string;
2708
+ /**
2709
+ * Relative path to the SWEP's view model.
2710
+ * @default `models/weapons/v_pistol.mdl`
2711
+ */
2712
+ ViewModel: string;
2713
+ /**
2714
+ * Used primarily for Counter Strike: Source view models, this variable is used to flip them back to normal.
2715
+ * @default `false`
2716
+ */
2717
+ ViewModelFlip: boolean;
2718
+ /**
2719
+ * Behaves similarly to `ViewModelFlip`, but for the second view model.
2720
+ * @default `false`
2721
+ */
2722
+ ViewModelFlip1: boolean;
2723
+ /**
2724
+ * Behaves similarly to `ViewModelFlip`, but for the third view model.
2725
+ * @default `false`
2726
+ */
2727
+ ViewModelFlip2: boolean;
2728
+ /**
2729
+ * The field of view percieved whilst wielding this `SWEP`.
2730
+ * @default `62`
2731
+ */
2732
+ ViewModelFOV: number;
2733
+ /**
2734
+ * Relative path to the SWEP's world model.
2735
+ * @default `models/weapons/w_357.mdl`
2736
+ */
2737
+ WorldModel: string;
2738
+ /**
2739
+ * Whether this weapon can be autoswitched
2740
+ * away from when the player runs out of ammo in this weapon or picks up another weapon or ammo
2741
+ * @default `true`
2742
+ */
2743
+ AutoSwitchFrom: boolean;
2744
+ /**
2745
+ * Whether this weapon can be autoswitched to
2746
+ * when the player runs out of ammo in their current weapon or they pick this weapon up
2747
+ * @default `true`
2748
+ */
2749
+ AutoSwitchTo: boolean;
2750
+ /**
2751
+ * Determines the priority of the weapon when
2752
+ * autoswitching. The weapon being autoswitched from will attempt to switch to a weapon with the same weight
2753
+ * that has ammo, but if none exists, it will prioritise higher weight weapons.
2754
+ * @default `5`
2755
+ */
2756
+ Weight: number;
2757
+ /**
2758
+ * The scale of the viewmodel bob (viewmodel movement
2759
+ * from left to right when walking around)
2760
+ * @default `1`
2761
+ */
2762
+ BobScale: number;
2763
+ /**
2764
+ * The scale of the viewmodel sway (viewmodel
2765
+ * position lerp when looking around).
2766
+ * @default `1`
2767
+ */
2768
+ SwayScale: number;
2769
+ /**
2770
+ * Should the weapon icon bounce in weapon
2771
+ * selection?
2772
+ * @default `true`
2773
+ */
2774
+ BounceWeaponIcon: boolean;
2775
+ /**
2776
+ * Should draw the weapon selection info
2777
+ * box, containing SWEP.Instructions, etc.
2778
+ * @default `true`
2779
+ */
2780
+ DrawWeaponInfoBox: boolean;
2781
+ /**
2782
+ * Should we draw the default HL2 ammo counter?
2783
+ *
2784
+ * @default `true`
2785
+ */
2786
+ DrawAmmo: boolean;
2787
+ /**
2788
+ * Should we draw the default crosshair?
2789
+ *
2790
+ * @default `true`
2791
+ */
2792
+ DrawCrosshair: boolean;
2793
+ /**
2794
+ * The SWEP render group, see Enums/RENDERGROUP. If unset, the engine will decide the render group based on the SWEPs world model.
2795
+ */
2796
+ RenderGroup: RENDERGROUP;
2797
+ /**
2798
+ * Slot in the weapon selection menu, starts with `0`
2799
+ * @default `0`
2800
+ */
2801
+ Slot: number;
2802
+ /**
2803
+ * Position in the slot, should be in the range `0-128`
2804
+ * @default `10`
2805
+ */
2806
+ SlotPos: number;
2807
+ /**
2808
+ * Internal variable for drawing the info box in weapon selection
2809
+ * @default `surface.GetTextureID( 'gui/speech_lid' )`
2810
+ */
2811
+ SpeechBubbleLid: number;
2812
+ /**
2813
+ * Path to
2814
+ * a material. Override this in your SWEP to set the icon in the weapon selection. This must be the texture ID,
2815
+ * see surface.GetTextureID. Keep in mind that the path must be to a `.vmt` file, NOT `.vtf`.
2816
+ *
2817
+ *
2818
+ * Alternatively you can render custom weapon selection via WEAPON:DrawWeaponSelection.
2819
+ *
2820
+ * @default `surface.GetTextureID( 'weapons/swep' )`
2821
+ */
2822
+ WepSelectIcon: number;
2823
+ /**
2824
+ * Should we use Counter-Strike muzzle
2825
+ * flashes upon firing? This is required for DoD:S or CS:S view models to fix their muzzle flashes.
2826
+ * @default `false`
2827
+ */
2828
+ CSMuzzleFlashes: boolean;
2829
+ /**
2830
+ * Use the X shape muzzle flash instead of the
2831
+ * default Counter-Strike muzzle flash. Requires Structures/SWEP#CSMuzzleFlashes to be set to true.
2832
+ * @default `false`
2833
+ */
2834
+ CSMuzzleX: boolean;
2835
+ /**
2836
+ * Primary attack settings. The table contains these fields:
2837
+ *
2838
+ * * string `Ammo` - Ammo type (`Pistol`, `SMG1`, etc.) See game.AddAmmoType.
2839
+ * * number `ClipSize` - The maximum amount of bullets one clip can hold. Setting it to `-1` means weapon uses no clips, like a grenade or a rocket launch.
2840
+ * * number `DefaultClip` - Default ammo in the clip, making it higher than ClipSize will give player additional ammo on spawn
2841
+ * * boolean `Automatic` - If true makes the weapon shoot automatically as long as the player has primary attack button held down
2842
+ */
2843
+ Primary: table;
2844
+ /**
2845
+ * Secondary attack settings, has same fields as Primary attack settings
2846
+ */
2847
+ Secondary: table;
2848
+ /**
2849
+ * Makes the player models hands bonemerged onto
2850
+ * the view model
2851
+ *
2852
+ * The gamemode and view models **must** support this feature for it to work!
2853
+ * You can find more information here: [Using Viewmodel Hands](https://wiki.facepunch.com/gmod/Using_Viewmodel_Hands)
2854
+ *
2855
+ *
2856
+ * @default `false`
2857
+ */
2858
+ UseHands: boolean;
2859
+ /**
2860
+ * The folder from where the weapon was loaded. This should always be
2861
+ * "weapons/weapon_myweapon", regardless whether your SWEP is stored as a file, or multiple files in a folder.
2862
+ * It is set automatically on load
2863
+ */
2864
+ Folder: string;
2865
+ /**
2866
+ * Makes the default SWEP crosshair be
2867
+ * positioned in 3D space where your aim actually is (like on Jeep), instead of simply sitting in the middle of
2868
+ * the screen at all times
2869
+ * @default `false`
2870
+ */
2871
+ AccurateCrosshair: boolean;
2872
+ /**
2873
+ * Disable the ability for players to duplicate this
2874
+ * SWEP
2875
+ * @default `false`
2876
+ */
2877
+ DisableDuplicator: boolean;
2878
+ /**
2879
+ * Sets the spawnmenu content icon type
2880
+ * for the entity, used by spawnmenu in the Sandbox-derived gamemodes.
2881
+ * See spawnmenu.AddContentType for more information.
2882
+ * @default `weapon`
2883
+ */
2884
+ ScriptedEntityType: string;
2885
+ /**
2886
+ * If set to false, the weapon will not play the
2887
+ * weapon pick up sound when picked up.
2888
+ * @default `true`
2889
+ */
2890
+ m_bPlayPickupSound: boolean;
2891
+ /**
2892
+ * If set,
2893
+ * overrides the icon path to be displayed in the Spawnmenu for this entity. The path is relative to the `materials/` folder.
2894
+ *
2895
+ * @default `entities/<ClassName>.png`
2896
+ */
2897
+ IconOverride: string;
2898
+ }
2899
+
2900
+ /**
2901
+ * Used by [Entity:GetSequenceInfo](https://wiki.facepunch.com/gmod/Entity:GetSequenceInfo).
2902
+ * @realm shared
2903
+ * @source https://wiki.facepunch.com/gmod/Structures/SequenceInfo
2904
+ */
2905
+ interface SequenceInfo {
2906
+ /**
2907
+ * Name of the sequence.
2908
+ */
2909
+ label: string;
2910
+ /**
2911
+ * Name of the activity this sequence is attached to.
2912
+ */
2913
+ activityname: string;
2914
+ /**
2915
+ * The activity ID associated with this sequence. See Enums/ACT.
2916
+ */
2917
+ activity: ACT;
2918
+ /**
2919
+ * How likely this sequence is to be picked when playing an activity its attached to. -1 means this is the only sequence for that activity. (needs validation)
2920
+ */
2921
+ actweight: number;
2922
+ /**
2923
+ * The looping and other flags of this sequence, see [flags here](https://github.com/ValveSoftware/source-sdk-2013/blob/master/src/public/studio.h#L3078).
2924
+ */
2925
+ flags: number;
2926
+ /**
2927
+ * Number of animation events this sequence has.
2928
+ */
2929
+ numevents: number;
2930
+ numblends: number;
2931
+ /**
2932
+ * Mins part of the bounding box for this sequence
2933
+ */
2934
+ bbmin: Vector;
2935
+ /**
2936
+ * Maxs part of the bounding box for this sequence
2937
+ */
2938
+ bbmax: Vector;
2939
+ /**
2940
+ * ideal cross fade in time (0.2 default)
2941
+ */
2942
+ fadeintime: number;
2943
+ /**
2944
+ * ideal cross fade out time (0.2 default)
2945
+ */
2946
+ fadeouttime: number;
2947
+ /**
2948
+ * transition node at entry
2949
+ */
2950
+ localentrynode: number;
2951
+ /**
2952
+ * transition node at exit
2953
+ */
2954
+ localexitnode: number;
2955
+ /**
2956
+ * Transition rules
2957
+ */
2958
+ nodeflags: number;
2959
+ /**
2960
+ * Frame that should generate EndOFSequence
2961
+ */
2962
+ lastframe: number;
2963
+ /**
2964
+ * If non 0, the next sequence for auto advancing sequences
2965
+ */
2966
+ nextseq: number;
2967
+ pose: number;
2968
+ /**
2969
+ * If non 0, index of pose parameter to be used as cycle index. This means that the sequence playback will be controlled by a pose parameter.
2970
+ */
2971
+ cycleposeindex: number;
2972
+ /**
2973
+ * A 1-based array of all animationIDs associated with this sequence. For use with Entity:GetAnimInfo.
2974
+ */
2975
+ anims: number[];
2976
+ }
2977
+
2978
+ /**
2979
+ * Used for [serverlist.Query](https://wiki.facepunch.com/gmod/serverlist.Query).
2980
+ * @realm menu
2981
+ * @source https://wiki.facepunch.com/gmod/Structures/ServerQueryData
2982
+ */
2983
+ interface ServerQueryData {
2984
+ /**
2985
+ * The game directory to get the servers for
2986
+ * @default `garrysmod`
2987
+ */
2988
+ GameDir: string;
2989
+ /**
2990
+ * Type of servers to retrieve. Valid values are `internet`, `favorite`, `history` and `lan`
2991
+ */
2992
+ Type: string;
2993
+ /**
2994
+ * Steam application ID to get the servers for
2995
+ * @default `4000`
2996
+ */
2997
+ AppID: number;
2998
+ /**
2999
+ * Called when a new server is found and queried.
3000
+ *
3001
+ *
3002
+ *
3003
+ * Function argument(s):
3004
+ * * number `ping` - Latency to the server.
3005
+ * * string `name` - Name of the server
3006
+ * * string `desc` - "Nice" gamemode name
3007
+ * * string `map` - Current map
3008
+ * * number `players` - Total player number ( bot + human )
3009
+ * * number `maxplayers` - Maximum reported amount of players
3010
+ * * number `botplayers` - Amount of bots on the server
3011
+ * * boolean `pass` - Whether this server has password or not
3012
+ * * number `lastplayed` - Time when you last played on this server, as UNIX timestamp or 0
3013
+ * * string `address` - IP Address of the server
3014
+ * * string `gamemode` - Gamemode folder name
3015
+ * * number `workshopid` - Gamemode Steam Workshop ID
3016
+ * * boolean `isanon` - Is the server signed into an anonymous account?
3017
+ * * string `version` - Version number, same format as jit.version_num
3018
+ * * string `localization` - Two digit country code, `us` if nil
3019
+ * * string `gmcategory` - Category of the gamemode, ex. `pvp`, `pve`, `rp` or `roleplay`
3020
+ *
3021
+ * Function return value(s):
3022
+ * * boolean `stop` - Return `false` to stop the query.
3023
+ */
3024
+ Callback: (ping: number, name: string, desc: string, map: string, players: number, maxplayers: number, botplayers: number, pass: boolean, lastplayed: number, address: string, gamemode: string, workshopid: number, isanon: boolean, version: string, localization: string, gmcategory: string) => boolean;
3025
+ /**
3026
+ * Called if the query has failed, called with the servers IP Address
3027
+ */
3028
+ CallbackFailed: function;
3029
+ /**
3030
+ * Called when the query is finished. No arguments
3031
+ */
3032
+ Finished: function;
3033
+ }
3034
+
3035
+ /**
3036
+ * Table used by [PhysObj:ComputeShadowControl](https://wiki.facepunch.com/gmod/PhysObj:ComputeShadowControl). Default values are given if the table element is omitted.
3037
+ * @realm shared
3038
+ * @source https://wiki.facepunch.com/gmod/Structures/ShadowControlParams
3039
+ */
3040
+ interface ShadowControlParams {
3041
+ /**
3042
+ * How long it takes to move to the set pos and angle. Limited by max speed/damping.
3043
+ * Cannot be 0! Will give errors if you do.
3044
+ *
3045
+ * @default `TICK_INTERVAL * 2`
3046
+ */
3047
+ secondstoarrive: number;
3048
+ /**
3049
+ * The time it should use - just use the one from ENTITY:PhysicsSimulate.
3050
+ * @default `0.1`
3051
+ */
3052
+ delta: number;
3053
+ /**
3054
+ * Where you want to move to.
3055
+ * @default `vector_origin`
3056
+ */
3057
+ pos: Vector;
3058
+ /**
3059
+ * Angle you want to move to.
3060
+ * @default `angle_zero`
3061
+ */
3062
+ angle: Angle;
3063
+ /**
3064
+ * What should be the maximal angular force applied.
3065
+ * @default `1`
3066
+ */
3067
+ maxangular: number;
3068
+ /**
3069
+ * At which force/speed should it start damping the rotation.
3070
+ * @default `1`
3071
+ */
3072
+ maxangulardamp: number;
3073
+ /**
3074
+ * Maximum linear force applied
3075
+ * @default `1`
3076
+ */
3077
+ maxspeed: number;
3078
+ /**
3079
+ * Maximum linear force/speed before damping.
3080
+ * @default `1`
3081
+ */
3082
+ maxspeeddamp: number;
3083
+ /**
3084
+ * The percentage it should damp the linear/angular force if it reaches it's max amount
3085
+ * @default `1`
3086
+ */
3087
+ dampfactor: number;
3088
+ /**
3089
+ * If it's further away than this it'll teleport (Set to 0 to not teleport)
3090
+ * @default `0`
3091
+ */
3092
+ teleportdistance: number;
3093
+ }
3094
+
3095
+ /**
3096
+ * A [table](https://wiki.facepunch.com/gmod/table) structure containing the information of 3D skybox.
3097
+ *
3098
+ * Returned by [game.Get3DSkyboxInfo](https://wiki.facepunch.com/gmod/game.Get3DSkyboxInfo).
3099
+ *
3100
+ * @realm shared
3101
+ * @source https://wiki.facepunch.com/gmod/Structures/Sky3DParams
3102
+ */
3103
+ interface Sky3DParams {
3104
+ /**
3105
+ * Position of the [sky_camera](https://developer.valvesoftware.com/wiki/Sky_camera) entity.
3106
+ */
3107
+ origin: Vector;
3108
+ /**
3109
+ * Scale of the 3D skybox.
3110
+ */
3111
+ scale: number;
3112
+ }
3113
+
3114
+ /**
3115
+ * Structure used to define a sound script, e.g. by sound.Add.
3116
+ * @realm shared
3117
+ * @source https://wiki.facepunch.com/gmod/Structures/SoundData
3118
+ */
3119
+ interface SoundData {
3120
+ /**
3121
+ * Path to the sound file, relative to the `sound/` directory. Can be a table
3122
+ * of sound files, in which case the sound is chosen randomly each time. Each
3123
+ * path may be prepended with a special character for special effects.
3124
+ */
3125
+ sound: string | string[];
3126
+ /** The name of the soundscript, referenced by functions such as Entity:EmitSound. */
3127
+ name: string;
3128
+ /** The sound channel to play in. See Enums/CHAN. */
3129
+ channel: CHAN;
3130
+ /** The soundlevel of the sound in dB. See Enums/SNDLVL. Affects how far it can be heard. */
3131
+ level: SNDLVL;
3132
+ /**
3133
+ * The volume of the sound as a decimal between `0` and `1`. Can be a table of
3134
+ * two numbers (a minimum and a maximum). Warning: a volume of `0` acts as `1`.
3135
+ */
3136
+ volume?: number;
3137
+ /** The pitch of the sound. Can be a table of two numbers (a minimum and a maximum). */
3138
+ pitch?: number | number[];
3139
+ /**
3140
+ * The initial pitch.
3141
+ * @deprecated Use pitch instead.
3142
+ */
3143
+ pitchstart?: number;
3144
+ /**
3145
+ * The pitch end.
3146
+ * @deprecated Use pitch instead.
3147
+ */
3148
+ pitchend?: number;
3149
+ }
3150
+
3151
+
3152
+ /**
3153
+ * Table describing a sound hint, used by [NPC:GetBestSoundHint](https://wiki.facepunch.com/gmod/NPC:GetBestSoundHint) and [sound.GetLoudestSoundHint](https://wiki.facepunch.com/gmod/sound.GetLoudestSoundHint).
3154
+ * @realm server
3155
+ * @source https://wiki.facepunch.com/gmod/Structures/SoundHintData
3156
+ */
3157
+ interface SoundHintData {
3158
+ /**
3159
+ * Origin of the sound hint
3160
+ */
3161
+ origin: Vector;
3162
+ /**
3163
+ * Owner of the sound hint, if any (emitting entity, like a thumper)
3164
+ */
3165
+ owner: Entity;
3166
+ /**
3167
+ * Target of the sound hint, if any
3168
+ */
3169
+ target: Entity;
3170
+ /**
3171
+ * Volume of the sound hint
3172
+ */
3173
+ volume: number;
3174
+ /**
3175
+ * Enums/SOUND
3176
+ */
3177
+ type: SOUND;
3178
+ /**
3179
+ * Global.CurTime based expiration date
3180
+ */
3181
+ expiration: number;
3182
+ /**
3183
+ * Does this sound hint expire?
3184
+ */
3185
+ expires: boolean;
3186
+ /**
3187
+ * Enums/CHAN
3188
+ */
3189
+ channel: CHAN;
3190
+ }
3191
+
3192
+ /**
3193
+ * Returned by [util.GetSunInfo](https://wiki.facepunch.com/gmod/util.GetSunInfo).
3194
+ * @realm client
3195
+ * @source https://wiki.facepunch.com/gmod/Structures/SunInfo
3196
+ */
3197
+ interface SunInfo {
3198
+ /**
3199
+ * The sun's direction relative to 0,0,0.
3200
+ */
3201
+ direction: Vector;
3202
+ /**
3203
+ * Indicates how obstructed the sun is, 1 not visible, 0 fully visible.
3204
+ */
3205
+ obstruction: number;
3206
+ /**
3207
+ * Color of sun's overlay in `0`-`255` range as Color structure.
3208
+ */
3209
+ overlayColor: Color;
3210
+ /**
3211
+ * The sun's overlay name of material. For example: `sprites/light_glow02_add_noz.vmt`.
3212
+ */
3213
+ overlayMaterial: string;
3214
+ /**
3215
+ * Size of sun's overlay.
3216
+ */
3217
+ overlaySize: number;
3218
+ /**
3219
+ * Color of sun in `0`-`255` range as Color structure.
3220
+ */
3221
+ sunColor: Color;
3222
+ /**
3223
+ * The sun's name of material.
3224
+ */
3225
+ sunMaterial: string;
3226
+ /**
3227
+ * Size of sun.
3228
+ */
3229
+ sunSize: number;
3230
+ /**
3231
+ * State of sun.
3232
+ */
3233
+ enabled: boolean;
3234
+ }
3235
+
3236
+ /**
3237
+ * Table returned by [util.GetSurfaceData](https://wiki.facepunch.com/gmod/util.GetSurfaceData).
3238
+ * @realm shared
3239
+ * @source https://wiki.facepunch.com/gmod/Structures/SurfacePropertyData
3240
+ */
3241
+ interface SurfacePropertyData {
3242
+ /**
3243
+ * The name of the surface property, identical to util.GetSurfacePropName.
3244
+ */
3245
+ name: string;
3246
+ /**
3247
+ * How hard a surface is. If this is greater than or equal to another surfaces's hardThreshold, a hard impact sound will be used.
3248
+ */
3249
+ hardnessFactor: number;
3250
+ /**
3251
+ * Hardness threshold for impact sounds. HitSurface.hardnessFactor >= InflictorSurface.hardThreshold - hard impact sound (depends on hardVelocityThreshold's value), HitSurface.hardnessFactor < InflictorSurface.hardThreshold - soft impact sound (always).
3252
+ */
3253
+ hardThreshold: number;
3254
+ /**
3255
+ * Velocity threshold for impact sounds. impactSpeed >= HitSurface.hardVelocityThreshold - hard impact sound (depends on hardThreshold's value), impactSpeed < HitSurface.hardVelocityThreshold - soft impact sound (always).
3256
+ */
3257
+ hardVelocityThreshold: number;
3258
+ /**
3259
+ * Amount of sound reflected from the surface represented as a number 0.0 - 1.0. 0 - no reflection, 1 - fully reflected.
3260
+ */
3261
+ reflectivity: number;
3262
+ /**
3263
+ * How rough a surface is. If this is greater than or equal to another surfaces's roughThreshold, a rough scrape sound will be used.
3264
+ */
3265
+ roughnessFactor: number;
3266
+ /**
3267
+ * Roughness threshold for friction sounds. HitSurface.roughnessFactor >= InflictorSurface.roughThreshold - rough friction sound, HitSurface.roughnessFactor < InflictorSurface.roughThreshold - soft friction sound.
3268
+ */
3269
+ roughThreshold: number;
3270
+ /**
3271
+ * Indicates whether or not the surface is a ladder. Used to detect whether a player is on a ladder. 0 - false, > 0 - true.
3272
+ */
3273
+ climbable: number;
3274
+ /**
3275
+ * Scalar multiplier for player jump height - or more accurately, applied z-axis velocity on a surface. For example, 1 - normal jump, 2 - twice as high, and 0.5 - half as high.
3276
+ */
3277
+ jumpFactor: number;
3278
+ /**
3279
+ * The surface material. See Enums/MAT.
3280
+ */
3281
+ material: MAT;
3282
+ /**
3283
+ * Scalar multiplier for player speed. Achieves this by multiplying CMoveData:SetMaxSpeed in GM:Move.
3284
+ */
3285
+ maxSpeedFactor: number;
3286
+ /**
3287
+ * This is the physical drag on an object when in contact with this surface (0 - x, 0 none to x a lot).
3288
+ */
3289
+ dampening: number;
3290
+ /**
3291
+ * Material density in kg / m^3 (water is 1000). If a surface's density is < 1000, it will float in water. This is used to calculate the total mass of an object.
3292
+ */
3293
+ density: number;
3294
+ /**
3295
+ * Collision elasticity - used to compute coefficient of restitution represented as a number 0.0 - 1.0. 0.01 is soft, 1.0 is hard.
3296
+ */
3297
+ elasticity: number;
3298
+ /**
3299
+ * Physical friction used to slow entities touching the surface represented as a number 0.0 - 1.0. 0.01 is slick, 1.0 is completely rough.
3300
+ */
3301
+ friction: number;
3302
+ /**
3303
+ * Material thickness. If this is 0, the material is not volumetrically solid, and thus the object mass will be calculated as "volume * 0.0254^3 * density" where 0.0254 is meters per inch. If non-zero, the mass will be "surfacearea * thickness * 0.0254^3 * density".
3304
+ */
3305
+ thickness: number;
3306
+ /**
3307
+ * Sound to play when a prop or func_breakable is broken.
3308
+ */
3309
+ breakSound: string;
3310
+ /**
3311
+ * Bullet impact sound with this surface.
3312
+ */
3313
+ bulletImpactSound: string;
3314
+ /**
3315
+ * Physical impact sound when hitting surfaces hard.
3316
+ */
3317
+ impactHardSound: string;
3318
+ /**
3319
+ * Physical impact sound when hitting surfaces softly.
3320
+ */
3321
+ impactSoftSound: string;
3322
+ /**
3323
+ * Unused sound.
3324
+ */
3325
+ rollingSound: string;
3326
+ /**
3327
+ * Friction sound when roughly scraping against an entity.
3328
+ */
3329
+ scrapeRoughSound: string;
3330
+ /**
3331
+ * Friction sound when smoothly scraping against an entity.
3332
+ */
3333
+ scrapeSmoothSound: string;
3334
+ /**
3335
+ * Footstep sound for left foot.
3336
+ */
3337
+ stepLeftSound: string;
3338
+ /**
3339
+ * Footstep sound for right foot.
3340
+ */
3341
+ stepRightSound: string;
3342
+ /**
3343
+ * Unused sound.
3344
+ */
3345
+ strainSound: string;
3346
+ }
3347
+
3348
+ /**
3349
+ * The `TOOL` table used to define a Sandbox tool. Canonicalized to `Tool`.
3350
+ * @realm shared
3351
+ * @source https://wiki.facepunch.com/gmod/Structures/TOOL
3352
+ */
3353
+ interface Tool {
3354
+ /** If false, the tool won't be added to the tool menu; players access it by other means. */
3355
+ AddToMenu?: boolean;
3356
+ /** The tool menu category under which the tool should be listed. */
3357
+ Category?: string;
3358
+ /** The console command to execute upon being selected in the Q menu. */
3359
+ Command?: string;
3360
+ /** The name of the tool in the Q menu. */
3361
+ Name?: string;
3362
+ /** Key-value (convar name - default value) table of client-side convars to create, prefixed with the tool's filename. */
3363
+ ClientConVar?: table;
3364
+ /** Same as ClientConVar, but created server-side instead. */
3365
+ ServerConVar?: table;
3366
+ /** Key-value (name - ConVar object) table of cached convars created from `ClientConVar`. */
3367
+ ClientConVars?: table;
3368
+ /** Same as ClientConVars, but server-side (`ServerConVar`) instead. */
3369
+ ServerConVars?: table;
3370
+ // BuildCPanel field: see TOOL.BuildCPanel.d.tlua (declared there to avoid a duplicate member).
3371
+ /** Overrides the tool usage information shown when the tool is equipped. */
3372
+ Information?: table;
3373
+ /** Class name of the tool (name of the .lua file). Set automatically. */
3374
+ Mode: string;
3375
+ /** The tool tab (spawnmenu.AddToolTab) to add this tool to (the internal name). */
3376
+ Tab: string;
3377
+ /** When enabled the game tries to run the left mouse click as soon as possible. */
3378
+ LeftClickAutomatic?: boolean;
3379
+ /** When enabled the game tries to run the right mouse click as soon as possible. */
3380
+ RightClickAutomatic?: boolean;
3381
+ }
3382
+
3383
+
3384
+ /**
3385
+ * Table is one element from [team.GetAllTeams](https://wiki.facepunch.com/gmod/team.GetAllTeams).
3386
+ * @realm shared
3387
+ * @source https://wiki.facepunch.com/gmod/Structures/TeamData
3388
+ */
3389
+ interface TeamData {
3390
+ /**
3391
+ * Color of the team
3392
+ */
3393
+ Color: Color;
3394
+ /**
3395
+ * Whether the team is joinable or not.
3396
+ */
3397
+ Joinable: boolean;
3398
+ /**
3399
+ * Name of the team
3400
+ */
3401
+ Name: string;
3402
+ /**
3403
+ * Score of the team
3404
+ */
3405
+ Score: number;
3406
+ }
3407
+
3408
+ /**
3409
+ * Used for [draw.Text](https://wiki.facepunch.com/gmod/draw.Text).
3410
+ * @realm client and menu
3411
+ * @source https://wiki.facepunch.com/gmod/Structures/TextData
3412
+ */
3413
+ interface TextData {
3414
+ /**
3415
+ * Text to be drawn.
3416
+ */
3417
+ text: string;
3418
+ /**
3419
+ * The font to draw with. List of default fonts can be found Default_Fonts.
3420
+ * @default `DermaDefault`
3421
+ */
3422
+ font: string;
3423
+ /**
3424
+ * This holds the X and Y coordinates. Key value 1 is x, key value 2 is y.
3425
+ */
3426
+ pos: table;
3427
+ /**
3428
+ * The alignment of the X position. See Enums/TEXT_ALIGN
3429
+ * @default `TEXT_ALIGN_LEFT`
3430
+ */
3431
+ xalign: TEXT_ALIGN;
3432
+ /**
3433
+ * The alignment of the Y position. See Enums/TEXT_ALIGN
3434
+ * @default `TEXT_ALIGN_TOP`
3435
+ */
3436
+ yalign: TEXT_ALIGN;
3437
+ /**
3438
+ * The text color
3439
+ * @default `color_white`
3440
+ */
3441
+ color: Color;
3442
+ }
3443
+
3444
+ /**
3445
+ * Used for [draw.TexturedQuad](https://wiki.facepunch.com/gmod/draw.TexturedQuad).
3446
+ * @realm client and menu
3447
+ * @source https://wiki.facepunch.com/gmod/Structures/TextureData
3448
+ */
3449
+ interface TextureData {
3450
+ /**
3451
+ * surface.GetTextureID number of the texture to be drawn.
3452
+ */
3453
+ texture: number;
3454
+ /**
3455
+ * The x Coordinate.
3456
+ */
3457
+ x: number;
3458
+ /**
3459
+ * The y Coordinate.
3460
+ */
3461
+ y: number;
3462
+ /**
3463
+ * The width of the texture.
3464
+ */
3465
+ w: number;
3466
+ /**
3467
+ * The height of the texture.
3468
+ */
3469
+ h: number;
3470
+ /**
3471
+ * The texture color. See Color.
3472
+ * @default `color_white`
3473
+ */
3474
+ color: Color;
3475
+ }
3476
+
3477
+ /**
3478
+ * Table returned by [Vector:ToScreen](https://wiki.facepunch.com/gmod/Vector:ToScreen).
3479
+ * @realm client
3480
+ * @source https://wiki.facepunch.com/gmod/Structures/ToScreenData
3481
+ */
3482
+ interface ToScreenData {
3483
+ /**
3484
+ * The x coordinate on the players screen
3485
+ */
3486
+ x: number;
3487
+ /**
3488
+ * The y coordinate on the players screen
3489
+ */
3490
+ y: number;
3491
+ /**
3492
+ * The coordinate is not behind the player. **This does not mean the coordinate is on the screen.** When this is false, it means that the coordinate would not be on the screen even if the player had a full 180 degree FOV.
3493
+ */
3494
+ visible: boolean;
3495
+ }
3496
+
3497
+ /**
3498
+ * Table structure used for util.TraceLine.
3499
+ * @realm shared
3500
+ * @source https://wiki.facepunch.com/gmod/Structures/Trace
3501
+ */
3502
+ interface Trace {
3503
+ /** The start position of the trace. */
3504
+ start?: Vector;
3505
+ /** The end position of the trace. */
3506
+ endpos?: Vector;
3507
+ /**
3508
+ * Things the trace should not hit. Can be an entity, a table of entities, a
3509
+ * table of entity classes, a mixed table, or a function (slow, avoid).
3510
+ */
3511
+ filter?: any;
3512
+ /** The trace mask (Enums/MASK). Determines what the trace should and shouldn't hit. */
3513
+ mask?: MASK;
3514
+ /** The collision group (Enums/COLLISION_GROUP). Determines what the trace hits w.r.t. collision group. */
3515
+ collisiongroup?: COLLISION_GROUP;
3516
+ /** Should the trace ignore the world or not. */
3517
+ ignoreworld?: boolean;
3518
+ /** If set, the trace result is written to this table instead of returning a new one. */
3519
+ output?: TraceResult | table;
3520
+ /** Turns the `filter` field into a whitelist, if it is a table. */
3521
+ whitelist?: boolean;
3522
+ /** Enables traces to hit clientside-only entities. */
3523
+ hitclientonly?: boolean;
3524
+ }
3525
+
3526
+
3527
+ /**
3528
+ * Table structure used as trace result. Default values are when the trace hits nothing.
3529
+ *
3530
+ * See [util.TraceLine](https://wiki.facepunch.com/gmod/util.TraceLine) and [util.TraceHull](https://wiki.facepunch.com/gmod/util.TraceHull).
3531
+ *
3532
+ * @realm shared
3533
+ * @source https://wiki.facepunch.com/gmod/Structures/TraceResult
3534
+ */
3535
+ interface TraceResult {
3536
+ /**
3537
+ * The entity hit by the trace.
3538
+ * @default `NULL`
3539
+ */
3540
+ Entity: Entity;
3541
+ /**
3542
+ * This indicates the how much of your trace length was used from 0-1 (resultLength/originalLength).
3543
+ * @default `1`
3544
+ */
3545
+ Fraction: number;
3546
+ /**
3547
+ * Given the trace started in a solid enviroment, this will return at what distance the trace left the solid from 0-1. Doesn't work if the trace hit a non-worldspawn entity.
3548
+ * @default `0`
3549
+ */
3550
+ FractionLeftSolid: number;
3551
+ /**
3552
+ * Indicates whether the trace hit something.
3553
+ * @default `false`
3554
+ */
3555
+ Hit: boolean;
3556
+ /**
3557
+ * The ID of the hitbox hit by the trace, or ID of the static prop hit in case of hitting the world.
3558
+ * @default `0`
3559
+ */
3560
+ HitBox: number;
3561
+ /**
3562
+ * Enums/HITGROUP describing what hitgroup the trace hit (not the same as HitBox).
3563
+ * @default `0`
3564
+ */
3565
+ HitGroup: HITGROUP;
3566
+ /**
3567
+ * Indicates whenever the trace hit a no-draw brush.
3568
+ * @default `false`
3569
+ */
3570
+ HitNoDraw: boolean;
3571
+ /**
3572
+ * Indicates whenever the trace did not hit the world.
3573
+ * @default `false`
3574
+ */
3575
+ HitNonWorld: boolean;
3576
+ /**
3577
+ * The direction of the surface that was hit as a normal vector (vector with Vector:Length of 1).
3578
+ * @default `Global.Vector(0, 0, 0)`
3579
+ */
3580
+ HitNormal: Vector;
3581
+ /**
3582
+ * The position the trace stopped. This will be the provided endpos if the trace hit nothing.
3583
+ */
3584
+ HitPos: Vector;
3585
+ /**
3586
+ * Indicates whenever the trace hit the sky.
3587
+ * @default `false`
3588
+ */
3589
+ HitSky: boolean;
3590
+ /**
3591
+ * The surface material (not texture) of whatever the trace hit. Will be `**displacement**` if the trace hit a displacement, and `**studio**` if it hit a prop.
3592
+ * @default `** empty **`
3593
+ */
3594
+ HitTexture: string;
3595
+ /**
3596
+ * Indicates whenever the trace hit the world.
3597
+ * @default `false`
3598
+ */
3599
+ HitWorld: boolean;
3600
+ /**
3601
+ * Enums/MAT of the material hit by the trace.
3602
+ * @default `nil`
3603
+ */
3604
+ MatType?: MAT;
3605
+ /**
3606
+ * The direction of the trace as a normal vector (vector with Vector:Length of 1).
3607
+ *
3608
+ * Equivalent to: `( traceRes.HitPos - traceRes.StartPos ):Normalize()`
3609
+ */
3610
+ Normal: Vector;
3611
+ /**
3612
+ * The PhysObj ID that was hit.
3613
+ *
3614
+ * Used for Entity:GetPhysicsObjectNum.
3615
+ * @default `0`
3616
+ */
3617
+ PhysicsBone: number;
3618
+ /**
3619
+ * The origin of the trace. Will match the provided startpos.
3620
+ */
3621
+ StartPos: Vector;
3622
+ /**
3623
+ * ID of hit surface property from `scripts/surfaceproperties.txt`.
3624
+ * You can get the name using util.GetSurfacePropName.
3625
+ *
3626
+ * Used for CEffectData:SetSurfaceProp.
3627
+ * @default `0`
3628
+ */
3629
+ SurfaceProps: number;
3630
+ /**
3631
+ * Indicates whenever the trace started in a solid enviroment.
3632
+ * @default `false`
3633
+ */
3634
+ StartSolid: boolean;
3635
+ /**
3636
+ * True if the entire trace is inside a solid.
3637
+ * @default `false`
3638
+ */
3639
+ AllSolid: boolean;
3640
+ /**
3641
+ * The surface flags of the hit surface. See Enums/SURF.
3642
+ * @default `0`
3643
+ */
3644
+ SurfaceFlags: SURF;
3645
+ /**
3646
+ * The displacement flags of the hit surface. See Enums/DISPSURF.
3647
+ * @default `0`
3648
+ */
3649
+ DispFlags: DISPSURF;
3650
+ /**
3651
+ * The contents of the hit surface. See Enums/CONTENTS.
3652
+ * @default `0`
3653
+ */
3654
+ Contents: CONTENTS;
3655
+ /**
3656
+ * BoneID on the model that the hit hitbox is attached to, if available.
3657
+ * @default `nil`
3658
+ */
3659
+ HitBoxBone?: number;
3660
+ }
3661
+
3662
+ /**
3663
+ * Table structure used by [steamworks.FileInfo](https://wiki.facepunch.com/gmod/steamworks.FileInfo).
3664
+ * @realm client and menu
3665
+ * @source https://wiki.facepunch.com/gmod/Structures/UGCFileInfo
3666
+ */
3667
+ interface UGCFileInfo {
3668
+ /**
3669
+ * The Workshop item ID
3670
+ */
3671
+ id: number;
3672
+ /**
3673
+ * The title of the Workshop item
3674
+ */
3675
+ title: string;
3676
+ /**
3677
+ * The description of the Workshop item. It will be limited to 255 characters (by Steam) unless steamworks.FileInfo is called with the `extraInfo` parameter set.
3678
+ */
3679
+ description: string;
3680
+ /**
3681
+ * The internal File ID of the workshop item, if any
3682
+ */
3683
+ fileid: number;
3684
+ /**
3685
+ * The internal File ID of the workshop item preview, if any
3686
+ */
3687
+ previewid: number;
3688
+ /**
3689
+ * A URL to the preview image of the workshop item
3690
+ */
3691
+ previewurl: string;
3692
+ /**
3693
+ * The SteamID64 of the original uploader of the addon
3694
+ */
3695
+ owner: number;
3696
+ /**
3697
+ * Unix timestamp of when the item was created
3698
+ */
3699
+ created: number;
3700
+ /**
3701
+ * Unix timestamp of when the file was last updated
3702
+ */
3703
+ updated: number;
3704
+ /**
3705
+ * Whether the file is banned or not
3706
+ */
3707
+ banned: boolean;
3708
+ /**
3709
+ * Comma (,) separated list of tags, may be truncated to some length
3710
+ */
3711
+ tags: string;
3712
+ /**
3713
+ * File size of the workshop item contents in bytes
3714
+ */
3715
+ size: number;
3716
+ /**
3717
+ * Filesize of the preview file in bytes
3718
+ */
3719
+ previewsize: number;
3720
+ /**
3721
+ * If the addon is subscribed, this value represents whether it is installed on the client and its files are accessible, false otherwise.
3722
+ */
3723
+ installed: boolean;
3724
+ /**
3725
+ * If the addon is subscribed, this value represents whether it is disabled on the client, false otherwise.
3726
+ */
3727
+ disabled: boolean;
3728
+ /**
3729
+ * A list of child Workshop Items for this item.
3730
+ *
3731
+ * For collections this will be sub-collections, for workshop items this will be the items they depend on.
3732
+ */
3733
+ children: table;
3734
+ /**
3735
+ * We advise against using this. It may be changed or removed in a future update.
3736
+ *
3737
+ * The "nice" name of the Uploader, or "Unnammed Player" if we failed to get the data for some reason.
3738
+ *
3739
+ * Do not use this field as it will most likely not be updated in time. Use steamworks.RequestPlayerInfo instead.
3740
+ */
3741
+ ownername: string;
3742
+ /**
3743
+ * If this key is set, no other data will be present in the response.
3744
+ *
3745
+ * Values above 0 represent Steam Error codes (https://steamerrors.com/), values below 0 mean the following:
3746
+ * * -1 means Failed to create query
3747
+ * * -2 means Failed to send query
3748
+ * * -3 means Received 0 or more than 1 result
3749
+ * * -4 means Failed to get item data from the response
3750
+ * * -5 means Workshop item ID in the response is invalid
3751
+ * * -6 means Workshop item ID in response is mismatching the requested file ID
3752
+ */
3753
+ error: number;
3754
+ /**
3755
+ * Number of "up" votes for this item.
3756
+ */
3757
+ up: number;
3758
+ /**
3759
+ * Number of "down" votes for this item.
3760
+ */
3761
+ down: number;
3762
+ /**
3763
+ * Number of total votes (up and down) for this item. This is NOT `up - down`.
3764
+ */
3765
+ total: number;
3766
+ /**
3767
+ * The up down vote ratio for this item, i.e. `1` is when every vote is `up`, `0.5` is when half of the total votes are the up votes, etc.
3768
+ */
3769
+ score: number;
3770
+ /**
3771
+ * A list of Steam content descriptiors for this Steam Workshop item.
3772
+ *
3773
+ * Possible values are:
3774
+ * * `general_mature`
3775
+ * * `gore`
3776
+ * * `suggestive`
3777
+ * * `nudity`
3778
+ * * `adult_only`
3779
+ */
3780
+ content_descriptors: string[];
3781
+ /**
3782
+ * If present, a list of additional previews for this Workshop item.
3783
+ *
3784
+ * steamworks.FileInfo must be called with `extraInfo` parameter.
3785
+ *
3786
+ * It will be a table of tables with the following keys:
3787
+ * * number `type` - type of additional preview. 0 = is normal image, 1=YouTube video ID
3788
+ * * string `url` - URL to the additional preview. Format depends on the type.
3789
+ */
3790
+ extra_previews: table[];
3791
+ }
3792
+
3793
+ /**
3794
+ * Table structure used by [undo.Do_Undo](https://wiki.facepunch.com/gmod/undo.Do_Undo) and [GM:CanUndo](https://wiki.facepunch.com/gmod/GM:CanUndo).
3795
+ * @realm server
3796
+ * @source https://wiki.facepunch.com/gmod/Structures/Undo
3797
+ */
3798
+ interface Undo {
3799
+ /**
3800
+ * The player responsible who owns the undo
3801
+ */
3802
+ Owner: Player;
3803
+ /**
3804
+ * The name of the text to report to the player
3805
+ */
3806
+ Name: string;
3807
+ /**
3808
+ * A table of entities to be removed by the undo
3809
+ */
3810
+ Entities: Entity[];
3811
+ /**
3812
+ * A table of {function_to_call, func_arg2, func_arg3}
3813
+ */
3814
+ Functions: table[];
3815
+ /**
3816
+ * A custom undo text to show the client
3817
+ */
3818
+ CustomUndoText: string;
3819
+ /**
3820
+ * A "nice" name of the undo, which will be used for the UI
3821
+ */
3822
+ NiceText: string;
3823
+ }
3824
+
3825
+ /**
3826
+ * The structure used by [Vehicle:SetVehicleParams](https://wiki.facepunch.com/gmod/Vehicle:SetVehicleParams) and [Vehicle:GetVehicleParams](https://wiki.facepunch.com/gmod/Vehicle:GetVehicleParams).
3827
+ * @realm server
3828
+ * @source https://wiki.facepunch.com/gmod/Structures/VehicleParams
3829
+ */
3830
+ interface VehicleParams {
3831
+ /**
3832
+ * Wheels per axle
3833
+ */
3834
+ wheelsPerAxle: number;
3835
+ /**
3836
+ * Number of axles
3837
+ */
3838
+ axleCount: number;
3839
+ /**
3840
+ * A table of Structures/VehicleParamsAxle tables.
3841
+ */
3842
+ axles: VehicleParamsAxle;
3843
+ /**
3844
+ * See Structures/VehicleParamsBody
3845
+ */
3846
+ body: VehicleParamsBody;
3847
+ /**
3848
+ * See Structures/VehicleParamsEngine
3849
+ */
3850
+ engine: VehicleParamsEngine;
3851
+ /**
3852
+ * See Structures/VehicleParamsSteering
3853
+ */
3854
+ steering: VehicleParamsSteering;
3855
+ }
3856
+
3857
+ /**
3858
+ * The structure used by [Structures/VehicleParams](https://wiki.facepunch.com/gmod/Structures/VehicleParams).
3859
+ * @realm server
3860
+ * @source https://wiki.facepunch.com/gmod/Structures/VehicleParamsAxle
3861
+ */
3862
+ interface VehicleParamsAxle {
3863
+ brakeFactor: number;
3864
+ offset: Vector;
3865
+ raytraceCenterOffset: Vector;
3866
+ raytraceOffset: Vector;
3867
+ suspension_maxBodyForce: number;
3868
+ suspension_springConstant: number;
3869
+ suspension_springDamping: number;
3870
+ suspension_springDampingCompression: number;
3871
+ suspension_stabilizerConstant: number;
3872
+ torqueFactor: number;
3873
+ wheelOffset: Vector;
3874
+ /**
3875
+ * Material index of braking material of the wheels. Upon braking, the wheels will be set to this material.
3876
+ */
3877
+ wheels_brakeMaterialIndex: number;
3878
+ wheels_damping: number;
3879
+ wheels_frictionScale: number;
3880
+ wheels_inertia: number;
3881
+ /**
3882
+ * Mass of each wheel.
3883
+ */
3884
+ wheels_mass: number;
3885
+ /**
3886
+ * Material index of the wheels by default.
3887
+ */
3888
+ wheels_materialIndex: number;
3889
+ /**
3890
+ * Radius of the wheels.
3891
+ */
3892
+ wheels_radius: number;
3893
+ wheels_rotdamping: number;
3894
+ /**
3895
+ * Material index of skid material of the wheels. Upon skidding ( pressing Space and sliding the vehicle ), the wheels will be set to this material.
3896
+ */
3897
+ wheels_skidMaterialIndex: number;
3898
+ wheels_springAdditionalLength: number;
3899
+ }
3900
+
3901
+ /**
3902
+ * The structure used by [Structures/VehicleParams](https://wiki.facepunch.com/gmod/Structures/VehicleParams).
3903
+ * @realm server
3904
+ * @source https://wiki.facepunch.com/gmod/Structures/VehicleParamsBody
3905
+ */
3906
+ interface VehicleParamsBody {
3907
+ /**
3908
+ * Additional gravity to be applied to the vehicle
3909
+ */
3910
+ addGravity: number;
3911
+ counterTorqueFactor: number;
3912
+ keepUprightTorque: number;
3913
+ /**
3914
+ * Mass center override
3915
+ */
3916
+ massCenterOverride: Vector;
3917
+ /**
3918
+ * Mass override
3919
+ */
3920
+ massOverride: number;
3921
+ /**
3922
+ * Maximum angular velocity
3923
+ */
3924
+ maxAngularVelocity: number;
3925
+ tiltForce: number;
3926
+ tiltForceHeight: number;
3927
+ }
3928
+
3929
+ /**
3930
+ * The structure used by [Structures/VehicleParams](https://wiki.facepunch.com/gmod/Structures/VehicleParams).
3931
+ * @realm server
3932
+ * @source https://wiki.facepunch.com/gmod/Structures/VehicleParamsEngine
3933
+ */
3934
+ interface VehicleParamsEngine {
3935
+ autobrakeSpeedFactor: number;
3936
+ autobrakeSpeedGain: number;
3937
+ /**
3938
+ * This acts as the final ratio of the gearbox.
3939
+ *
3940
+ * It's like a master coefficient of the gearbox.
3941
+ */
3942
+ axleRatio: number;
3943
+ /**
3944
+ * Amount of seconds between being able to use the boost ( by pressing Shift key by default )
3945
+ */
3946
+ boostDelay: number;
3947
+ /**
3948
+ * Duration of the boost in seconds
3949
+ */
3950
+ boostDuration: number;
3951
+ boostForce: number;
3952
+ /**
3953
+ * Maximum speed while boosting
3954
+ *
3955
+ * The [Vehicle:SetVehicleParams](https://wiki.facepunch.com/gmod/Vehicle:SetVehicleParams) function takes this in **miles per hour**, but [Vehicle:GetVehicleParams](https://wiki.facepunch.com/gmod/Vehicle:GetVehicleParams) returns this in **hammer units per second**!
3956
+ *
3957
+ * In this case HU = inches, so 1 MPH is 17.6 HU/s.
3958
+ */
3959
+ boostMaxSpeed: number;
3960
+ /**
3961
+ * Amount of gears this vehicle has.
3962
+ */
3963
+ gearCount: number;
3964
+ /**
3965
+ * A table of numbers, of gear rations.
3966
+ *
3967
+ * Table length is equal to "gearCount" member of this table.
3968
+ */
3969
+ gearRatio: table;
3970
+ /**
3971
+ * The HP amount of the vehicle
3972
+ *
3973
+ * This value is used to calculate the effectively applied torque, along with ratios and `maxRPM`.
3974
+ */
3975
+ horsepower: number;
3976
+ /**
3977
+ * If `true`, the gearbox shifts gears, if `false` the gearbox stays stuck to the 1st gear (gear number 0).
3978
+ */
3979
+ isAutoTransmission: boolean;
3980
+ /**
3981
+ * Maximum RPM of the vehicle.
3982
+ *
3983
+ * Despite this being a maximum value, the vehicle can exceed it.
3984
+ *
3985
+ * Attempts to exceed the max RPM will force the active gear ratio to be that of the 1st gear, which will provide even more torque. This is the opposite of a rev limiter. This value is only used for the calculation of the effectively applied torque.
3986
+ */
3987
+ maxRPM: number;
3988
+ /**
3989
+ * Maximum reverse speed of the vehicle
3990
+ *
3991
+ * The [Vehicle:SetVehicleParams](https://wiki.facepunch.com/gmod/Vehicle:SetVehicleParams) function takes this in **miles per hour**, but [Vehicle:GetVehicleParams](https://wiki.facepunch.com/gmod/Vehicle:GetVehicleParams) returns this in **hammer units per second**!
3992
+ *
3993
+ * In this case HU = inches, so 1 MPH is 17.6 HU/s.
3994
+ */
3995
+ maxRevSpeed: number;
3996
+ /**
3997
+ * Maximum forward going speed of the vehicle without boosting
3998
+ *
3999
+ * The [Vehicle:SetVehicleParams](https://wiki.facepunch.com/gmod/Vehicle:SetVehicleParams) function takes this in **miles per hour**, but [Vehicle:GetVehicleParams](https://wiki.facepunch.com/gmod/Vehicle:GetVehicleParams) returns this in **hammer units per second**!
4000
+ *
4001
+ * In this case HU = inches, so 1 MPH is 17.6 HU/s.
4002
+ */
4003
+ maxSpeed: number;
4004
+ /**
4005
+ * Amount of RPM to automatically shift one gear down
4006
+ */
4007
+ shiftDownRPM: number;
4008
+ /**
4009
+ * Amount of RPM to automatically shift one gear up
4010
+ */
4011
+ shiftUpRPM: number;
4012
+ throttleTime: number;
4013
+ torqueBoost: boolean;
4014
+ }
4015
+
4016
+ /**
4017
+ * The structure used by [Structures/VehicleParams](https://wiki.facepunch.com/gmod/Structures/VehicleParams).
4018
+ * @realm server
4019
+ * @source https://wiki.facepunch.com/gmod/Structures/VehicleParamsSteering
4020
+ */
4021
+ interface VehicleParamsSteering {
4022
+ boostSteeringRateFactor: number;
4023
+ boostSteeringRestRateFactor: number;
4024
+ brakeSteeringRateFactor: number;
4025
+ /**
4026
+ * The maximum angle at which the vehicle can turn while boosting
4027
+ */
4028
+ degreesBoost: number;
4029
+ /**
4030
+ * The maximum angle at which the vehicle can turn while moving at max speed and not boosting
4031
+ */
4032
+ degreesFast: number;
4033
+ /**
4034
+ * The maximum angle at which the vehicle can turn while moving slowest
4035
+ */
4036
+ degreesSlow: number;
4037
+ /**
4038
+ * Disabled in Garry's Mod. In Half-Life 2: Episode 2 this dictates whether the vehicle should leave wheel dust effects when driving around
4039
+ */
4040
+ dustCloud: boolean;
4041
+ /**
4042
+ * Whether the vehicle is allowed to skid/drift
4043
+ */
4044
+ isSkidAllowed: boolean;
4045
+ /**
4046
+ * In Hammer Units
4047
+ */
4048
+ powerSlideAccel: number;
4049
+ speedFast: number;
4050
+ speedSlow: number;
4051
+ steeringExponent: number;
4052
+ steeringRateFast: number;
4053
+ steeringRateSlow: number;
4054
+ steeringRestRateFast: number;
4055
+ steeringRestRateSlow: number;
4056
+ throttleSteeringRestRateFactor: number;
4057
+ turnThrottleReduceFast: number;
4058
+ turnThrottleReduceSlow: number;
4059
+ }
4060
+
4061
+ /**
4062
+ * Table structure passed to [SANDBOX:PlayerSpawnVehicle](https://wiki.facepunch.com/gmod/SANDBOX:PlayerSpawnVehicle), describing a spawnable Vehicle in Sandbox gamemode.
4063
+ *
4064
+ * Example usage in defined a custom spawnable vehicle:
4065
+ * ```
4066
+ * list.Set( "Vehicles", "Jeep", {
4067
+ * -- Required information
4068
+ * Name = "Jeep",
4069
+ * Model = "models/buggy.mdl",
4070
+ * Class = "prop_vehicle_jeep_old",
4071
+ * Category = "Half-Life 2",
4072
+ *
4073
+ * -- Optional information
4074
+ * Author = "VALVe",
4075
+ * Information = "The regular old jeep",
4076
+ *
4077
+ * KeyValues = {
4078
+ * vehiclescript = "scripts/vehicles/jeep_test.txt"
4079
+ * }
4080
+ * } )
4081
+ * ```
4082
+ *
4083
+ * @realm shared
4084
+ * @source https://wiki.facepunch.com/gmod/Structures/VehicleTable
4085
+ */
4086
+ interface VehicleTable {
4087
+ /**
4088
+ * Entity class name for this vehicle.
4089
+ */
4090
+ Class: string;
4091
+ /**
4092
+ * Nice name for this vehicle, for UI purposes.
4093
+ */
4094
+ Name: string;
4095
+ /**
4096
+ * Model of the vehicle.
4097
+ */
4098
+ Model: string;
4099
+ /**
4100
+ * A list of key-value pairs to apply to the vehicle entity.
4101
+ * Possible valid keys that can be set are:
4102
+ *
4103
+ * | Key | Description |
4104
+ * |:-------:|:------------|
4105
+ * | `vehiclescript` | The vehicle script files contained in scripts\vehicles\ define the behaviour and handling of a vehicle.
4106
+ * | `limitview` | Limit vertical view of the vehicles to +/-70 degrees (90 for unlimited)
4107
+ * | `vehiclelocked` | Players cannot enter vehicle until it is unlocked.
4108
+ * | `cargovisible` | Is the Magnusson cargo hopper visible?
4109
+ * | `EnableGun` | Whether the Tau Cannon is enabled or disabled. Doesn't work correctly with the Episode Two jalopy model.
4110
+ * | `NoHazardLights`| Stops the jalopy's hazard lights from turning on and flashing when the player exits the vehicle.
4111
+ */
4112
+ KeyValues: table;
4113
+ /**
4114
+ * Offset away the surface player is looking at to spawn at.
4115
+ * @default `nil`
4116
+ */
4117
+ Offset?: number;
4118
+ /**
4119
+ * Set these members on the spawned vehicle's table (Entity:GetTable) to given values.
4120
+ * @default `nil`
4121
+ */
4122
+ Members?: table;
4123
+ /**
4124
+ * Author of the vehicle, for UI purposes.
4125
+ * @default ``
4126
+ */
4127
+ Author: string;
4128
+ /**
4129
+ * Category of this vehicle, for UI purposes.
4130
+ * @default `Other`
4131
+ */
4132
+ Category: string;
4133
+ /**
4134
+ * A small description of the vehicle, for UI purposes.
4135
+ * @default ``
4136
+ */
4137
+ Information: string;
4138
+ }
4139
+
4140
+ /**
4141
+ * Table structure used by [video.Record](https://wiki.facepunch.com/gmod/video.Record).
4142
+ * @realm client and menu
4143
+ * @source https://wiki.facepunch.com/gmod/Structures/VideoData
4144
+ */
4145
+ interface VideoData {
4146
+ /**
4147
+ * The video container format.
4148
+ *
4149
+ * Valid options are: `webm`, `ogg`
4150
+ */
4151
+ container: string;
4152
+ /**
4153
+ * The video codec.
4154
+ *
4155
+ * Valid options are: `vp8`, `theora`
4156
+ */
4157
+ video: string;
4158
+ /**
4159
+ * The audio codec.
4160
+ *
4161
+ * Valid options are: `vorbis`
4162
+ */
4163
+ audio: string;
4164
+ /**
4165
+ * The video quality
4166
+ */
4167
+ quality: number;
4168
+ /**
4169
+ * The record bitrate
4170
+ */
4171
+ bitrate: number;
4172
+ /**
4173
+ * Frames per second
4174
+ */
4175
+ fps: number;
4176
+ /**
4177
+ * Lock the frame count per second
4178
+ */
4179
+ lockfps: boolean;
4180
+ /**
4181
+ * The file name for the video
4182
+ */
4183
+ name: string;
4184
+ /**
4185
+ * The videos width
4186
+ */
4187
+ width: number;
4188
+ /**
4189
+ * The videos height
4190
+ */
4191
+ height: number;
4192
+ }
4193
+
4194
+ /**
4195
+ * Table structure used for [render.RenderView](https://wiki.facepunch.com/gmod/render.RenderView).
4196
+ *
4197
+ * Unless stated otherwise, the default values for all these keys would be inherited from the engine's CViewSetup and do not have static representations.
4198
+ *
4199
+ * @realm client
4200
+ * @source https://wiki.facepunch.com/gmod/Structures/ViewData
4201
+ */
4202
+ interface ViewData {
4203
+ /**
4204
+ * The view's original position
4205
+ */
4206
+ origin: Vector;
4207
+ /**
4208
+ * The view's angles
4209
+ */
4210
+ angles: Angle;
4211
+ /**
4212
+ * Default width divided by height. Has a deprecated alias `aspectratio`.
4213
+ */
4214
+ aspect: number;
4215
+ /**
4216
+ * The x position of the viewport to render in
4217
+ */
4218
+ x: number;
4219
+ /**
4220
+ * The y position of the viewport to render in
4221
+ */
4222
+ y: number;
4223
+ /**
4224
+ * The width of the viewport to render in
4225
+ */
4226
+ w: number;
4227
+ /**
4228
+ * The height of the viewport to render in
4229
+ */
4230
+ h: number;
4231
+ /**
4232
+ * Draw the HUD and call the hud painting related hooks
4233
+ * @default `false`
4234
+ */
4235
+ drawhud: boolean;
4236
+ /**
4237
+ * Draw monitors
4238
+ * @default `false`
4239
+ */
4240
+ drawmonitors: boolean;
4241
+ /**
4242
+ * The weapon's viewmodel
4243
+ * @default `true`
4244
+ */
4245
+ drawviewmodel: boolean;
4246
+ /**
4247
+ * Whether to force draw the local player or not.
4248
+ * @default `false`
4249
+ */
4250
+ drawviewer: boolean;
4251
+ /**
4252
+ * The viewmodel's FOV
4253
+ */
4254
+ viewmodelfov: number;
4255
+ /**
4256
+ * The main view's FOV
4257
+ */
4258
+ fov: number;
4259
+ /**
4260
+ * If set, renders the view orthogonally. A table with these keys:
4261
+ * * left
4262
+ * * right
4263
+ * * top
4264
+ * * bottom
4265
+ */
4266
+ ortho: table;
4267
+ /**
4268
+ * Coordinate for the left clipping plane. Requires `ortho` to be set to `true`.
4269
+ *
4270
+ * **Deprecated**: Use `ortho` table instead!
4271
+ */
4272
+ ortholeft: number;
4273
+ /**
4274
+ * Coordinate for the right clipping plane. Requires `ortho` to be set to `true`.
4275
+ *
4276
+ * **Deprecated**: Use `ortho` table instead!
4277
+ */
4278
+ orthoright: number;
4279
+ /**
4280
+ * Coordinate for the top clipping plane. Requires `ortho` to be set to `true`.
4281
+ *
4282
+ * **Deprecated**: Use `ortho` table instead!
4283
+ */
4284
+ orthotop: number;
4285
+ /**
4286
+ * Coordinate for the bottom clipping plane. Requires `ortho` to be set to `true`.
4287
+ *
4288
+ * **Deprecated**: Use `ortho` table instead!
4289
+ */
4290
+ orthobottom: number;
4291
+ /**
4292
+ * The distance of the view's origin to the near clipping plane
4293
+ */
4294
+ znear: number;
4295
+ /**
4296
+ * The distance of the view's origin to the far clipping plane
4297
+ */
4298
+ zfar: number;
4299
+ /**
4300
+ * The distance of the view's origin to the near clipping plane for the viewmodel
4301
+ */
4302
+ znearviewmodel: number;
4303
+ /**
4304
+ * The distance of the view's origin to the far clipping plane for the viewmodel
4305
+ */
4306
+ zfarviewmodel: number;
4307
+ /**
4308
+ * Currently works identically to the "bloomtone" option (it also overrides it if you set this to false).
4309
+ * @default `false`
4310
+ */
4311
+ dopostprocess: boolean;
4312
+ /**
4313
+ * Disables default engine bloom and pauses the "brightness changes" on HDR maps.
4314
+ * @default `true`
4315
+ */
4316
+ bloomtone: boolean;
4317
+ /**
4318
+ * This is identifying which logical part of the scene an entity is being redered in, see Enums/VIEW.
4319
+ * @default `0`
4320
+ */
4321
+ viewid: VIEW;
4322
+ /**
4323
+ * This allows you to "zoom in" on a part of the screen - for example, the top-left quarter of the screen. This is similar to how [poster splits the screen](https://garry.blog/poster-screenshots/) into separate renders.
4324
+ *
4325
+ * It's a table with 4 keys, controlling what portion of the screen to draw:
4326
+ * * left - where the left edge starts. Natural value is 0.
4327
+ * * right - where the right edge ends. Natural value is equal to w (the width of the viewport).
4328
+ * * top - where the `bottom` edge starts. Natural value is 0.
4329
+ * * bottom - where the `top` edge ends. Natural value is equal to h (the height of the viewport).
4330
+ *
4331
+ * Note that top and bottom are reversed.
4332
+ *
4333
+ * Values outside the viewport are allowed, but not recommended - instead you should increase the view FOV.
4334
+ */
4335
+ offcenter: table;
4336
+ }
4337
+
4338
+ /**
4339
+ * Table structure used for [render.GetViewSetup](https://wiki.facepunch.com/gmod/render.GetViewSetup).
4340
+ *
4341
+ * @realm client
4342
+ * @source https://wiki.facepunch.com/gmod/Structures/ViewSetup
4343
+ */
4344
+ interface ViewSetup {
4345
+ /**
4346
+ * The current view id. See Enums/VIEW.
4347
+ */
4348
+ viewid: VIEW;
4349
+ /**
4350
+ * The view's origin/position
4351
+ */
4352
+ origin: Vector;
4353
+ /**
4354
+ * The view's angles
4355
+ */
4356
+ angles: Angle;
4357
+ /**
4358
+ * Width divided by height
4359
+ */
4360
+ aspect: number;
4361
+ /**
4362
+ * The x position of the viewport
4363
+ */
4364
+ x: number;
4365
+ /**
4366
+ * The y position of the viewport
4367
+ */
4368
+ y: number;
4369
+ /**
4370
+ * The width of the viewport
4371
+ */
4372
+ width: number;
4373
+ /**
4374
+ * The height of the viewport
4375
+ */
4376
+ height: number;
4377
+ /**
4378
+ * The main view's FOV, adjusted for aspect ratio.
4379
+ */
4380
+ fov: number;
4381
+ /**
4382
+ * The main view's FOV as the user setting.
4383
+ */
4384
+ fov_unscaled: number;
4385
+ /**
4386
+ * The viewmodel's FOV, adjusted for aspect ratio.
4387
+ */
4388
+ fovviewmodel: number;
4389
+ /**
4390
+ * The viewmodel's FOV as the user setting.
4391
+ */
4392
+ fovviewmodel_unscaled: number;
4393
+ /**
4394
+ * If the current view is orthogonal, a table with these keys:
4395
+ * * left
4396
+ * * right
4397
+ * * top
4398
+ * * bottom
4399
+ *
4400
+ * Will not be present if view is not orthagonal.
4401
+ */
4402
+ ortho: table;
4403
+ /**
4404
+ * The distance of the view's origin to the near clipping plane
4405
+ */
4406
+ znear: number;
4407
+ /**
4408
+ * The distance of the view's origin to the far clipping plane
4409
+ */
4410
+ zfar: number;
4411
+ /**
4412
+ * The distance of the view's origin to the near clipping plane for the viewmodel
4413
+ */
4414
+ znearviewmodel: number;
4415
+ /**
4416
+ * The distance of the view's origin to the far clipping plane for the viewmodel
4417
+ */
4418
+ zfarviewmodel: number;
4419
+ /**
4420
+ * Whether default engine bloom and tonemapping are enabled at this instant for this view.
4421
+ */
4422
+ bloomtone: boolean;
4423
+ /**
4424
+ * Whether `m_bRenderToSubrectOfLargerScreen` if set for this view.
4425
+ */
4426
+ subrect: boolean;
4427
+ /**
4428
+ * It's a table with 4 keys, controlling what portion of the screen to draw:
4429
+ * * left - where the left edge starts. Natural value is 0.
4430
+ * * right - where the right edge ends. Natural value is equal to w (the width of the viewport).
4431
+ * * top - where the `bottom` edge starts. Natural value is 0.
4432
+ * * bottom - where the `top` edge ends. Natural value is equal to h (the height of the viewport).
4433
+ *
4434
+ * Note that top and bottom are reversed.
4435
+ *
4436
+ * This will not be present if offscreen rendering is not enabled for this view.
4437
+ *
4438
+ * See Structures/ViewData for more info.
4439
+ */
4440
+ offcenter: table;
4441
+ }
4442
+