Quote:
startup:
Sleep(1.0);
HeapNew(160000);
slot = 0;
For(i = 1; i <= GetThingCount(); i = i + 1)
{
If(GetThingTemplate(i) == nodetemplate)
{
HeapSet(slot, i); //current thing is a node, place it in current slot
slot = slot + 1; // go to next 'slot'
if(slot >= 9999)
i = GetThingCount(); //bail out if we've reached the max of nodes
}
}
nodecount = slot; // this is the actual amount of nodes used, logically the heap amount should be size - 1
//Heap of all nodes now available, now we need to find and mark the nodes that can be moved too
For(slot = 0; slot < nodecount; slot = slot + 1)
{
//get the thing we're going to work on here (this works)
WorkingNode = HeapGet(slot);
//Set all the nodes as zero to start, we will allow up to 9 possible nodes to be moved too. (zero no more nodes)
For(i = 0; i <= 7; i = i + 1)
MoveNode = 0;
//reset node count
movenodes = 0;
//Things are in order, do the dirty work of finding a list of their move to able nodes
For(slotcheck = 0; slotcheck < nodecount - 1; slotcheck = slotcheck + 1)
{
CheckNode = HeapGet(slotcheck);
If(HasLOS(WorkingNode, CheckNode)) // First things first, they've got to see eachother
{
MoveNode[movenodes] = CheckNode;
movenodes = movenodes + 1;
}
}
for(i = 0; i < 9; i = i + 1)
{
HeapSet( ((i + 1) * 10000) + slot, MoveNode);
}
}
Sleep(1.0);
HeapNew(160000);
slot = 0;
For(i = 1; i <= GetThingCount(); i = i + 1)
{
If(GetThingTemplate(i) == nodetemplate)
{
HeapSet(slot, i); //current thing is a node, place it in current slot
slot = slot + 1; // go to next 'slot'
if(slot >= 9999)
i = GetThingCount(); //bail out if we've reached the max of nodes
}
}
nodecount = slot; // this is the actual amount of nodes used, logically the heap amount should be size - 1
//Heap of all nodes now available, now we need to find and mark the nodes that can be moved too
For(slot = 0; slot < nodecount; slot = slot + 1)
{
//get the thing we're going to work on here (this works)
WorkingNode = HeapGet(slot);
//Set all the nodes as zero to start, we will allow up to 9 possible nodes to be moved too. (zero no more nodes)
For(i = 0; i <= 7; i = i + 1)
MoveNode = 0;
//reset node count
movenodes = 0;
//Things are in order, do the dirty work of finding a list of their move to able nodes
For(slotcheck = 0; slotcheck < nodecount - 1; slotcheck = slotcheck + 1)
{
CheckNode = HeapGet(slotcheck);
If(HasLOS(WorkingNode, CheckNode)) // First things first, they've got to see eachother
{
MoveNode[movenodes] = CheckNode;
movenodes = movenodes + 1;
}
}
for(i = 0; i < 9; i = i + 1)
{
HeapSet( ((i + 1) * 10000) + slot, MoveNode);
}
}
-El Scorcho
"Its dodgeball time!" -Stormy Waters
"Its dodgeball time!" -Stormy Waters