This guide will start with the very basics and will teach you how to make one yourself! You may even be able to start making more complex random maps than me and making them as if your doing a scenario! Please as you read through this guide, go through the processes given here as they are in step by step form! Before we start scripting, we need to create the files in the first place! -Tips- Copy and paste this template into your xml file: This tells age of mythology what to display. The only thing you need to change pahaps is: ui/ui map scenario 256x256 This tells age of mythology what picture to display for your map. There are lots of different ones you can use so try changing the filepath to this one: ui/ui god kronos 256x256 Remeber to keep the quotation marks on both sides of the filepath. I don't think I need to go into details on what this is a picture of! Congratulations! - You have created one of the 2 files needed for age of mythology random map scripting! Start by copying and pasting this template into your xs file: // Text // Set size. rmSetStatusText("",0.04); // Set up default water. // Init map. int id = rmCreateArea("mountain"); // LOADING: rmSetStatusText("",0.07); rmSetStatusText("",0.10); rmSetStatusText("",0.13); rmSetStatusText("",0.16); rmSetStatusText("",0.19); rmSetStatusText("",0.22); rmSetStatusText("",0.25); rmSetStatusText("",0.28); rmSetStatusText("",0.34); rmSetStatusText("",0.37); rmSetStatusText("",0.40); rmSetStatusText("",0.43); rmSetStatusText("",0.46); rmSetStatusText("",0.49); rmSetStatusText("",0.52); rmSetStatusText("",0.55); rmSetStatusText("",0.61); rmSetStatusText("",0.64); rmSetStatusText("",0.67); rmSetStatusText("",0.70); rmSetStatusText("",0.73); rmSetStatusText("",0.76); rmSetStatusText("",0.79); rmSetStatusText("",0.82); rmSetStatusText("",0.85); rmSetStatusText("",0.88); rmSetStatusText("",0.91); rmSetStatusText("",0.94); rmSetStatusText("",1.00); } Now save it and launch age of mythology, select singleplayer and select your map. Now launch your new random map! This will create a giant hill in the centre of the map! I am now going to run through the steps on how this map works going through all the steps: rmSetStatusText("",0.04); // Set up default water. // Init map. This is the first part of the script and this gives you all the settings of the actual random map. This is to tell the game what size you want the random map to be. I myself actually prefer the set size option rather than doing it the tiles way. This will make the map size adjust accoding to the number of players. int playerTiles=9000; Try changing the map size by changing the "playertiles" value. The larger the number, the larger the map. // Set up default water. // Init map. The next part of the script is very obvious The first part tells you the sea level of the map. This is currently set to zero but try changing the sea height to 10. Here is the code below if you get stuck: rmSetSeaLevel(10.0); The second part tells you default settings of the map. Now for the main bit of the script!: I have numbered each section which I am now going to go through: (1)Tells you the area main name and script name. 1 What do you notice? You will notice that 1 creates a perfect round hill, 0 makes it less of a circular shape and more random. Keep going down in value and the hill gets more and more out of shape intill you get the hill going all over the map creating cool landscapes at really low values! (7)Not sure - I think this tells the script to place the actual area. You will have to ask more experienced scripters than me! rmSetStatusText("",0.79); This tells you what the position the loading bar should be when launching you map. (That big green bar you get when you launch your map to show it is loading!) There are some other symbols and things in the script but now is not the time to worry about them! If construction continues, this guide will teach you to: [This message has been edited by nottud (edited 10-19-2006 @ 06:12 PM).]
If you are struggling, just copy both the xs and xml files from and exsisting random map, open them up and clear them then just save them under a different name which are identical to each other.
This file is only a bit of code to tell age of mythology what to display, not the main code!
<
<
Before we start this, I would like to greatly credit Auron_ for using his random map template for this tutorial perpose!
// Main entry point for random map script/
void main(void) {
rmSetStatusText("",0.01);
int playerTiles=9000;
if(cMapSize == 1)
{
playerTiles =12000;
rmEchoInfo("Large map");
}
int size=2.0*sqrt(cNumberNonGaiaPlayers*playerTiles/0.9);
rmEchoInfo("Map size="+size+"m x "+size+"m");
rmSetMapSize(size, size);
rmSetSeaLevel(0.0);
rmTerrainInitialize("grassB");
rmSetLightingSet("default");
rmSetSeaType("Mediterranean Sea");
//ELEVATION
rmSetAreaSize(id, 0.1, 0.1);
rmSetAreaLocation(id, 0.5,0.5);
rmSetAreaBaseHeight(id, 15.0);
rmSetAreaHeightBlend(id, 2);
rmSetAreaCoherence(id, 0.50);
rmBuildArea(id);
// Set size.
int playerTiles=9000;
if(cMapSize == 1)
{
playerTiles =12000;
rmEchoInfo("Large map");
}
int size=2.0*sqrt(cNumberNonGaiaPlayers*playerTiles/0.9);
rmEchoInfo("Map size="+size+"m x "+size+"m");
rmSetMapSize(size, size);
rmSetSeaLevel(0.0);
rmTerrainInitialize("grassB");
rmSetLightingSet("default");
rmSetSeaType("Mediterranean Sea");
// Set size.
int playerTiles=9000;
if(cMapSize == 1)
{
playerTiles =12000;
rmEchoInfo("Large map");
}
int size=2.0*sqrt(cNumberNonGaiaPlayers*playerTiles/0.9);
rmEchoInfo("Map size="+size+"m x "+size+"m");
rmSetMapSize(size, size);
if(cMapSize == 1)
{
playerTiles =12000;
rmEchoInfo("Large map");
}
rmSetSeaLevel(0.0);
rmTerrainInitialize("grassB");
rmSetLightingSet("default");
rmSetSeaType("Mediterranean Sea");
(1)int id = rmCreateArea("mountain");
(2)rmSetAreaSize(id, 0.1, 0.1);
(3)rmSetAreaLocation(id, 0.5,0.5);
(4)rmSetAreaBaseHeight(id, 15.0);
(5)rmSetAreaHeightBlend(id, 2);
(6)rmSetAreaCoherence(id, 0.50);
(7)rmBuildArea(id);
(2)This tells you the size of the area out of 1 being the entire map
(3)tells you where is it - 0.5,0.5 is the centre of the map
(4)tells you the height of the area, in this case it is the hill.
(5)This tells you how much you want the land to blend in into the surroundings. 0 is not blend. 1 is a little blend. 2 or more blends it in really well.
(6)This is my favorite bit which I am going to let you try out yourself! I want to on the main script to change this value to the amounts listed below and save it. Then open age of mythology and open the script. Here are the values I want you to try:
0
-1
-10
-100
You map find that the script has these dotted around the script, especially at the end in this script template:
*Construction has currently been suspended untill feedback is given about the guide on whever it is of any use and if it is worth continuing
Prepare for the ultimate duel!
Learn to use all my triggers and what you can do with them. Visit here.
Find out and download the transform trigger here.
Play some minigames I have created outside AOM including some 3D games here.