Expanding mapname.script: Objectives

Contents

  1. Overview

  2. Objectives: Initialization, Completions, and Messages

Overview

Please complete the tutorial for creating a "mapname.script" file before attempting this tutorial. There are several things that need to be added to "mapname.script" when adding 1 or more objectives to a map. Only the non-specific objective stuff is discussed here. Three functions will be added to "mapname.script".

Objectives: Initialization, Completions, and Messages

  1. Add the following function declarations under the ""//Objectives" comment, it should look like the following:
    void InitObjectives();
    void CompleteObjective(float index, entity p);
    handle GetObjectiveMessage(float index);
  2. Add the following function definitions under the "/****Function Definitions****/" comment.
    void mapObject_mapname::InitObjectives()
    {
        sys.print("\n\n*****Loaded mapname Map Script*****\n\n");
    	//Do Initialization Stuff Here
    
    }
    
    void mapObject_mapname::CompleteObjective(float index, entity p)
    {
       //Handle Objective Completions
       
    }
    
    handle mapObject_mapname::GetObjectiveMessage(float index)
    {
        //Handle Objective Messages
    
        return g_locStr_BadObjective;
    }