It looks very easy. The difficult part is when you have more than 1 layer and especially when you have more than 1 tileset. I guess some of the people who got the "expected quad" error are using maps with more than 1 tileset.
I know this vid is from 5 years ago, but I followed everything you did in this part, and Love2D tells me the image doesn't exist. I put the script and all associated files for the tilemap in the same folder together to see if that was the issue, but that thing just won't stop bothering me. I did merge the tileset and tilemap together to get the image parameter, but it still won't work.
My map will not export as a lua file, first of all the option for (*.lua) does not show up, and secondly, whenever I truy to export it as a lua file it says that it is an "unknown file extension". Any ideas?
change the size of the love2d window to the map. you can calculate by groundlayer.width * tilewidth, groundlayer.height * tileheight. but in most games you will usually add a camera that scrolls with the player character or the mousecursor
I have the same problem. I used a camera that's centred around my player character and the lines seem to appear when the player coordinates aren't whole numbers. But trying to MAKE those numbers be whole values solves the problem while making the character... vibrate... . If you managed to solve it, how?
It doesn't matter too much, just need one that you can get comfortable in, I like using vscode for my lua, but I also have worked in those other editors and have had a good experience
I got the same error, but I managed to fix it. The reason I got that error is because I got confused when declaring the for loop that mapped the quads, and put in an extra comma. I mistakenly typed "for y=0, (tileset.imageheight / tileset.tileheight), -1 do" when I should have typed "for y=0, (tileset.imageheight / tileset.tileheight) -1 do". I was confused as to why he was subtracting 1 from the second argument, and thought he meant that the loop had to do go in steps of -1 XD. Edit:LOL sorry, I didn't saw the date on your comment.
because the coordinate system starts at (0,0). For example, "layer.height" gives you the total amount of rows on that layer. so if the map had 30 rows, the first row is row 0 and the last one is row 29. If you are looping trough them and start at 0, you need to take that into consideration.
pro vim tip - bind capslock to escape, stops the weird caps lock vimness and also is more handy for exiting insert mode :D
It looks very easy. The difficult part is when you have more than 1 layer and especially when you have more than 1 tileset. I guess some of the people who got the "expected quad" error are using maps with more than 1 tileset.
I know this vid is from 5 years ago, but I followed everything you did in this part, and Love2D tells me the image doesn't exist. I put the script and all associated files for the tilemap in the same folder together to see if that was the issue, but that thing just won't stop bothering me. I did merge the tileset and tilemap together to get the image parameter, but it still won't work.
My map will not export as a lua file, first of all the option for (*.lua) does not show up, and secondly, whenever I truy to export it as a lua file it says that it is an "unknown file extension". Any ideas?
I have a question for you. How do you take the map that you made at the end and make it fit up the whole love2d window?
change the size of the love2d window to the map. you can calculate by groundlayer.width * tilewidth, groundlayer.height * tileheight.
but in most games you will usually add a camera that scrolls with the player character or the mousecursor
How do I use multiple tilesets?
When i use this with my own map and tileset, it creates black lines around the tiles
I have the same problem. I used a camera that's centred around my player character and the lines seem to appear when the player coordinates aren't whole numbers. But trying to MAKE those numbers be whole values solves the problem while making the character... vibrate... .
If you managed to solve it, how?
How does path refer to the path to the map? I never see you defining it in your code for example path = require(file/tilemap(.lua))
in the main.lua file he called the function and passed path in the function params
I keep getting "tiledmap.lua:33: bad argument #2 to 'draw' (Quad expected, got nil)" as an error, help );
Hey, great video ! Which Lua editor do you recommend ? Does it matter or any will workjust fine ? Atom / sublime text / SciTE , another ?
It doesn't matter too much, just need one that you can get comfortable in, I like using vscode for my lua, but I also have worked in those other editors and have had a good experience
@@SkyVaultGames Thanks mate !
Loving your videos! Any chance your Vim config is posted anywhere?
Great tutorial, thank you!
HI, i'm trying to load my map, and it's giving me an error saying, Quad expected, got nil! i don't understand i followed all steps... can you help?
I got the same error, but I managed to fix it. The reason I got that error is because I got confused when declaring the for loop that mapped the quads, and put in an extra comma. I mistakenly typed "for y=0, (tileset.imageheight / tileset.tileheight), -1 do" when I should have typed "for y=0, (tileset.imageheight / tileset.tileheight) -1 do". I was confused as to why he was subtracting 1 from the second argument, and thought he meant that the loop had to do go in steps of -1 XD.
Edit:LOL sorry, I didn't saw the date on your comment.
@@Xn10001 lol np, i managed to fix it, i needed for a uni project, i hope i don't have to work with love again lol
How did u fixed it? :/
@@bme8561 hi, i would love to help you but i really don't remember :/.. sorry
Have you built tilemap generation into your game?
I would love to make chunk-based procedural worlds but I don't know where to start
Is that a linux distribution? if it is whats it called? it looks really sweet!
It is! Its manjaro kde edition
Why subtract minus 1
because the coordinate system starts at (0,0). For example, "layer.height" gives you the total amount of rows on that layer.
so if the map had 30 rows, the first row is row 0 and the last one is row 29. If you are looping trough them and start at 0, you need to take that into consideration.
woah, that code editor looks super cool! What's it called?
It's called vim, it's one of the most famous text editors for Linux
Which OS is this?
Its Manjaro Linux using the Kde Plasma desktop :)
SkyVaultGames thank you, I am curious about mankato, can you explain why you chose it?
I really love the community behind it and sense its based on Arch linux you have access to the AUR, so theres a ton of software available
Awesome has tempted me in the past, though normally I go with i3wm or Kde, but definitely interested in trying awesome sometime :)