When running `scripts\run_match.ps1` I receive many counts of error

When I run scripts\run_match.ps1 in PowerShell I get many of the same variation of an error as seen below:

99 P1 {"p2Units":[[],[],[],[],[],[],[]],"turnInfo":[0,99,-1],"p1Stats":[30.0,421.0,41.9,2],"p1Units":[[],[],[],[],[],[],[]],"p2Stats":[30.0,421.0,41.9,2],"events":{"selfDestruct":[],
"breach":[],"damage":[],"shield":[],"move":[],"spawn":[],"death":[],"attack":[],"melee":[]}}
Invalid command, couldn't json for player 0 : {"p2Units":[[],[],[],[],[],[],[]],"turnInfo":[0,99,-1],"p1Stats":[30.0,421.0,41.9,2],"p1Units":[[],[],[],[],[],[],[]],"p2Stats":[30.0,42
1.0,41.9,2],"events":{"selfDestruct":[],"breach":[],"damage":[],"shield":[],"move":[],"spawn":[],"death":[],"attack":[],"melee":[]}}
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
	at com.google.gson.Gson.fromJson(Gson.java:899)
	at com.google.gson.Gson.fromJson(Gson.java:852)
	at com.google.gson.Gson.fromJson(Gson.java:801)
	at towergame.Parser.processInputForPlayer(Parser.java:179)
	at towergame.Parser.processInputDeploy(Parser.java:356)
	at towergame.GameMain.runLoop(GameMain.java:352)
	at towergame.GameMain.startGame(GameMain.java:202)
	at towergame.GameMain.main(GameMain.java:175)
	at towerworker.TowerWorker.main(TowerWorker.java:79)
Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 path $
	at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:350)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:80)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:61)
	at com.google.gson.Gson.fromJson(Gson.java:887)
	... 8 more

I’m on windows 10 and have tried reinstalling the program from GitHub from several times to no avail. Any help/advice would be appreciated

I’ve had this happen before to me, I managed to get a fix to it, but I have no idea why and I don’t know if it will work for you.

go to your algo’s folder, and open up run.ps1 in a text editor.
change py -3 $algoPath to python $algoPath
If that doesn’t work, change python $algoPath back to py -3 $algoPath

I have no idea why changing it back fixes the issue (it did for me at least), but give this a go and see if it works.

Note that this fix is algo-dependant, you you have to either do this fix on the run.ps1 file for each algo you have, or simply copy and paste the file over into other algos folders.

I saw that thread, I tried it, doing that made it so whenever I attempted to run the program it would crash, the same was true even if I changed it back.

I ended up reinstalling the program as I couldn’t figure out a way to make it stop crashing.

I found that if you try to print something it gives this error, instead use the gamelib.debug_write() function to write something in the powershell.