Search found 4 matches
- Tue May 28, 2024 5:38 pm
- Forum: General
- Topic: Messed up variable with connecting block textures
- Replies: 6
- Views: 1852
Re: Messed up variable with connecting block textures
What does this mean exactly? Sorry, I'm not the best programmer ahah. How could I change the code in order to prevent something like this? Like I said, I'm not sure at all what's actually causing this in the generateTerrain code. OK, I've finally understood what's going on here. The problem is as f...
- Mon May 27, 2024 5:26 pm
- Forum: General
- Topic: Messed up variable with connecting block textures
- Replies: 6
- Views: 1852
Re: Messed up variable with connecting block textures
Well, I've added this to main.lua right after generateTerrain, to see the map structure: for i = 1, #self.ents[1] do io.stdout:write(self.ents[1][i].id) if i % self.worldW == 0 then io.stdout:write("\n") end end The output was: 11111111111111111111111111111111 2222222222222222222222222222...
- Sun May 26, 2024 1:25 pm
- Forum: General
- Topic: Messed up variable with connecting block textures
- Replies: 6
- Views: 1852
Re: Messed up variable with connecting block textures
Hello, welcome to the forums. Your comparison works for me. I've converted your snippet to a whole program by adding a line before and a few lines after your code, like this: local Block = {} function Block:update(t,state,dt) -- check adjacencies and update self.merge -- v (self) for i = 1, #t do l...
- Sat May 25, 2024 7:42 pm
- Forum: General
- Topic: Messed up variable with connecting block textures
- Replies: 6
- Views: 1852
Messed up variable with connecting block textures
I'm making a tile-based platformer and have come into an issue. For some reason, v and v2 both work perfectly fine, but v3 has just decided to not return true when checking its ID. The possible IDs can only be 1 or 2 in this case, and you can see that v and v2 have no issues accessing them. For refe...