supcom

Making it playable

Once you have your map set out properly it's always a good idea to try it out and check that the scale is right. To start up a game you need to do the following (assuming you already have the tool window open):

Create start markers

First we create two markers which serve as the starting points where the ACU's will gate in.

  1. Open to the Markers Layer (or just press F6)
  2. Create two blank markers by dragging the "blank marker" icon out onto your map (they should appear in the markers tool window as "Blank Marker 00" and "Blank Marker 01")
  3. Rename "Blank Marker 00" to "ARMY_1" and "Blank Marker 01" to "ARMY_2" (by clicking on them twice slowly)

In case you're wondering, this is how a marker on the map looks like: Tutorial-marker

Create armies

Next we create armies. Defining an army is important for the game scripts, everything a player can control belongs to a specific army. So for a 2 player map, we need 2 armies.

  1. Open the armies layer (or just press F2)
  2. Create two armies (click the leftmost new army button)
  3. Open the games layer (or just press F1)
  4. Click on "add a configuration" and rename the configuration to "standard" (by clicking on it twice slowly)
  5. Click on "add a team"
  6. Drag the two armies ("ARMY_1" and "ARMY_2") into the teams box

Tutorial-12

What we want to do next is rename the team to FFA, however the editor doesn't work very well here so we have to do it manually:

   Configurations = {
       ['standard'] = {
           teams = {
               { name = 'New Team 1', armies = {'ARMY_2','ARMY_1',} },
           },
           customprops = {
           },
       },
   }}
   Configurations = {
       ['standard'] = {
           teams = {
               { name = 'FFA', armies = {'ARMY_2','ARMY_1',} },
           },
           customprops = {
           },
       },
   }}

Adding a startup script

We also need to add a lua script file to get the game running:

   local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
   
   function OnPopulate()
   	ScenarioUtils.InitializeArmies()
   end
   
   function OnStart(self)
   end

Finished! You should now see the map in the Supreme commander maps list and you should be able to play it! Please try to do so and if you can, you can skip ahead to the next lession. If not, the following should help you out (although it's a bit extensive, so just ignore it if you can actually play the map).

Further changes to the scenario file

If your map is unplayable, it is likely that something has been messed up in the scenario.lua file. I have made the following code to make it a bit easier to understand what exactly is being done by the computer. Please note that this scenario file may look different than what you see in your editor. Several lines of code are in another place than in the code generated by the map editor. Should your code, for some reason, not work (and can't you figure out why) then this piece of code is a good template to find the error or to replace the old code in the scenario.lua file alltogether. The lua is fairly flexible in reading the elements (for example, note the difference between ['standard'] and standard in this code and the piece directly above). The code has the following structure:

version = 3
ScenarioInfo = {
	name="yourmapname",
	description="<yourmapname>yourmapname",
	map="/maps/yourmapname.v0001/yourmapname.scmap",
	map_version=1,
	save="/maps/yourmapname.v0001/yourmapname_save.lua",
	script="/maps/yourmapname.v0001/yourmapname_script.lua",
	size={ 256, 256 },
	starts=true,
	preview="",
  
	type="skirmish",
	Configurations={
		standard={
			customprops={ },
			teams={ { armies={"ARMY_1","ARMY_2",}, name="FFA"}}
		}
	},
	
	norushoffsetX_ARMY_1=0,
	norushoffsetX_ARMY_2=0,
	norushoffsetY_ARMY_1=0,  
	norushoffsetY_ARMY_2=0,
	norushradius=70,
  
	}

The following rules apply. If something is broken to the point that you can't play your map (usually you will see spawn points in the left-top corner, or not at all):

If you find, after a lot of trying, that the editor-generated code is still not making the map playable, then you can copy the full code in this section and use it to replace the old code completely. Then, the following parts should be changed to ensure that everything works:

  1. Every yourmapname should be changed to what your map name is.
  2. The number of armies must be consistent to the number of players that will play on your map. So if you have six armies in total, you should add "Army_3",'"Army_4",'"Army_5",'"Army_6",' and for a total of 8 armies, it should of course continue to "Army_8",
  3. Do the same for the no rush information. Every army number x must have a norushoffsetX_ARMY_x=0', and a norushoffsetY_ARMY_x'=0, (If you want a different offset, that is of course perfectly fine.
  4. The 'size={256,256}' element must have the correct numbers for its x and y dimension. If you have a map that is 256 by 256 units (5km by 5km), then you can leave this alone. Otherwise, change the numbers to what they should be (512 for 10km, 1024 for 20km, 2048 for 40km and 4096 for 80km). Be careful that you don't mix up the x and y size if you have map that isn't a perfect square.
  5. Should you not yet have renamed your map for the correct map version, do so. Please note that this still has map_version = 1, so if you are already beyond that version, this should change in accordance.

Lesson 4: Texturing