I've decided to try this using SuperLib and the pathfinder it uses. However, I can't seem to get it to successfully find a path between two points and build the road. I'm assuming that's because I don't know how to use it properly.
Here is the current test code I'm trying:
Code: Select all
///////////Temp Test of Roadbuilder//////////////////
local testRoadBuilder = SuperLib.RoadBuilder();
testRoadBuilder.Init(AIMap.GetTileIndex(43,23), AIMap.GetTileIndex(38,36), false, 4000, null);
while(!testRoadBuilder.DoPathfinding()){AILog.Info("trying to find path...");this.Sleep(10);}
testRoadBuilder.ConnectTiles();
In the code above, "DoPathfinding()" never returns true.
I also tried:
Code: Select all
///////////Temp Test of Roadbuilder//////////////////
local testRoadBuilder = SuperLib.RoadBuilder();
testRoadBuilder.Init(AIMap.GetTileIndex(43,23), AIMap.GetTileIndex(38,36), false, 4000, null);
testRoadBuilder.ConnectTiles();
So obviously I am not understanding how to use this and I'm hoping someone can nudge me in the right direction. Maybe there are some code examples around that I haven't found yet?
Or maybe using SuperLib isn't the correct way to go either?
Thanks in advance for any help