L3DT users' wiki
Large 3D terrain generator

Expanding BattleTanks II

Adding maps and tanks to BattleTanks II is very easy; simply create the required media files, and “link” them together with a .MAP or .TANK file, for immediate use in BattleTanks II. Detailed instructions for creating and installing your own maps and tanks can be found below.

Creating Maps

The Terrain

First, create a terrain with L3DT for your game. The recommended map size is 512×512 or 1024×1024, although you can make it any size you want; however, it must be scaled down to 512×512 eventually, so larger maps may appear out of scale.

After saving your map, select “View → Show Map → Heightfield”. Then select “File → Export → Active Map”. In the window that appears, select “PNG” from the “File Format” drop-down. Now enable the “Re-size for export” check-box, and make sure the width and height is 512×512. Save the heightfield as “MapName_HEIGHT.png” or some other easily identifiable name.

Map Setup

Now, open your BattleTanks II folder, and enter a subfolder named “Maps”. Now create a new folder and rename it to the title you chose for your map.

Copy your map's heightmap ”…HEIGHT.png”, and texture ”…TX.jpg” file into the newly created folder.

Create a new file with the extension ”.map” (or copy an exsisting map file) and place it in the “BattleTanks II\Maps” folder. Open the file in notepad, and insert the following:

<map>
	<display name="Insert Map Name" order="1" mapimage="MyMap/MyMap_TX.jpg"/>
	<description>
		Created by ______
	</description>
	<terrain>
		<heightmap>MyMap/MyMap_HEIGHT.png</heightmap>
		<texturemap>MyMap/MyMap_TX.jpg</texturemap>
		<detailmap scale="3">Desert/detailmap.jpg</detailmap>
		<height>150</height>
	</terrain>
	<water enabled="false"/>
	<sky>
		<posz>Desert\right.jpg</posz>
		<negz>Desert\left.jpg</negz>
		<negx>Desert\front.jpg</negx>
		<posx>Desert\back.jpg</posx>
 
		<posy>Desert\top.jpg</posy>
	</sky>
	<teams>
		<team name="American" r="0" g="160" b="0" flagicon="Common/AmericanIcon.png">
			<flagpole mesh="Common/flagpole.x" scale="4"/>
			<flag mesh="Common/blueflag.x" scale="4"/>
		</team>
		<neutralteam flagicon="Common/NeutralIcon.png">
			<flagpole mesh="Common/flagpole.x" scale="4"/>
		</neutralteam>
		<team name="German" r="255" g="0" b="0" flagicon="Common/GermanIcon.png">
			<flagpole mesh="Common/flagpole.x" scale="4"/>
			<flag mesh="Common/redflag.x" scale="4"/>
		</team>
		<team name="Japanese" r="255" g="255" b="0" flagicon="Common/JapaneseIcon.png">
			<flagpole mesh="Common/flagpole.x" scale="4"/>
			<flag mesh="Common/yellowflag.x" scale="4"/>
		</team>
		<team name="Russian" r="0" g="0" b="255" flagicon="Common/RussianIcon.png">
			<flagpole mesh="Common/flagpole.x" scale="4"/>
			<flag mesh="Common/russianflag.x" scale="4"/>
		</team>
	</teams>
	<objects>
		<controlpoint x="1324" z="1324" team="American"/>
		<controlpoint x="724" z="1324" team="Russian"/>
 
		<controlpoint x="1024" z="1024" team="Neutral"/>
 
		<controlpoint x="724" z="724" team="German"/>
		<controlpoint x="1224" z="724" team="Japanese"/>
 
		<repairstation x="910" y="0" z="1000">
			<mesh file="Desert\garage.x" fragment="Desert/brickfragment.x" scale="4" lightmapped="false"/>
			<rotation x="0" y="90" z="0"/>
		</repairstation>
	</objects>
</map>

Replace “Insert Map Name” and “MyMap” with the appropriate map, folder, and file names.

Start up BattleTanks II. When you click “Normal Game”, your new maps should appear in the list. You can use them now, although you may want to customize control points, objects, etc.

Control Points

Open the .map file again in notepad, and scroll down to the area which reads:

	<objects>
		<controlpoint x="1324" z="1324" team="American"/>
		<controlpoint x="724" z="1324" team="Russian"/>
 
		<controlpoint x="1024" z="1024" team="Neutral"/>
 
		<controlpoint x="724" z="724" team="German"/>
		<controlpoint x="1224" z="724" team="Japanese"/>
 
		<repairstation x="910" y="0" z="1000">
			<mesh file="Desert\garage.x" fragment="Desert/brickfragment.x" scale="4" lightmapped="false"/>
			<rotation x="0" y="90" z="0"/>
		</repairstation>
	</objects>

To relocate a control point, change the X and Z values. As you can see, you can also set the team which owns each control point with the “team” attribute. Adding a new control point is as easy as adding a new '<controlpoint x=”…” z=”…” team=”…”/>' line.

Repair Stations

Like control points, you can add and modify repair stations basically by copying the template given in the above example. For example, this code creates a repair station at {910, 0, 1000}:

	<repairstation x="910" y="0" z="1000">
		<mesh file="Desert\garage.x" fragment="Desert/brickfragment.x" scale="4" lightmapped="false"/>
		<rotation x="0" y="90" z="0"/>
	</repairstation>

The X position represents the left-to-right position of the object, 0 being to the map's far left, 2048 being the map's far right. The same applies with the Z coordinate, except it represents the front-to-back position. The Y coordinate basically specifies how far above/below the ground the object should be offset.

The <rotation> tag includes 3 values; X, Y, and Z. X rotation it pitch, Y rotation is yaw, and Z rotation is roll. Generally, you will only want to use the yaw rotation to set the direction the object is facing.

Static Objects

Static objecs can be added to your world exactly like repair stations, except instead of using a “repairstation” tag, you use a “staticobject” tag, like this:

	<staticobject x="910" y="0" z="1000">
		<mesh file="Desert\garage.x" fragment="Desert/brickfragment.x" scale="4" lightmapped="false"/>
		<rotation x="0" y="90" z="0"/>
	</staticobject>

A static object like this would appear exactly the same as a armor station object of the same type, except it lacks the ability to heal nearby tanks.

Trees

Coming soon…

Sky

Coming soon…

Creating Tanks

Coming soon..

 
projects/johnj/expanding_battletanks_ii.txt · Last modified: 2017/08/31 07:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki