Page 1 of 1
"Stacking levels" (loading new layer, existing world)
Posted: Fri Oct 30, 2009 7:45 am
by Teancum
So the premise of this I totally understand. LUA-wise it's simple. You load the stock world, then your mods to that world to change it. For example:
Code: Select all
ReadDataFile("COR\\cor1.lvl")
--And our new layer
ReadDataFile("NEW\\cor1.lvl", "cor1_newmode")
The issue lies in setting up the REQs so I don't have to load a totally new level, which is just more weight to the file size. I'm
guessing I can just modify the world req and remove unnecessary lines for terrain, pathing, etc. Then I remove all common world objects, leaving only the objects I need for my new mode, and put those as a new game type in ZE. Theoretically that means all the common world assets will load from the stock map and that my custom lvl will only load "cor1_newmode".
This is all theoretical, of course -- but I know at one time this was discussed and I wondered if anyone had actually done it.
Re: "Stacking levels" (loading new layer, existing world)
Posted: Fri Oct 30, 2009 10:10 am
by [RDH]Zerted
I've done it just to see if it works, and it does. However I didn't remove anything from the maps. I think the DMI map should be put together this way.
Re: "Stacking levels" (loading new layer, existing world)
Posted: Fri Oct 30, 2009 10:41 am
by Teancum
I'll investigate removing all unneeded stuff from the req and seeing if I can load a layer on top of it. Like you said duplicating a level is no problem, but I wonder if it breaks if the second level has issues. It shouldn't since you can do similar things with sides if you only want to add [x] or [y] thing.
Re: "Stacking levels" (loading new layer, existing world)
Posted: Fri Oct 30, 2009 10:06 pm
by [RDH]Zerted
Yeah, you tell it what layers/mode to load. If those don't include the base layer, then there is no reason to have it.
Re: "Stacking levels" (loading new layer, existing world)
Posted: Mon Nov 02, 2009 2:35 pm
by Teancum
So I can confirm this works, and is easy to do for a semi-seasoned modder. I was able to add an 360kb lvl to the jedi temple with just my custom layer in it, load the regular temple, then my layer on top and had no issues. I will write a tutorial when I have time.
Re: "Stacking levels" (loading new layer, existing world)
Posted: Mon Nov 02, 2009 2:42 pm
by Maveritchell
Sorry I didn't comment on this earlier; I've done this a number of times to either load in new things to stock levels or load in extra options to my own levels. I originally thought you meant that you didn't want an actual separate .lvl file, but I see now you really just wanted to not duplicate anything unnecessarily.
Re: "Stacking levels" (loading new layer, existing world)
Posted: Mon Nov 02, 2009 4:15 pm
by Teancum
Yep, pretty much. It was surprisingly simple actually.
Re: "Stacking levels" (loading new layer, existing world)
Posted: Mon Nov 02, 2009 11:51 pm
by Maveritchell
Teancum wrote:Yep, pretty much. It was surprisingly simple actually.
If you understand how .lvl files (and their root .req files) work (and I know that you personally do) there's nothing to it (or anything like it) as long as you understand where any given script needs to load data. If you know where the game world is loaded in, you really only have two things to test if you're trying to overwrite or add new data - loading immediately before or after. You can pretty much add anything new anywhere
if you know where similar data is loaded.