[Question] Unpacking levels

Making or wanting help making your own asset? Check in here
Post Reply
Bleach
Posts: 471
Joined: 2007-06-01 10:35

[Question] Unpacking levels

Post by Bleach »

how do i unpack levels so i can edit the in the bf2 editor?
Image

Image

In Game Name MuttRag.
Rambo Hunter
Posts: 1899
Joined: 2006-12-22 18:40

Post by Rambo Hunter »

go to the map folder, right click the .zip files and click "extract here"
that's using winrar. but as long at the files are extracted in levels/MAPNAME it should work
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Post by Rhino »

you unpack them like any other zip file, right click, exstract. With WinXP you dont even need to isntall winzip or winrar to open them...
Image
IronTaxi
Retired PR Developer
Posts: 4925
Joined: 2006-05-31 12:56

Post by IronTaxi »

you can simply unzip them (client/server) and that can give you limited access to the level, ie changing vehicle spawns and such..

to really modify a level you need the editor folder which is not distributed with the level and contains lots of files pertaining to setting up the editor layers..detail and colour layers for terrain and lightmap settings...
TY2D2
Posts: 433
Joined: 2007-06-07 05:21

Post by TY2D2 »

I wonder is it possible to get those files form devs? No one ever releases them because they are big files, but why not make a seperate file with all the editor folders for each map? That would make it a lot easier for community mappers to modify stuff.
Image
First Strike Developer
ASF Clan Leader
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Post by Rhino »

here you go.
Step 1: Setting up the Map for Audit.

In this step we will cover how to set the map up for Audit to be used for the BF2 editor, and so it can be used by others later on.

First copy the map folder into your "pr_edit" mod leaves folder.
(if you do not have a "pr_edit" mod do this tut here: http://realitymod.com/forum/t14468-tuto ... gspan.html)

Now after you have that, you should now inside the map folder you just copied over to your "pr_edit"'s level folder, a "Info" folder, a "client.zip" and a "server.zip".
Image

Now for the editor to be able to read the maps files, you must first exstract both the client and server .zips into your maps folder.
Image


You will now need to get hold of, or create the Editor files used by the BF2 Editor.

If you can get hold of the editor files from the crator of the map, or somone who had made them from scratch in the past (by doing a audit or w/e) is the quickest / easist way. So first allways see if you can get hold of them if possible. If not, you will need to create them from scratch.

A) If you can get hold of the editor files, simpley place them in the "Editor" folder inside the map folder, ie: "\levels\*MAP NAME*\Editor\". If the editor folder is not there, create it. Inside of the editor folder you will need to put the "gameplayobjects.con" (GPO.con for short) and "layer.con" files. These are the editor files and not the game files bare in mind as there is a GPO.con file for each layer of the game files but the editor version is all of them together.

B) If you can not get hold of the editor files, then you need to crate them from scratch. This is where it starts to get tricky.
First you need create your Editor folder. simpley just create a new folder inside your map folder and rename it to "Editor"
Image Image

Once you have the editor folder, go to your maps: "\GameModes\gpm_cq\64\" folder and copy the "GamePlayObjects.con" (GPO.con for short) into your maps editor folder: "\Editor\".

This is only the 64 layer of your GPO.con file. Now this is where it gets really tricky where we need to edit in the other layers into the Editors GPO.con file so its all the layers, combined.

Open up your Editors GPO.con file (\Editor\GamePlayObjects.con) with notepade or w/e text editor you use. This GPO.con file defines all your object spawns, player spawns, Control points etc in your map. All the text that you see when you open it is about them. I will give you a full run down on how the GPO.con file works later on but as this section might be missed out if you already have these files, I'll state them later on.

Leave your Editors GPO.con open and also open up the 32 layer GPO.con file
here: "\GameModes\gpm_cq\32\GamePlayObjects.con"
and the 16 layer GPO.con file
here: "\GameModes\gpm_cq\16\GamePlayObjects.con"

