Ok, so we're all familiar with the line found in the Mission scripts that goes like so:
ReadDataFile("dc:HFV\\HFV.lvl", "HFV_conquest")
but I'm wondering, how would you change this to get it to reference the script in a different folder in the addon folder? Such as loading
MJE\\MJE.lvl, "MJE_conquest" from this script? It's possible to load the stock missions from an addon script in this manner; that's how I made the lazer tag mod. That of course is achieved by removing the "dc:" part. But how would you navigate backward to the addon folder and then forward to the desired mod map folder within addon, using LUA code?
...I think I've already tried /, //, ..\, *\, **\, and none of those work for backward file navigation)
calling all LUA programmers...
In-LUA file navigation
Moderator: Moderators
-
Jaspo
- Command Sergeant Major

- Posts: 282
- Joined: Sun Mar 01, 2009 4:34 am
- Projects :: AotC DoW+++Boonta Eve Classic
- xbox live or psn: No gamertag set
- Contact:
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: In-LUA file navigation
http://www.gametoast.com/forums/viewtop ... 74&t=18253
That's not directly a tutorial for what you're referring to, but I mention it a couple times in there:
You were on the right track, but directories have to be separated by the double backslash and not just a single. Moving up a directory is "..".
That's not directly a tutorial for what you're referring to, but I mention it a couple times in there:
Code: Select all
ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\dtshell.lvl")-
Jaspo
- Command Sergeant Major

- Posts: 282
- Joined: Sun Mar 01, 2009 4:34 am
- Projects :: AotC DoW+++Boonta Eve Classic
- xbox live or psn: No gamertag set
- Contact:
Re: In-LUA file navigation
ah, ok, so you just skip the dc: altogether. Brilliant! Thanks a lot!
