Mapname.script

Contents

  1. Overview

  2. Create the mapname.script file

  3. How mapname.script works

Overview

Please complete creating a "map.script" file before following this tutorial. The "mapname.script" file is used to setup how things change during gameplay. These include things like spawn points, territories, objectives, objective markers, respawn times, and more.

Create the mapname.script file

  1. Open a text editor and create a file called "mapname.script" in the "script/maps" folder. Make sure the file is not saved as a text file.
  2. Add the following lines of code to "mapname.script" file:
    //Defines
    
    object mapObject_mapname : mapObject_Default
    {
    /****Variable and Function Declarations****/
    //Objectives
    
    //Objective Markers
    
    //Spawns
    
    //Territories
    
    //End Game
    
    }
    
    mapObject_Base mapname_MapScript()
    {
    	return new mapObject_mapname;
    }
    
    /****Function Definitions****/

How mapname.script works

In the mapinfo file, "mapname.md", we tell the game where our entry point is. This is accomplished by the following line:

"script_entrypoint" "mapname_MapScript"
When running the map, the function "mapname_MapScript" is called. As we can see in the code above this function creates a new instance/object called "mapObject_mapname". This object, or instance, is created based off of a class (which is basically a template). The template inherits part of its structure from "mapObject_Default".

This "mapname.script" file does not do anything yet and therefore is the same for all maps. When adding unique features for a map this file will develop into a unique file, but will still have this basic structure.