Have all of them open at the same time but make sure you do not mix them up, it is easy to do so so keep them on diffrent sides of the screen.

Now the GPO.con file is split into diffrent sections:
  1. Object Spawners
  2. Spawn Points
  3. Control Points
  4. Combat Zones
you will now need to mix all the 64, 32 and 16 layers into one file. Bare in mind that your 64 layer is the one you are working with in your editor file that has already been done, and you will use as a template.

Now first the object spawnsers section will look something like this apart with far more text, this is only one object which is a TOW missile stand:

Code: Select all

[color=Red]rem ********** Object Spawner **********[/color]
rem [ObjectSpawnerTemplate: CPNAME_DO_64_ustown_AT]
ObjectTemplate.create ObjectSpawner CPNAME_DO_64_ustown_AT
ObjectTemplate.activeSafe ObjectSpawner CPNAME_DO_64_ustown_AT
ObjectTemplate.modifiedByUser esj
ObjectTemplate.isNotSaveable 1
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.setObjectTemplate 1 ats_tow
ObjectTemplate.setObjectTemplate 2 ats_tow

[color=blue]if v_arg1 == host[/color]

   rem [ObjectSpawner: CPNAME_DO_64_ustown_AT]
   Object.create CPNAME_DO_64_ustown_AT
   Object.absolutePosition 262.000/134.994/-410.000
   Object.rotation 4.200/0.000/0.000
   Object.setControlPointId 3
   Object.layer 2

[color=green]endIf[/color]
now the Object Spawners section is split into 2 groups. the First group is the group that defines all the settings of the object, and the 2nd group spawns the object onto the map.
The Red "rem ********** Object Spawner **********" line represents the start of the object spawners.
The Blue "if v_arg1 == host"splits the 1st group from the 2nd group.
The Green "endIf" ends the object Spawners section.
It is imporant that these groups are kept seprate for the editor to use.

So now lets mearge in the 32 and 16 layers of the object spawner groups into the Editors GPO.con file.

First we will mearge the first group into the GPO.con file. so lets first take the 32 layer first.
Now Select the begging of the first line, of the first object where the red arrow is:

Image

Then Scroll down the page to the last object (in the first group still), note the "if v_arg1 == host" bit just after the arrow which a blue line under it.

Image

hold the "shift" key and click where the red arrow is, it will select all the lines (objects) between the start and the finnish.

Then copy thous lines and paste them into your editors GPO.con file right before the "if v_arg1 == host" and after the ones that are already there. (you will need to make 2 new lines.)
Image

Do excatly the same for the 16 layer as you did to the 32 layer and paste it into the Editor's GPO.con file, make sure you save it (if its a read only file, make it so it can be read) :)

you can now see how you are going to be building up this file with 64 on the top, 32 in the middile, and 16 on the bottom all the way. Shots from points in the .con where 64 changes to 32, then 32 changes to 16 etc.
Image

Image

Now thats the first group of the object spawners, now to do the 2nd group which is more or less the same thing.
Go to your 32 GPO.con file and select the begging of the 2nd groups object spaner. Make sure you include the space at the begging. Again note the "if v_arg1 == host" at the top.
Image

Then again, scroll to the end, hold the "shift" key and click at the very end of the 2nd group, here:
Image

Take note of the "endIf" bit at the end :)

Copy all thous lines into the Editor's GPO.con file at the very end of the 2nd group of object spawners, again make 2 lines before you paste it in.
Image

again, do the same for the 16 layer.

Now with any luck you should be starting to get the hang of it cos its taking me ages to do all the SS etc :p


Now onto the Spawn Points, these are the player spawn points bear in mind, they are a little diffrent from the object spawns as they have there group 1 and group 2 mixed into one group with the group 2 bit just under each spawn point bit. dont worrie about that yet :p

