diff --git a/userraw/maps/mp/bots/_bot_utility.gsc b/userraw/maps/mp/bots/_bot_utility.gsc index 1820b26..f9a285c 100644 --- a/userraw/maps/mp/bots/_bot_utility.gsc +++ b/userraw/maps/mp/bots/_bot_utility.gsc @@ -384,219 +384,277 @@ RoundUp( floatVal ) return i; } +wpsFromCSV(mapname) +{ + fileName = "waypoints/"+ toLower(mapname) + "_wp.csv"; + printLn( "Getting waypoints from csv: "+fileName ); + + waypoints = []; + + waypointCount = int(tableLookupByRow(fileName, 0, 0)); + + if (waypointCount == "" || waypointCount <= 0) + return waypoints; + + for (i = 1; i <= waypointCount; i++) + { + waypoint = spawnStruct(); + + orgStr = tableLookupByRow(fileName, i, 0); + orgToks = strtok(orgStr, " "); + waypoint.origin = (int(orgToks[0]), int(orgToks[1]), int(orgToks[2])); + + childStr = tableLookupByRow(fileName, i, 1); + childToks = strtok(childStr, " "); + waypoint.childCount = childToks.size; + waypoint.children = []; + for( j=0; j