core.libraries.thirdparty.niknaks.modules.sh_ain_module

(no description)

Functions

AddToClosedList()

View source »

Adds the node to the closed list.

AddToOpenList()

View source »

Adds the node to the open list.

CanMaybeReach(start_pos, end_pos, NODE_TYPE, HULL_SIZE, max_dis)

View source »

A cheap lookup function. Checks to see if we can reach the position using nearby nodes. Note that this use zones and might have false positives on maps with a broken NodeGraph.

Parameters

  • start_pos Vector

  • end_pos Vector

  • NODE_TYPE number optional

  • HULL_SIZE number optional

  • max_dis number optional

    -- Distance to nearest node

Returns

  • boolean

FindHintNode(position, NODE_TYPE, HintType, HintGroup, Zone)

View source »

Returns the nearest node with said HintType.

Parameters

  • position Vector

  • NODE_TYPE number optional

  • HintType number

  • HintGroup number optional

  • Zone number optional

Returns

  • ain_node

FindNode(position, NODE_TYPE, Zone)

View source »

Returns the nearest node

Parameters

  • position Vector

  • NODE_TYPE number optional

  • Zone number optional

Returns

  • ain_node

FindNodeWithHull(position, NODE_TYPE, HULL, Zone)

View source »

Returns the nearest node with a connection matching the hull.

Parameters

  • position Vector

  • NODE_TYPE number optional

  • HULL number

  • Zone number optional

Returns

  • ain_node

GenerateZones()

View source »

Overrides and generates all the zones in the nodegraph. This can fix zone-errors.

GetAllGridNodes()

View source »

A function returning all nodes connected to this one. A bit costly.

Returns

GetAllNodes()

View source »

Returns a list of all nodes. With the ID as keys.

GetConnections()

View source »

Returns all the connections from this node.

Returns

GetConnectionsByHull(hull)

View source »

Returns all the connections from this node, with said hull that aren't invalid.

Parameters

  • hull number

Returns

GetCostSoFar()

View source »

Returns the cost so far.

Returns

  • number

GetDestID()

View source »

Returns the node IF of the distination node.

GetID()

View source »

Returns the node ID.

GetID()

View source »

Returns the link ID.

GetInfo()

View source »

Returns the node info.

GetMapVersion()

View source »

Returns the AIN map-version.

GetMove(HULL)

View source »

Returns the move bitflags.

Parameters

  • HULL number

GetMoveType()

View source »

Returns the move-type to this node.

Returns

  • number

GetNode(id)

View source »

Returns the given ain_node at said ID.

Parameters

  • id number

GetPos(hull)

View source »

Returns the node position.

Parameters

  • hull

Returns

  • Vector

GetSrcID()

View source »

Returns the node ID of the source node.

GetTotalCost()

View source »

Returns the total cost.

Returns

  • number

GetType()

View source »

Returns the node type.

Returns

  • number NODE_TYPE

GetVersion()

View source »

Returns the AIN version. Should be 37.

GetYaw()

View source »

Returns the node YAW.

GetZone()

View source »

Returns the node zone. It should match any notes connected to this one.

HasMoveFlag(HULL, flag)

View source »

Checks to see if it has any of said move flag

Parameters

  • HULL number

  • flag number

IsClosed()

View source »

Returns true if the node is within the closed list.

Returns

  • boolean

IsNodeType(NODE_TYPE)

View source »

Returns true if the node_type match.

Parameters

  • NODE_TYPE number

Returns

  • boolean

IsOpen()

View source »

Returns true if the node is on the open list.

Returns

  • boolean

IsOpenListEmpty()

View source »

Returns true if the open list is empty.

Returns

  • boolean

IsValid()

View source »

Returns true if the node is valid.

NikNaks.NodeGraph.GetMap()

View source »

Returns the nodegraph for the current map and caches it

Returns

  • NodeGraph or boolean

  • optional AIN_ERROR_*

PathFind(start_pos, end_pos, NODE_TYPE, options, HULL_SIZE, generator)

View source »

A* pathfinding using the NodeGraph.

Parameters

  • start_pos Vector or Entity

  • end_pos Vector or Entity

  • NODE_TYPE number optional

  • HULL_SIZE number optional

  • generator function optional

    -- A funtion that allows you to calculate your own cost: func( node, fromNode, CAP_MOVE, elevator, length )

Returns

  • LPathFollower or boolean

PathFindASync(start_pos, end_pos, callback, NODE_TYPE, options, HULL_SIZE, generator)

View source »

A* pathfinding using the NodeGraph. Returns the result in the callback. Calculates 20 paths pr tick.

Parameters

  • start_pos Vector or Entity

  • end_pos Vector or Entity

  • callback function

    -- Returns the result. LPathFollower or false

  • NODE_TYPE number optional

  • HULL_SIZE number optional

  • generator function optional

    -- A funtion that allows you to calculate your own cost: func( node, fromNode, CAP_MOVE, elevator, length )

PopOpenList()

View source »

Pops the open list and returns the kiwest total cost node.

RemoveFromClosedList()

View source »

Removes the node from the closed list.

SaveAin(filePath)

View source »

Saves the nodegraph to a file.

Parameters

SetCostSoFar(cost)

View source »

Sets the cost for pathfinding.

Parameters

  • cost number

SetMoveType(CAP_MOVE)

View source »

Sets the move-type to this node.

Parameters

  • CAP_MOVE number

SetTotalCost(cost)

View source »

Sets the total cost.

Parameters

  • cost number

UpdateOnOpenList()

View source »

Updates the open list.