[TUTORIAL]Ginev's Battlefront 2 Layer System

Started by Anyder, February 01, 2016, 12:58:34 PM

Previous topic - Next topic
GINEV Battlefront 2 LAYER System TUTORIAL:
If you remember the BF2 Dagobah map where when you play Clone Wars on the swamp you can find destroyed gunship.
But when you play on Galactic Civil war there is destroyed X wing.Well how this is possible?Here is the tutorial for how to do it:

Now before we start im going to say that the best thing will be to start this on a completely empty new map+the default 4 command posts of course.

This tutorial is a little long and you need to be focused at 100%.It's clearly not for newbies!

Open your map and you will see the Load Layers interface with the top interface (checked) conquest.The bottom interface have Common and conquest.Check them both then click Ok.Your map will be loaded and opened.
Click on "Change" in the Active Layer section.Its selected on (Base) as default.Its somewhere on the middle-top of the entire screen.
When you click on CHANGE you will get the Layers NULL bar.There click new and create new layer.Right mouse button and
rename it to (in this tutorial il will call it) CW-Conquest.Click again New and create one more layer.Name it GCW-Conquest.
Now pay attention that for this tutorial this is my names.It will be best to do the same cuz the names are important!!!

Now click on the Base layer just to be sure that we are on him.
The next thing to do is to decide what you going to put in the 2 new layers that we created.For start we have already a 4 default Command posts in the base layer.
We dont need this command posts in the BASE layer.So we better move them in some of the other layers cuz this Base layer on the end will not be used for anything.
So how to do it?First be sure that you selected the Base Layer in the "Active Layer section".Go to the "Object" section.The section from where you put models in your map.If you look in left you can see the "Multi Select" option.
Click on it.Now select with the left mouse button the 4 Command Posts.

Now when you have them selected click again in the "Active Layer" section "Change".in the new interface on the bottom
you will see this option "Move Data Into Layer..."

Click on it.You will get a small new interface with the layers that we have so far.

So since we are going to move this 4 cps into the clone wars era select the "CW-Conquest" layer.
Then click Ok.

Done.The command posts are moved there with their respectfull spawn paths and regions...i think.
Before you check first Save your map and exit it.Then open it again.When you open it select all layers and click Ok to load your map.Change the Layer from Base to CW-Conquest from the "Active Layer" section and you will see your command posts moved there.
If they are there then you have did it right and the BASE layer will be empty.This method work not only for CPS.It works and for every other objects placed in your world.

So now our  CW-Conquest layer have 4 command posts.But the GCW-Conquest is still empty.You need to add atleast 2 cps for the 2 teams in zero editor in order to make battle in that era.
So to do it be sure that you click CHANGE and switch to the GCW-Conquest layer.Then add somewhere 2 new command posts.YOu know the drill.Add spawn paths,capture regions etc.Just make sure the name of the command posts to be cp1, cp2....etc...When you are done save the map just in case but don't leave it.We have more work to do.

We are not finished yet.So the "Conquest" layer is empty now.So we dont need him.Click "Change" select the "conquest" layer and then click on the bottom "Del".This will delete the layer.Now you should have at the end 3 layers which are:
Base, CW-Conquest and GCW-Conquest.
Leave the Layers menu so we can focus on other option in the zero editor (close it).
Now if you look a little in right of the "Active Layer" section in zero editor you will see other option: "Configure".CLick on it.

You will see new window pup up with big name "GAME MODES".Now if you have in the 1st section (the left one) this layers:
Base, CW-Conquest and GCW-Conquest.Remove our new layers and leave only Base there.
In the middle section you probably going to have "conquest".Since we dont need that conquest layer you can simply rename it to something else.In our case rename it to this:CW-Battle.This is important.
After you rename it click in the 3rd (right) section.Click there on Add.If nothing happen click few more times cuz that button is little bugged.
When you click it will give you option to choose a layer.You will be able to choose between CW-Conquest and GCW-Conquest.

Choose the CW-Conquest.Then click Ok.
So now if you click in the middle section CW-Battle in the right 3rd section you will see and CW-Conquest.We are done with this.
Now we must do the same and for the GCW era.

In the middle section create a new layer and name it GCW-Battle (pay attention also and for the big letters).After that click in the 3rd section (right) add and select this time the GCW-Conquest.
So every time when you click in the middle section between the 2 modes you will see the used layers in right to change aswell.Dont close this window yet.


