Page 1 of 1

custom common.lvl can be called via map lua

Posted: Sat Jul 14, 2012 9:44 pm
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")

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

Posted: Mon Jul 16, 2012 4:05 pm
by giftheck
So calling a custom common.lvl overrides the original common.lvl, correct?

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

Posted: Mon Jul 16, 2012 6:44 pm
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

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

Posted: Tue Jul 17, 2012 2:51 pm
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.