custom common.lvl can be called via map lua

Post everything from general questions, to modding questions, to map WIPs to releases. (SWBF1 only)

Moderator: Moderators

Post Reply
Led
Private Third Class
Posts: 54
Joined: Sat Sep 26, 2009 6:05 pm

custom common.lvl can be called via map lua

Post by Led »

Once again, I don't know everything, and I have not seen this before (maybe this is old news to SWBF2 modders, I just don't follow SWBF2), but I have just found that SWBF (original) can call custom common.lvl by a map lua via a ReadDataFile command, such as this:

ReadDataFile("COMMON\\common-custom.lvl")

or

ReadDataFile("dc:common\\common.lvl")


This can be done client side for client side custom common.lvl modifications (e.g. different color explosions just for the client) or for server side only common.lvl modifications (e.g. making a negative health recharge rate for a health bot) or more importantly in my opinion, for modders that make custom common.lvl files for their mods, they can now just drop their new common in the Addon map folder, call it in the lua, and it will not affect any other maps.

Random custom common.lvl can also be implemented via the random lua commands I have discussed here previously.

A snippet from by bes2a.lua looks like this:

Code: Select all

    ReadDataFile("sound\\bes.lvl;bes2gcw");
    ReadDataFile("SIDE\\all.lvl",
        "all_inf_basicurban",
        "all_inf_lukeskywalker",
        "all_inf_smuggler");
    ReadDataFile("SIDE\\imp.lvl",
        "imp_inf_basic_tie",
        "imp_inf_dark_trooper",
        "imp_inf_darthvader");

ReadDataFile("COMMON\\common-dot.lvl")
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Legacy

Re: custom common.lvl can be called via map lua

Post by giftheck »

So calling a custom common.lvl overrides the original common.lvl, correct?
Led
Private Third Class
Posts: 54
Joined: Sat Sep 26, 2009 6:05 pm

Re: custom common.lvl can be called via map lua

Post by Led »

Yes.

Here is a video of a a stock common.lvl file on bes2r followed by a custom common.lvl on bes2a (dot in the sniper reticule:
http://www.xfire.com/video/590b0d/

btw, this was client side, but it should work server side or as addon map too
User avatar
giftheck
Droid Pilot Assassin
Droid Pilot Assassin
Posts: 2218
Joined: Mon Jan 19, 2009 5:58 pm
Projects :: Star Wars Battlefront Legacy

Re: custom common.lvl can be called via map lua

Post by giftheck »

Interesting.

I wonder if this could be used to get around the custom skeleton problem with big mods. If you used custom unit skeletons in the main common.lvl it crashed the game at startup.
Post Reply