Functions (NodeGraph module) - ShadowBonnieRUS/GMOD-SB_Advanced_Nextbots_Base GitHub Wiki
Here are descriptions for functions used in NodeGraph module.
🔹 SBAdvancedNextbotNodeGraph.Load
Attempts to load NodeGraph data from .ain
map file. Clears current NodeGraph.
Arguments: 0
Returns: 1
- bool | Returns true of success, false otherwise.
🔹 SBAdvancedNextbotNodeGraph.GetAllNodes
Returns all nodes from current NodeGraph.
Arguments: 0
Returns: 1
- table | Table of nodes.
🔹 SBAdvancedNextbotNodeGraph.GetNodesCount
Returns nodes count in current NodeGrapg. Faster than #SBAdvancedNextbotNodeGraph.GetAllNodes()
.
Arguments: 0
Returns: 1
- number | Nodes count.
🔹 SBAdvancedNextbotNodeGraph.GetNearestNode
Returns nearest node to given position. If ConVar sb_anb_nodegraph_accurategetnearestnode
is 1, function will return nearest node to nearest connection to given position.
Arguments: 1
- Vector | Position.
Returns: 1
- any | Nearest node or nil.
🔹 SBAdvancedNextbotNodeGraph.GetNodeByID
Returns node with given ID.
Arguments: 1
- number | Node ID.
Returns: 1
- any | Nearest node or nil.
🔹 SBAdvancedNextbotNodeGraph.GetEditOps
Returns table, where keys are node IDs and values are WorldCraft node IDs. Used to get WC node ID using default node ID.
Arguments: 0
Returns: 1
- table | Table to convert node ID to WC version.
🔹 SBNodeGraphNode:GetOrigin
Returns origin of node.
Arguments: 0
Returns: 1
- Vector | Node origin.
🔹 SBNodeGraphNode:GetYaw
Returns yaw of node.
Arguments: 0
Returns: 1
- number | Node yaw.
🔹 SBNodeGraphNode:GetID
Returns ID of node.
Arguments: 0
Returns: 1
- number | Node ID.
🔹 SBNodeGraphNode:GetType
Returns type of node. See SBAdvancedNextbotNodeGraph.NODE_ Enums.
Arguments: 0
Returns: 1
- number | Node type.
🔹 SBNodeGraphNode:GetInfo
Returns info about node.
Arguments: 0
Returns: 1
- number | Node info.
🔹 SBNodeGraphNode:GetZone
Returns zone of node. See SBAdvancedNextbotNodeGraph.AI_NODE_ZONE_ Enums.
Arguments: 0
Returns: 1
- number | Node zone.
🔹 SBNodeGraphNode:GetAdjacentNodes
Returns all nodes to which this node is attached.
Arguments: 0
Returns: 1
- table | Add adjacent nodes.
🔹 SBNodeGraphNode:GetAcceptedMoveTypes
Returns accepted move types as integer from this node to given node.
Arguments: 1
- SBNodeGraphNode | Other node.
Returns: 1
- number | Accepted move types.
🔹 SBNodeGraphNode:IsValid
Returns is node valid or not.
Arguments: 0
Returns: 1
- bool | Is node valid or not.
🔹 SBNodeGraphPathFollower:Compute
Same as PathFollower:Compute
Custom path cost generator arguments: SBNodeGraphNode (from node), SBNodeGraphNode (to node), number ('accepted move type' capabilities).
Custom path cost generator returns: -1 to skip node or positive number to set cost from one node to another.
🔹 SBNodeGraphPathFollower:FirstSegment
Same as PathFollower:FirstSegment
🔹 SBNodeGraphPathFollower:GetAge
Same as PathFollower:GetAge
🔹 SBNodeGraphPathFollower:GetAllSegments
Same as PathFollower:GetAllSegments
🔹 SBNodeGraphPathFollower:GetCurrentGoal
Same as PathFollower:GetCurrentGoal
🔹 SBNodeGraphPathFollower:GetEnd
Same as PathFollower:GetEnd
🔹 SBNodeGraphPathFollower:GetGoalTolerance
Same as PathFollower:GetGoalTolerance
🔹 SBNodeGraphPathFollower:GetLength
Same as PathFollower:GetLength
🔹 SBNodeGraphPathFollower:GetMinLookAheadDistance
Same as PathFollower:GetMinLookAheadDistance
🔹 SBNodeGraphPathFollower:GetStart
Same as PathFollower:GetStart
🔹 SBNodeGraphPathFollower:Invalidate
Same as PathFollower:Invalidate
🔹 SBNodeGraphPathFollower:IsValid
Same as PathFollower:IsValid
🔹 SBNodeGraphPathFollower:LastSegment
Same as PathFollower:LastSegment
🔹 SBNodeGraphPathFollower:ResetAge
Same as PathFollower:ResetAge
🔹 SBNodeGraphPathFollower:SetGoalTolerance
Same as PathFollower:SetGoalTolerance
🔹 SBNodeGraphPathFollower:SetMinLookAheadDistance
Same as PathFollower:SetMinLookAheadDistance
🔹 SBNodeGraphPathFollower:Update
Same as PathFollower:Update
🔹 SBNodeGraphPathFollower:Draw
Same as PathFollower:Draw