Garry's Mod Wiki

NEXTBOT

The list of hooks for nextbot NPCs.

Inherits methods from NextBot.

Events

NEXTBOT:BehaveStart()
Called to initialize the behaviour. This is called automatically when the NextBot is created, you should not call it manually. Note: You shouldn't override this unless you know what you are doing - it's used to kick off the coroutine that runs the bot's behaviour. See NEXTBOT:RunBehaviour instead.
NEXTBOT:BehaveUpdate( number interval )
Called to update the bot's behaviour. If you override this hook you must call coroutine.resume(self.BehaveThread) to resume the NEXTBOT:RunBehaviour Behavior
NEXTBOT:BodyUpdate()
Called to update the bot's animation.
NEXTBOT:OnContact( Entity ent )
Called when the nextbot touches another entity.
NEXTBOT:OnEntitySight( Entity ent )
Called when the nextbot NPC sees another Nextbot NPC or a Player. Note: This hook will only run after NextBot:SetFOV or other vision related function is called on the nextbot. See NextBot:IsAbleToSee for more details.
NEXTBOT:OnEntitySightLost( Entity ent )
Called when the nextbot NPC loses sight of another Nextbot NPC or a Player. Note: This hook will only run after NextBot:SetFOV or other vision related function is called on the nextbot. See NextBot:IsAbleToSee for more details.
NEXTBOT:OnIgnite()
Called when the bot is ignited.
NEXTBOT:OnInjured( CTakeDamageInfo info )
Called when the bot gets hurt. This is a good place to play hurt sounds or voice lines.
NEXTBOT:OnKilled( CTakeDamageInfo info )
Called when the bot gets killed.
NEXTBOT:OnLandOnGround( Entity ent )
Called when the bot's feet return to the ground.
NEXTBOT:OnLeaveGround( Entity ent )
Called when the bot's feet leave the ground - for whatever reason.
NEXTBOT:OnNavAreaChanged( CNavArea old, CNavArea new )
Called when the nextbot enters a new navigation area.
NEXTBOT:OnOtherKilled( Entity victim, CTakeDamageInfo info )
Called when someone else or something else has been killed.
NEXTBOT:OnStuck()
Called when the bot thinks it is stuck.
NEXTBOT:OnTraceAttack( CTakeDamageInfo info, Vector dir, table trace )
Called when a trace attack is done against the nextbot, allowing override of the damage being dealt by altering the CTakeDamageInfo. This is called before NEXTBOT:OnInjured.
NEXTBOT:OnUnStuck()
Called when the bot thinks it is un-stuck.
NEXTBOT:RunBehaviour()
A hook called to process nextbot logic. This hook runs in a coroutine by default. It will only be called if NEXTBOT:BehaveStart is not overriden.