My purpose is to explain a bit, to the noob modder, how to use winRFA to make your own patch files (mapname_005.rfa) that you can upload to your server so people can play your mod!
Col. Crushans RFA explorer is a neat program, but is buggy and can be prone to errors. WinRFA is 60kb, has a very simple interface and thus is very simple to use once you learn how.
I want to mod (map name). How do I get started?
Lets say you want to mod Operation Market Garden, for vanilla (regular) 1942, say to add bf109's for axis. *IMPORTANT:* What game type do you want to mod? Conquest? Team Death Match? Co-op? (We will revisit this later.)
First you have to understand how the game files work. If you go to Battlefield1942\Mods\bf1942\Archives\bf1942\levels, you will see all the level files for the game.
If you look, you will see a Market_Garden.rfa, Market_Garden_000.rfa and Market_Garden_003.rfa. Market_Garden.rfa is the file that was released with the original game. As you know various patches and updates came out for 1942. If the developers felt any changes needed to be made, they simply made a patch file. That's what Market_Garden_000.rfa and _003.rfa are. The game first reads the map file, Market_Garden.rfa. Then, if there are any files with a _### number it reads those, in numerical order. For instance, MapName_005.rfa would be read after MapName_003.rfa.
Now you should have a basic idea of how Battlefield 1942 reads levels and opens them. To make your own server side mod patch file, lets use number 007. Our patch file would be named Market_Garden_007.rfa.
In this case we want to simply spawn two bf109's for axis. For that reason the only file we would need in our new patch file is objectspawns.con. However, perhaps we will want to change something down the road, or lets say we want to spawn a zero instead of a bf109. If so in either case, we should include ObjectSpawnTemplates.con. (Objectspawns.con and ObjectSpawnTemplates.con may be referred to as OS.con and OST.con here for shortness sake. You will also see this on the forums sometimes.)
Another short description. Simply put:
ObjectSpawnTemplates.con defines what will spawn.
ObjectSpawns.con defines where it will spawn.
Okay! Where do we get these files? In the map's rfa file.
First, open winRFA, then choose File--> Open.rfa from the menu. Open Market_Garden.rfa. You will see a LOT of files. Don't worry, we are only looking for two. Did you decide what game type you wanted to mod (Conquest, TDM, Coop)? If not, make a decision! We could mod them all, but lets do Conquest. Okay, but I see more than one Objectspawns.con and ObjectSpawnTemplates.con. What gives?
To understand how winRFA displays files:
WinRFA displays the entire contents of a rfa file, in a list. If you look you will see:
bf1942/Levels/Market_Garden/
in front of each file. This is the file structure of the map. If you were to extract the RFA file (exactly like a zip file), bf1942 would be a folder, and in it would be a Levels folder. Once you click a file (that is text), winRFA displays the file in the lower window pane. You can edit and save them here as well.
We want to mod the Conquest game style. Do you know which OS.con and OST.con files to look for? That's right, the two under bf1942/Levels/Market_Garden/Conquest.
Click on either one of those files to highlight it. Select the second one by holding the ctrl key and clicking it. Your screen should look like this:
Next, we want to extract these files somewhere. Let's say C:\Modding. With these two files highlighted, choose "Extract" from the menu and then "Selected". Tell it to extract the files to the C:\Modding folder. It works pretty quick, so once you hit the button the files should be there.
Good! We're on our way to making our own patchfile. But we aren't done! Remember, Market Garden already has two patch files of its own! If we didn't extract the newer files, our server side mod could be different from the Market Garden we know. Just remember to extract the files in order (MapName.rfa, then 000, then 001, etc etc). I will save you the trouble of looking; Market_Garden_000.rfa doesn't contain any changes we need to worry about, but Market_Garden_003.rfa contains a newer ObjectSpawns.con file.
Open Market_Garden_003.rfa and click on the conquest version of ObjectSpawns.con. Choose 'extract selected' exactly like we did above. Extract to your Modding folder.
Perfect. We're one step away from having our own patchfile! All we have to do is pack the files we extracted. Once its packed, we can edit the file in winRFA. It is easy to make a mistake packing the RFA. This step is critical to maintaining the file structure, so bf1942 opens it properly. If not, your changes won't take effect, or you will get a crash.
To pack the files into your own RFA patchfile:
Open winRFA. Click "Pack" from the menu, and choose "Directory". A new window will open, with two text boxes. The first says "Source Directory" and the second is "Base Path". Next to the source directory text box there is a " ... " button. Click it, then your mod folder, C:\Modding. There will be a new folder, called bf1942. Click it, then hit OK.
Your screen should look like this:
Click the Pack button, and save it to your C:\Modding folder, or anywhere you'd like, with the name Market_Garden_007
**Note: Its best not to save this to your game's levels folder, as you will get a "Data Differs from Server" error if you try to join an online game.
Congratulations! You have your very own patch file. If you've done it successfully, when you open it with winRFA it should look like this:
Take note of the file structure. It should match the one shown above. Remember, this is key!
Now its saved, you can simply edit your patchfile directly in winRFA. Just open Market_Garden_007 any time you want to make a change, edit OS.con or OST.con to your liking, and then click the "Save Changes" button. If you forget, winRFA is smart enough to ask you "Text was modified. Save changes?" when you click another file.
You're done! You now have your very own patch file, can edit it, and can mod other maps using this same method. Have fun!
A brief overview to get your started modding (pretending we still want to add planes to market garden).
Like stated earlier, ObjectSpawnTemplates.con tells you what spawns what. Open it, and scroll down to the Fighter Object Spawner:
Code: Select all
ObjectTemplate.create ObjectSpawner FighterSpawner
ObjectTemplate.setObjectTemplate 2 mustang
ObjectTemplate.setObjectTemplate 1 bf109
ObjectTemplate.MinSpawnDelay 40
ObjectTemplate.MaxSpawnDelay 80
ObjectTemplate.SpawnDelayAtStart 0
ObjectTemplate.TimeToLive 45
ObjectTemplate.Distance 40
ObjectTemplate.DamageWhenLost 10
If we want to spawn a bf109 for axis, no changes would need to be made. If we wanted to spawn a zero, we would change the third line to read:
Code: Select all
ObjectTemplate.setObjectTemplate 1 zero
Besides position, there is rotation of an object, in the Z/Y/X format as well. Beginning you will only have to worry about the Z rotation. This is which direction the vehicle will face. A rotation of 0/X/X would be facing north, 90/X/X facing east, 180/X/X facing south, and 270/X/X OR -90/X/X facing west. As you noticed, the rotation is clockwise.
Once you have your positions, you can add the plane to ObjectSpawns.con. Remember, this file tells us WHERE the object will spawn. Even though we are adding a bf109, we are actually adding a fighterspawner to the map, as far as the game is concerned. So, lets do that. In ObjectSpawns.con, add this to get two fighters for axis:
Code: Select all
rem *** Additional Fighter #1 ***
Object.create FighterSpawner
Object.absolutePosition 1193.34/40.28/724.55
Object.rotation 0/-9.66/0
Object.setTeam 1
rem *** Additional Fighter #2 ***
Object.create FighterSpawner
Object.absolutePosition 1193.34/40.28/724.55
Object.rotation 0/-9.66/0
Object.setTeam 1
The first line explains WHAT is being created (a fighter spawner), the second line the position (in z/y/x format), the third the rotation of the vehicle (z/y/x format as well), and the last which team it will spawn for. This determines WHAT will spawn (remember, this is determined by ObjectSpawnTemplates.con).
IMPORTANT: You cannot "make up" spawners and have your mod work server-side. For example, you cannot make a "MustangSpawner" in OST.con and have it work. You are limited to what is available on each map. For market garden, that is:
LightTankSpawner
HeavyTankSpawner
APCSpawner
WillySpawner
ScoutCarSpawner
AAGunSpawner
FighterSpawner
DiveBomberSpawner
HeavyBomberSpawner
MachineGunSpawner
ArtillerySpawner
LCVPSpawner
As you might know, some of these aren't used, so you could always add new vehicles to the map. For instance, LCVPSpawner isn't in use, nor is DiveBomberSpawner. Just because a spawner is named "DiveBomberSpawner" doesn't mean it has to spawn a dive bomber, however. It's just a name. For example, a DiveBomberSpawner could look like this:
Code: Select all
ObjectTemplate.create ObjectSpawner DiveBomberSpawner
ObjectTemplate.setObjectTemplate 2 lynx
ObjectTemplate.setObjectTemplate 1 kettenkrad
This is a very basic way to get started, but hopefully you are to the point where you understand Battlefield 1942's map structure, and can create your own patch files and begin to mod them. Visit the forums if you have any questions. Good luck!