Quick reference on nodes and how to access them
Nodes are a series of global variables and have an associated index. The amount of nodes present is stored in
$nodes. Node IDs are stored in a double linked list
$nodePosition[ %node ] - Position of node in the world
$nodeX[ %node ] - Size of node on X axis
$nodeY[ %node ] - Size of node on Y axis
$nodeCrouch[ %node ] - Whether or not you have to be crouching to occupy this node's space
$nodeHeight[ %node ] - Z position of node
$nodeNeighbors[ %node ] - Amount of links this node has
$nodeNeighbor[ %node SPC %i ] - Linked node
%i$nodeNeighborEdge[ %node SPC %neighbor ] - The edge this node shares with
%neighbor$nodeNeighborAxis[ %node SPC %neighbor ] - Two booleans specifying which cardinal direction neighbor
%neighbor is in relation to
%node$nodeYMax[ %node ] - The y element of the northern edge
$nodeYMin[ %node ] - The y element of the southern edge
$nodeXMax[ %node ] - The x element of the eastern edge
$nodeXMin[ %node ] - The x element of the western edge
(edges are represented x1 y1 z1 x2 y2 z2)
$nodeEdgeN[ %node ] - The north edge
$nodeEdgeE[ %node ] - The east edge
$nodeEdgeS[ %node ] - The south edge
$nodeEdgeW[ %node ] - The west edge
Some misc crap
$nodeShape[ %node ] - The static shape for each node when debug shapes are drawn
$nodeAtPosition[ %position ] - The node found at
%positionFor the linked list:
$nodeLLStart - The start node in the LL
$nodeLLNext[ %node ] - The next node after
%node in the LL
$nodeLLPrevious[ %node ] - The previous node before
%node in the LL
wrath_printLL(); - Prints the linked list
How I iterate through the LL. Checking the position for null might be unnecessary
for(%i = $nodeLLStart; $nodePosition[ %i ] !$= ""; %i = $nodeLLNext[ %i ])
Creating/deleting nodes:
wrath_createNode(%position, %x, %y, %crouch)wrath_deleteNode(%node)Code is a little messy, sorry