NPC.CapabilitiesAdd

From GMod Wiki

Jump to: navigation, search
Function
Syntax NPC:CapabilitiesAdd( Enum capabilities )
Description:
Determines what an NPC can/can't do.
Returns: nil
In Object: Npc
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=NPC.CapabilitiesAdd]NPC.CapabilitiesAdd [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionGarry's fighter NPC
Used onNewerServer.png
Code
 
  function ENT:Initialize()
 
   self:SetModel( "models/Humans/Group01/Female_01.mdl" )
 
   self:SetHullType(HULL_HUMAN);
   self:SetHullSizeNormal();
 
   self:SetSolid( SOLID_BBOX )
   self:SetMoveType( MOVETYPE_STEP )
 
   self:CapabilitiesAdd( CAP_MOVE_GROUND | CAP_OPEN_DOORS | CAP_ANIMATEDFACE | CAP_TURN_HEAD | CAP_USE_SHOT_REGULATOR | CAP_AIM_GUN )
 
   self:SetMaxYawSpeed( 5000 )
 
   self:Give( "weapon_ak47" ) //Can be given sweps.
 
  end
 
OutputAllows NPCs to use the abilities described.


Additional Notes

SERVER | -000002147483648 |-00000000000000000000000000000000 | CAP_SIMPLE_RADIUS_DAMAGE -- Do not use robust radius damage model on this character.
SERVER | 0000000000000001 | 00000000000000000000000000000001 | CAP_MOVE_GROUND -- Walk/Run
SERVER | 0000000000000002 | 00000000000000000000000000000010 | CAP_MOVE_JUMP -- Jump/Leap
SERVER | 0000000000000004 | 00000000000000000000000000000100 | CAP_MOVE_FLY -- Can fly  move all around
SERVER | 0000000000000008 | 00000000000000000000000000001000 | CAP_MOVE_CLIMB -- climb ladders
SERVER | 0000000000000016 | 00000000000000000000000000010000 | CAP_MOVE_SWIM -- navigate in water; UNDONE - not yet implemented
SERVER | 0000000000000032 | 00000000000000000000000000100000 | CAP_MOVE_CRAWL -- crawl; UNDONE - not yet implemented
SERVER | 0000000000000064 | 00000000000000000000000001000000 | CAP_MOVE_SHOOT -- Tries to shoot weapon while moving
SERVER | 0000000000000128 | 00000000000000000000000010000000 | CAP_SKIP_NAV_GROUND_CHECK -- Optimization - skips ground tests while computing navigation
SERVER | 0000000000000256 | 00000000000000000000000100000000 | CAP_USE -- Open doors/push buttons/pull levers
SERVER | 0000000000001024 | 00000000000000000000010000000000 | CAP_AUTO_DOORS -- Can trigger auto doors
SERVER | 0000000000002048 | 00000000000000000000100000000000 | CAP_OPEN_DOORS -- Can open manual doors
SERVER | 0000000000004096 | 00000000000000000001000000000000 | CAP_TURN_HEAD -- Can turn head  always bone controller 0
SERVER | 0000000000008192 | 00000000000000000010000000000000 | CAP_WEAPON_RANGE_ATTACK1 -- Can do a weapon range attack 1
SERVER | 0000000000016384 | 00000000000000000100000000000000 | CAP_WEAPON_RANGE_ATTACK2 -- Can do a weapon range attack 2
SERVER | 0000000000032768 | 00000000000000001000000000000000 | CAP_WEAPON_MELEE_ATTACK1 -- Can do a weapon melee attack 1
SERVER | 0000000000065536 | 00000000000000010000000000000000 | CAP_WEAPON_MELEE_ATTACK2 -- Can do a weapon melee attack 2
SERVER | 0000000000131072 | 00000000000000100000000000000000 | CAP_INNATE_RANGE_ATTACK1 -- Can do a innate range attack 1
SERVER | 0000000000262144 | 00000000000001000000000000000000 | CAP_INNATE_RANGE_ATTACK2 -- Can do a innate range attack 2
SERVER | 0000000000524288 | 00000000000010000000000000000000 | CAP_INNATE_MELEE_ATTACK1 -- Can do a innate melee attack 1
SERVER | 0000000001048576 | 00000000000100000000000000000000 | CAP_INNATE_MELEE_ATTACK2 -- Can do a innate melee attack 2
SERVER | 0000000002097152 | 00000000001000000000000000000000 | CAP_USE_WEAPONS -- Can use weapons (non-innate attacks)
SERVER | 0000000008388608 | 00000000100000000000000000000000 | CAP_ANIMATEDFACE -- Has animated eyes/face
SERVER | 0000000016777216 | 00000001000000000000000000000000 | CAP_USE_SHOT_REGULATOR -- Uses the shot regulator for range attack1
SERVER | 0000000033554432 | 00000010000000000000000000000000 | CAP_FRIENDLY_DMG_IMMUNE -- Don't take damage from npc's that are D_LI
SERVER | 0000000067108864 | 00000100000000000000000000000000 | CAP_SQUAD -- Can form squads
SERVER | 0000000134217728 | 00001000000000000000000000000000 | CAP_DUCK -- Cover and Reload ducking
SERVER | 0000000268435456 | 00010000000000000000000000000000 | CAP_NO_HIT_PLAYER -- Don't hit players
SERVER | 0000000536870912 | 00100000000000000000000000000000 | CAP_AIM_GUN -- Use arms to aim gun, not just body.
SERVER | 0000001073741824 | 01000000000000000000000000000000 | CAP_NO_HIT_SQUADMATES

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox