Well,
Codewalker posted a tiny patch which allows you load files that the COH client normally wouldn't, so I guess I should bring you all into the exciting world of creating your own maps. The game has a built-in editor, but that requires a server, so your options are to edit the maps manually or make an external map editor. I won't be making an external map editor because I figure we'll eventually be able to use the in-game one, so here are some instructions to do it manually.
If you don't want to mess with hex editors yourself,
click here to download the already-patched cityofheroes.exe for issue 24 beta. In order to make sure nobody thinks I added malware to it (or that the download site modified the file in any way) do the following:
* Rename your original cityofheroes.exe to cityofheroes.i24.exe and copy the linked cityofheroes.exe to the folder.
* Shift+Right click your City of Heroes folder. A menu will appear. Select Command Prompt here.
* Type in fc /b cityofheroes.exe cityofheroes.i24.exe
This will File Compare in /Binary the two files, and display the differences between the two files. Specifically, four bytes:
007237A8: F0 E4
007237AC: F0 D8
007237B0: F0 C8
007237B4: F0 C0
With that patch in place, you can go ahead and add maps to your data folder and play them from demos.
City of Heroes maps are simple text files. Good ol' Notepad can be used to create your own maps. The main problem is figuring out WHAT you want to put in the map. We'll start with the demo for our experiment; save this as mymap.cohdemo in your client_demos folder:
1 0 Version 2
0 0 Map maps/mymap.txt
0 0 Time 6
0 1 Player
0 1 NEW Puddle
0 1 NPC Puddle
0 1 POS 0 0 0
0 1 PYR 0 0 0
0 CAM POS 0 10 0
0 CAM PYR 0 -2.2 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
1000 CAM POS 0 10 0
This just loads the map and leaves the camera floating at 0,0,0 for 10 seconds. If you try to run the demo now, you'll just see the standard blue sky and nothing else.
Under the city of heroes folder, create the folder
data if necessary, then a folder named
maps inside it. Paste the following into a file called mymap.txt and save it there:
Version 2
Scenefile scenes/cityscene_stormpalace.txt
If you were to run the file now, you're still on an empty map, but you'll notice the sky is different; if the filename didn't clue you in, that's the Storm Palace's scene. Scene files are stored in the piggs, but since you only need the filename, I put a list
here. Just remember to put scenes/ before the actual file name.
If you can't see the Storm Palace sky when you run this demo, check your paths. Make sure you have client_demos/mymap.cohdemo and data/maps/mymap.txtNote that scenes do more than just set the sky; they also do texture swaps. For example, the Winter scene turns a lot of grass textures into snow textures, and the Ruined scene replaced a lot of textures with their damaged counterparts. So, to avoid confusion, I'll be using the Altas Park city scene.
Moving on! We should have some solid ground under our feet. Time to
Reference some geometry.
Version 2
Scenefile scenes/cityscene_atlas_park.txt
Ref grass_plate_flat_01
Rot 0 0 0
Pos 0 0 0
End
Ref grass_plate_flat_02
Rot 0 0 0
Pos 128 0 128
End
Ref grass_plate_rolling_01
Rot 0 0 0
Pos 128 0 0
End
Ref grass_plate_rolling_02
Rot 0 0 0
Pos 0 0 128
End
If you run the demo after saving mymap.txt, this is what you'll see:
It's not pretty, but it's ground. Plates come in many varieties, but here I used two flat ones and two irregular ones in diagonal. They are 128 units by 128 units, so I just placed them one next to each other, and that's what the
Pos statements are about: placement.
Rot is obviously rotation, which we'll see shortly.
Now, where did I get those geometry names? Here's the ugly part: they are not easy to get to, and there's not a list or a sample library... yet, anyway. It's one of those projects I have in the backburner, but I'll need help. So if you want to help catalog the game's geometry, post here! Basically I'd give you a list of geometry, you'd make a map containing one of the items (and just that item) and screenshot it, and so we'll slowly build a library of stuff. But I'm getting ahead of myself.
I'm going to use all flat grass plates because they're easier to handle, and then I'll add a little house. And some trees. This is when I opened
Cameraman to help me find coordinates to place stuff in.
Version 2
Scenefile scenes/cityscene_atlas_park.txt
Ref grass_plate_flat_01
Rot 0 0 0
Pos 0 0 0
End
Ref grass_plate_flat_02
Rot 0 0 0
Pos 128 0 0
End
Ref grass_plate_flat_03
Rot 0 0 0
Pos 0 0 128
End
Ref grass_plate_flat_04
Rot 0 0 0
Pos 128 0 128
End
Ref rmn_bldg_04
Rot 0 -2.5 0
Pos 128 0 128
End
Ref conifer_sml1
Rot 0 0 0
Pos 156 0 95
End
Ref conifer_med1
Rot 0 0 0
Pos 136 0 94
End
Ref conifer_med2
Rot 0 0 0
Pos 95 0 129
End
Ref conifer_lrg1
Rot 0 0 0
Pos 105 0 166
End
If you run the demo now, this is what you'll see:
That's starting to look like something that might be usable in a demo. Or as the very basic beginnings of a city zone.
Note the use of the
Rot command in order to make the house face the right way. Pos and Rot works the same as POS and PYR in demos, so if you're familiar with demos you should feel right at home with those two.
Oh, but how am I going to get into this zone? And for what purpose would I go into this tiny little map? Well, for an entry, we could use a portal. Portals are FX scripts, which those familiar with demo editing should already know. In order to use an FX, it has to be defined inside a group; so add these lines at the bottom of the map:
Def Portal
Group Omni/PARTICLE_100
Rot 0 0 0
Pos 0 0 0
End
Type Scripted/Praetorian/Magic_Door/Magic_Door.fx
End
Ref Portal
Rot 0 -1.21 0
Pos 133 4 63
End
The
Def command allows you to group several things together and then use them as a unit, but I won't be touching that topic on this post because it's already too long as it is. Suffice to day, you use Def with a name, and then group items inside. You can attach FX to one of the items using the
Type command.
You will notice that the
Pos and
Rot in the group is 0. That's because the Def has its own little set of coordinates for grouping items. The Ref statement afterwards, which calls the group I just defined, places it in the right location with the right rotation.
Def names must be unique. That is, unique across the whole game. I used "Portal" here and it worked, but if there's already an item named "Portal" that you want to use, the Def would conflict. So if you want to make sure, add something unique to your defs, like grpMyPortal.
As for why go there, I have just the incentive. Add this bit to the end, then run the demo.
Ref Tourism_plaque_01
Rot 0 0 0
Pos 74 0 82
End
Where there's a badge, a badge whore is sure to follow.
And that concludes my first post on this topic. Certainly not the last. I just wanted to show you guys how easy it is to actually create your own maps from scratch (editing existing ones is a completely different story), and we really just need to start cataloguing all the existing map elements in the game.