Using Battlecraft to add objects; add to your SSM Patch file

Help setting up tips/tricks using Battlecraft
Post Reply
User avatar
Iced Earth
Posts: 209
Joined: Sun Oct 18, 2009 2:07 pm
Contact:

Using Battlecraft to add objects; add to your SSM Patch file

Post by Iced Earth »

I was going to type this up for a friend, so I thought it might be best to type it up here so it can be read by n00bs in the future. :) Once again, an old tutorial I wrote, so I thought I would post here too!

This tutorial ASSUMES you have read & understand the "getting started" tut I wrote on using winRFA and building your own patch files, which can be found here.

Using Battlecraft (the 1942 map editor, found HERE) is a great way to place vehicles/objects on whatever map you're trying to mod. Please note that this is written for regular 1942, not desert combat or any other mod (you need the .lst files for battlecraft in order for all the objects/buildings in that mod to be seen while editing).

First things first, what map do you want to mod? Let's say its Invasion of the Philippines. Great. **DO NOT** just start changing things!! This will ruin your original map.

To prevent any accidents/errors from happening, the first thing you should do when you have battlecraft open is go to
File --> Copy Level To... This window should pop up:

Image

Put whatever name you'd like in there. I usually do something like "MyInvasion_of_the_Philippines" or "My_Philippines_Modding", etc etc.

Click copy.

Remember, the ORIGINAL map is still open! We don't want to edit this one!! If you are ever unsure of which map you're editing, look at the title of the battlecraft window (the blue bar at the top). This displays the name of the map. So, from here, we want to...

Click File, then Open.

Look for the map you just created, and choose Open.


Adding Vehicles / Objects:

Now we can start editing! I've found that adding spawners is the easiest way to add vehicles to a map, NOT by adding them from the cached objects list. Also, we are going to be ADDING spawners, EVEN IF a spawner for our vehicle already exists!! Anyways, to do this, expand the Object Spawns option in the left window pane. Clicking the [+] icon will expand it.

This will now display all the object spawns for this map. Some familiar ones are: ScoutcarSpawner, AAGunSpawner, DefgunSpawner, etc etc. Double-click the 'Add Template' text. This will bring up the Edit Object Spawn Template window, shown below:

Image

The default name for the spawner is New_Object_Spawn1. Change this to whatever vehicle/object you'd like to spawn. Let's say you want to add more tanks to the map. Like I said earlier, there is already a 'TankSpawner' on this map, but we want to create a new spawner anyways. The reason: It will be a whole lot easier to identify the new from the old later on. Name the spawner NewTankSpawner.

You can select whatever tanks you'd like for each side, but for pacific maps the default is chi-ha for the Japanese, and sherman for the Americans. If you didn't know yet, Team 1 = Axis, Team 2 = Allied. Just click the (none) next to the team 1 or 2 object lines to bring up a window to select which vehicle you'd like. There is a dropdown menu that has a series of filters which makes searching easier. These are: All, Structures, Props, Vegetation, Stationary Weapons, Vehicles_Air, Vehicles_Land, Vehicles_Sea, Effects.

After your new object spawner is created, it will appear in the window pane on the left. Simply go to the area of the map you'd like it, click and drag it to the desired location. Once its placed, you can double-click it to view the coordinates and rotation, or you can move the vehicle around by using the different tools on the toolbar. To move an object, it needs to be unlocked. Click the object once to 'select it', then click the "unlocked" icon on the toolbar (Not the global unlock). Now you can use the "Translate Objects" tool (click to move to desired location) or "Nudge Tool" to click and drag the object around.

Other Things:

Adding soldier spawn positions to a flag:
You can't (as far as I know)! But you can move them! I recommend renaming them as well. If the spawn point is called US_Marine_Base1, rename it US_Marine_Base1NEW. This will make it easy to find later.

Adding weapon kits:
Download and install the battlecraft 42 kit support here. Simply create a new object spawner, call it whatever you'd like (KitSpawner), and select a kit for team 1 / 2. They will be in the drop-down menu as "soldier kits."

Coding the changes:

Okay! Let's fast forward and say we've made all the changes to our map we want to. How the hell do we make this server-side, and get it on our server? Here comes the most FUN part...the CODING! (No, not really the most fun part!)

First things first. Lets hit SAVE!!! You did? Okay, great.

From here, you should read the beginning modding guide I posted above and know it. If not, stop reading this and go read that!! Right now you need to know what map style you want to mod (TDM, Conquest, CTF) and make a patchfile accordingly.

