Clone wiki

Caesaria / Missions

Mission is json based structure, which set options, map and events.

Forexample (game/resource/missions/tutorial.mission):

{
  version : 1                                    //version, may be we need it somewhere
  map : "/maps/Tutorial1.sav"                    //map file to. it relative to game resource folder
  funds : 8000                                   //base city funds
  date : "-350.01.01"                            //start mission date  
  finish : "-300.01.01"                          //end mission date

  win :                                          //win options 
  {
    population : 150
    culture : 0
    prosperity : 0
    peace : 0
    favour : 0 
    next : "/missions/tutorial2.mission"         //if mission win, which next mission will be load   
    title : "##clerk##"                          //it title show in greetings window
    may_continue : false                         //if true, player may stay in city
    short : "##build_some_houses##"              //mission short overview
    maxHouseLevel : "big_villa"                  //reserved
    caption : "##new_village##"                  //mission caption in win target window   
    overview :  [ "##tutorial_text##",           //mission full overview, displayed in win target window
                  "@img=picture2_00002" ]        //@img= set image for preview between text 
  }

  empire : {                                     //empire options, such cities.model
    enabled : false                              //if enabled==false, access to empire will be disabled 
  }

  events :                                       //events sections
  {
    "disable_advisors#empire_options" : {        //this line is "event_name#event_type"  
      adviser : { enabled : false }              //in first tutorial disable adviser
    }

    "tutorial#random_fire" : {                   //this event burn some buildings in city
      population : 30                            //population treschold when event can execute
      exec : {                                   //those events will be executed parent after event call
        "first_fire#tutorial_window" : {         //show user window about fires
          tutorial : "/tutorial/first_fire.tutorial"
        }

        "enable_prefecture#building_options" :  {//and set prefectures enabled
          buildings : { prefecture : true }
        }
      }
    }

    "tutorial#random_collapse" : {               //this event collapsed some building in city        
      population : 60                            //
      exec : {
        "first_collapse#tutorial_window" : {     //show player tutorial window about buildings damage  
          tutorial : "/tutorial/first_collapse.tutorial"
        }

        "enable_engineer#building_options" : {   //and set available engineer's post
          buildings : { engineering_post : true, senate_1 : true }
        }
      }
    }

    "tutorial#tutorial_window" : {               //when population grow to 80 citizens
      population : 80                         
      tutorial : "/tutorial/religion.tutorial"   //we can show tutorial window about religion 
    }

    "enable_religion#building_options" : {       //and set available small temples
      population : 80
      buildings : {
        small_ceres_temple : true,
        small_venus_temple : true,
        small_mars_temple : true,
        small_neptune_temple : true,
        small_mercury_temple : true
      }
    }

    "health_upper#health_updater" : {            //ok, in tutorial we not need check health level by house
      date : "-350.01.01"
      endTime : "01.01.01"
      value : 30
    }

    "wheat_upper#wheat_updater" : {              //and rome send wheat to us
      date : "-350.01.01"
      endTime : "01.01.01"
      value : 200
    }
  }

  buildoptions :                                 //start available constructions settings
  {
    farm : "disable_all"                         //disabled farms 
    raw_material : "disable_all"
    factory : "disable_all"
    water : "disable_all"
    health : "disable_all"
    religion : "disable_all"
    education : "disable_all"
    entertainment : "disable_all"
    govt : "disable_all"
    engineering : "disable_all"
    security : "disable_all"
    check_desirability : false

    buildings :                                  //after we work with groups settings
    {                                            //we can set constructions settings
      well : true                                //forexample set well available for build
    }
  }
}

Updated