@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.
- package/README.md +28 -0
- package/__metadata.json +4 -0
- package/_globals.d.tlua +178 -0
- package/_gmod-std.d.tlua +35 -0
- package/achievementicon.d.tlua +12 -0
- package/achievements.d.tlua +162 -0
- package/ai.d.tlua +65 -0
- package/ai_schedule.d.tlua +17 -0
- package/ai_task.d.tlua +17 -0
- package/angle.d.tlua +197 -0
- package/avatarimage.d.tlua +10 -0
- package/awesomium.d.tlua +14 -0
- package/baseclass.d.tlua +42 -0
- package/bf_read.d.tlua +110 -0
- package/bit.d.tlua +121 -0
- package/button.d.tlua +13 -0
- package/cam.d.tlua +220 -0
- package/ceffectdata.d.tlua +337 -0
- package/chat.d.tlua +62 -0
- package/checkbutton.d.tlua +14 -0
- package/cleanup.d.tlua +88 -0
- package/cluaemitter.d.tlua +119 -0
- package/clualocomotion.d.tlua +383 -0
- package/cluaparticle.d.tlua +426 -0
- package/cmovedata.d.tlua +476 -0
- package/cnavarea.d.tlua +845 -0
- package/cnavladder.d.tlua +209 -0
- package/cnewparticleeffect.d.tlua +259 -0
- package/color.d.tlua +339 -0
- package/concommand.d.tlua +69 -0
- package/constraint.d.tlua +311 -0
- package/construct.d.tlua +26 -0
- package/contentheader.d.tlua +32 -0
- package/contenticon.d.tlua +86 -0
- package/contentsidebar.d.tlua +45 -0
- package/contentsidebartoolbox.d.tlua +13 -0
- package/contextbase.d.tlua +37 -0
- package/controlpanel.d.tlua +140 -0
- package/controlpresets.d.tlua +118 -0
- package/convar.d.tlua +162 -0
- package/cookie.d.tlua +60 -0
- package/coroutine.d.tlua +90 -0
- package/crecipientfilter.d.tlua +152 -0
- package/csent.d.tlua +10 -0
- package/csoundpatch.d.tlua +150 -0
- package/ctakedamageinfo.d.tlua +366 -0
- package/ctrllistbox.d.tlua +12 -0
- package/ctrlnumpad.d.tlua +73 -0
- package/cusercmd.d.tlua +320 -0
- package/custom_classes.d.tlua +65 -0
- package/custom_entity_fields.d.tlua +96 -0
- package/cvars.d.tlua +80 -0
- package/dadjustablemodelpanel.d.tlua +81 -0
- package/dalphabar.d.tlua +27 -0
- package/dbinder.d.tlua +37 -0
- package/dbubblecontainer.d.tlua +18 -0
- package/dbutton.d.tlua +88 -0
- package/dcategoryheader.d.tlua +13 -0
- package/dcategorylist.d.tlua +11 -0
- package/dcheckbox.d.tlua +46 -0
- package/dcheckboxlabel.d.tlua +90 -0
- package/dcollapsiblecategory.d.tlua +240 -0
- package/dcolorbutton.d.tlua +73 -0
- package/dcolorcombo.d.tlua +54 -0
- package/dcolorcube.d.tlua +137 -0
- package/dcolormixer.d.tlua +303 -0
- package/dcolorpalette.d.tlua +294 -0
- package/dcolumnsheet.d.tlua +49 -0
- package/dcombobox.d.tlua +161 -0
- package/ddragbase.d.tlua +151 -0
- package/ddrawer.d.tlua +72 -0
- package/debug.d.tlua +236 -0
- package/debugoverlay.d.tlua +193 -0
- package/dentityproperties.d.tlua +63 -0
- package/derma.d.tlua +119 -0
- package/dexpandbutton.d.tlua +30 -0
- package/dfilebrowser.d.tlua +228 -0
- package/dform.d.tlua +176 -0
- package/dframe.d.tlua +261 -0
- package/dgrid.d.tlua +113 -0
- package/dhorizontaldivider.d.tlua +196 -0
- package/dhorizontalscroller.d.tlua +104 -0
- package/dhscrollbar.d.tlua +109 -0
- package/dhtml.d.tlua +91 -0
- package/dhtmlcontrols.d.tlua +62 -0
- package/diconbrowser.d.tlua +113 -0
- package/diconlayout.d.tlua +190 -0
- package/dimage.d.tlua +221 -0
- package/dimagebutton.d.tlua +103 -0
- package/dkillicon.d.tlua +9 -0
- package/dlabel.d.tlua +385 -0
- package/dlabeleditable.d.tlua +51 -0
- package/dlabelurl.d.tlua +100 -0
- package/dlistbox.d.tlua +82 -0
- package/dlistboxitem.d.tlua +42 -0
- package/dlistlayout.d.tlua +14 -0
- package/dlistview.d.tlua +360 -0
- package/dlistview_column.d.tlua +135 -0
- package/dlistview_columnplain.d.tlua +11 -0
- package/dlistview_draggerbar.d.tlua +11 -0
- package/dlistview_line.d.tlua +140 -0
- package/dlistviewheaderlabel.d.tlua +11 -0
- package/dlistviewlabel.d.tlua +11 -0
- package/dlistviewline.d.tlua +11 -0
- package/dmenu.d.tlua +266 -0
- package/dmenubar.d.tlua +42 -0
- package/dmenuoption.d.tlua +135 -0
- package/dmenuoptioncvar.d.tlua +64 -0
- package/dmodelpanel.d.tlua +207 -0
- package/dmodelselect.d.tlua +20 -0
- package/dmodelselectmulti.d.tlua +19 -0
- package/dnotify.d.tlua +93 -0
- package/dnumberscratch.d.tlua +284 -0
- package/dnumberwang.d.tlua +147 -0
- package/dnumpad.d.tlua +11 -0
- package/dnumslider.d.tlua +182 -0
- package/dpanel.d.tlua +152 -0
- package/dpanellist.d.tlua +109 -0
- package/dpaneloverlay.d.tlua +65 -0
- package/dpanelselect.d.tlua +13 -0
- package/dpanpanel.d.tlua +64 -0
- package/dprogress.d.tlua +27 -0
- package/dproperties.d.tlua +52 -0
- package/dproperty_boolean.d.tlua +12 -0
- package/dproperty_combo.d.tlua +31 -0
- package/dproperty_entity.d.tlua +12 -0
- package/dproperty_float.d.tlua +12 -0
- package/dproperty_generic.d.tlua +50 -0
- package/dproperty_int.d.tlua +12 -0
- package/dproperty_vectorcolor.d.tlua +14 -0
- package/dpropertysheet.d.tlua +167 -0
- package/dragndrop.d.tlua +123 -0
- package/draw.d.tlua +162 -0
- package/drgbpicker.d.tlua +49 -0
- package/drive.d.tlua +159 -0
- package/dscrollbargrip.d.tlua +13 -0
- package/dscrollpanel.d.tlua +110 -0
- package/dshape.d.tlua +72 -0
- package/dsizetocontents.d.tlua +46 -0
- package/dslider.d.tlua +302 -0
- package/dsprite.d.tlua +84 -0
- package/dtab.d.tlua +81 -0
- package/dtextentry.d.tlua +442 -0
- package/dtilelayout.d.tlua +218 -0
- package/dtooltip.d.tlua +76 -0
- package/dtree.d.tlua +185 -0
- package/dtree_node.d.tlua +793 -0
- package/dtree_node_button.d.tlua +13 -0
- package/duplicator.d.tlua +338 -0
- package/dverticaldivider.d.tlua +223 -0
- package/dvscrollbar.d.tlua +109 -0
- package/editablepanel.d.tlua +10 -0
- package/effect.d.tlua +121 -0
- package/effects.d.tlua +77 -0
- package/engine.d.tlua +248 -0
- package/entity.d.tlua +8295 -0
- package/ents.d.tlua +267 -0
- package/enums.d.tlua +7082 -0
- package/file.d.tlua +419 -0
- package/file_class.d.tlua +7 -0
- package/fingerposer.d.tlua +12 -0
- package/fingervar.d.tlua +13 -0
- package/frame.d.tlua +11 -0
- package/frame_blend.d.tlua +105 -0
- package/game.d.tlua +482 -0
- package/gameevent.d.tlua +968 -0
- package/gamemode.d.tlua +48 -0
- package/global.d.tlua +3156 -0
- package/gm.d.tlua +3218 -0
- package/gmod.d.tlua +20 -0
- package/gmsave.d.tlua +53 -0
- package/gui.d.tlua +232 -0
- package/gwen.d.tlua +55 -0
- package/halo.d.tlua +42 -0
- package/hammer.d.tlua +17 -0
- package/hook.d.tlua +64 -0
- package/html.d.tlua +22 -0
- package/http.d.tlua +72 -0
- package/iconeditor.d.tlua +130 -0
- package/igmodaudiochannel.d.tlua +419 -0
- package/imagecheckbox.d.tlua +48 -0
- package/imaterial.d.tlua +288 -0
- package/imesh.d.tlua +70 -0
- package/index.d.tlua +277 -0
- package/input.d.tlua +252 -0
- package/invalidateinternalentitycache.d.tlua +13 -0
- package/irestore.d.tlua +94 -0
- package/isave.d.tlua +94 -0
- package/itexture.d.tlua +108 -0
- package/ivideowriter.d.tlua +53 -0
- package/jit.d.tlua +243 -0
- package/killicon.d.tlua +84 -0
- package/label.d.tlua +20 -0
- package/language.d.tlua +26 -0
- package/list.d.tlua +112 -0
- package/makeballoon.d.tlua +15 -0
- package/markup.d.tlua +38 -0
- package/markupobject.d.tlua +53 -0
- package/material.d.tlua +9 -0
- package/math.d.tlua +899 -0
- package/matproxy.d.tlua +60 -0
- package/matselect.d.tlua +106 -0
- package/menu.d.tlua +20 -0
- package/menubar.d.tlua +39 -0
- package/mesh.d.tlua +183 -0
- package/modelimage.d.tlua +12 -0
- package/motionsensor.d.tlua +115 -0
- package/navmesh.d.tlua +274 -0
- package/net.d.tlua +639 -0
- package/nextbot.d.tlua +380 -0
- package/notification.d.tlua +35 -0
- package/npc.d.tlua +1787 -0
- package/numpad.d.tlua +89 -0
- package/os.d.tlua +56 -0
- package/package.d.tlua +15 -0
- package/package.json +18 -0
- package/panel.d.tlua +3650 -0
- package/panellist.d.tlua +13 -0
- package/pathfollower.d.tlua +301 -0
- package/permissions.d.tlua +77 -0
- package/physcollide.d.tlua +40 -0
- package/physenv.d.tlua +136 -0
- package/physobj.d.tlua +799 -0
- package/pixelvis_handle_t.d.tlua +9 -0
- package/player.d.tlua +3320 -0
- package/player_manager.d.tlua +147 -0
- package/preseteditor.d.tlua +13 -0
- package/presets.d.tlua +79 -0
- package/projectedtexture.d.tlua +553 -0
- package/properties.d.tlua +65 -0
- package/propselect.d.tlua +50 -0
- package/radiobutton.d.tlua +13 -0
- package/render.d.tlua +1700 -0
- package/resource.d.tlua +73 -0
- package/richtext.d.tlua +17 -0
- package/sandbox.d.tlua +576 -0
- package/saverestore.d.tlua +148 -0
- package/schedule.d.tlua +69 -0
- package/scripted_ents.d.tlua +124 -0
- package/search.d.tlua +26 -0
- package/serverlist.d.tlua +85 -0
- package/slidebar.d.tlua +12 -0
- package/slider.d.tlua +11 -0
- package/sound.d.tlua +140 -0
- package/spawnicon.d.tlua +95 -0
- package/spawnmenu.d.tlua +286 -0
- package/spawnmenucontentpanel.d.tlua +52 -0
- package/sql.d.tlua +154 -0
- package/stack.d.tlua +57 -0
- package/steamworks.d.tlua +208 -0
- package/string.d.tlua +535 -0
- package/structures.d.tlua +4442 -0
- package/surface.d.tlua +463 -0
- package/surfaceinfo.d.tlua +70 -0
- package/system.d.tlua +134 -0
- package/table.d.tlua +533 -0
- package/task.d.tlua +92 -0
- package/team.d.tlua +195 -0
- package/textentry.d.tlua +12 -0
- package/tgaimage.d.tlua +11 -0
- package/timer.d.tlua +198 -0
- package/tool.d.tlua +466 -0
- package/ugcpublishwindow.d.tlua +83 -0
- package/umsg.d.tlua +147 -0
- package/undo.d.tlua +122 -0
- package/urllabel.d.tlua +13 -0
- package/usermessage.d.tlua +48 -0
- package/utf8.d.tlua +89 -0
- package/util.d.tlua +1087 -0
- package/vector.d.tlua +413 -0
- package/vehicle.d.tlua +472 -0
- package/vgui.d.tlua +201 -0
- package/video.d.tlua +17 -0
- package/vmatrix.d.tlua +392 -0
- package/weapon.d.tlua +913 -0
- package/weapons.d.tlua +90 -0
- package/widgets.d.tlua +29 -0
- package/workshopfilebase.d.tlua +68 -0
package/npc.d.tlua
ADDED
|
@@ -0,0 +1,1787 @@
|
|
|
1
|
+
// AUTO-GENERATED tlua declarations. Do not edit by hand.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is a list of all methods only available for NPCs. It is also possible to call [Entity](https://wiki.facepunch.com/gmod/Entity) functions on NPCs.
|
|
5
|
+
* @source https://wiki.facepunch.com/gmod/NPC
|
|
6
|
+
*/
|
|
7
|
+
interface NPC extends Entity {}
|
|
8
|
+
|
|
9
|
+
interface NPC {
|
|
10
|
+
/**
|
|
11
|
+
* Makes the NPC like, hate, feel neutral towards, or fear the entity in question. If you want to setup relationship towards a certain entity `class`, use [NPC:AddRelationship](https://wiki.facepunch.com/gmod/NPC:AddRelationship).
|
|
12
|
+
*
|
|
13
|
+
* **NOTE**: NPCs do not see [NextBot](https://wiki.facepunch.com/gmod/NextBot)s by default. This can be fixed by adding the [FL_OBJECT](https://wiki.facepunch.com/gmod/Enums/FL) flag to the NextBot.
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
* @realm server
|
|
17
|
+
* @source https://wiki.facepunch.com/gmod/NPC:AddEntityRelationship
|
|
18
|
+
*/
|
|
19
|
+
AddEntityRelationship(self: NPC, target: Entity, disposition: number, priority?: number): void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface NPC {
|
|
23
|
+
/**
|
|
24
|
+
* Changes how an NPC feels towards another NPC. If you want to setup relationship towards a certain `entity`, use [NPC:AddEntityRelationship](https://wiki.facepunch.com/gmod/NPC:AddEntityRelationship).
|
|
25
|
+
*
|
|
26
|
+
* **WARNING**: Avoid using this in [GM:OnEntityCreated](https://wiki.facepunch.com/gmod/GM:OnEntityCreated) to prevent crashing due to infinite loops. This function may create an entity with given class and delete it immediately after.
|
|
27
|
+
*
|
|
28
|
+
*
|
|
29
|
+
* @realm server
|
|
30
|
+
* @source https://wiki.facepunch.com/gmod/NPC:AddRelationship
|
|
31
|
+
*/
|
|
32
|
+
AddRelationship(self: NPC, relationstring: string): void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface NPC {
|
|
36
|
+
/**
|
|
37
|
+
* Advances the NPC on its path to the next waypoint.
|
|
38
|
+
* **WARNING**: Calling this on an NPC without any route will result in an instant crash.
|
|
39
|
+
*
|
|
40
|
+
*
|
|
41
|
+
* @realm server
|
|
42
|
+
* @source https://wiki.facepunch.com/gmod/NPC:AdvancePath
|
|
43
|
+
*/
|
|
44
|
+
AdvancePath(self: NPC): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface NPC {
|
|
48
|
+
/**
|
|
49
|
+
* Force an NPC to play their Alert sound.
|
|
50
|
+
* @realm server
|
|
51
|
+
* @source https://wiki.facepunch.com/gmod/NPC:AlertSound
|
|
52
|
+
*/
|
|
53
|
+
AlertSound(self: NPC): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface NPC {
|
|
57
|
+
/**
|
|
58
|
+
* Executes any movement the current sequence may have.
|
|
59
|
+
* @realm server
|
|
60
|
+
* @source https://wiki.facepunch.com/gmod/NPC:AutoMovement
|
|
61
|
+
*/
|
|
62
|
+
AutoMovement(self: NPC, interval: number, target?: Entity): boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface NPC {
|
|
66
|
+
/**
|
|
67
|
+
* Become a ragdoll and remove the entity. Internally handles serverside/clientside ragdoll creation, momentum calculation, triggering ragdoll creation hooks / events and cloning entity's bone transforms to the created ragdoll.
|
|
68
|
+
* @realm server
|
|
69
|
+
* @source https://wiki.facepunch.com/gmod/NPC:BecomeRagdoll
|
|
70
|
+
*/
|
|
71
|
+
BecomeRagdoll(self: NPC, info: CTakeDamageInfo): Entity;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface NPC {
|
|
75
|
+
/**
|
|
76
|
+
* Adds a capability to the NPC.
|
|
77
|
+
* @realm server
|
|
78
|
+
* @source https://wiki.facepunch.com/gmod/NPC:CapabilitiesAdd
|
|
79
|
+
*/
|
|
80
|
+
CapabilitiesAdd(self: NPC, capabilities: CAP): void;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface NPC {
|
|
84
|
+
/**
|
|
85
|
+
* Removes all of Capabilities the NPC has.
|
|
86
|
+
* @realm server
|
|
87
|
+
* @source https://wiki.facepunch.com/gmod/NPC:CapabilitiesClear
|
|
88
|
+
*/
|
|
89
|
+
CapabilitiesClear(self: NPC): void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface NPC {
|
|
93
|
+
/**
|
|
94
|
+
* Returns the NPC's capabilities along the ones defined on its weapon.
|
|
95
|
+
* @realm server
|
|
96
|
+
* @source https://wiki.facepunch.com/gmod/NPC:CapabilitiesGet
|
|
97
|
+
*/
|
|
98
|
+
CapabilitiesGet(self: NPC): CAP;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface NPC {
|
|
102
|
+
/**
|
|
103
|
+
* Checks whether the NPC has the specified capabilities.
|
|
104
|
+
* @realm server
|
|
105
|
+
* @source https://wiki.facepunch.com/gmod/NPC:CapabilitiesHas
|
|
106
|
+
*/
|
|
107
|
+
CapabilitiesHas(self: NPC, capabilities: CAP): void;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
interface NPC {
|
|
111
|
+
/**
|
|
112
|
+
* Remove a certain capability.
|
|
113
|
+
* @realm server
|
|
114
|
+
* @source https://wiki.facepunch.com/gmod/NPC:CapabilitiesRemove
|
|
115
|
+
*/
|
|
116
|
+
CapabilitiesRemove(self: NPC, capabilities: number): void;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface NPC {
|
|
120
|
+
/**
|
|
121
|
+
* Returns the NPC relationship class. This is mostly used to tell NPCs who should be attacking who.
|
|
122
|
+
*
|
|
123
|
+
* Do not confuse with [Entity:GetClass](https://wiki.facepunch.com/gmod/Entity:GetClass)!
|
|
124
|
+
* @realm server
|
|
125
|
+
* @source https://wiki.facepunch.com/gmod/NPC:Classify
|
|
126
|
+
*/
|
|
127
|
+
Classify(self: NPC): CLASS;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
interface NPC {
|
|
131
|
+
/**
|
|
132
|
+
* Resets the [NPC:GetBlockingEntity](https://wiki.facepunch.com/gmod/NPC:GetBlockingEntity).
|
|
133
|
+
* @realm server
|
|
134
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ClearBlockingEntity
|
|
135
|
+
*/
|
|
136
|
+
ClearBlockingEntity(self: NPC): void;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface NPC {
|
|
140
|
+
/**
|
|
141
|
+
* Clears out the specified [Enums/COND](https://wiki.facepunch.com/gmod/Enums/COND) on this NPC.
|
|
142
|
+
* @realm server
|
|
143
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ClearCondition
|
|
144
|
+
*/
|
|
145
|
+
ClearCondition(self: NPC, condition: number): void;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
interface NPC {
|
|
149
|
+
/**
|
|
150
|
+
* Clears the Enemy from the NPC's memory, effectively forgetting it until met again with either the NPC vision or with [NPC:UpdateEnemyMemory](https://wiki.facepunch.com/gmod/NPC:UpdateEnemyMemory).
|
|
151
|
+
* @realm server
|
|
152
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ClearEnemyMemory
|
|
153
|
+
*/
|
|
154
|
+
ClearEnemyMemory(self: NPC, enemy?: Entity): void;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
interface NPC {
|
|
158
|
+
/**
|
|
159
|
+
* Clears the NPC's current expression which can be set with [NPC:SetExpression](https://wiki.facepunch.com/gmod/NPC:SetExpression).
|
|
160
|
+
* @realm server
|
|
161
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ClearExpression
|
|
162
|
+
*/
|
|
163
|
+
ClearExpression(self: NPC): void;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
interface NPC {
|
|
167
|
+
/**
|
|
168
|
+
* Clears the current NPC goal or target.
|
|
169
|
+
* @realm server
|
|
170
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ClearGoal
|
|
171
|
+
*/
|
|
172
|
+
ClearGoal(self: NPC): void;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface NPC {
|
|
176
|
+
/**
|
|
177
|
+
* Stops the current schedule that the NPC is doing.
|
|
178
|
+
* @realm server
|
|
179
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ClearSchedule
|
|
180
|
+
*/
|
|
181
|
+
ClearSchedule(self: NPC): void;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
interface NPC {
|
|
185
|
+
/**
|
|
186
|
+
* Returns the ID of a given condition by name. Opposite of [NPC:ConditionName](https://wiki.facepunch.com/gmod/NPC:ConditionName).
|
|
187
|
+
*
|
|
188
|
+
* This is useful for custom conditions defined by engine NPCs, such as `COND_ZOMBIE_RELEASECRAB` for zombies, and `COND_COMBINE_ON_FIRE` for Combine Soldiers.
|
|
189
|
+
*
|
|
190
|
+
* @realm server
|
|
191
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ConditionID
|
|
192
|
+
*/
|
|
193
|
+
ConditionID(self: NPC, conditionName: string): number;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface NPC {
|
|
197
|
+
/**
|
|
198
|
+
* Translates condition ID to a string. For the opposite process, see [NPC:ConditionID](https://wiki.facepunch.com/gmod/NPC:ConditionID).
|
|
199
|
+
* @realm server
|
|
200
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ConditionName
|
|
201
|
+
*/
|
|
202
|
+
ConditionName(self: NPC, cond: number): string;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
interface NPC {
|
|
206
|
+
/**
|
|
207
|
+
* Returns the way the NPC "feels" about a given entity. See [NPC:AddEntityRelationship](https://wiki.facepunch.com/gmod/NPC:AddEntityRelationship).
|
|
208
|
+
*
|
|
209
|
+
* **NOTE**: For `ai` type entities, this will return [ENTITY:GetRelationship](https://wiki.facepunch.com/gmod/ENTITY:GetRelationship). If it returns `nil` or for engine NPCs, this will return whatever was last set by [NPC:AddEntityRelationship](https://wiki.facepunch.com/gmod/NPC:AddEntityRelationship). As a last resort, engine will decide on the disposition based on this NPC's [NPC:Classify](https://wiki.facepunch.com/gmod/NPC:Classify).
|
|
210
|
+
*
|
|
211
|
+
*
|
|
212
|
+
*
|
|
213
|
+
* @realm server
|
|
214
|
+
* @source https://wiki.facepunch.com/gmod/NPC:Disposition
|
|
215
|
+
*/
|
|
216
|
+
Disposition(self: NPC, ent: Entity): (D, number);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
interface NPC {
|
|
220
|
+
/**
|
|
221
|
+
* Forces the NPC to drop the specified weapon.
|
|
222
|
+
* @realm server
|
|
223
|
+
* @source https://wiki.facepunch.com/gmod/NPC:DropWeapon
|
|
224
|
+
*/
|
|
225
|
+
DropWeapon(self: NPC, weapon?: Weapon, target?: Vector, velocity?: Vector): void;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
interface NPC {
|
|
229
|
+
/**
|
|
230
|
+
* Makes an NPC exit a scripted sequence, if one is playing.
|
|
231
|
+
* @realm server
|
|
232
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ExitScriptedSequence
|
|
233
|
+
*/
|
|
234
|
+
ExitScriptedSequence(self: NPC): void;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
interface NPC {
|
|
238
|
+
/**
|
|
239
|
+
* Force an NPC to play its Fear sound.
|
|
240
|
+
* @realm server
|
|
241
|
+
* @source https://wiki.facepunch.com/gmod/NPC:FearSound
|
|
242
|
+
*/
|
|
243
|
+
FearSound(self: NPC): void;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
interface NPC {
|
|
247
|
+
/**
|
|
248
|
+
* Force an NPC to play its FoundEnemy sound.
|
|
249
|
+
* @realm server
|
|
250
|
+
* @source https://wiki.facepunch.com/gmod/NPC:FoundEnemySound
|
|
251
|
+
*/
|
|
252
|
+
FoundEnemySound(self: NPC): void;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
interface NPC {
|
|
256
|
+
/**
|
|
257
|
+
* Returns the weapon the NPC is currently carrying, or [NULL](https://wiki.facepunch.com/gmod/Global_Variables).
|
|
258
|
+
* @realm shared
|
|
259
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetActiveWeapon
|
|
260
|
+
*/
|
|
261
|
+
GetActiveWeapon(self: NPC): Entity;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
interface NPC {
|
|
265
|
+
/**
|
|
266
|
+
* Returns the NPC's current activity.
|
|
267
|
+
* @realm server
|
|
268
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetActivity
|
|
269
|
+
*/
|
|
270
|
+
GetActivity(self: NPC): number;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
interface NPC {
|
|
274
|
+
/**
|
|
275
|
+
* Returns the aim vector of the NPC. NPC alternative of [Player:GetAimVector](https://wiki.facepunch.com/gmod/Player:GetAimVector).
|
|
276
|
+
*
|
|
277
|
+
* **NOTE**: If the NPC has both [NPC:GetEnemy](https://wiki.facepunch.com/gmod/NPC:GetEnemy) and [NPC:GetActiveWeapon](https://wiki.facepunch.com/gmod/NPC:GetActiveWeapon), engine will automatically call [ENTITY:GetAttackSpread](https://wiki.facepunch.com/gmod/ENTITY:GetAttackSpread) to add random spread degrees to the return value.
|
|
278
|
+
*
|
|
279
|
+
*
|
|
280
|
+
* @realm server
|
|
281
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetAimVector
|
|
282
|
+
*/
|
|
283
|
+
GetAimVector(self: NPC): Vector;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
interface NPC {
|
|
287
|
+
/**
|
|
288
|
+
* Returns the activity to be played when the NPC arrives at its goal
|
|
289
|
+
* @realm server
|
|
290
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetArrivalActivity
|
|
291
|
+
*/
|
|
292
|
+
GetArrivalActivity(self: NPC): number;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
interface NPC {
|
|
296
|
+
/**
|
|
297
|
+
* Returns the direction from the NPC origin to its current navigational destination.
|
|
298
|
+
* @realm server
|
|
299
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetArrivalDirection
|
|
300
|
+
*/
|
|
301
|
+
GetArrivalDirection(self: NPC): Vector;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
interface NPC {
|
|
305
|
+
/**
|
|
306
|
+
* Returns NPC arrival distance, set by [NPC:SetArrivalDistance](https://wiki.facepunch.com/gmod/NPC:SetArrivalDistance).
|
|
307
|
+
*
|
|
308
|
+
* @realm server
|
|
309
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetArrivalDistance
|
|
310
|
+
*/
|
|
311
|
+
GetArrivalDistance(self: NPC): number;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
interface NPC {
|
|
315
|
+
/**
|
|
316
|
+
* Returns the sequence to be played when the NPC arrives at its goal.
|
|
317
|
+
* @realm server
|
|
318
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetArrivalSequence
|
|
319
|
+
*/
|
|
320
|
+
GetArrivalSequence(self: NPC): number;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
interface NPC {
|
|
324
|
+
/**
|
|
325
|
+
* Returns NPC arrival speed, set by [NPC:SetArrivalSpeed](https://wiki.facepunch.com/gmod/NPC:SetArrivalSpeed).
|
|
326
|
+
*
|
|
327
|
+
* @realm server
|
|
328
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetArrivalSpeed
|
|
329
|
+
*/
|
|
330
|
+
GetArrivalSpeed(self: NPC): number;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
interface NPC {
|
|
334
|
+
/**
|
|
335
|
+
* Returns the most dangerous/closest sound hint based on the NPCs location and the types of sounds it can sense.
|
|
336
|
+
* @realm server
|
|
337
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetBestSoundHint
|
|
338
|
+
*/
|
|
339
|
+
GetBestSoundHint(self: NPC, types: number): table;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface NPC {
|
|
343
|
+
/**
|
|
344
|
+
* Returns the entity blocking the NPC along its path.
|
|
345
|
+
* @realm server
|
|
346
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetBlockingEntity
|
|
347
|
+
*/
|
|
348
|
+
GetBlockingEntity(self: NPC): Entity;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
interface NPC {
|
|
352
|
+
/**
|
|
353
|
+
* Returns the goal type for current navigation path.
|
|
354
|
+
* @realm server
|
|
355
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetCurGoalType
|
|
356
|
+
*/
|
|
357
|
+
GetCurGoalType(self: NPC): number;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
interface NPC {
|
|
361
|
+
/**
|
|
362
|
+
* Gets the NPC's current waypoint position (where NPC is currently moving towards), if any is available.
|
|
363
|
+
* @realm server
|
|
364
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetCurWaypointPos
|
|
365
|
+
*/
|
|
366
|
+
GetCurWaypointPos(self: NPC): Vector;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
interface NPC {
|
|
370
|
+
/**
|
|
371
|
+
* Returns the NPC's current schedule.
|
|
372
|
+
* @realm server
|
|
373
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetCurrentSchedule
|
|
374
|
+
*/
|
|
375
|
+
GetCurrentSchedule(self: NPC): number;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
interface NPC {
|
|
379
|
+
/**
|
|
380
|
+
* Returns how proficient (skilled) an NPC is with its current weapon.
|
|
381
|
+
* @realm server
|
|
382
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetCurrentWeaponProficiency
|
|
383
|
+
*/
|
|
384
|
+
GetCurrentWeaponProficiency(self: NPC): number;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
interface NPC {
|
|
388
|
+
/**
|
|
389
|
+
* Returns the entity that this NPC is trying to fight.
|
|
390
|
+
*
|
|
391
|
+
* This returns nil if the NPC has no enemy. You should use [Global.IsValid](https://wiki.facepunch.com/gmod/Global.IsValid) (which accounts for nil and NULL) on the return to verify validity of the enemy.
|
|
392
|
+
*
|
|
393
|
+
* @realm server
|
|
394
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetEnemy
|
|
395
|
+
*/
|
|
396
|
+
GetEnemy(self: NPC): NPC;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
interface NPC {
|
|
400
|
+
/**
|
|
401
|
+
* Returns the first time an NPC's enemy was seen by the NPC.
|
|
402
|
+
* @realm server
|
|
403
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetEnemyFirstTimeSeen
|
|
404
|
+
*/
|
|
405
|
+
GetEnemyFirstTimeSeen(self: NPC, enemy?: Entity): number;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
interface NPC {
|
|
409
|
+
/**
|
|
410
|
+
* Returns the last known position of an NPC's enemy.
|
|
411
|
+
*
|
|
412
|
+
* Similar to [NPC:GetEnemyLastSeenPos](https://wiki.facepunch.com/gmod/NPC:GetEnemyLastSeenPos), but the known position will be a few seconds ahead of the last seen position.
|
|
413
|
+
* @realm server
|
|
414
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetEnemyLastKnownPos
|
|
415
|
+
*/
|
|
416
|
+
GetEnemyLastKnownPos(self: NPC, enemy?: Entity): Vector;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
interface NPC {
|
|
420
|
+
/**
|
|
421
|
+
* Returns the last seen position of an NPC's enemy.
|
|
422
|
+
*
|
|
423
|
+
* Similar to [NPC:GetEnemyLastKnownPos](https://wiki.facepunch.com/gmod/NPC:GetEnemyLastKnownPos), but the known position will be a few seconds ahead of the last seen position.
|
|
424
|
+
* @realm server
|
|
425
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetEnemyLastSeenPos
|
|
426
|
+
*/
|
|
427
|
+
GetEnemyLastSeenPos(self: NPC, enemy?: Entity): Vector;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
interface NPC {
|
|
431
|
+
/**
|
|
432
|
+
* Returns the last time an NPC's enemy was seen by the NPC.
|
|
433
|
+
* @realm server
|
|
434
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetEnemyLastTimeSeen
|
|
435
|
+
*/
|
|
436
|
+
GetEnemyLastTimeSeen(self: NPC, enemy?: Entity): number;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
interface NPC {
|
|
440
|
+
/**
|
|
441
|
+
* Returns the expression file the NPC is currently playing.
|
|
442
|
+
* @realm server
|
|
443
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetExpression
|
|
444
|
+
*/
|
|
445
|
+
GetExpression(self: NPC): string;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
interface NPC {
|
|
449
|
+
/**
|
|
450
|
+
* Returns the eye direction of the NPC.
|
|
451
|
+
* @realm server
|
|
452
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetEyeDirection
|
|
453
|
+
*/
|
|
454
|
+
GetEyeDirection(self: NPC): Vector;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
interface NPC {
|
|
458
|
+
/**
|
|
459
|
+
* Returns the Field Of View of the NPC. See [NPC:SetFOV](https://wiki.facepunch.com/gmod/NPC:SetFOV).
|
|
460
|
+
* @realm server
|
|
461
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetFOV
|
|
462
|
+
*/
|
|
463
|
+
GetFOV(self: NPC): number;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
interface NPC {
|
|
467
|
+
/**
|
|
468
|
+
* Returns the position we are trying to reach, if any.
|
|
469
|
+
* @realm server
|
|
470
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetGoalPos
|
|
471
|
+
*/
|
|
472
|
+
GetGoalPos(self: NPC): Vector;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
interface NPC {
|
|
476
|
+
/**
|
|
477
|
+
* Returns the entity we are trying to reach, if any.
|
|
478
|
+
* @realm server
|
|
479
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetGoalTarget
|
|
480
|
+
*/
|
|
481
|
+
GetGoalTarget(self: NPC): Entity;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
interface NPC {
|
|
485
|
+
/**
|
|
486
|
+
* Returns the 2D head direction of the NPC.
|
|
487
|
+
* @realm server
|
|
488
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetHeadDirection
|
|
489
|
+
*/
|
|
490
|
+
GetHeadDirection(self: NPC): Vector;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
interface NPC {
|
|
494
|
+
/**
|
|
495
|
+
* Returns NPCs hull type set by [NPC:SetHullType](https://wiki.facepunch.com/gmod/NPC:SetHullType).
|
|
496
|
+
* @realm server
|
|
497
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetHullType
|
|
498
|
+
*/
|
|
499
|
+
GetHullType(self: NPC): number;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
interface NPC {
|
|
503
|
+
/**
|
|
504
|
+
* Returns the ideal activity the NPC currently wants to achieve.
|
|
505
|
+
* **NOTE**: By default, base NPCs will automatically attempt to play a sequence bound to the ideal activity. To prevent ideal activity from overriding NPC's active sequence, set this to `ACT_DO_NOT_DISTURB`.
|
|
506
|
+
*
|
|
507
|
+
*
|
|
508
|
+
* @realm server
|
|
509
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetIdealActivity
|
|
510
|
+
*/
|
|
511
|
+
GetIdealActivity(self: NPC): number;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
interface NPC {
|
|
515
|
+
/**
|
|
516
|
+
* Returns the ideal move acceleration of the NPC.
|
|
517
|
+
* @realm server
|
|
518
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetIdealMoveAcceleration
|
|
519
|
+
*/
|
|
520
|
+
GetIdealMoveAcceleration(self: NPC): number;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
interface NPC {
|
|
524
|
+
/**
|
|
525
|
+
* Returns the ideal move speed of the NPC.
|
|
526
|
+
* @realm server
|
|
527
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetIdealMoveSpeed
|
|
528
|
+
*/
|
|
529
|
+
GetIdealMoveSpeed(self: NPC): number;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
interface NPC {
|
|
533
|
+
/**
|
|
534
|
+
* Returns the ideal sequence the NPC currently wants to achieve.
|
|
535
|
+
* @realm server
|
|
536
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetIdealSequence
|
|
537
|
+
*/
|
|
538
|
+
GetIdealSequence(self: NPC): number;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
interface NPC {
|
|
542
|
+
/**
|
|
543
|
+
* Returns the ideal yaw (left right rotation) for this NPC at this moment.
|
|
544
|
+
* @realm server
|
|
545
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetIdealYaw
|
|
546
|
+
*/
|
|
547
|
+
GetIdealYaw(self: NPC): number;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
interface NPC {
|
|
551
|
+
/**
|
|
552
|
+
* Returns all known enemies this NPC has. The enemy table is updated with [NPC:UpdateEnemyMemory](https://wiki.facepunch.com/gmod/NPC:UpdateEnemyMemory) and [NPC:ClearEnemyMemory](https://wiki.facepunch.com/gmod/NPC:ClearEnemyMemory), meaning other entities may be in enemies list even though your NPC doesn't hate it.
|
|
553
|
+
*
|
|
554
|
+
* See also [NPC:GetKnownEnemyCount](https://wiki.facepunch.com/gmod/NPC:GetKnownEnemyCount)
|
|
555
|
+
*
|
|
556
|
+
* @realm server
|
|
557
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetKnownEnemies
|
|
558
|
+
*/
|
|
559
|
+
GetKnownEnemies(self: NPC): table;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
interface NPC {
|
|
563
|
+
/**
|
|
564
|
+
* Returns known enemy count of this NPC.
|
|
565
|
+
*
|
|
566
|
+
* See also [NPC:GetKnownEnemies](https://wiki.facepunch.com/gmod/NPC:GetKnownEnemies)
|
|
567
|
+
*
|
|
568
|
+
* @realm server
|
|
569
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetKnownEnemyCount
|
|
570
|
+
*/
|
|
571
|
+
GetKnownEnemyCount(self: NPC): number;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
interface NPC {
|
|
575
|
+
/**
|
|
576
|
+
* Returns the last registered or memorized position of the NPC. When using scheduling, the NPC will focus on navigating to the last position via nodes.
|
|
577
|
+
*
|
|
578
|
+
* See [NPC:SetLastPosition](https://wiki.facepunch.com/gmod/NPC:SetLastPosition).
|
|
579
|
+
*
|
|
580
|
+
* @realm server
|
|
581
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetLastPosition
|
|
582
|
+
*/
|
|
583
|
+
GetLastPosition(self: NPC): Vector;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
interface NPC {
|
|
587
|
+
/**
|
|
588
|
+
* Returns [Global.CurTime](https://wiki.facepunch.com/gmod/Global.CurTime) based time since this NPC last received damage from given enemy. The last damage time is set when [NPC:MarkTookDamageFromEnemy](https://wiki.facepunch.com/gmod/NPC:MarkTookDamageFromEnemy) is called.
|
|
589
|
+
*
|
|
590
|
+
* @realm server
|
|
591
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetLastTimeTookDamageFromEnemy
|
|
592
|
+
*/
|
|
593
|
+
GetLastTimeTookDamageFromEnemy(self: NPC, enemy?: Entity): number;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
interface NPC {
|
|
597
|
+
/**
|
|
598
|
+
* Returns NPCs max view distance. An NPC will not be able to see enemies outside of this distance.
|
|
599
|
+
* @realm server
|
|
600
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetMaxLookDistance
|
|
601
|
+
*/
|
|
602
|
+
GetMaxLookDistance(self: NPC): number;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
interface NPC {
|
|
606
|
+
/**
|
|
607
|
+
* Returns how far should the NPC look ahead in its route.
|
|
608
|
+
* @realm server
|
|
609
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetMinMoveCheckDist
|
|
610
|
+
*/
|
|
611
|
+
GetMinMoveCheckDist(self: NPC): number;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
interface NPC {
|
|
615
|
+
/**
|
|
616
|
+
* Returns how far before the NPC can come to a complete stop.
|
|
617
|
+
* @realm server
|
|
618
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetMinMoveStopDist
|
|
619
|
+
*/
|
|
620
|
+
GetMinMoveStopDist(self: NPC, minResult?: number): number;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
interface NPC {
|
|
624
|
+
/**
|
|
625
|
+
* Returns the movement delay for given NPC.
|
|
626
|
+
*
|
|
627
|
+
* See [NPC:SetMoveDelay](https://wiki.facepunch.com/gmod/NPC:SetMoveDelay).
|
|
628
|
+
*
|
|
629
|
+
* @realm server
|
|
630
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetMoveDelay
|
|
631
|
+
*/
|
|
632
|
+
GetMoveDelay(self: NPC): number;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
interface NPC {
|
|
636
|
+
/**
|
|
637
|
+
* Returns the current timestep the internal NPC motor is working on.
|
|
638
|
+
* @realm server
|
|
639
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetMoveInterval
|
|
640
|
+
*/
|
|
641
|
+
GetMoveInterval(self: NPC): number;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
interface NPC {
|
|
645
|
+
/**
|
|
646
|
+
* Returns the current move velocity of the NPC.
|
|
647
|
+
* @realm server
|
|
648
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetMoveVelocity
|
|
649
|
+
*/
|
|
650
|
+
GetMoveVelocity(self: NPC): Vector;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
interface NPC {
|
|
654
|
+
/**
|
|
655
|
+
* Returns the NPC's current movement activity.
|
|
656
|
+
* @realm server
|
|
657
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetMovementActivity
|
|
658
|
+
*/
|
|
659
|
+
GetMovementActivity(self: NPC): number;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
interface NPC {
|
|
663
|
+
/**
|
|
664
|
+
* Returns the index of the sequence the NPC uses to move.
|
|
665
|
+
* @realm server
|
|
666
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetMovementSequence
|
|
667
|
+
*/
|
|
668
|
+
GetMovementSequence(self: NPC): number;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
interface NPC {
|
|
672
|
+
/**
|
|
673
|
+
* Returns the NPC's state.
|
|
674
|
+
* @realm server
|
|
675
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetNPCState
|
|
676
|
+
*/
|
|
677
|
+
GetNPCState(self: NPC): number;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
interface NPC {
|
|
681
|
+
/**
|
|
682
|
+
* Returns the NPC's navigation type.
|
|
683
|
+
* @realm server
|
|
684
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetNavType
|
|
685
|
+
*/
|
|
686
|
+
GetNavType(self: NPC): number;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
interface NPC {
|
|
690
|
+
/**
|
|
691
|
+
* Returns the nearest member of the squad the NPC is in.
|
|
692
|
+
* @realm server
|
|
693
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetNearestSquadMember
|
|
694
|
+
*/
|
|
695
|
+
GetNearestSquadMember(self: NPC): NPC;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
interface NPC {
|
|
699
|
+
/**
|
|
700
|
+
* Gets the NPC's next waypoint position, where NPC will be moving after reaching current waypoint, if any is available.
|
|
701
|
+
* @realm server
|
|
702
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetNextWaypointPos
|
|
703
|
+
*/
|
|
704
|
+
GetNextWaypointPos(self: NPC): Vector;
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
interface NPC {
|
|
708
|
+
/**
|
|
709
|
+
* Returns the distance the NPC is from Target Goal.
|
|
710
|
+
* @realm server
|
|
711
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetPathDistanceToGoal
|
|
712
|
+
*/
|
|
713
|
+
GetPathDistanceToGoal(self: NPC): number;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
interface NPC {
|
|
717
|
+
/**
|
|
718
|
+
* Returns the amount of time it will take for the NPC to get to its Target Goal.
|
|
719
|
+
* @realm server
|
|
720
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetPathTimeToGoal
|
|
721
|
+
*/
|
|
722
|
+
GetPathTimeToGoal(self: NPC): number;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
interface NPC {
|
|
726
|
+
/**
|
|
727
|
+
* Returns the shooting position of the NPC, i.e. where their bullets would come from, etc.
|
|
728
|
+
*
|
|
729
|
+
* If the NPC does not overwrite this, it will return [Entity:GetPos](https://wiki.facepunch.com/gmod/Entity:GetPos).
|
|
730
|
+
*
|
|
731
|
+
* @realm server
|
|
732
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetShootPos
|
|
733
|
+
*/
|
|
734
|
+
GetShootPos(self: NPC): Vector;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
interface NPC {
|
|
738
|
+
/**
|
|
739
|
+
* Returns the current squad name of the NPC, as set via [NPC:SetSquad](https://wiki.facepunch.com/gmod/NPC:SetSquad).
|
|
740
|
+
* @realm server
|
|
741
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetSquad
|
|
742
|
+
*/
|
|
743
|
+
GetSquad(self: NPC): string;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
interface NPC {
|
|
747
|
+
/**
|
|
748
|
+
* Returns NPC step height.
|
|
749
|
+
*
|
|
750
|
+
* @realm server
|
|
751
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetStepHeight
|
|
752
|
+
*/
|
|
753
|
+
GetStepHeight(self: NPC): number;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
interface NPC {
|
|
757
|
+
/**
|
|
758
|
+
* Returns the NPC's current target set by [NPC:SetTarget](https://wiki.facepunch.com/gmod/NPC:SetTarget).
|
|
759
|
+
*
|
|
760
|
+
* This returns nil if the NPC has no target. You should use [Global.IsValid](https://wiki.facepunch.com/gmod/Global.IsValid) (which accounts for nil and NULL) on the return to verify validity of the target.
|
|
761
|
+
*
|
|
762
|
+
* @realm server
|
|
763
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetTarget
|
|
764
|
+
*/
|
|
765
|
+
GetTarget(self: NPC): Entity;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
interface NPC {
|
|
769
|
+
/**
|
|
770
|
+
* Returns the status of the current task.
|
|
771
|
+
* @realm server
|
|
772
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetTaskStatus
|
|
773
|
+
*/
|
|
774
|
+
GetTaskStatus(self: NPC): number;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
interface NPC {
|
|
778
|
+
/**
|
|
779
|
+
* Returns [Global.CurTime](https://wiki.facepunch.com/gmod/Global.CurTime) based time since the enemy was reacquired, meaning it is currently in Line of Sight of the NPC.
|
|
780
|
+
*
|
|
781
|
+
* @realm server
|
|
782
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetTimeEnemyLastReacquired
|
|
783
|
+
*/
|
|
784
|
+
GetTimeEnemyLastReacquired(self: NPC, enemy?: Entity): number;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
interface NPC {
|
|
788
|
+
/**
|
|
789
|
+
* Returns the view offset of the NPC. Set by [NPC:SetViewOffset](https://wiki.facepunch.com/gmod/NPC:SetViewOffset).
|
|
790
|
+
* @realm server
|
|
791
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetViewOffset
|
|
792
|
+
*/
|
|
793
|
+
GetViewOffset(self: NPC): Vector;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
interface NPC {
|
|
797
|
+
/**
|
|
798
|
+
* Returns a specific weapon the NPC owns.
|
|
799
|
+
* @realm server
|
|
800
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetWeapon
|
|
801
|
+
*/
|
|
802
|
+
GetWeapon(self: NPC, _class: string): Weapon;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
interface NPC {
|
|
806
|
+
/**
|
|
807
|
+
* Returns a table of the NPC's weapons.
|
|
808
|
+
* @realm server
|
|
809
|
+
* @source https://wiki.facepunch.com/gmod/NPC:GetWeapons
|
|
810
|
+
*/
|
|
811
|
+
GetWeapons(self: NPC): Weapon[];
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
interface NPC {
|
|
815
|
+
/**
|
|
816
|
+
* Used to give a weapon to an already spawned NPC.
|
|
817
|
+
* @realm server
|
|
818
|
+
* @source https://wiki.facepunch.com/gmod/NPC:Give
|
|
819
|
+
*/
|
|
820
|
+
Give(self: NPC, weapon: string): Weapon;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
interface NPC {
|
|
824
|
+
/**
|
|
825
|
+
* Returns whether or not the NPC has the given condition.
|
|
826
|
+
* @realm server
|
|
827
|
+
* @source https://wiki.facepunch.com/gmod/NPC:HasCondition
|
|
828
|
+
*/
|
|
829
|
+
HasCondition(self: NPC, condition: number): boolean;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
interface NPC {
|
|
833
|
+
/**
|
|
834
|
+
* Polls the enemy memory to check if the given entity has eluded us or not.
|
|
835
|
+
* @realm server
|
|
836
|
+
* @source https://wiki.facepunch.com/gmod/NPC:HasEnemyEluded
|
|
837
|
+
*/
|
|
838
|
+
HasEnemyEluded(self: NPC, enemy?: Entity): boolean;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
interface NPC {
|
|
842
|
+
/**
|
|
843
|
+
* Polls the enemy memory to check if the NPC has any memory of given enemy.
|
|
844
|
+
* @realm server
|
|
845
|
+
* @source https://wiki.facepunch.com/gmod/NPC:HasEnemyMemory
|
|
846
|
+
*/
|
|
847
|
+
HasEnemyMemory(self: NPC, enemy?: Entity): boolean;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
interface NPC {
|
|
851
|
+
/**
|
|
852
|
+
* Returns true if the current navigation has an obstacle, this is different from [NPC:GetBlockingEntity](https://wiki.facepunch.com/gmod/NPC:GetBlockingEntity), this is for virtual navigation obstacles put by AI's local navigation system to prevent movement to the marked area, forcing NPC to steer around, [for example](https://github.com/ValveSoftware/source-sdk-2013/blob/master/src/game/server/hl2/npc_playercompanion.cpp#L2897).
|
|
853
|
+
* @realm server
|
|
854
|
+
* @source https://wiki.facepunch.com/gmod/NPC:HasObstacles
|
|
855
|
+
*/
|
|
856
|
+
HasObstacles(self: NPC): boolean;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
interface NPC {
|
|
860
|
+
/**
|
|
861
|
+
* Force an NPC to play their Idle sound.
|
|
862
|
+
* @realm server
|
|
863
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IdleSound
|
|
864
|
+
*/
|
|
865
|
+
IdleSound(self: NPC): void;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
interface NPC {
|
|
869
|
+
/**
|
|
870
|
+
* Makes the NPC ignore given entity/enemy until given time.
|
|
871
|
+
* @realm server
|
|
872
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IgnoreEnemyUntil
|
|
873
|
+
*/
|
|
874
|
+
IgnoreEnemyUntil(self: NPC, enemy: Entity, _until: number): void;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
interface NPC {
|
|
878
|
+
/**
|
|
879
|
+
* Returns whether the NPC is currently crouching or not. Citizens and Combine Soldiers are capable of this behavior by default.
|
|
880
|
+
* @realm server
|
|
881
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsCrouching
|
|
882
|
+
*/
|
|
883
|
+
IsCrouching(self: NPC): boolean;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
interface NPC {
|
|
887
|
+
/**
|
|
888
|
+
* Returns whether the current navigational waypoint is the final one.
|
|
889
|
+
* @realm server
|
|
890
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsCurWaypointGoal
|
|
891
|
+
*/
|
|
892
|
+
IsCurWaypointGoal(self: NPC): boolean;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
interface NPC {
|
|
896
|
+
/**
|
|
897
|
+
* Returns whether or not the NPC is performing the given schedule.
|
|
898
|
+
* @realm server
|
|
899
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsCurrentSchedule
|
|
900
|
+
*/
|
|
901
|
+
IsCurrentSchedule(self: NPC, schedule: number): boolean;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
interface NPC {
|
|
905
|
+
/**
|
|
906
|
+
* Returns whether the NPC is facing their ideal yaw. See [NPC:SetIdealYaw](https://wiki.facepunch.com/gmod/NPC:SetIdealYaw), [NPC:GetIdealYaw](https://wiki.facepunch.com/gmod/NPC:GetIdealYaw) and [NPC:SetIdealYawAndUpdate](https://wiki.facepunch.com/gmod/NPC:SetIdealYawAndUpdate).
|
|
907
|
+
* @realm server
|
|
908
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsFacingIdealYaw
|
|
909
|
+
*/
|
|
910
|
+
IsFacingIdealYaw(self: NPC): boolean;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
interface NPC {
|
|
914
|
+
/**
|
|
915
|
+
* Returns whether the NPC has an active goal.
|
|
916
|
+
* @realm server
|
|
917
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsGoalActive
|
|
918
|
+
*/
|
|
919
|
+
IsGoalActive(self: NPC): boolean;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
interface NPC {
|
|
923
|
+
/**
|
|
924
|
+
* Tests whether a position or an NPC is in the view cone of the NPC.
|
|
925
|
+
* @realm server
|
|
926
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsInViewCone
|
|
927
|
+
*/
|
|
928
|
+
IsInViewCone(self: NPC, position: Vector): boolean;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
interface NPC {
|
|
932
|
+
IsInViewCone(self: NPC, ent: Entity): boolean;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
interface NPC {
|
|
936
|
+
/**
|
|
937
|
+
* Returns if the current movement is locked on the Yaw axis.
|
|
938
|
+
* @realm server
|
|
939
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsMoveYawLocked
|
|
940
|
+
*/
|
|
941
|
+
IsMoveYawLocked(self: NPC): boolean;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
interface NPC {
|
|
945
|
+
/**
|
|
946
|
+
* Returns whether the NPC is moving or not.
|
|
947
|
+
* @realm server
|
|
948
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsMoving
|
|
949
|
+
*/
|
|
950
|
+
IsMoving(self: NPC): boolean;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
interface NPC {
|
|
954
|
+
/**
|
|
955
|
+
* Checks if the NPC is running an **ai_goal**. ( e.g. An npc_citizen NPC following the Player. )
|
|
956
|
+
* @realm server
|
|
957
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsRunningBehavior
|
|
958
|
+
*/
|
|
959
|
+
IsRunningBehavior(self: NPC): boolean;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
interface NPC {
|
|
963
|
+
/**
|
|
964
|
+
* Returns whether the current NPC is the leader of the squad it is in.
|
|
965
|
+
* @realm server
|
|
966
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsSquadLeader
|
|
967
|
+
*/
|
|
968
|
+
IsSquadLeader(self: NPC): boolean;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
interface NPC {
|
|
972
|
+
/**
|
|
973
|
+
* Returns the "forgettable" status for a given enemy, as set by [NPC:SetUnforgettable](https://wiki.facepunch.com/gmod/NPC:SetUnforgettable), or by internal logic of engine NPCs.
|
|
974
|
+
* @realm server
|
|
975
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsUnforgettable
|
|
976
|
+
*/
|
|
977
|
+
IsUnforgettable(self: NPC, enemy: Entity): boolean;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
interface NPC {
|
|
981
|
+
/**
|
|
982
|
+
* Returns true if the entity was remembered as unreachable. The memory is updated automatically from following engine tasks if they failed:
|
|
983
|
+
* * TASK_GET_CHASE_PATH_TO_ENEMY
|
|
984
|
+
* * TASK_GET_PATH_TO_ENEMY_LKP
|
|
985
|
+
* * TASK_GET_PATH_TO_INTERACTION_PARTNER
|
|
986
|
+
* * TASK_ANTLIONGUARD_GET_CHASE_PATH_ENEMY_TOLERANCE
|
|
987
|
+
* * SCHED_FAIL_ESTABLISH_LINE_OF_FIRE - Combine NPCs, also when failing to change their enemy
|
|
988
|
+
*
|
|
989
|
+
* @realm server
|
|
990
|
+
* @source https://wiki.facepunch.com/gmod/NPC:IsUnreachable
|
|
991
|
+
*/
|
|
992
|
+
IsUnreachable(self: NPC, testEntity: Entity): boolean;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
interface NPC {
|
|
996
|
+
/**
|
|
997
|
+
* Force an NPC to play their LostEnemy sound.
|
|
998
|
+
* @realm server
|
|
999
|
+
* @source https://wiki.facepunch.com/gmod/NPC:LostEnemySound
|
|
1000
|
+
*/
|
|
1001
|
+
LostEnemySound(self: NPC): void;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
interface NPC {
|
|
1005
|
+
/**
|
|
1006
|
+
* Tries to achieve our ideal animation state, playing any transition sequences that we need to play to get there.
|
|
1007
|
+
* @realm server
|
|
1008
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MaintainActivity
|
|
1009
|
+
*/
|
|
1010
|
+
MaintainActivity(self: NPC): void;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
interface NPC {
|
|
1014
|
+
/**
|
|
1015
|
+
* Causes the NPC to temporarily forget the current enemy and switch on to a better one.
|
|
1016
|
+
* @realm server
|
|
1017
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MarkEnemyAsEluded
|
|
1018
|
+
*/
|
|
1019
|
+
MarkEnemyAsEluded(self: NPC, enemy?: Entity): void;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
interface NPC {
|
|
1023
|
+
/**
|
|
1024
|
+
* Marks the NPC as took damage from given entity.
|
|
1025
|
+
*
|
|
1026
|
+
* See also [NPC:GetLastTimeTookDamageFromEnemy](https://wiki.facepunch.com/gmod/NPC:GetLastTimeTookDamageFromEnemy).
|
|
1027
|
+
*
|
|
1028
|
+
* @realm server
|
|
1029
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MarkTookDamageFromEnemy
|
|
1030
|
+
*/
|
|
1031
|
+
MarkTookDamageFromEnemy(self: NPC, enemy?: Entity): void;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
interface NPC {
|
|
1035
|
+
/**
|
|
1036
|
+
* Executes a climb move.
|
|
1037
|
+
*
|
|
1038
|
+
* Related functions are [NPC:MoveClimbStart](https://wiki.facepunch.com/gmod/NPC:MoveClimbStart) and [NPC:MoveClimbStop](https://wiki.facepunch.com/gmod/NPC:MoveClimbStop).
|
|
1039
|
+
* @realm server
|
|
1040
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveClimbExec
|
|
1041
|
+
*/
|
|
1042
|
+
MoveClimbExec(self: NPC, destination: Vector, dir: Vector, distance: number, yaw: number, left: number): AIMR;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
interface NPC {
|
|
1046
|
+
/**
|
|
1047
|
+
* Starts a climb move.
|
|
1048
|
+
*
|
|
1049
|
+
* Related functions are [NPC:MoveClimbExec](https://wiki.facepunch.com/gmod/NPC:MoveClimbExec) and [NPC:MoveClimbStop](https://wiki.facepunch.com/gmod/NPC:MoveClimbStop).
|
|
1050
|
+
* @realm server
|
|
1051
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveClimbStart
|
|
1052
|
+
*/
|
|
1053
|
+
MoveClimbStart(self: NPC, destination: Vector, dir: Vector, distance: number, yaw: number): void;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
interface NPC {
|
|
1057
|
+
/**
|
|
1058
|
+
* Stops a climb move.
|
|
1059
|
+
*
|
|
1060
|
+
* Related functions are [NPC:MoveClimbExec](https://wiki.facepunch.com/gmod/NPC:MoveClimbExec) and [NPC:MoveClimbStart](https://wiki.facepunch.com/gmod/NPC:MoveClimbStart).
|
|
1061
|
+
* @realm server
|
|
1062
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveClimbStop
|
|
1063
|
+
*/
|
|
1064
|
+
MoveClimbStop(self: NPC): void;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
interface NPC {
|
|
1068
|
+
/**
|
|
1069
|
+
* Similar to other `NPC:Move*` functions, invokes internal code to move the NPC to a given location.
|
|
1070
|
+
*
|
|
1071
|
+
* Meant to be used within [ENTITY:OverrideMove](https://wiki.facepunch.com/gmod/ENTITY:OverrideMove).
|
|
1072
|
+
* @realm server
|
|
1073
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveGroundStep
|
|
1074
|
+
*/
|
|
1075
|
+
MoveGroundStep(self: NPC, pos: Vector, targetEntity?: Entity, yaw?: number, asFarAsCan?: boolean, testZ?: boolean): number;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
interface NPC {
|
|
1079
|
+
/**
|
|
1080
|
+
* Executes a jump move.
|
|
1081
|
+
*
|
|
1082
|
+
* Related functions are [NPC:MoveJumpStart](https://wiki.facepunch.com/gmod/NPC:MoveJumpStart) and [NPC:MoveJumpStop](https://wiki.facepunch.com/gmod/NPC:MoveJumpStop).
|
|
1083
|
+
* @realm server
|
|
1084
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveJumpExec
|
|
1085
|
+
*/
|
|
1086
|
+
MoveJumpExec(self: NPC): AIMR;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
interface NPC {
|
|
1090
|
+
/**
|
|
1091
|
+
* Starts a jump move.
|
|
1092
|
+
*
|
|
1093
|
+
* Related functions are [NPC:MoveJumpExec](https://wiki.facepunch.com/gmod/NPC:MoveJumpExec) and [NPC:MoveJumpStop](https://wiki.facepunch.com/gmod/NPC:MoveJumpStop).
|
|
1094
|
+
* @realm server
|
|
1095
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveJumpStart
|
|
1096
|
+
*/
|
|
1097
|
+
MoveJumpStart(self: NPC, vel: Vector): void;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
interface NPC {
|
|
1101
|
+
/**
|
|
1102
|
+
* Stops a jump move.
|
|
1103
|
+
*
|
|
1104
|
+
* Related functions are [NPC:MoveJumpExec](https://wiki.facepunch.com/gmod/NPC:MoveJumpExec) and [NPC:MoveJumpStart](https://wiki.facepunch.com/gmod/NPC:MoveJumpStart).
|
|
1105
|
+
* @realm server
|
|
1106
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveJumpStop
|
|
1107
|
+
*/
|
|
1108
|
+
MoveJumpStop(self: NPC): AIMR;
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
interface NPC {
|
|
1112
|
+
/**
|
|
1113
|
+
* Makes the NPC walk toward the given position. The NPC will return to the player after amount of time set by **player_squad_autosummon_time** [ConVar](https://wiki.facepunch.com/gmod/ConVar).
|
|
1114
|
+
*
|
|
1115
|
+
* Only works on Citizens (npc_citizen) and is a part of the Half-Life 2 squad system.
|
|
1116
|
+
*
|
|
1117
|
+
* The NPC **must** be in the player's squad for this to work.
|
|
1118
|
+
*
|
|
1119
|
+
* @realm server
|
|
1120
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveOrder
|
|
1121
|
+
*/
|
|
1122
|
+
MoveOrder(self: NPC, position: Vector): void;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
interface NPC {
|
|
1126
|
+
/**
|
|
1127
|
+
* Pauses the NPC movement?
|
|
1128
|
+
*
|
|
1129
|
+
* Related functions are [NPC:MoveStart](https://wiki.facepunch.com/gmod/NPC:MoveStart), [NPC:MoveStop](https://wiki.facepunch.com/gmod/NPC:MoveStop) and [NPC:ResetMoveCalc](https://wiki.facepunch.com/gmod/NPC:ResetMoveCalc).
|
|
1130
|
+
* @realm server
|
|
1131
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MovePause
|
|
1132
|
+
*/
|
|
1133
|
+
MovePause(self: NPC): void;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
interface NPC {
|
|
1137
|
+
/**
|
|
1138
|
+
* Starts NPC movement?
|
|
1139
|
+
*
|
|
1140
|
+
* Related functions are [NPC:MoveStop](https://wiki.facepunch.com/gmod/NPC:MoveStop), [NPC:MovePause](https://wiki.facepunch.com/gmod/NPC:MovePause) and [NPC:ResetMoveCalc](https://wiki.facepunch.com/gmod/NPC:ResetMoveCalc).
|
|
1141
|
+
* @realm server
|
|
1142
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveStart
|
|
1143
|
+
*/
|
|
1144
|
+
MoveStart(self: NPC): void;
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
interface NPC {
|
|
1148
|
+
/**
|
|
1149
|
+
* Stops the NPC movement?
|
|
1150
|
+
*
|
|
1151
|
+
* Related functions are [NPC:MoveStart](https://wiki.facepunch.com/gmod/NPC:MoveStart), [NPC:MovePause](https://wiki.facepunch.com/gmod/NPC:MovePause) and [NPC:ResetMoveCalc](https://wiki.facepunch.com/gmod/NPC:ResetMoveCalc).
|
|
1152
|
+
* @realm server
|
|
1153
|
+
* @source https://wiki.facepunch.com/gmod/NPC:MoveStop
|
|
1154
|
+
*/
|
|
1155
|
+
MoveStop(self: NPC): void;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
interface NPC {
|
|
1159
|
+
/**
|
|
1160
|
+
* Picks random node around given vector, around specified length, using dir as search direction start. Works similarly to [NPC:NavSetRandomGoal](https://wiki.facepunch.com/gmod/NPC:NavSetRandomGoal), but you can decide any position you want as a search starting point rather than your NPC.
|
|
1161
|
+
* @realm server
|
|
1162
|
+
* @source https://wiki.facepunch.com/gmod/NPC:NavSetGoal
|
|
1163
|
+
*/
|
|
1164
|
+
NavSetGoal(self: NPC, pos: Vector, length: number, dir: Vector): boolean;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
interface NPC {
|
|
1168
|
+
/**
|
|
1169
|
+
* Creates a path to closest node at given position. This won't actually force the NPC to move.
|
|
1170
|
+
*
|
|
1171
|
+
* **NOTE**: This will call either [NPC:TaskComplete](https://wiki.facepunch.com/gmod/NPC:TaskComplete) or [NPC:TaskFail](https://wiki.facepunch.com/gmod/NPC:TaskFail) for the current schedule and task, forcing the current task to progress to next task or fail.
|
|
1172
|
+
*
|
|
1173
|
+
*
|
|
1174
|
+
* See also [NPC:NavSetRandomGoal](https://wiki.facepunch.com/gmod/NPC:NavSetRandomGoal).
|
|
1175
|
+
* @realm server
|
|
1176
|
+
* @source https://wiki.facepunch.com/gmod/NPC:NavSetGoalPos
|
|
1177
|
+
*/
|
|
1178
|
+
NavSetGoalPos(self: NPC, pos: Vector): boolean;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
interface NPC {
|
|
1182
|
+
/**
|
|
1183
|
+
* Set the goal target for an NPC.
|
|
1184
|
+
*
|
|
1185
|
+
* This will call either [NPC:TaskComplete](https://wiki.facepunch.com/gmod/NPC:TaskComplete) or [NPC:TaskFail](https://wiki.facepunch.com/gmod/NPC:TaskFail) for the current schedule and task, forcing the current task to progress to next task or fail.
|
|
1186
|
+
*
|
|
1187
|
+
*
|
|
1188
|
+
* @realm server
|
|
1189
|
+
* @source https://wiki.facepunch.com/gmod/NPC:NavSetGoalTarget
|
|
1190
|
+
*/
|
|
1191
|
+
NavSetGoalTarget(self: NPC, target: Entity, offset?: Vector): boolean;
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
interface NPC {
|
|
1195
|
+
/**
|
|
1196
|
+
* Creates a random path of specified minimum length between a closest start node and random node in the specified direction. This won't actually force the NPC to move.
|
|
1197
|
+
* @realm server
|
|
1198
|
+
* @source https://wiki.facepunch.com/gmod/NPC:NavSetRandomGoal
|
|
1199
|
+
*/
|
|
1200
|
+
NavSetRandomGoal(self: NPC, minPathLength: number, dir: Vector): boolean;
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
interface NPC {
|
|
1204
|
+
/**
|
|
1205
|
+
* Sets a goal in x, y offsets for the NPC to wander to
|
|
1206
|
+
* @realm server
|
|
1207
|
+
* @source https://wiki.facepunch.com/gmod/NPC:NavSetWanderGoal
|
|
1208
|
+
*/
|
|
1209
|
+
NavSetWanderGoal(self: NPC, xOffset: number, yOffset: number): boolean;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
interface NPC {
|
|
1213
|
+
/**
|
|
1214
|
+
* Forces the NPC to pickup an existing weapon entity. The NPC will not pick up the weapon if they already own a weapon of given type, or if the NPC could not normally have this weapon in their inventory.
|
|
1215
|
+
*
|
|
1216
|
+
* @realm server
|
|
1217
|
+
* @source https://wiki.facepunch.com/gmod/NPC:PickupWeapon
|
|
1218
|
+
*/
|
|
1219
|
+
PickupWeapon(self: NPC, wep: Weapon): boolean;
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
interface NPC {
|
|
1223
|
+
/**
|
|
1224
|
+
* Forces the NPC to play a sentence from scripts/sentences.txt
|
|
1225
|
+
* @realm server
|
|
1226
|
+
* @source https://wiki.facepunch.com/gmod/NPC:PlaySentence
|
|
1227
|
+
*/
|
|
1228
|
+
PlaySentence(self: NPC, sentence: string, delay: number, volume: number): number;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
interface NPC {
|
|
1232
|
+
/**
|
|
1233
|
+
* Makes the NPC remember an entity or an enemy as unreachable, for a specified amount of time. Use [NPC:IsUnreachable](https://wiki.facepunch.com/gmod/NPC:IsUnreachable) to check if an entity is still unreachable.
|
|
1234
|
+
* @realm server
|
|
1235
|
+
* @source https://wiki.facepunch.com/gmod/NPC:RememberUnreachable
|
|
1236
|
+
*/
|
|
1237
|
+
RememberUnreachable(self: NPC, ent: Entity, time?: number): void;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
interface NPC {
|
|
1241
|
+
/**
|
|
1242
|
+
* Removes conditions to ignore for the this NPC.
|
|
1243
|
+
* @realm server
|
|
1244
|
+
* @source https://wiki.facepunch.com/gmod/NPC:RemoveIgnoreConditions
|
|
1245
|
+
*/
|
|
1246
|
+
RemoveIgnoreConditions(self: NPC, conditions?: table): void;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
interface NPC {
|
|
1250
|
+
/**
|
|
1251
|
+
* Resets the ideal activity of the NPC. See also [NPC:SetIdealActivity](https://wiki.facepunch.com/gmod/NPC:SetIdealActivity).
|
|
1252
|
+
* @realm server
|
|
1253
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ResetIdealActivity
|
|
1254
|
+
*/
|
|
1255
|
+
ResetIdealActivity(self: NPC, act: number): void;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
interface NPC {
|
|
1259
|
+
/**
|
|
1260
|
+
* Resets all the movement calculations.
|
|
1261
|
+
*
|
|
1262
|
+
* Related functions are [NPC:MoveStart](https://wiki.facepunch.com/gmod/NPC:MoveStart), [NPC:MovePause](https://wiki.facepunch.com/gmod/NPC:MovePause) and [NPC:MoveStop](https://wiki.facepunch.com/gmod/NPC:MoveStop).
|
|
1263
|
+
* @realm server
|
|
1264
|
+
* @source https://wiki.facepunch.com/gmod/NPC:ResetMoveCalc
|
|
1265
|
+
*/
|
|
1266
|
+
ResetMoveCalc(self: NPC): void;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
interface NPC {
|
|
1270
|
+
/**
|
|
1271
|
+
* Forces the NPC to switch to a specific weapon the NPC owns. See [NPC:GetWeapons](https://wiki.facepunch.com/gmod/NPC:GetWeapons).
|
|
1272
|
+
* @realm server
|
|
1273
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SelectWeapon
|
|
1274
|
+
*/
|
|
1275
|
+
SelectWeapon(self: NPC, weapon: string | Weapon): void;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
interface NPC {
|
|
1279
|
+
/**
|
|
1280
|
+
* Stops any sounds (speech) the NPC is currently playing.
|
|
1281
|
+
*
|
|
1282
|
+
* Equivalent to `Entity:EmitSound( "AI_BaseNPC.SentenceStop" )`
|
|
1283
|
+
*
|
|
1284
|
+
* @realm server
|
|
1285
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SentenceStop
|
|
1286
|
+
*/
|
|
1287
|
+
SentenceStop(self: NPC): void;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
interface NPC {
|
|
1291
|
+
/**
|
|
1292
|
+
* Sets the NPC's current activity.
|
|
1293
|
+
* @realm server
|
|
1294
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetActivity
|
|
1295
|
+
*/
|
|
1296
|
+
SetActivity(self: NPC, act: number): void;
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
interface NPC {
|
|
1300
|
+
/**
|
|
1301
|
+
* @realm server
|
|
1302
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetArrivalActivity
|
|
1303
|
+
*/
|
|
1304
|
+
SetArrivalActivity(self: NPC, act: number): void;
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
interface NPC {
|
|
1308
|
+
/**
|
|
1309
|
+
* Sets the direction from the NPC origin to its current navigational destination.
|
|
1310
|
+
* @realm server
|
|
1311
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetArrivalDirection
|
|
1312
|
+
*/
|
|
1313
|
+
SetArrivalDirection(self: NPC, dir: Vector): void;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
interface NPC {
|
|
1317
|
+
/**
|
|
1318
|
+
* Sets the distance to goal at which the NPC should stop moving and continue to other business such as doing the rest of their tasks in a schedule.
|
|
1319
|
+
* @realm server
|
|
1320
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetArrivalDistance
|
|
1321
|
+
*/
|
|
1322
|
+
SetArrivalDistance(self: NPC, dist: number): void;
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
interface NPC {
|
|
1326
|
+
/**
|
|
1327
|
+
* Sets the sequence to be played when the NPC arrives at its goal.
|
|
1328
|
+
* @realm server
|
|
1329
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetArrivalSequence
|
|
1330
|
+
*/
|
|
1331
|
+
SetArrivalSequence(self: NPC, seq: number): void;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
interface NPC {
|
|
1335
|
+
/**
|
|
1336
|
+
* Sets the arrival speed? of the NPC
|
|
1337
|
+
* @realm server
|
|
1338
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetArrivalSpeed
|
|
1339
|
+
*/
|
|
1340
|
+
SetArrivalSpeed(self: NPC, speed: number): void;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
interface NPC {
|
|
1344
|
+
/**
|
|
1345
|
+
* Sets an NPC condition.
|
|
1346
|
+
* @realm server
|
|
1347
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetCondition
|
|
1348
|
+
*/
|
|
1349
|
+
SetCondition(self: NPC, condition: COND): void;
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
interface NPC {
|
|
1353
|
+
/**
|
|
1354
|
+
* Sets the weapon proficiency of an NPC (how skilled an NPC is with its current weapon).
|
|
1355
|
+
* @realm server
|
|
1356
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetCurrentWeaponProficiency
|
|
1357
|
+
*/
|
|
1358
|
+
SetCurrentWeaponProficiency(self: NPC, proficiency: number): void;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
interface NPC {
|
|
1362
|
+
/**
|
|
1363
|
+
* Sets the target for an NPC.
|
|
1364
|
+
* @realm server
|
|
1365
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetEnemy
|
|
1366
|
+
*/
|
|
1367
|
+
SetEnemy(self: NPC, enemy: Entity, newenemy?: boolean): void;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
interface NPC {
|
|
1371
|
+
/**
|
|
1372
|
+
* Sets the NPC's .vcd expression. Similar to [Entity:PlayScene](https://wiki.facepunch.com/gmod/Entity:PlayScene) except the scene is looped until it's interrupted by default NPC behavior or [NPC:ClearExpression](https://wiki.facepunch.com/gmod/NPC:ClearExpression).
|
|
1373
|
+
* @realm server
|
|
1374
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetExpression
|
|
1375
|
+
*/
|
|
1376
|
+
SetExpression(self: NPC, m_iszExpressionScene: string): number;
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
interface NPC {
|
|
1380
|
+
/**
|
|
1381
|
+
* Sets the Field Of View of the NPC, for use with such functions as [NPC:IsInViewCone](https://wiki.facepunch.com/gmod/NPC:IsInViewCone). it is also used internally by the NPC for enemy detection, etc.
|
|
1382
|
+
* @realm server
|
|
1383
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetFOV
|
|
1384
|
+
*/
|
|
1385
|
+
SetFOV(self: NPC, fov: number): void;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
interface NPC {
|
|
1389
|
+
/**
|
|
1390
|
+
* Forces given NPC to crouch, if it is able to do so. Only Citizens and Combine Soldiers can by default.
|
|
1391
|
+
* @realm server
|
|
1392
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetForceCrouch
|
|
1393
|
+
*/
|
|
1394
|
+
SetForceCrouch(self: NPC, force: boolean): void;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
interface NPC {
|
|
1398
|
+
/**
|
|
1399
|
+
* Updates the NPC's hull and physics hull in order to match its model scale. [Entity:SetModelScale](https://wiki.facepunch.com/gmod/Entity:SetModelScale) seems to take care of this regardless.
|
|
1400
|
+
* @realm server
|
|
1401
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetHullSizeNormal
|
|
1402
|
+
*/
|
|
1403
|
+
SetHullSizeNormal(self: NPC): void;
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
interface NPC {
|
|
1407
|
+
/**
|
|
1408
|
+
* Sets the hull type for the NPC.
|
|
1409
|
+
* @realm server
|
|
1410
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetHullType
|
|
1411
|
+
*/
|
|
1412
|
+
SetHullType(self: NPC, hullType: number): void;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
interface NPC {
|
|
1416
|
+
/**
|
|
1417
|
+
* Sets the ideal activity the NPC currently wants to achieve. This is most useful for custom SNPCs.
|
|
1418
|
+
* @realm server
|
|
1419
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetIdealActivity
|
|
1420
|
+
*/
|
|
1421
|
+
SetIdealActivity(self: NPC, arg0: number): void;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
interface NPC {
|
|
1425
|
+
/**
|
|
1426
|
+
* Sets the ideal sequence the NPC currently wants to achieve. This is most useful for custom SNPCs.
|
|
1427
|
+
* @realm server
|
|
1428
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetIdealSequence
|
|
1429
|
+
*/
|
|
1430
|
+
SetIdealSequence(self: NPC, sequenceId: number): void;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
interface NPC {
|
|
1434
|
+
/**
|
|
1435
|
+
* Sets the ideal yaw angle (left-right rotation) for the NPC. Does not actually force the NPC to start turning in that direction. See [NPC:UpdateYaw](https://wiki.facepunch.com/gmod/NPC:UpdateYaw), [NPC:GetIdealYaw](https://wiki.facepunch.com/gmod/NPC:GetIdealYaw) and [NPC:SetIdealYawAndUpdate](https://wiki.facepunch.com/gmod/NPC:SetIdealYawAndUpdate).
|
|
1436
|
+
* @realm server
|
|
1437
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetIdealYaw
|
|
1438
|
+
*/
|
|
1439
|
+
SetIdealYaw(self: NPC, angle: number): void;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
interface NPC {
|
|
1443
|
+
/**
|
|
1444
|
+
* Sets the ideal yaw angle (left-right rotation) for the NPC and forces them to turn to that angle.
|
|
1445
|
+
* @realm server
|
|
1446
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetIdealYawAndUpdate
|
|
1447
|
+
*/
|
|
1448
|
+
SetIdealYawAndUpdate(self: NPC, angle: number, speed?: number): void;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
interface NPC {
|
|
1452
|
+
/**
|
|
1453
|
+
* Sets conditions to ignore, which would normally interrupt an Engine-based schedule. Specified conditions will still be set, will call [ENTITY:OnCondition](https://wiki.facepunch.com/gmod/ENTITY:OnCondition) and can be returned by [NPC:HasCondition](https://wiki.facepunch.com/gmod/NPC:HasCondition), but they will no longer interrupt the Engine schedule.
|
|
1454
|
+
* @realm server
|
|
1455
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetIgnoreConditions
|
|
1456
|
+
*/
|
|
1457
|
+
SetIgnoreConditions(self: NPC, conditions: table, size: number): void;
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
interface NPC {
|
|
1461
|
+
/**
|
|
1462
|
+
* Sets the last registered or memorized position for this NPC. When using scheduling, the NPC will focus on navigating to the last position via nodes.
|
|
1463
|
+
*
|
|
1464
|
+
* **NOTE**: The navigation requires ground nodes to function properly, otherwise the NPC could only navigate in a small area. (https://developer.valvesoftware.com/wiki/Info_node)
|
|
1465
|
+
*
|
|
1466
|
+
*
|
|
1467
|
+
* @realm server
|
|
1468
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetLastPosition
|
|
1469
|
+
*/
|
|
1470
|
+
SetLastPosition(self: NPC, position: Vector): void;
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
interface NPC {
|
|
1474
|
+
/**
|
|
1475
|
+
* Sets NPC's max view distance. An NPC will not be able to see enemies outside of this distance.
|
|
1476
|
+
* @realm server
|
|
1477
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetMaxLookDistance
|
|
1478
|
+
*/
|
|
1479
|
+
SetMaxLookDistance(self: NPC, dist: number): void;
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
interface NPC {
|
|
1483
|
+
/**
|
|
1484
|
+
* Sets how long to try rebuilding path before failing task.
|
|
1485
|
+
* @realm server
|
|
1486
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetMaxRouteRebuildTime
|
|
1487
|
+
*/
|
|
1488
|
+
SetMaxRouteRebuildTime(self: NPC, time: number): void;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
interface NPC {
|
|
1492
|
+
/**
|
|
1493
|
+
* Sets the movement delay for given NPC.
|
|
1494
|
+
*
|
|
1495
|
+
* See [NPC:GetMoveDelay](https://wiki.facepunch.com/gmod/NPC:GetMoveDelay).
|
|
1496
|
+
*
|
|
1497
|
+
* @realm server
|
|
1498
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetMoveDelay
|
|
1499
|
+
*/
|
|
1500
|
+
SetMoveDelay(self: NPC, delay: number): void;
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
interface NPC {
|
|
1504
|
+
/**
|
|
1505
|
+
* Sets the timestep the internal NPC motor is working on.
|
|
1506
|
+
* @realm server
|
|
1507
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetMoveInterval
|
|
1508
|
+
*/
|
|
1509
|
+
SetMoveInterval(self: NPC, time: number): void;
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
interface NPC {
|
|
1513
|
+
/**
|
|
1514
|
+
* Sets the move velocity of the NPC
|
|
1515
|
+
* @realm server
|
|
1516
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetMoveVelocity
|
|
1517
|
+
*/
|
|
1518
|
+
SetMoveVelocity(self: NPC, vel: Vector): void;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
interface NPC {
|
|
1522
|
+
/**
|
|
1523
|
+
* Sets whether the current movement should locked on the Yaw axis or not.
|
|
1524
|
+
* @realm server
|
|
1525
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetMoveYawLocked
|
|
1526
|
+
*/
|
|
1527
|
+
SetMoveYawLocked(self: NPC, lock: boolean): void;
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
interface NPC {
|
|
1531
|
+
/**
|
|
1532
|
+
* Sets the activity the NPC uses when it moves.
|
|
1533
|
+
* @realm server
|
|
1534
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetMovementActivity
|
|
1535
|
+
*/
|
|
1536
|
+
SetMovementActivity(self: NPC, activity: number): void;
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
interface NPC {
|
|
1540
|
+
/**
|
|
1541
|
+
* Sets the sequence the NPC navigation path uses for speed calculation. Doesn't seem to have any visible effect on NPC movement or actively playing sequence.
|
|
1542
|
+
*
|
|
1543
|
+
* To be able to use this, first set [NPC:SetIdealActivity](https://wiki.facepunch.com/gmod/NPC:SetIdealActivity) to `ACT_DO_NOT_DISTURB`, set this to any sequence with root motion data and call [Entity:SetSequence](https://wiki.facepunch.com/gmod/Entity:SetSequence) on your desired sequence. As long as your NPC's [NPC:GetMovementSequence](https://wiki.facepunch.com/gmod/NPC:GetMovementSequence) has root motion data, your NPC will move to navigation point even though your NPC's [Entity:GetSequence](https://wiki.facepunch.com/gmod/Entity:GetSequence) doesn't have any motion.
|
|
1544
|
+
*
|
|
1545
|
+
* @realm server
|
|
1546
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetMovementSequence
|
|
1547
|
+
*/
|
|
1548
|
+
SetMovementSequence(self: NPC, sequenceId: number): void;
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1551
|
+
interface NPC {
|
|
1552
|
+
/**
|
|
1553
|
+
* Sets the state the NPC is in to help it decide on a ideal schedule.
|
|
1554
|
+
* @realm server
|
|
1555
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetNPCState
|
|
1556
|
+
*/
|
|
1557
|
+
SetNPCState(self: NPC, state: number): void;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
interface NPC {
|
|
1561
|
+
/**
|
|
1562
|
+
* Sets the navigation type of the NPC.
|
|
1563
|
+
* @realm server
|
|
1564
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetNavType
|
|
1565
|
+
*/
|
|
1566
|
+
SetNavType(self: NPC, navtype: number): void;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
interface NPC {
|
|
1570
|
+
/**
|
|
1571
|
+
* Sets the NPC's current schedule.
|
|
1572
|
+
* @realm server
|
|
1573
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetSchedule
|
|
1574
|
+
*/
|
|
1575
|
+
SetSchedule(self: NPC, schedule: number): void;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
interface NPC {
|
|
1579
|
+
/**
|
|
1580
|
+
* Assigns the NPC to a new squad. A squad can have up to 16 NPCs. NPCs in a single squad should be friendly to each other.
|
|
1581
|
+
*
|
|
1582
|
+
* See also [ai.GetSquadMembers](https://wiki.facepunch.com/gmod/ai.GetSquadMembers) and [NPC:GetSquad](https://wiki.facepunch.com/gmod/NPC:GetSquad).
|
|
1583
|
+
*
|
|
1584
|
+
* NPCs within the same squad are meant to function more effectively, tactics wise.
|
|
1585
|
+
*
|
|
1586
|
+
* @realm server
|
|
1587
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetSquad
|
|
1588
|
+
*/
|
|
1589
|
+
SetSquad(self: NPC, name?: string): void;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
interface NPC {
|
|
1593
|
+
/**
|
|
1594
|
+
* Sets the SNPC step height.
|
|
1595
|
+
*
|
|
1596
|
+
* **NOTE**: This only works for [scripted NPCs](https://wiki.facepunch.com/gmod/Scripted_Entities).
|
|
1597
|
+
*
|
|
1598
|
+
*
|
|
1599
|
+
* @realm server
|
|
1600
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetStepHeight
|
|
1601
|
+
*/
|
|
1602
|
+
SetStepHeight(self: NPC, height: number): void;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
interface NPC {
|
|
1606
|
+
/**
|
|
1607
|
+
* Sets the NPC's target. This is used in some engine schedules.
|
|
1608
|
+
* @realm server
|
|
1609
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetTarget
|
|
1610
|
+
*/
|
|
1611
|
+
SetTarget(self: NPC, entity: Entity): void;
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
interface NPC {
|
|
1615
|
+
/**
|
|
1616
|
+
* Sets the status of the current task.
|
|
1617
|
+
* @realm server
|
|
1618
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetTaskStatus
|
|
1619
|
+
*/
|
|
1620
|
+
SetTaskStatus(self: NPC, status: number): void;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
interface NPC {
|
|
1624
|
+
/**
|
|
1625
|
+
* Sets given entity as an unforgettable enemy. The state can be retrieved via [NPC:IsUnforgettable](https://wiki.facepunch.com/gmod/NPC:IsUnforgettable).
|
|
1626
|
+
* @realm server
|
|
1627
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetUnforgettable
|
|
1628
|
+
*/
|
|
1629
|
+
SetUnforgettable(self: NPC, enemy: Entity, set?: boolean): void;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
interface NPC {
|
|
1633
|
+
/**
|
|
1634
|
+
* Sets the view offset of the NPC. Player alternative of [Player:SetViewOffset](https://wiki.facepunch.com/gmod/Player:SetViewOffset).
|
|
1635
|
+
*
|
|
1636
|
+
* This affects NPC's [NPC:GetShootPos](https://wiki.facepunch.com/gmod/NPC:GetShootPos).
|
|
1637
|
+
* @realm server
|
|
1638
|
+
* @source https://wiki.facepunch.com/gmod/NPC:SetViewOffset
|
|
1639
|
+
*/
|
|
1640
|
+
SetViewOffset(self: NPC, arg0: Vector): void;
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
interface NPC {
|
|
1644
|
+
/**
|
|
1645
|
+
* Resets the NPC's movement animation and velocity. Does not actually stop the NPC from moving.
|
|
1646
|
+
* @realm server
|
|
1647
|
+
* @source https://wiki.facepunch.com/gmod/NPC:StopMoving
|
|
1648
|
+
*/
|
|
1649
|
+
StopMoving(self: NPC, immediate?: boolean): void;
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
interface NPC {
|
|
1653
|
+
/**
|
|
1654
|
+
* Cancels [NPC:MoveOrder](https://wiki.facepunch.com/gmod/NPC:MoveOrder) basically.
|
|
1655
|
+
*
|
|
1656
|
+
* Only works on Citizens (npc_citizen) and is a part of the Half-Life 2 squad system.
|
|
1657
|
+
*
|
|
1658
|
+
* The NPC **must** be in the player's squad for this to work.
|
|
1659
|
+
*
|
|
1660
|
+
* @realm server
|
|
1661
|
+
* @source https://wiki.facepunch.com/gmod/NPC:TargetOrder
|
|
1662
|
+
*/
|
|
1663
|
+
TargetOrder(self: NPC, target: Entity): void;
|
|
1664
|
+
}
|
|
1665
|
+
|
|
1666
|
+
interface NPC {
|
|
1667
|
+
/**
|
|
1668
|
+
* Marks the current NPC task as completed.
|
|
1669
|
+
*
|
|
1670
|
+
* This is meant to be used alongside [NPC:TaskFail](https://wiki.facepunch.com/gmod/NPC:TaskFail) to complete or fail custom Lua defined tasks. ([Schedule:AddTask](https://wiki.facepunch.com/gmod/Schedule:AddTask))
|
|
1671
|
+
*
|
|
1672
|
+
* @realm server
|
|
1673
|
+
* @source https://wiki.facepunch.com/gmod/NPC:TaskComplete
|
|
1674
|
+
*/
|
|
1675
|
+
TaskComplete(self: NPC): void;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
interface NPC {
|
|
1679
|
+
/**
|
|
1680
|
+
* Marks the current NPC task as failed.
|
|
1681
|
+
*
|
|
1682
|
+
* This is meant to be used alongside [NPC:TaskComplete](https://wiki.facepunch.com/gmod/NPC:TaskComplete) to complete or fail custom Lua defined tasks. ([Schedule:AddTask](https://wiki.facepunch.com/gmod/Schedule:AddTask))
|
|
1683
|
+
*
|
|
1684
|
+
* @realm server
|
|
1685
|
+
* @source https://wiki.facepunch.com/gmod/NPC:TaskFail
|
|
1686
|
+
*/
|
|
1687
|
+
TaskFail(self: NPC, failReason: string): void;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
interface NPC {
|
|
1691
|
+
/**
|
|
1692
|
+
* Force the NPC to update information on the supplied enemy, as if it had line of sight to it.
|
|
1693
|
+
* @realm server
|
|
1694
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UpdateEnemyMemory
|
|
1695
|
+
*/
|
|
1696
|
+
UpdateEnemyMemory(self: NPC, enemy: Entity, pos: Vector): void;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
interface NPC {
|
|
1700
|
+
/**
|
|
1701
|
+
* Updates the turn activity. Basically applies the turn animations depending on the current turn yaw.
|
|
1702
|
+
* @realm server
|
|
1703
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UpdateTurnActivity
|
|
1704
|
+
*/
|
|
1705
|
+
UpdateTurnActivity(self: NPC): void;
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
interface NPC {
|
|
1709
|
+
/**
|
|
1710
|
+
* Forces the NPC to turn to their ideal yaw angle. See [NPC:SetIdealYaw](https://wiki.facepunch.com/gmod/NPC:SetIdealYaw) and [NPC:SetIdealYawAndUpdate](https://wiki.facepunch.com/gmod/NPC:SetIdealYawAndUpdate).
|
|
1711
|
+
* @realm server
|
|
1712
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UpdateYaw
|
|
1713
|
+
*/
|
|
1714
|
+
UpdateYaw(self: NPC, speed?: number): void;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
interface NPC {
|
|
1718
|
+
/**
|
|
1719
|
+
* **NOTE**: This function only works on `ai` type [SENTs](https://wiki.facepunch.com/gmod/Scripted_Entities).
|
|
1720
|
+
*
|
|
1721
|
+
*
|
|
1722
|
+
* @realm server
|
|
1723
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UseActBusyBehavior
|
|
1724
|
+
*/
|
|
1725
|
+
UseActBusyBehavior(self: NPC): boolean;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
interface NPC {
|
|
1729
|
+
/**
|
|
1730
|
+
* Enables the AI's [Assault Behavior](https://developer.valvesoftware.com/wiki/Assault "Assault Behavior") when an `ai_goal_assault` is set for this SENT.
|
|
1731
|
+
* **NOTE**: This function only works on `ai` type [SENTs](https://wiki.facepunch.com/gmod/Scripted_Entities).
|
|
1732
|
+
*
|
|
1733
|
+
*
|
|
1734
|
+
* @realm server
|
|
1735
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UseAssaultBehavior
|
|
1736
|
+
*/
|
|
1737
|
+
UseAssaultBehavior(self: NPC): boolean;
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
interface NPC {
|
|
1741
|
+
/**
|
|
1742
|
+
* **NOTE**: This function only works on `ai` type [SENTs](https://wiki.facepunch.com/gmod/Scripted_Entities).
|
|
1743
|
+
*
|
|
1744
|
+
*
|
|
1745
|
+
* @realm server
|
|
1746
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UseFollowBehavior
|
|
1747
|
+
*/
|
|
1748
|
+
UseFollowBehavior(self: NPC): boolean;
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
interface NPC {
|
|
1752
|
+
/**
|
|
1753
|
+
* Orders the SNPC to control any nearby `func_tank`s looking for an NPC to operate itself, if available.
|
|
1754
|
+
* **NOTE**: This function only works on `ai` type [SENTs](https://wiki.facepunch.com/gmod/Scripted_Entities).
|
|
1755
|
+
*
|
|
1756
|
+
*
|
|
1757
|
+
* @realm server
|
|
1758
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UseFuncTankBehavior
|
|
1759
|
+
*/
|
|
1760
|
+
UseFuncTankBehavior(self: NPC): boolean;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
interface NPC {
|
|
1764
|
+
/**
|
|
1765
|
+
* Enables the AI's [Lead Behavior](https://developer.valvesoftware.com/wiki/ai_goal_lead "Lead Behavior") when an `ai_goal_lead` is set for this SENT.
|
|
1766
|
+
* **NOTE**: This function only works on `ai` type [SENTs](https://wiki.facepunch.com/gmod/Scripted_Entities).
|
|
1767
|
+
*
|
|
1768
|
+
*
|
|
1769
|
+
* @realm server
|
|
1770
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UseLeadBehavior
|
|
1771
|
+
*/
|
|
1772
|
+
UseLeadBehavior(self: NPC): boolean;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
interface NPC {
|
|
1776
|
+
/**
|
|
1777
|
+
* Undoes the other `Use*Behavior` functions.
|
|
1778
|
+
*
|
|
1779
|
+
* **NOTE**: This function only works on `ai` type [SENTs](https://wiki.facepunch.com/gmod/Scripted_Entities).
|
|
1780
|
+
*
|
|
1781
|
+
*
|
|
1782
|
+
* @realm server
|
|
1783
|
+
* @source https://wiki.facepunch.com/gmod/NPC:UseNoBehavior
|
|
1784
|
+
*/
|
|
1785
|
+
UseNoBehavior(self: NPC): void;
|
|
1786
|
+
}
|
|
1787
|
+
|