In the bottom you will see one option: "Update World REQ and mode MRQs"
Click on that and select your 3 letter name.req in your world1 folder.Then click Open.Done that actually save the changes to all files.Close this little window (GAME MODES).NOW SAVE YOUR MAP!!!!!
-------------------------------------------------------------------------------
And we just need to make a little change to our luas.
Go to your luas which are located in your data_***/Common/scripts/***.
Open the Clone War lua file.
example: ***c_con.lua

Now i dont know if this line is required but we will add it just in case cuz i did not have enough time to test it more.
First find section of your lua:


________________________________________________________________________________________________________________
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
   
   --  REP Attacking (attacker is always #1)
    REP = 1;
    CIS = 2;
    --  These variables do not change
    ATT = REP;
    DEF = CIS;


function ScriptPostLoad()     
   
   
    --This defines the CPs.  These need to happen first
    cp1 = CommandPost:New{name = "cp1"}
    cp2 = CommandPost:New{name = "cp2"}
    cp3 = CommandPost:New{name = "cp3"}
    cp4 = CommandPost:New{name = "cp4"}

________________________________________________________________________________________________________________

You will need to add this:myGameMode = "***_CW-Battle"   (pay attention that this things *** are your 3 letter name of your map.
For this tutorial im going to use ABC name for our map.You change the 3 letters with your.
So you have to add this myGameMode = "ABC_CW-Battle" beneat this line: ScriptCB_DoFile("setup_teams")

On the end your part of the lua must look like this:

________________________________________________________________________________________________________________
--
-- Copyright (c) 2005 Pandemic Studios, LLC. All rights reserved.
--

-- load the gametype script
ScriptCB_DoFile("ObjectiveConquest")
ScriptCB_DoFile("setup_teams")
   
myGameMode = "ABC_CW-Battle"

   --  REP Attacking (attacker is always #1)
    REP = 1;
    CIS = 2;
    --  These variables do not change
    ATT = REP;
    DEF = CIS;


function ScriptPostLoad()     
   
   
    --This defines the CPs.  These need to happen first
    cp1 = CommandPost:New{name = "cp1"}
    cp2 = CommandPost:New{name = "cp2"}
    cp3 = CommandPost:New{name = "cp3"}
    cp4 = CommandPost:New{name = "cp4"}

________________________________________________________________________________________________________________

Now scroll down in your lua and find this line:

ReadDataFile("dc:ABC\\ABC.lvl", "ABC_conquest")   Now REMEMBER ABC is just example here.Use your 3 letter name.

Make this line look like this:

ReadDataFile("dc:ABC\\ABC.lvl", "ABC_CW-Battle")

Like i said earlier this is for the clone wars lua.If you remember in zero editor in the GAME MODES window we used in the middle section this mode name ABC_CW-Battle.
So basically when you start the clone wars era this mode will be played with his respectfull layers.
Save your lua.

Do the same and for the Galactic Civil War era lua just make sure you use GCW instead of CW
Examples of the two lua lines for GCw lua:

myGameMode = "ABC_GCW-Battle"  (Put it in his respectfull place just like in the clone war lua)

ReadDataFile("dc:ABC\\ABC.lvl", "ABC_GCW-Battle")   (This also in his respectfull place)
However if you remember you added only 2 new command posts for galactic civil war thats why find this two section at the begining of your gcw lua:
_____________________________________________________________________________________________
function ScriptPostLoad()     
   
   
    --This defines the CPs.  These need to happen first
    cp1 = CommandPost:New{name = "cp1"}
    cp2 = CommandPost:New{name = "cp2"}
    cp3 = CommandPost:New{name = "cp3"}
    cp4 = CommandPost:New{name = "cp4"}
   
   
   
    --This sets up the actual objective.  This needs to happen after cp's are defined
    conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
                                     textATT = "game.modes.con",
                                     textDEF = "game.modes.con2",
                                     multiplayerRules = true}
   
    --This adds the CPs to the objective.  This needs to happen after the objective is set up
    conquest:AddCommandPost(cp1)
    conquest:AddCommandPost(cp2)
    conquest:AddCommandPost(cp3)
    conquest:AddCommandPost(cp4)   
_____________________________________________________________________________________________
REMOVE CP 3 and 4 section.So this will look like this:

_____________________________________________________________________________________________
function ScriptPostLoad()     
   
   
    --This defines the CPs.  These need to happen first
    cp1 = CommandPost:New{name = "cp1"}
    cp2 = CommandPost:New{name = "cp2"}
   
   
   
    --This sets up the actual objective.  This needs to happen after cp's are defined
    conquest = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF,
                                     textATT = "game.modes.con",
                                     textDEF = "game.modes.con2",
                                     multiplayerRules = true}
   
    --This adds the CPs to the objective.  This needs to happen after the objective is set up
    conquest:AddCommandPost(cp1)
    conquest:AddCommandPost(cp2)   
_____________________________________________________________________________________________
If you have plans of adding more cps in the gcw era add more cps here with the name of the cps.

Save luas and we are ready.

Just to say something in the end.We moved the 4 default CPs in clone wars layers.You added 2 new in Galactic Civil war era so
if you play Clone War era you will have 4 new cps there if you play GCW you will have only 2. (I know you are already angry of this stupid explanations :D)

EXAMPLE:IF you add let say a rock in the clone wars layer era that rock wont be rendered in the GCW era.

You can munge your map now.

PS.

Ginev:Best of luck...

Obi Wan spirit:...and may the Force be with you...

Ginev:SHUT UP old man,this is my tutorial...

Obi Wan spirit:Sorry....
Anyder | Talent, Ops & Culture | SWBF & Player Engagement
Email: communityambassador@swbfgamers.com
SWBFSpy Discord: http://discord.swbfspy.com
SWBFSpy Info: http://info.swbfspy.com

Somewhere at the begining of the tutorial i made a mistake.I accedently said Base layer but its actually Conquest layer.
Find this pard of the tutorial of the begining:


Now click on the conquest layer just to be sure that we are on him.
The next thing to do is to decide what you going to put in the 2 new layers that we created.For start we have already a 4 default Command posts in the "Conquest" layer.
We dont need this command posts in the conquest layer.So we better move them in some of the other layers cuz this conquest layer on the end will not be used for anything.
So how to do it?First be sure that you selected the conquest Layer in the "Active Layer section".Go to the "Object" section.The section from where you put models in your map.If you look in left you can see the "Multi Select" option.
Click on it.Now select with the left mouse button the 4 Command Posts.



Its the same with the original post.I just changed Base with Conquest because the 4 command posts are in the Conquest layer not in the Base.Sorry about that people...  :shrug: