Home  Mods  Forum  Tutorials
How to start modding  Texture modding  Map modding 


Map Modding

This tutorial has been writen Quisam, and the original tutorial can be found here.


Modding Overview

Because Battlefield Heroes runs off the same engine as Battlefield 2 and Battlefield 2142, it means that Heroes structure is very much the same as these two other titles. And so with a little bit of modification you can, in theory, create levels for the game using the map tools for Battlefield 2. After pursuing this I found out you can indeed create playable levels for the game. This is good news because maybe the developers will allow us to have User Generated Levels implemented into the game.

feel free to share this with anyone and everyone. This information could potentially change the game as we know it.

Installing the Editor

Guide Overview/ Quick Steps-
1. Download Tools
2. Install the tools via two methods
a. Make sure Battlefield 2 is installed. Mod tools will be installed into the same directory as your Battlefield 2 game files.
b. Edit your Registry to make the install wizard think BF2 is installed into a certain directory called "BFHMods”
Finding and Downloading Tools-
The latest general release of the BF2 mod tools is 1.3. These can be found at http://battlefield2.filefront.com/file/Battlefield_2_Editor;64087
The download is 50.5MB and comes in the form of a .zip Tool

Installing the Tools-

To install the mod tools, the installer requires that Battlefield 2 is installed. Which means you can approach installation in two different ways.
1- Battlefield 2 is installed so I will have no problems installing the mod tools.
2- I don’t own a copy of BF2 so it won’t let me install the tools!
1. For those who own a copy of the game you can just open up the installer and follow all the steps to install it. The tools will be installed to the same directory as your Battlefield 2 game files

2. For those who don’t own a copy of the game, there is a way to trick the installer into thinking you own a copy of the game. This can be achieved by modifying your registry.
You can do this by following these steps-
1. You will need to create a new folder named "BFHMods” in the directory "C:\Program Files\EA GAMES\”. This is where we will install all of the tools as well as work on all of our mods.
2. You will need to create a reg file using one of the following codes-
XP

[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA GAMES\Battlefield 2]
"Language"="English"
"Locale"="en_US"
"InstallDir"="c:\\Program Files\\EA GAMES\\BFHMods"
"Version"="1.4"
Windows 7/Vista
[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA GAMES\Battlefield 2]
"Language"="English"
"Locale"="en_US"
"InstallDir"="c:\\ Program Files (x86)\\EA GAMES\\BFHMods"
"Version"="1.4"
After running these files, you should be able to install the mod tools

Configuring Mod Tools

Guide Overview/Quick Steps-
1. Copy all of the files from the Battlefield Heroes Game folder into the mod tools directory (BFHMods or Bf2 Directory)
2. Unzip all the zip files located here-
C:\Program Files\EA Games\BFHMods\mods\bfheroes
3. Create several files which will setup all of the mods settings
4. Unzip Files within Level folder to prepare for opening
5. Setting up Mod Assets within Editor 1. Moving Files-
To begin we will need to copy and paste all of the files from the Battlefield Heroes game folder into the directory with all of our mod tools (Either the BF2 Directory or the folder we made called ‘BFHMods’).
The Battlefield Heroes game folder is typically stored at the following directory-
XP

C:\Program Files\EA Games\Battlefield Heroes
Windows 7/Vista
C:\Program Files (x86)\EA Games\Battlefield Heroes

And we are moving these files to- XP
C:\Program Files\EA Games\BFHMods
Windows 7/Vista
C:\Program Files (x86)\EA Games\BFHMods

Note: The BFH Games files are about 1GB. Depending on your system, this could take a while.
*If you notice, the only real difference here is XP programs are stored in ‘Program Files’, and 7/Vista Files are stored in ‘Program Files(x86)’

2. Unzip BFHeroes BFH Files**-

