Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is my loop stopping?

Asked by 9 years ago

If you need any extra info, I will post it.

I am using the PolyDraw Module BTW.

So, I am running a loop. And it stops running after going through only a couple of times.

01function SetChunkSize(NX, NY)
02    print("SettingChunkSize")
03    local Chunksize = ChunkSize
04    local Tilesize = TileSize
05 
06    if NX == -1 or NX == 1 or NY == -1 or NY == 1 then
07        Chunksize = Vector2.new(((Chunksize.X-1)/2)+1, ((Chunksize.Y-1)/2)+1)
08        Tilesize = Tilesize * 2
09    elseif NX == -2 or NX == 2 or NY == -2 or NY == 2 then
10        Chunksize = Vector2.new(((Chunksize.X-1)/4)+1, ((Chunksize.Y-1)/4)+1)
11        Tilesize = Tilesize * 4
12    end
13 
14    print(Chunksize.X .. ":" .. Chunksize.Y .. "_" .. Tilesize)
15    return Chunksize, Tilesize
View all 35 lines...

NOTE: This is not the whole script. The loop is in the GenerateTriangles function. Anyone know why it stops?

Output: Player:-1, 0 SettingChunkSize 3:3_512 0:0 0:1 0:2

0
Is there any error? About how big is `Chunksize.X` and `Chunksize.Y`? BlueTaslem 18071 — 9y
0
The chunksize is a Vector two of 17 x 17 at first. I have no errors also. I do know that it works as it was not until tonight that it stopped working. I was implementing the change of the tilesize as the chunks would be less detailed. MisaMiner 50 — 9y

Answer this question