Ok then,
Lets start with the next step.
I'll assume from this point that you have your own Scorched Earth server operational or you can access the file system of a server from which you can copy, edit files directly etc. (It is possible to create a new map without a server to play with but how can you test whether your PHP files and links are working?).
Create new map folder
In Windows Explorer, go to the
"\Scorched Earth\MP4\" directory of the Scorched Earth installation
*Here you will see all the directories for the SE Map sectors currently supported.
Create a new directory with the name of the new map sector you wish to add.
*If possible and for simpler integration in the PHP files later on, use a single name with no spaces.
Now, which current Scorched Earth map do you think is most similar to the one you wish to add? In this I mean; the size of the map, the number of districts and the amount of cities in the drop down lists etc. that you think will be similar to your new map.
If its a large and complex map you will find a lot of files in the directory eg. Moscow, GulfOfFinland.
Use that map folder as an example of what you will be creating.
*When having a look at the files be careful that you don't make any changes otherwise that map may not work properly or at all!
Copy PHP files from another map folder
The fundamental files you will need to create in your new map folder are:
**(just copy these from another map folder and edit the names)**
default.php
"NewMap"-intel.php (this PHP file controls the sector, district and city drop down lists and the links on the main map image)
"NewMap"-sector.php
"NewMap"-districts.php
"NewMapCity".php
Note that the sector, district and city php files are the same internally but are just edited to suit. I'll explain further below.
Note that some of the PHP files has a jpg image file that goes with it. Have a good look at your reference map folder and see how this has been done.
Before we edit the content of the PHP files to suit the new map lets get some images to go with them.
Image Capture
Please allow me to assume you have a good understanding of the FMB and a good quality graphics application. Otherwise this would be a very long process to descibe.
I'll use the the Imphal map as an example. In game and the FMB this is the Burma map. It was named "Imphal" in SE as this map mostly deals with the Battle of Imphal in March 1944.
To create good resolution images ensure the graphic settings in game are at least 1024x768 x32bit in resolution. I used 1152x864 x32 when capturing the images for Imphal.
Sector Map
First one to capture is the whole map view. This will be used to create both the districts-small and whole sector maps.
Open the Full Mission Builder (FMB) and open the map you are adding.
Ensure that the whole map is visible and take a screen capture (print screen)
Open graphics program (ie PhotoShop etc) and open the screen capture file you just made.
This will be "grab0000.tga" in your Forgotten Battles main directory.
Use the Rectangular Marqee tool to cut out the map from the overall screen grab to trim the image of the surrounding FMB sliders and frame.
If the map doesn't completely fill a full grid then trim along the grid lines **only if the grid line in question is very close to the edge of map!!**
This makes mapping the FMB co-ordinates to the image a lot easier.
Copy selection
Create new file
Paste
Save as Jpg file
Take a note of the image size in pixels. This is needed for the PHP file.
Here is Imphal_Sector.jpg as an example:
You may see that the very top of map was trimmed . This was OK to do so as the edge of actual playable map was within the viewable image. This is how it was in the FMB and the map co-ordinates for the sector map had to be adjusted to suit as seen in the file below.
Edit Sector map PHP File.
Here is Imphal_Sector.php. This was copied from another map folder and then edited to suit Imphal. The highlighted text is what you need to edit to suit the new map.
----------------------------------------------------------------------------------------
<?php
session_start();
// asp2php (vbscript) converted
//If the session variable is False or does not exist then redirect the user to the unauthorised user page
if ($_SESSION["CommanderGood_session"] != true) {
header("Location: ../Scripts/default.php");
}
//Set page specific variables
//
Imphal Sector
$CampaignMap="
Imphal";
$pageTitle="Scorched Earth Mission HQ"; //Title bar text
$pageName="
Imphal Sector Map"; //Title in top left corner of page
$GeographicMapImage="
Imphal_Sector.jpg"; //Bitmap of geographic area
$maxpX=
1118; //Size of map image in pixels in x direction
$mincX=
200; //Max longitude of image in FB coords
$maxcX=
139200; //Min longitude of image in FB coords
$maxpY=
799; //Size of map image in pixels in y direction
$mincY=
400; //Max latitude of image in FB coords
$maxcY=
99900; //Min latitude of image in FB coords
$mapOffsetX=0.0; //FB longitude offset of map origin
$mapdivoffsetX=250; //Pixel offset of left edge of map image DIV
$mapOffsetY=0.0; //FB latitude offset of map origin
$mapdivoffsetY=0; //Pixel offset of top edge of map image DIV
$ShowRoads=false; //Turns on display of pre-defined road routes
$ShowRoadWP=false; //Turns on display of pre-defined road route waypoints
$ShowRailways=false; //Turns on display of pre-defined rail routes
$ShowRailwayWP=false; //Turns on display of pre-defined rail route waypoints
include '../Scripts/MP-BuildPage.php';
?>
-----------------------------------------------------------------------------------------------
As you can see there is not a lot that you need to change.
All your doing is editing the names, the image size in pixels and the FMB co-ordinates that the image shows.
The above PHP is an example for all the district and city php files as well!
Its the same file with appropriate changes made for each district. Look at another map folder and you will see how they are all the same bar the changes as made above.
*The critical and probably most time consuming aspect of this process is getting the FMB map co-ordinates correct for your image file. You can't do that with any accuracy unless you have an operational Scorched Earth system to test it in. Enable the "ShowRoads" and railways section above when tweaking the Latitude and Longitude co-ordinates once the map is basically functional. This ensures you will be able line everything up nicely.
Edit the "intel.php" file
This file brings all the php's and Jpeg's together.
Again, the highlighted text is what is edited to suit. At this point I like to think that you are getting an understanding of what the different lines in the file are actually doing.
-----------------------------------------------------------------------------------------------
<?php
session_start();
// asp2php (vbscript) converted
include '../Scripts/MP-ApplicationMetadata.php';
include '../Scripts/MP-Connection.php';
//If the session variable is False or does not exist then redirect the user to the unauthorised user page
if ($_SESSION["CommanderGood_session"] != true) {
header("Location: ../Scripts/default.php");
}
$DBCon = $SectorDBCon[$_SESSION["SectorDB_session"]];
if ( $DBCon[0] == "mysql" ) {
$DBstring = "mysql://$DBCon[1]/$DBCon[5]";
}
else {
$DBstring = str_replace("\\",":",$DBCon[1]);
$DBstring = "access://".substr(strrchr($DBstring,":"),1);
}
?>
<HTML>
<HEAD>
<TITLE>Scorched Earth - Mission HQ,
Imphal Sector</TITLE>
<META NAME="AUTHOR" CONTENT="<?php echo $Meta1; ?>">
<META NAME="COPYRIGHT" CONTENT="<?php echo $Meta2; ?>">
<link href="../Scripts/MP-Styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript1.2" type="text/javascript">
function CNAdjective(strNation) {
if ( strNation.toUpperCase() == 'GERMANY' ) {
return 'Axis';
}
else if ( strNation.toUpperCase() == 'RUSSIA' ) {
return 'Allied';
}
else {
return 'Admin';
}
}
var CommanderName = "<?php echo $_SESSION['CommanderName_session']; ?>";
var CommanderNation = "<?php echo $_SESSION['CommanderNation_session']; ?>";
var CommanderdivHTML = '<div id="CommanderData" \n'+
'style="position:absolute;\n'+
'width:170px;\n';
CommanderdivHTML += ( CommanderName.toUpperCase() == "ADMINISTRATOR" ) ? 'height:125px;\n' : 'height:105px;\n';
CommanderdivHTML += 'background-color:#B0B0C0;\n'+
'left:7px;\n'+
'visibility:visible;\n'+
'top:14px;\n">';
CommanderdivHTML += '<table align="center" width="100%">\n';
CommanderdivHTML += '<tr><td align="left" colspan=1><span class="tiny"> </span></td></tr>\n';
CommanderdivHTML += '<tr><td align="center" colspan=1><span class="tiny">You are logged in as:</span></td></tr>\n';
if ( CommanderName.toUpperCase() == "ADMINISTRATOR" ) {
CommanderdivHTML += '<tr><td align="center"><span class="small"><b>Administrator</b></span></td></tr>\n';
CommanderdivHTML += '<tr><td align="center"><span class="tiny">with</span><span class="small"> <b>Full Privileges</b></span></td></tr>\n';
}
else {
CommanderdivHTML += '<tr><td align="center"><span class="tiny">Commander </span><span class="small"><b>'+CommanderName+'</b></span></td></tr>\n';
CommanderdivHTML += '<tr><td align="center"><span class="small"><b>('+CNAdjective(CommanderNation)+' Forces)</b></span></td></tr>\n';
}
CommanderdivHTML += '<tr><td align="center" colspan=1><span class="tiny"><a href="../Scripts/MP-Checkpoint.php?Sector_DB=
Imphal&Status=new">Logout</a> | <a href="./default.php">Change Sector</a></span></td></tr>\n';
if ( CommanderName.toUpperCase() == "ADMINISTRATOR" ) {
CommanderdivHTML += '<tr><td align="center" colspan=2><span class="tiny"><a href="../Scripts/MP-ManageCampaign.php?Sector=
Imphal&Focus=">Manage
Imphal Campaign</a></span></td></tr>\n';
}
CommanderdivHTML += '<tr><td align="center" colspan=2><span class="tiny"><a href="../Scripts/MP-OptionsScreen.php?Sector=
Imphal">View Settings</a> | <a href="../Scripts/MP-ProductionCosts.php?Sector=
Imphal">View Costs</a></span></td></tr>\n';
CommanderdivHTML += '</table>\n</div>\n';
document.write(CommanderdivHTML);
</script>
<script language="JavaScript1.2" type="text/javascript">
function loadSectorMap() {
var sectorURL;
sectorURL=document.SectorMapForm.SectorMap.options[document.SectorMapForm.SectorMap.options.selectedIndex].value;
window.location = sectorURL;
}
function loadCityMap() {
var cityURL;
cityURL=document.CityMapForm.CityMap.options[document.CityMapForm.CityMap.options.selectedIndex].value;
window.location = cityURL;
}
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<span class="large">
Imphal Sector - Mission HQ</span><br>
<span class="small">Latest intelligence briefs and mission waypoint generation.<p>
<form name="SectorMapForm">
Request a District Map:
<select name="SectorMap" style="font-family:sans-serif; font-size:12px; background:#FFFFFF none; color:#000" onChange="loadSectorMap()">
<option value="#" SELECTED>Choose District</option>
<option value="
Imphal_Sector.php">Whole
Imphal Sector</option>
<option value="Imphal_District_A.php">Imphal District A</option>
<option value="Imphal_District_B.php">Imphal District B</option>
<option value="Imphal_District_C.php">Imphal District C</option>
<option value="Imphal_District_D.php">Imphal District D</option>
<option value="Imphal_District_E.php">Imphal District E</option>
<option value="Imphal_District_F.php">Imphal District F</option>
<option value="Imphal_District_G.php">Imphal District G</option>
<option value="Imphal_District_H.php">Imphal District H</option>
<option value="Imphal_District_I.php">Imphal District I</option>
</select>
</form>
<form name="CityMapForm">
Request a detailed city map:
<select name="CityMap" style="font-family:sans-serif; font-size:12px; background:#FFFFFF none; color:#000" onChange="loadCityMap()">
<option value="#" SELECTED>Choose City</option>
<option value="Chindwin_River_Sth.php">Chindwin River</option>
<option value="Imphal_Kangla.php">Imphal Kangla</option>
<option value="Imphal_Main.php">Imphal Main</option>
<option value="Kawkkwa.php">Kawkkwa</option>
<option value="Malon.php">Malon Airfield</option>
<option value="Palel.php">Palel</option>
<option value="Pantha.php">Pantha</option>
<option value="Sittaung.php">Sittaung</option>
<option value="Sittaung_Steamer_Station.php">Sittaung Steamer Station</option>
<option value="Tamu.php">Tamu</option>
</select>
</form>
</span>
<p>
<hr>
<p>
<map name="
Imphal">
<area shape="default" nohref>
<area shape="circle" coords="143,108,30" href="Imphal_District_A.php" alt="Imphal District A Map">
<area shape="circle" coords="401,108,30" href="Imphal_District_B.php" alt="Imphal District B Map">
<area shape="circle" coords="674,108,30" href="Imphal_District_C.php" alt="Imphal District C Map">
<area shape="circle" coords="143,280,30" href="Imphal_District_D.php" alt="Imphal District D Map">
<area shape="circle" coords="401,280,30" href="Imphal_District_E.php" alt="Imphal District E Map">
<area shape="circle" coords="674,280,30" href="Imphal_District_F.php" alt="Imphal District F Map">
<area shape="circle" coords="143,460,30" href="Imphal_District_G.php" alt="Imphal District G Map">
<area shape="circle" coords="401,460,30" href="Imphal_District_H.php" alt="Imphal District H Map">
<area shape="circle" coords="674,460,30" href="Imphal_District_I.php" alt="Imphal District I Map">
<area shape="rectangle" coords="40,30,78,64" href="Imphal_Kangla.php" alt="Imphal-Kangla Map">
<area shape="rectangle" coords="10,10,32,32" href="Imphal_Main.php" alt="Imphal Main Map">
<area shape="rectangle" coords="80,250,115,290" href="Palel.php" alt="Palel Map">
<area shape="rectangle" coords="250,405,288,444" href="Tamu.php" alt="Tamu Map">
<area shape="rectangle" coords="420,465,450,490" href="Sittaung.php" alt="Sittaung Map">
<area shape="rectangle" coords="725,15,744,33" href="Malon.php" alt="Malon Map">
<area shape="rectangle" coords="240,481,260,497" href="Pantha.php" alt="Pantha Map">
<area shape="rectangle" coords="422,499,439,515" href="Sittaung_Steamer_Station.php" alt="Sittaung Steamer Stn Map">
<area shape="rectangle" coords="572,312,610,340" href="Kawkkwa.php" alt="Kawkkwa Map">
<area shape="rectangle" coords="390,500,440,560" href="Chindwin_River_Sth.php" alt="chindwin River Map">
</map>
<IMG SRC="
Imphal_Districts_small.jpg" ALT="
Imphal Map Layout" usemap="#
Imphal">
</CENTER>
<p>
<hr>
<span class="tiny">Scorched Earth Online War
<br>
<?php echo $Meta1; ?>
<br>
<?php echo "[$DBstring]"; ?>
</span>
</BODY>
</HTML>
----------------------------------------------------------------------------------------------------------------------------------
I hope that this is clear to understand. I felt that posting the whole file would give you a better reference and understanding of what needs to be done. If not please post any questions.
Next post I'll go through making the districts_small image and provide further explanation on the intel.php file above.
Thanks
Hawk_5
.