City - atom description

From Nebuchadnezzar Modding Wiki
Revision as of 17:33, 16 April 2021 by Polarski.nepos (talk | contribs) (→‎Properties description)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<- back to all classes

General description[edit]

  • City atom represent other citites in the world you can trade with.
  • It also used to define player city on the world map.

Properties description[edit]

Name Type Default value /
Obligatory
Description
name locale string obligatory Name of the city.
position int2 obligatory Position of the city on the world map.
label_alignment int2 obligatory Alignment of city label on the world map.
label_position int2 obligatory Additional offset for city label on the world map.
home_bezier_offset int2 obligatory Home city offset for open trade bezier curve start position.
this_bezier_offset int2 obligatory This city offset for open trade bezier curve end position.
control_point int2 obligatory Control point position for open trade bezier curve.
export_goods vec_1D[atom[Goods]] obligatory List of goods player's city can export to this city.
import_goods vec_1D[atom[Goods]] obligatory List of goods player's city can import from this city.
export_limits vec_1D[int] obligatory Maximal year trade volume for export goods.
import_limits vec_1D[int] obligatory Maximal year trade volume for import goods.
export_prices vec_1D[int] obligatory Base prices for export goods.
import_prices vec_1D[int] obligatory Base prices for import goods.
open_trade_goods vec_1D[atom[Goods]] empty vec List of goods player can choose from to open trade route.
open_trade_count vec_1D[int] empty vec Required amount of goods to open trade goods.
min_prestige int 0 Required prestige to open trade route.
max_prestige int 0 Maximal value of prestige for computation prestige component of city relation.
prestige_reached_event atom[Event] null Event when reach city required prestige.
trade_direction string obligatory Direction from city trade ship will arrive.
trade_ship atom[Ship Trade] null Ship used as trade ship with this city.

Properties in detail[edit]

position[edit]

  • It's position in pixels from the top left cornder of map texture.

label alignment[edit]

  • Use -1 for left/top alignment
  • Use 0 for center alignment
  • Use 1 for right/bottom alignment

max_prestige[edit]

  • If defined then the prestige component of city relation is computed as ratio between current prestige and this max prestige multiply by maximal value of prestige relation component.

Example[edit]

atom ('city.nz.13.jerusalem',
{
    name		= "@city.jerusalem",
    position		= {170, 210},
    label_position	= {-10, 13},
    label_alignment	= {1, 0},

    control_point 	= {218, 183},
    home_bezier_offset	= {0, 0},
    this_bezier_offset	= {0, 0},

    import_goods = {
        'goods.brick',
        'goods.dye',
    },
    import_limits = {
        90,
        100,
    },
    import_prices = {
        15,
        35,
    },

    export_goods = {
        'goods.gold_jewels',
        'goods.grapes',
    },
    export_limits = {
        60,
        30,
    },
    export_prices = {
        85,
        40,
    },

    open_trade_goods = {
        'goods.gold_jewels',
        'goods.grapes',
        'goods.ceramic',
    },
    open_trade_count = {
        20,
        35,
        35,
    },

    trade_direction = "north",
    trade_ship = 'ship.trade',

    prestige_reached_event = 'event.city_reached',
    min_prestige = 550,
    max_prestige = 1800,
})