After updating wasmoon, experiencing error with goto statements.
Line -14346: ')' expected near
Line 14346 is the goto statement ::tryAgain:: below.
function placeRandomNumberOfTilesInRing(rowCoord, colCoord, numberOfTilesToDraw, chosenTerrain, ringRadius, ringWidth, terrainTypes, terrainLayoutResult)
count = 0
neighbors = GetAllSquaresOfTypeInRingAroundSquare(rowCoord, colCoord, ringRadius, ringWidth, terrainTypes, terrainLayoutResult)
print('placeRandomNumberOfTilesInRing: '..#neighbors..' neighbors found')
if (#neighbors < 1) then
print('placeRandomNumberOfTilesInRing: No neighbor tiles found. Check selected terrainTypes')
return
end
if (numberOfTilesToDraw > #neighbors) then
print('placeRandomNumberOfTilesInRing: number of tiles to draw is less than found neighbors. Setting numberOfTilesToDraw to '..#neighbors)
numberOfTilesToDraw = #neighbors
end
::tryAgain::
print('placeRandomNumberOfTilesInRing: making pass to place random terrain')
for k, v in ipairs(neighbors) do
--start again here
chosenIndex = GetRandomIndex(neighbors)
if (count < numberOfTilesToDraw and terrainLayoutResult[neighbors[chosenIndex][1]][neighbors[chosenIndex][2]].terrainType ~= chosenTerrain) then
terrainLayoutResult[neighbors[chosenIndex][1]][neighbors[chosenIndex][2]].terrainType = chosenTerrain
table.remove(neighbors, chosenIndex)
count = count + 1
end
end
if (count < numberOfTilesToDraw) then
goto tryAgain
end
end
After updating wasmoon, experiencing error with goto statements. Line -14346: ')' expected near
Line 14346 is the goto statement
::tryAgain::
below.