go to the 32 GPO.con and select the start of the first spawnpoint, will start off with something like: "rem [SpawnPointTemplate: " then scroll down all the way till you see a "rem ********** Control Points **********", copy all thous lines and paste them into the bottom of the Spawn Points section of the Editor's GPO.con file, then do the same again for the 16man layer.


Now for the Control Points. Control Points are abit like the object spawnsers as they use the two split groups again.
starts off with the "rem ********** Control Points **********"
then in the middle you have your "if v_arg1 == host" again
then at the end you have your "endIf" again.

Go to your 32 GPO.con file and select the start of the first Control Point. Will start off with something like "rem [ControlPointTemplate: "
Then scroll down to the bottom of the first group, just before the "if v_arg1 == host" and hold the "shift" key again, select all the control points, copy them and paste them into your Editors GPO.con file at the bottom of the 1st Control point group. do the same for the 16 GPO.con

Now to do the 2nd group of the control points (in the 32 GPO.con), go to the first line and select it, will look something like " rem [ControlPoint: " (remember, keep thous extra forward spaces in). Then scroll down to the bottom, just beofre the "endIf" bit, hold shift, select, copy and paste them into the end of the 2nd group in the editors GPO.con file. do the same again for the 16 GPO.con


Last but not least comes the Combat Zones. These will allways be at the very bottom of the file, and bare in mind that sometimes more than one layer uses excatly the same combat zones. you do not want to put excatly the same combat zone in twice as it will muck up the editor.
So first, check the name of the Combat Zone(s) in your 64 layer (your editors GPO.con file). in this case Daqing_oilfields has 2 combat zones in its 64 layer, one used for ground troops and one for jets. Its first one is called "CombatArea.create CombatArea_143_64_player" and its 2nd one "CombatArea.create CombatArea_115_64_player"
Image
Not going to bother taking a shot of both names, just did the first one to give u an idea of where too look.
So quickly do a check before you do anything that the same combat zone name is not in any other GPO.con files you are about to copy in (the 32 or 16 GPO.con files).

Now take note of this bit highlited.
Image

Code: Select all

CombatAreaManager.use 1
CombatAreaManager.timeAllowedOutside 10.000000
you only need that part once at the very top of your first combat zone in the GPO.con, do not put it in more than once in the GPO.con file or the editor can some times mess up the save (like the times in the old betas where the entier map was just 100% red and you could not spawn in without being out of the combat zone).

Now go to the 32 GPO.con file and copy in the combat zone(s) without copying in the first 2 lines, stated above. Paste them under the last combat zone in the Editors GPO.con file, then do excatly the same for the 16 GPO.con file. Again, do not copy in the same combat zone which might apear in more than one layer. if the name matched from your check you did before do not have that combat zone in more than once.


We are almost done with the first step now, We just need to do the Layer.con file then we can use these files with the editor :)
Close down the GPO.con files but keep your editor's GPO.con file open as you will probaly need it in a sec.

I always like to work off a template so download this Layer.con file (right click, save as) http://www.gloryhoundz.com/prmm/users/rhino/Layer.con

put that into your maps Editor folder. Now the chances of this file being 100% correct already are very small as almost all maps are diffrent in this repects, just depends on which mad order the mapper decied to do it in. Now this is the one I have quickly made for Daqing_oilfields. Now these files really dont exsplain them selfs so let me try and exsplain them quickly.

Code: Select all

rem ******** 64_player ********
LayerManager.AddUserLayer "64_player" 4 2 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "64"
the first line is just the name that has been removed, dont need to worrie about that too much but i still change them as i use them when doing text editing.
The next line down is first the real name that is used inside the editor, do not uses spaces etc in this name (inside the quotes). after the quotes is a buch of numbers, now the first number, "4" in this case I really to be honest dont have a clue what it dose, but it always increases by a power of 2 when moving up the layers. So the next layer would be 8, then the one after that 16, then the one after that 32, etc, etc. Now the next number is the layer number isself, in this case the number "2", aka "layer 2". now the 0 and 1 after again, i do not know excatly what these do BUT i think they have something to do with the editor options. just leave them 0 and 1 they are not imporant to the outcome of the map.
Next 2 lines down leave them at 0, only really for editor use.
Next line down is just adding the gamemode gpm_cq aka, AAS 2.
Next line down is just adding the player size filter.

