Difference between revisions of "How to create new map (mission, scenario)"

From Nebuchadnezzar Modding Wiki
Jump to navigation Jump to search
Line 23: Line 23:
 
*In your mode create code>def</code> folder. It will contains all def files.
 
*In your mode create code>def</code> folder. It will contains all def files.
 
*In that folder create <code>mission.lua</code> file.
 
*In that folder create <code>mission.lua</code> file.
**The name of the file is important because because the type of atom is basedon the name of file it's in.
+
**The name of the file is important because because the '''type of atom is based on the def file name'''.
 
*And now let's add some content.
 
*And now let's add some content.
 
<pre>
 
<pre>
Line 42: Line 42:
 
}
 
}
 
</pre>
 
</pre>
 +
 +
*First of all, we will prepare some general variable, which we can use in multiple mission atom.
 +
*Beause it's better to have shared data in some variable.
 +
*The variable <code>nature_buildings</code> now contains all nature buildings from the <code>base</code>
  
 
<pre>
 
<pre>

Revision as of 17:54, 4 February 2021

Mission vs Scenario vs Map

First let's explain these 3 different concepts.

Mission

  • Mission is basic unit of Nebuchadnezzar.
  • It connects map and objectives together.
  • Several mission together can form campaign.
  • Player always play missions.

Scenario

  • Scenario is just a special subset of mission.
  • It's a mission which is not part of any campaign.
  • Player can play any scenario without any limitation, because all scenarios are unlocked.

Map

  • Map is data file containg information about specific map.
  • Stuff like surface layout, buildings etc.

Create new mission

Create mission atom

To create new mission you have to create an atom for it first.

  • In your mode create code>def folder. It will contains all def files.
  • In that folder create mission.lua file.
    • The name of the file is important because because the type of atom is based on the def file name.
  • And now let's add some content.
nature_buildings = {
    'base::build.palm.1',
    'base::build.palm.2',
    'base::build.palm.3',
    'base::build.palm.4',
    'base::build.bush.1',
    'base::build.bush.2',
    'base::build.bush.3',
    'base::build.bush.4',
    'base::build.palm.bush.1',
    'base::build.palm.bush.2',
    'base::build.palm.bush.3',
    'base::build.palm.bush.4',
    'base::build.fish.1',
}
  • First of all, we will prepare some general variable, which we can use in multiple mission atom.
  • Beause it's better to have shared data in some variable.
  • The variable nature_buildings now contains all nature buildings from the base
irrig_buildings = {
    'base::build.irrig.canal',
    'base::build.irrig.pump',
    'base::build.irrig.bridge.dirty',
    'base::build.irrig.bridge.stone',
}

mission_base = {
    base_mods = {"base"},
    first_residents_event = 'base::event.first_residents',
    leaving_residents_event = 'base::event.leaving_residents',
    returning_residents_event = 'base::event.returning_residents',
    no_path_residents_event = 'base::event.no_path_residents',
}

atom ('mission.my_first_mission', mission_base,
{
    description = 'description.my_first_mission',
    intro_event = 'event.intro.my_first_mission',
    money_events = {},

    allowed_buildings = ac(
        nature_buildings, ac(
        irrig_buildings, {
        'build.road.dirty',
        'build.shop.bread',
        'build.farm.plant.1',
        'build.warehouse.1',
        'build.house.lower.1',
    }),

    allowed_monuments = {},
    allowed_templates = {},

    map = 'map.my_first_mission',
    prestige = 'prestige.my_first_mission',
    requests = {},
    demands = {},

    target_population = 300,
    target_prestige = 10,
    target_level_atoms = {'base::level.house.lower.1'},
    target_level_counts = {12},
})