possable to merge layers in BF1

Started by Delta327, February 22, 2018, 02:16:17 PM

Previous topic - Next topic
hey guys i have a question for swbf1 modders im trying to edit a shipped world and last time i did this the layers didnt load uo when i did this. my question is how do u merge layers in zeroeditor,
PROJECTS:                                 
BF1:
Sector 3-4482-F
Solar System
BF2:
Shattered Galaxy
Project 171A

February 22, 2018, 04:23:40 PM #1 Last Edit: February 22, 2018, 08:25:37 PM by RepComm
Edit (I'm on my laptop now):

Layer ( *.LYR ) files are plain text / config files that store attributes and object placements.
World ( *.WLD ) file is another similar file (it is also text / config).

-Speculation: I think this cfg/config format was probably the JSON format/notation equivalent back in 2004, because it is used extensively for multiple purposes in SWBF's files.

To merge layers manually,  all you need to do it copy/paste the text from given layer files into the given layer or main world ( *.WLD ) file. There is a catch though, so I'll cover that.

The basic layout of a WLD file (probably what you want to merge layers into, if you are having issues loading them), looks like this:
Code (JavaScript) Select

Version(3);
SaveType(0);

Camera("camera")
{
Rotation(-0.014, -0.007, -0.893, 0.450);
Position(-176.078, 14.313, -77.866);
FieldOfView(55.400);
NearPlane(1.000);
FarPlane(1100.000);
ZoomFactor(1.000);
Bookmark(-187.831, 15.033, 33.616,  0.205, 0.087, -0.897, 0.381);
}
TerrainName("bespin2.ter");
SkyName("bespin2.sky");
ScriptName("DummyScript.dll");
ControllerManager("StandardCtrlMgr");

WorldExtents()
{
Min(0.000000, 0.000000, 0.000000);
Max(0.000000, 0.000000, 0.000000);
}

NextSequence(-14070829);

Object("", "bes2_bldg_base", 1963669)
{
ChildRotation(1.000, 0.000, 0.000, 0.000);
ChildPosition(-179.000, -50.000, -132.000);
SeqNo(1963669);
Team(0);
NetworkId(-1);
}


You can see at this last few lines "Object(name, mshName, uniqueId)" line,
there are a TON of these lines in a layer/world file that have lots of object placements.
This is the object placement entry (every time you place an object and save the map, these are produced in the layer/world).

An object in a LAYER file will have an extra attribute:
Code (JavaScript) Select
    Layer( layerId );

As you can see in stock bespin 'base' model/object placement:
Code (JavaScript) Select

Object("", "bes2_bldg_base", 1963669)
{
ChildRotation(1.000, 0.000, 0.000, 0.000);
ChildPosition(-179.000, -50.000, -132.000);
SeqNo(1963669);
Team(0);
NetworkId(-1);
Layer(2); -- This line specifies layer it's in, which ZE reads and stores, and eventually resaves
}


If you just copy/paste all of the object entries from an LYR layer, it will work for the first load into zero editor, but after you save the map, zero editor just resaves them back into the layer specified by the id it read the first time.

If you are just moving all layers to world WLD file, then you can go into a text editor
and use 'Find And Replace' feature to go through each Layer(*number*) and replace it with a space (or just no text at all). If you do this, make sure you go through each layer number (because there are usually multiple).

Or you can manually go through each entry and remove the Layer(); line completely.. Bleh

Maybe a bash/batch/autoit file/program could be made to automate this process..

--TESTING ZE ABILITY TO DO THIS--

Apparently there is a feature to move all of a layer's data into another.
See SleepKiller's post below, as this image is incorrect! Thanks SK!

Actually that Zero Editor method is incorrect and will not do anything. The steps shown will move whatever you have selected in the editor into the layer selected. (And since the screenshot doesn't have anything selected in the editor it will do nothing.)

In order to merge layers together first open the layers window in Zero Editor. Then hold down shift and click on which layers you want to merge. They should all be highlighted as selected. The button named "Merge" will no no longer be greyed out and will become clickable. Clicking it will merge the selected layers into one.

Quote from: RepComm on February 22, 2018, 04:23:40 PM
-Speculation: I think this cfg/config format was probably the JSON format/notation equivalent back in 2004, because it is used extensively for multiple purposes in SWBF's files.
I think that would likely just be XML. The format Zero Editor uses is likely just something Pandemic developed and used internally, much like Valve's key-value format.

Thanks for corrections! I'll cross that incorrect bit out now

ok thanks for the tutorial you guys
PROJECTS:                                 
BF1:
Sector 3-4482-F
Solar System
BF2:
Shattered Galaxy
Project 171A