"Stacking levels" (loading new layer, existing world)

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

"Stacking levels" (loading new layer, existing world)

Post 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.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: "Stacking levels" (loading new layer, existing world)

Post 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.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: "Stacking levels" (loading new layer, existing world)

Post 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.
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: "Stacking levels" (loading new layer, existing world)

Post 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.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: "Stacking levels" (loading new layer, existing world)

Post 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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: "Stacking levels" (loading new layer, existing world)

Post 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.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: "Stacking levels" (loading new layer, existing world)

Post by Teancum »

Yep, pretty much. It was surprisingly simple actually.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: "Stacking levels" (loading new layer, existing world)

Post 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.
Post Reply