
(Any faces you may or may not see on this picture are purely a fidget of your imagination)
I figured out what I think to be the best method to make single hops and that is to make every node linked to the 6 nodes that he is neighbored by, but I need advice on how to find the different nodes. One method, pictured above is to destroy every link and procedurally perform containerboxsearches, activating the next brick. When the next brick gets activated, it does the exact same and links up with 6 of it's neighbors and what should come of it should be a web of links between neighboring nodes.
This seems extremely unpractical though and with game boards getting larger and larger, this could start to have an effect on the load-up time.
What I have node-ing wise.
function addLandTileNodes()
{
for(%a = 0; %a < mainBrickGroup.getCount(); %a++)
{
%b = mainBrickGroup.getObject(%a);
for(%c = 0; %c < %b.getCount(); %c++)
{
%brick = %b.getObject(%c);
if(%brick.getDatablock().getName() $= "BotTileBrickData")
{
if(printBrickToPrintName(%brick) $= "ModTer/blank")
{
%brick.node = new FxDTSBrick()
{
datablock = brickSlyrBotPathNodeData;
position = getWord(%brick.getPosition(), 0) SPC getWord(%brick.getPosition(), 1) SPC getWord(%brick.getPosition, 2) + 1.7;
isPlanted = 1;
colorID = 1;
client = -1;
};
%brick.node.plant();
// %error = %brick.node.plant();
// if(%error)
// {
// %brick.node.schedule(33,delete); Failiure is not an option (hah)
// return;
// }
getBrickGroupFromObject(%brick).add(%brick.node);
%brick.node.setTrusted(1);
}
}
}
}
BotWars_Debug("Created Nodes");
}
function BotWars_HandleMovement(%troop, %brick)
{
%bricktype = BotWars_settleMovementType(%brick);
%trooptype = %troop.movementType;
if(%bricktype !$= %trooptype)
{
BotWars_Debug("Can't go");
return;
}
BotWars_Debug("movement pass"); //MOVEMENT HERE
BotWars_Debug(slayer.pathHandler.findPath(%troop.activebrick.node, %brick.node).result);
}