We want to view the objects (vehicles, AA guns, whatever) that we added first. In battlecraft, click Tools, then Archive File Editor. We're looking for ObjectSpawns.con. When we were editing in BC, it was probably under all modes visible, but just incase we modified conquest only, or TDM only, I look for that version of the file. As you can see below, that is Conquest:

Image

Once you have that opened, click and drag at the top, all the way to the bottom. Right click and copy. Should look like this:

Image

From there, if you have Windows, go to Start --> Programs --> Accessories --> WordPad, and Paste.

Now you should have the entire ObjectSpawns.con file pasted in here. We're just going to be doing some editing. First, Delete everything that isn't new. This should be easy, since we named all the new spawners "NewScoutCarSpawner" and "NewTankSpawner", right? ;-) WordPad has a very useful feature. Once all the old stuff is deleted, simply go to the Edit menu, then choose Replace. Take a look at the screenshot below:

Image

In the first box, type the name of the spawner. This is the one we made up, and the one we want to replace. In the next box, put the old spawner name, this is what we want to replace it with (the spawner name that came from the map). Next, click "Replace All". This should take just a fraction of a second, and you should see all the spawners have the appropriate names now (NewTankSpawner is now TankSpawner, etc).

Okay! Now we're going somewhere! Believe it or not, we aren't that far off from being done. Now, this isn't simply a cut-and-paste operation either. Do the objects have SetOSIDs? Remember, these tell it what vehicle to spawn at what flag (axis or allied, depending on the owner), and that it will not spawn if the flag is gray. OSID = Flag ID Number. To make sure your vehicles have the right OSID's (or none at all if you choose), check ControlPointTemplates.con. ObjectSpawnerID will (did you see this coming?) tell you what the OSID is.

Once I have all the code in WordPad set, I copy it and paste it into my patchfile's ObjectSpawns.con at the top, and give it a header like:

Code: Select all

rem *** New Spawners below ***
Also, did you add kits that you can pickup? You have to "borrow" another spawner. Remember, you can make a team 1,2,3,4,5,6, 7 and even more, so pick a spawner with settings you'd like for your kits. Perhaps a WillySpawner. For instance:

Code: Select all

ObjectTemplate.create ObjectSpawner willyspawner
ObjectTemplate.setObjectTemplate 4 Jap_Engineer
ObjectTemplate.setObjectTemplate 3 USMarine_Medic
ObjectTemplate.setObjectTemplate 2 willy
ObjectTemplate.setObjectTemplate 1 blackmedal
Just remember to put the CORRECT kit here. Jap_Engineer, USMarine_Medic are valid kits. To see the full lits of available kits, click HERE.

Besides ObjectSpawns, you might have to Tweak ObjectSpawnTemplates to your liking. Also, if have any any special coding (adding carrier planes, adding spawn points, etc), this would have to go in ObjectSpawnTemplates.con.

Don't forget to do the necessary steps to finish your other changes (soldier spawns, etc) as well.

Good luck, and if I missed anything please ask or feel free to add.
Image
User avatar
Tuesday
Posts: 36
Joined: Fri Jul 09, 2010 3:39 pm
Location: UK
Contact:

Re: Using Battlecraft to add objects; add to your SSM Patch

Post by Tuesday »

Is there any way to play a map I modded to test it before I put it on my server?
User avatar
Iced Earth
Posts: 209
Joined: Sun Oct 18, 2009 2:07 pm
Contact:

Re: Using Battlecraft to add objects; add to your SSM Patch

Post by Iced Earth »

Yep; you should always test your maps in a 'true testing environment', basically do this:
  • Copy your 1942 directory
  • Paste it somewhere else
  • Put your mods in this copy
  • Start the dedicated server program in the copied game, and start the map (local game)
  • Join the server via your regular 1942
  • If it doesn't crash, congratulations, your mod works! If it does crash, back to the drawing board.
Image
User avatar
Tuesday
Posts: 36
Joined: Fri Jul 09, 2010 3:39 pm
Location: UK
Contact:

Re: Using Battlecraft to add objects; add to your SSM Patch

Post by Tuesday »

Thanks but can you explain that in more detail please?
User avatar
Iced Earth
Posts: 209
Joined: Sun Oct 18, 2009 2:07 pm
Contact:

Re: Using Battlecraft to add objects; add to your SSM Patch

Post by Iced Earth »

Hmm, thats pretty much it, lol.

Copy your whole Battlefield 1942 folder. Paste it somewhere else. Go to this copy of your BF's levels folder, and put your maps there. Find the dedicated_server.exe program that comes with BF in the copied folder, and set it up for a LAN game on your map. Open your regular BF and go to multiplayer -> local. Refresh and your game should show up. Join it! If it works, your patch is good. If you crash, something is wrong.
Image
Post Reply