A common system that any NPC/Nextbot base can adopt to make it compatiable with other bases that are using this system.
To implement CNS into your NPC/Nextbot base, you need to take the following steps:
- Declare and implement all the functions, variables and enumerations listed below to avoid any possible error.
- Declare
ENT.UsingCNS = true
on a shared enviroment in your NPC.
D_
= Enums for disposition, more information at https://wiki.facepunch.com/gmod/Enums/D
self.UsingCNS
= Signifies that this entity is using CNS.
Title | Description |
---|---|
Purpose | Returns the way the NPC "feels" about an entity |
Parameters | ent = The entity to check against |
Returns | enum D_ |
Default GMod? | Yes - NPC library |
self:Disposition(ent)
Title | Description |
---|---|
Purpose | Obtain the current main enemy |
Parameters | None |
Returns | Entity or NULL |
Default GMod? | Yes - NPC library |
self:GetEnemy()
Title | Description |
---|---|
Purpose | Set the current main enemy |
Parameters | ent = The ent to set as enemy |
Returns | None |
Default GMod? | Yes - NPC library |
self:SetEnemy(ent)
Title | Description |
---|---|
Purpose | Returns the current weapon that the entity is using |
Parameters | None |
Returns | Entity or NULL |
Default GMod? | Yes - NPC & Player library |
self:GetActiveWeapon()