From 7d02640dfb0b9bbee3c04dc29a52f49d2cc09205 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 2 Sep 2020 03:34:57 -0600 Subject: [PATCH] csv --- userraw/maps/mp/bots/_bot_utility.gsc | 470 +++++++++++++++----------- userraw/maps/mp/bots/_wp_editor.gsc | 35 +- userraw/waypoints/mp_rust_wp.csv | 179 ++++++++++ 3 files changed, 476 insertions(+), 208 deletions(-) create mode 100644 userraw/waypoints/mp_rust_wp.csv 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