Okay, I'm kind of stumped on one thing - Lua's string functions.
I'm trying to write a parser for my Love2D-based map editor, which has the format as followed:
-- Comment header for no reason.
map[1] = {1, 2, 3}
objmap[1] = {55, 66, 77}
It may look similar... because it's actually an included LUA file that is parsed by my game and generates levels based on the tables inside.
I can write the tables no problem using Lua's built-in writing functions. It's the Opening of the files that's stumped me.
I've tried including (via require()) and heavy coding, but unfortunately I know that love2d's file system has limited access (which is mostly a good thing!) and thus that didn't work.
I'm trying to write this parser so I can work on levels without having to work on the levels in one-go.
Any pointers on how to split up what's in the curly braces? I've looked at the online lua guide and it... was admittedly hard to understand. then maybe part of it is the fact I've been up a very long time and need rest.
Whatever the reason, I humbly seek advice from anyone who has any idea on how to solve this issue.
Lua string functions - How do I do this?
- TheKraigose
- Prole
- Posts: 9
- Joined: Tue Apr 12, 2011 5:20 pm
- Location: Somewhere that's Hi in the middle, Round at Both Ends!
- Contact:
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Lua string functions - How do I do this?
I'm not sure what exactly the question is?
Help us help you: attach a .love.
- TheKraigose
- Prole
- Posts: 9
- Joined: Tue Apr 12, 2011 5:20 pm
- Location: Somewhere that's Hi in the middle, Round at Both Ends!
- Contact:
Re: Lua string functions - How do I do this?
I actually figured it out.Robin wrote:I'm not sure what exactly the question is?
My question though was "how do you do strings and file handling in Lua". Sorry about earlier DX
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Lua string functions - How do I do this?
Maybe you want to use TSerial for this?
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Who is online
Users browsing this forum: Ahrefs [Bot] and 2 guests