Now I've exsplained the basics, really the only thing you need to worrie about now is whats on line 2 and maybe the last line, but line 2 is the most imporant as all the other lines can be changed inside the editor, if you mess line 2 up the editor will not load it.

This layer.con template its kinda a bad exsample as its all set out, but ill just set it up for mashtuur quickly so bare with me.

Now if we look in mashtuurs Editors GPO.con file, if we scroll down too the 2nd group of the object spawners we can see that the 64 layer is on layer 3.
Image
At the mo its set to layer 2. Now you would think that the easit way to change this would be to change from:

Code: Select all

LayerManager.AddUserLayer "64_player" 4 [b]2[/b] 0 1
to:

Code: Select all

LayerManager.AddUserLayer "64_player" 4 [b]3[/b] 0 1
WRONG

This will not work (im 90% sure) and will stop the editor from loading your map correctly.

Instead you need to rejig your layers.con file till its all in the right place.

Here is your Layers.con file:

Code: Select all

rem ******** 64_player ********
LayerManager.AddUserLayer "64_player" 4 2 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "64"

rem ******** blank ********
LayerManager.AddUserLayer "blank" 8 3 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0

rem ******** 32_player ********
LayerManager.AddUserLayer "32_player" 16 4 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "32"

rem ******** 16_player ********
LayerManager.AddUserLayer "16_player" 32 5 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "16"
Note at the mo, the 64 layer is ment to be on layer 3. At the moment layer 3 is taken up by the "blank" bit. easit soloution is to just change that section into the 64 so you edit from the above, to this:

Code: Select all

rem ******** 64_player ********
LayerManager.AddUserLayer "64_player" 4 2 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "64"

[b]rem ******** 64_player ********
LayerManager.AddUserLayer "64_player" 8 3 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "64"[/b]

rem ******** 32_player ********
LayerManager.AddUserLayer "32_player" 16 4 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "32"

rem ******** 16_player ********
LayerManager.AddUserLayer "16_player" 32 5 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "16"
See how it was changed? Now look in your Editor's GPO.con file for what the other layers are, if we look we can see that 32 is on layer 2, and 16 is on layer 4. so just edit it to this:

Code: Select all

rem ******** 32_player ********
LayerManager.AddUserLayer "32_player" 4 2 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "32"

rem ******** 64_player ********
LayerManager.AddUserLayer "64_player" 8 3 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "64"

rem ******** 16_player ********
LayerManager.AddUserLayer "16_player" 16 4 0 1
LayerManager.SetLocked 0
LayerManager.SetDisabled 0
LayerManager.AddGameModeFilter "gpm_cq"
LayerManager.AddPlayerFilter "16"
I deleted the last bit as it was not needed.


Once done, save it up and you should now, finaly have editor files for use, YAY!!! :D
Image
TY2D2
Posts: 433
Joined: 2007-06-07 05:21

Post by TY2D2 »

I was more interested in the textures... But that helps too... Color and Detail textures take forever to do, and ar even harder to recreate like the original map.
Image
First Strike Developer
ASF Clan Leader
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Post by Rhino »

TY2D2 wrote:I was more interested in the textures... But that helps too... Color and Detail textures take forever to do, and ar even harder to recreate like the original map.
colour textures the editor will convert to the standard the editor uses itself. Detail textures how ever need a more complicated approach to change.
Image
Bleach
Posts: 471
Joined: 2007-06-01 10:35

Post by Bleach »

Hey thanks now im on my way to converting wake island ive done most of it just want to add some copters in it for sp and for the usmc
Image

Image

In Game Name MuttRag.
Post Reply

Return to “PR:BF2 Community Modding”