starting_conditions.lua

This script contains some convenience functions intended mainly for use in the Discovery and New World starting conditions.

sleep_then_goto(sleeptime, field)

Wait for the given number of milliseconds, then center the interactive player’s map view on the given Field.

This function returns immediately after calling.

Parameters
  • sleeptime – The number of milliseconds to wait

  • field – The wl.map.Field to center the view on

Returns

nil

launch_expeditions(player, items)

Creates some expedition ships in random places with the given additional items on them. If called for the interactive player, centers the view on an arbitrary of these ships.

Parameters
  • player – The wl.game.Player to use

  • items – An array of tables with ware_or_worker_name = amount pairs. As many ships will be created as there are subtables, and the n-th ship created will load the additional wares and workers defined in items[n]. The capacity of each ship will be adjusted to accommodate the build cost of the player’s tribe’s port building plus one builder plus the number of additional items for this ship.

Returns

nil