FANDOM


Last things to do ... Edit

To make the map really perfect, we should do some final steps. They are not required, though.

Lighting Edit

The editor gives you full control of the world lighting Supreme Commander uses. To adjust the settings, go to the Lighting layer in the Layers window. The best way to get the hang of the settings is to experiment. You can create everything from a bright midday noon to a spooky dusk, so have fun! Note that you can scroll down the Lighting menu to get access to even more options.

Defining gameplay areas Edit

Remember those ugly tan strips along the edges of our map before? We want to get rid of them now, this is pretty easy. It works by defining a gameplay area - everything outside this area will not be displayed. Here's how it works:

go to the Areas layer in the Layer window. Click on the “New” button (Editor-menubutton-new) to create an area entitled AREA_1. Click on the text under the Value column and change it to “1, 1, 255, 255”. The end result should look like this:

Tutorial-19

Areas are always visible when you have the Areas layer selected. To view them with other layers, go to View > Debug > Areas.

Now we need to edit our map script and add a command to activate the play area. Open your MapName_script.lua file and edit to something like this:

local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua')
local ScenarioFramework = import('/lua/ScenarioFramework.lua')

function OnPopulate()
    ScenarioUtils.InitializeArmies()
    ScenarioFramework.SetPlayableArea('AREA_1' , false)
end

Shot explanation: The first two lines allow you to make use of other .lua files in your code. The function OnPopulate is called by the game engine when it is time to add entities to the map. The first line within this function tells the scenario to initialize the armies if they are not already done so by default. The second function sets the playable area of the map to the area we defined earlier. If you’ve played the campaign, this is essentially the same code used to expand the playing field after certain checkpoints. Save the file and go back to the editor. Go to Edit > Scenario and ensure that the Script path matches the file you created. Fix it if it does not.


Guiding the AI Edit

The Supreme Commander AI needs guidance to work properly. It can’t always determine the best sites to attack, or the best places to defend. Go back to the Markers layer in the Layer window. The available markers should be self-explanatory. Drag them onto the map at appropriate locations. If you need more information about markers, go here:

Adding civilians Edit

If you want to add Civilians to your map, go back to the Armies layer in the Layer window. Create two new armies. Click on one and rename it to ARMY_9. Rename the other to NEUTRAL_CIVILIAN. In the Armies window, click on the [+] of NEUTRAL_CIVILIAN to open up the army list. With INITIAL selected, right click on the map and choose a building. This will plop down a building at the location you clicked for the NEUTRAL_CIVILIAN army. If you accidentally deselect the INITIAL group, you can always drag buildings between groups in the Armies window. Place all of the typical civilian buildings in the NEUTRAL_CIVILIAN army. Defensive structures should be placed in the INITIAL group of the ARMY_9 army.

Next we have to tell the game to treat these as civilian buildings. Unfortunately, doing this from the editor causes a crash, so we have to do it manually. Close the editor and go to the _scenario.lua file. Modify the CustomProps section so that it looks like this:

customprops = {
  ['ExtraArmies'] = STRING( 'ARMY_9 NEUTRAL_CIVILIAN' ),
},

Save the lua file and try out the map. If you have problems getting the civilians to appear, make sure you set up the armies properly. If all else fails, open up one of the official maps that contains civilians and compare the setup to yours.

Wreckage Edit

Wreckage is created in the same way as civilians. In ARMY_9, create a new group by clicking on the second new button from the left. Rename the group to “WRECKAGE” by clicking on it. Place units around the map with the WRECKAGE group selected. The units initially start alive, which is why they appear so in the editor, but a script automatically destroys them at the start of the game.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.