Page 1 of 1

In-LUA file navigation

Posted: Tue Mar 09, 2010 2:33 pm
by Jaspo
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...

Re: In-LUA file navigation

Posted: Tue Mar 09, 2010 2:37 pm
by Maveritchell
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:

Code: Select all

ReadDataFile("..\\..\\addon\\BDT\\data\\_LVL_PC\\dtshell.lvl")
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 "..".

Re: In-LUA file navigation

Posted: Tue Mar 09, 2010 2:44 pm
by Jaspo
ah, ok, so you just skip the dc: altogether. Brilliant! Thanks a lot!