Building a Full Base: All Your Base Are Belong To Us
Okay, so you've got a couple of structures and some vehicles. That's really not enough for a base though...
Before we really get into it, here's some odds and ends you may want.
Player[#].GoEden(); // Forces a player to play as Eden
Player[#].GoPlymouth(); // Forces a player to play as Plymouth
Player[#].SetColorNumber(0 - 5); // Forces a player to play using the specified color
0 = blue
1 = red
2 = green
3 = yellow
4 = cyan
5 = magenta
6 = black (unused)
These should probably only be used in single player games or for multiplayer AIs since humans
generally pick their colony and color for a reason.
We are now going to cover:
-Creating Tubes and Walls
-Creating Mines
-Setting up Initial Resources
-Resource Settings
Let's start nice and easy. Tubes and walls are pretty simple.
TethysGame::CreateWallOrTube(X, Y, ?, type)
X/Y are the x and y position of the wall/tube (obviously). Don't forget the offsets!
? is unknown, to my knowledge. Leave it at -1.
Type is the type of wall/tube you're making.
mapTube // Tube
mapWall // Concrete Wall
mapLavaWall // Plymouth Lava Wall
mapMicrobeWall // Eden Microbe Wall
Of course, you don't want to have to do these things one at a time, right? Luckily, we can create lines at a time:
CreateTubeOrWallLine(xStart, yStart, xEnd, yEnd, type);
Again, this should be pretty self-explanitory. On to mines.
Mining beacons. The bane of my existence. The problem isn't that they're hard. The problem is there are so
many of the darned things! Finding good locations and placing them takes forever!
Anyways, here's the code:
TethysGame::CreateBeacon(Beacon Type, x, y, Ore Type, Bar Level, Variant);
You may be confused by the presence of a "Beacon Type" and an "Ore Type" setting. Don't worry, you won't be for long.
Beacon Type: Is this a mining beacon, a magma vent, or a fumarole? Valid options are mapMiningBeacon, mapMagmaVent, and mapFumarole.
Ore Type: Sets whether the mine is common or rare ore. 0 = common, 1 = rare. -1 = random.
Bar level: Sets mine's yield. 0 = 3 bar, 1 = 2 bar, 2 = 1 bar. -1 = random.
Variant: Not all mines are the same. There are 3 variants of each type of mine. I usually just set this to random though, so each game is a bit different. 0 = low-yield variant, 1 = regular-yield variant, 2 = high-yield variant. -1 = random
IMPORTANT NOTE: For magma vents and fumaroles set ore type, bar level, and variant to -1.
For aesthetic reasons, Magma Vents should only be placed on dark gray terrain. Convention dictates that fumaroles aren't found on sandy terrain, but this isn't a rule.
Here are some examples:
TethysGame::CreateBeacon(mapMiningBeacon, 93+31, 12-1, 0, 0, -1);
TethysGame::CreateBeacon(mapMiningBeacon, 14+31, 119-1, 1, 2, -1);
TethysGame::CreateBeacon(mapFumarole, 64+31, 4-1, -1, -1, -1);
Okay, it's time to put it all to work! Go make a full base! I want it to have at least:
1 Command Center
1 Structure Factory
1 Agridome
1 Tokamak
1 Common Ore Smelter
1 Mining Beacon (Common Ore)
1 Common Ore Mine (place directly above the mining beacon. Beacon must be placed first!)
1 Robo-Miner
1 Robo-Surveyor
1 Earthworker
1 Robo-Dozer
3 Cargo Trucks
3 ConVecs
1 Guard Post
Some concrete walls
Make sure everything that needs to be is connected to the CC via tubes. Come back when you're done.
Okay, we've got ourselves a base, but it still needs something. People, food, ore, and technology, maybe?
Player[#].SetKids(amount); // Sets number of children
Player[#].SetWorkers(amount); // Sets number of workers
Player[#].SetScientists(amount); // Sets number of scientists
Player[#].SetFoodStored(amount); // Sets amount of food stored
Player[#].SetOre(amount); // Sets amount of common metal stored (must have storage capacity)
Player[#].SetRareOre(amount); // Sets amount of rare metal stored (must have storage capacity)
Player[#].MarkResearchComplete(techID); // Marks specified technology as completed
Most of that is pretty self-explanitory, though you may be wondering how you can find out what a tech's tech ID is. Open up the techtree you're using in a text editor (notepad, for example). It'll be the 5 digit number next to the tech's name. Make sure not include any leading zeroes, however (example: If a tech's ID is 01234, you would write MarkResearchComplete(1234) )!
What about resource settings or difficulty level? Just do this:
short i;
for (i = 0; i < TethysGame::NoPlayers(); i++)
{
switch (Player[i].Difficulty() )
{
case 0:
Player[i].SetKids(22);
Player[i].SetWorkers(30);
Player[i].SetScientists(19);
Player[i].SetOre(4500);
Player[i].SetFoodStored(1900);
break;
case 1:
Player[i].SetKids(19);
Player[i].SetWorkers(26);
Player[i].SetScientists(16);
Player[i].SetOre(3000);
Player[i].SetFoodStored(1500);
break;
case 2:
Player[i].SetKids(17);
Player[i].SetWorkers(22);
Player[i].SetScientists(14);
Player[i].SetOre(3000);
Player[i].SetFoodStored(1200);
break;
}
}
That will iterate through all players and set their starting resources based on their Resource Setting. These are just some recommended settings. Feel free to modify the values as you see fit.
Looking good! Again, feel free to ask question and post your results. If anyone notices any errors, feel free to point them out!
Until next time, good luck!
Next week: Basic Triggers/Intro to Disasters