Even though the game is made with them, the Battlefield 2 mod tools don’t do very well with Zip Files. This means we will need to unzip the majority of the zip files within ‘C:\Program Files\EA Games\BFHMods\mods\bfheroes’.
This means we take we take file files such as "Sound_client.zip” and create a folder called "Sound_Client” which has all of the files from the zip in it.
**Winrar (http://www.rarlab.com/) and jZip (http://www.jzip.com/) are highly suggested for this process. They can be downloaded and installed for FREE

3. Creating Game Files-

To successfully install and use the mod tools we’ll need to create a set of files which help define how our mod works. To make this easy you can just copy and paste my settings and use them for your own purposes.

You will first need to create the following folders (the folder you need to create is in bold-
C:\Program Files\EA Games\BFHMods\bf2editor\mods\bfheroes\LevelEditor\
(So you will need to create the folder ‘bfheroes’ and the folder ‘LevelEditor’ within bfheroes)

LayerInit.con
C:\Program Files\EA Games\BFHMods\bf2editor\mods\bfheroes\LayerInit.con

CODE
LayerManager.CreateDefaultFilter gpm_tdm Team Deathmatch
LayerManager.CreateDefaultFilter gpm_sl   
LayerManager.CreateDefaultFilter gpm_tut Tutorial
LayerManager.CreateDefaultFilter gpm_hoth Hero of the Hill   

LayerManager.CreateDefaultPlayerFilter 16

LevelSettings.con

C:\Program Files\EA Games\BFHMods\bf2editor\mods\bfheroes\LevelEditor\LevelSettings.con

CODE
LevelSettings.AddTeam RA Royal
LevelSettings.AddTeam NA National

gameLogic.setTeamName 1 "National"
gameLogic.setTeamName 2 "British"

gameLogic.setTeamLanguage 1 "Russian"
gameLogic.setTeamLanguage 2 "English"

gameLogic.setTeamFlag 0 "flag_neutral"
gameLogic.setTeamFlag 1 "flag_NA"
gameLogic.setTeamFlag 2 "flag_RA"

gameLogic.setKit 1 0 "NA_Commando_kit" "german_male_commando" "german_male_commando"
gameLogic.setKit 2 0 "RA_Commando_kit" "british_male_commando" "british_male_commando"

gameLogic.setKit 1 1 "NA_Soldier_kit" "german_male_soldier" "german_male_soldier"
gameLogic.setKit 2 1 "RA_Soldier_kit" "british_male_soldier" "british_male_soldier"

gameLogic.setKit 1 2 "NA_Gunner_kit" "german_male_gunner" "german_male_gunner"
gameLogic.setKit 2 2 "RA_Gunner_kit" "british_male_gunner" "british_male_gunner"

gameLogic.setKit 1 3 "NAF_Commando_kit" "german_female_commando" "german_female_commando"
gameLogic.setKit 2 3 "RAF_Commando_kit" "british_female_commando" "british_female_commando"

gameLogic.setKit 1 4 "NAF_Soldier_kit" "german_female_soldier" "german_female_soldier"
gameLogic.setKit 2 4 "RAF_Soldier_kit" "british_female_soldier" "british_female_soldier"

gameLogic.setKit 1 5 "NAF_Gunner_kit" "german_female_gunner" "german_female_gunner"
gameLogic.setKit 2 5 "RAF_Gunner_kit" "british_female_gunner" "british_female_gunner"

4. Setting up Levels

To be able to open up levels you will need to unzip the files "client.zip” and "server.zip” within the level folder.
For example, to open Riverside Rush within the editor, you will need to open up the folder "heat” within the levels folder (C:\Program Files\EA Games\BFHMods\mods\bfheroes\Levels\heat). Then once inside, unzip "Client.zip” and "Server.zip”.

5. Setting Up Mod Inside of the Editor

Now we have to configure the mod within the editor. We can do this by doing the following-

1. Open up the BFEditor
2. Select bfheroes as our starting mod
3. Once the editor has loaded up press the mod tab at the top of the page
4. Select "Mod Manager” from the dropdown menu
5. On the Window that appears click the "Editor Content” Tab

6. Check all of the boxes next to folder icons. These are the mod resources that the editor will load every time you start it up.
CONGRATULATIONS! YOU’RE ALL READY TO BEGIN MODDING!

Actually Creating Levels in Editor

Creating levels for Battlefield Heroes with the Battlefield Editor is almost exactly like creating levels for Battlefield 2. Iif you are unfamiliar with the tools I suggest that you try looking around the internet for battlefield 2 modding guides. Trying searching this forum, bfeditor.org (a great battlefield modding resource), or google

I know some people are probably thinking "WOW WHAT A N3WB HE ISN'T GOING TO EXPLAIN EVERY SINGLE FUNCTION IN THE EDITOR". Well the reasoning behind this is there are many people who are familiar with the BF2 tools, plus there are tons of brilliant guides out there which will explain everything you need to know. And since Battlefield Heroes levels are created in the exact same way as BF2, the BF2 guides work just as good for BFH levels (for the most part).

So basically its along the lines of create new level, mess with the terrain, place objects, place control points, place spawn points, move about until you're happy, render shadows, render the map, and do some minor tweaking.

Side Note:Control Point flag Values-
0= Neutral 1=National 2=Royal

Rendering Levels and Preparing them for play

The main difference between BF2 levels and BFH levels is a file you must create called "InitLogic.con" within your level files.
1. Open up your level files
2. Open the file "init.con"
3. At the end of the file it should say "endIf"
4. copy and paste the following code after "endif"
CODE

run InitLogic.con
5. Save the file
6. Open notepad and copy the following code into the document

CODE

rem *** Generated by BF2Editor ***

rem -------------------------------- Game Modes ---------------------------------

if v_arg1 == BF2Editor

LevelSettings.ClearGameModes

endIf

rem -------------------------------- Spawn Logic --------------------------------

gameLogic.setVehiclePrioAndMax 16 1 VTLightTank 4
gameLogic.setVehiclePrioAndMax 16 1 VTScoutCar 4
gameLogic.setVehiclePrioAndMax 16 2 VTLightTank 4
gameLogic.setVehiclePrioAndMax 16 2 VTScoutCar 4

rem -----------------------------------------------------------------------------

gameLogic.setBeforeSpawnCamera 8/29/6 -176/-8/0

if v_arg1 == BF2Editor
LevelSettings.CustomTextureSuffix ""
else
texturemanager.customTextureSuffix ""
endIf
rem -----------------------------------------------------------------------------

gameLogic.MaximumLevelViewDistance 400
gameLogic.useColdBreath 0

rem -----------------------------------------------------------------------------

gameLogic.setDefaultNumberOfTicketsEx 16 1 50
gameLogic.setDefaultNumberOfTicketsEx 16 2 50
gameLogic.setDefaultNumberOfTicketsEx 32 1 50
gameLogic.setDefaultNumberOfTicketsEx 32 2 50
gameLogic.setDefaultNumberOfTicketsEx 64 1 50
gameLogic.setDefaultNumberOfTicketsEx 64 2 50
gameLogic.setDefaultNumberOfTicketsEx 128 1 50
gameLogic.setDefaultNumberOfTicketsEx 128 2 50
gameLogic.setDefaultTimeToNextAIWave 8
gameLogic.setTicketLossAtEndPerMin 1000
gameLogic.setTicketLossPerMin 1 1000
gameLogic.setTicketLossPerMin 2 1000

renderer.globalStaticMeshLodDistanceScale 1
renderer.globalBundleMeshLodDistanceScale 1
renderer.globalSkinnedMeshLodDistanceScale 1
windManager.globalWindDirection 0.5/0/0.5
windManager.globalWindSpeed 3

NOTE: gameLogic.setBeforeSpawnCamera is the starting position of your camera. You can add your own camera values here.

7. Save this file as type "all file types" and name it InitLogic.con. You'll want to place this inside your level folder
(basically in the Init.con file we are saying "run the InitLogic file we just made")

When your level is ready for the world to see you must go up to Mod, hit 'Package Mod', check the box next to 'Package this level', and hit okay for the mod to be made. Wait for the level to package and you should be able to play the level inside Battlefield Heroes.




Source: http://bfhmods.ucoz.com/forum/5-121-1
Views: 2112 Added by: McFluff (2011-09-25) Author: Quisiam

 
  Quote  

Samy

2012-10-07 1:35 AM
je veut jouer
  Quote  

It Dont Work

2012-07-16 5:47 AM
ive done the registry trick try difrent scripts from other sites it just says "Battlefield 2 is not installed!"
  Quote  

peuzomer

2012-01-27 9:50 PM
ikwofkosdmdcsnak

Hosted by uCoz | By using this site you agree to our terms of use
Radošās komūnas licence