Skip to content
Lemonymous edited this page Nov 20, 2022 · 2 revisions

Table of Contents

 

easyEdit.island

  This module can be used to add new islands to the game, or fetch existing ones.

An island must have exactly 8 regions in order to function properly. Every table associated with regions must have exactly 8 entries; and 8 region images must be provided.

 

add

  • table   add(string island_id, string base_island_id)

  To add a new island, start by calling this function. Use a unique island_id for your island to avoid potential collisions with islands from other mods.

  You can create an island with a default base by leaving base_island_id empty, or you can use the id of an existing island to get a better base to start from. Anything you change after that, will only affect your own island.

 

Example - island with a default base:

local island = easyEdit.island:add("island_example")

Example - island based on Archive island:

local island = easyEdit.island:add("island_example", "archive")

This will return a island object, which you can build on using table fields and methods found on this page.

 

get

  • table   get(string island_id)

  Returns the island object for an existing island with this island_id.

Vanilla Island id
"archive"
"rst"
"pinnacle"
"detritus"

 

island

fields

_id

  • string

  The unique id for this island.

 

magic

  • Point

  An undocumented offset of some kind.

 

network

  • table of table of int

  A table describing which island regions are connected to other island regions. This determines which regions become available as missions after completing a mission.

Example of a valid network:

island.network = {
	{2,3},
	{2,4},
	{0,1,3,4},
	{0,2,5},
	{1,2,5,6},
	{3,4,6,7},
	{4,5,7},
	{5,6}
}

To descipher the above network, imagine each of the 8 regions numbered 0 through 7, each listed on their own line.

  • The first region (0) is connected to region 2 and 3. This means that if you complete a mission in region 0, missions for region 2 and 3 becomes available.
  • The second region (1) is connected to region 2 and 4. Completing region 1 makes region 2 and 4 available.
  • The third region (2) is connected to region 0, 1, 3 and 4.
  • And so on..
  • If you draw this on a map, you will see that it all tracks.

 

regionData

  • table of RegionInfo

  A table of RegionInfo objects describing the how to draw the image and text of a region.

Signature of RegionInfo objects:

  • userdata   RegionInfo(Point image_offset, Point text_offset, number region_width)
Argument Type Description
image_offset Point The offset of the region image
text_offset Point The offset for the region's text
region_width number The maximum width the text can be before a linebreak is made

 

Example of a valid regionData table:

island.regionData = {
	RegionInfo(Point(13,105), Point(10,-45), 100),
	RegionInfo(Point(100,12), Point(0,-20), 300),
	RegionInfo(Point(98,78), Point(0,-20), 100),
	RegionInfo(Point(64,172), Point(10,-30), 100),
	RegionInfo(Point(172,92), Point(-10,-20), 100),
	RegionInfo(Point(172,172), Point(-10,-80), 100),
	RegionInfo(Point(263,138), Point(0,0), 300),
	RegionInfo(Point(277,209), Point(-20,-30), 300)
}

 

shift

  • Point

  Quote from the base game file scripts/island.lua:

"this is bullshit to translate between high res zoomed in images and low res zoomed out"

 

methods

 

appendAssets

  • void   appendAssets(string path_island_asset_folder)

  Loads island assets from your mod. path_island_asset_folder can be entered as a path relative to your mod's root directory. All files within the directory provided will be added to the game, and associated with your island.

Example of a mod's directory structure:

  • img/
    • island/
      • island.png
      • island1x.png
      • island1x_out.png
      • islands/
        • island_0.png
        • island_0_OL.png
        • island_1.png
        • island_1_OL.png
        • island_2.png
        • island_2_OL.png
        • island_3.png
        • island_3_OL.png
        • island_4.png
        • island_4_OL.png
        • island_5.png
        • island_5_OL.png
        • island_6.png
        • island_6_OL.png
        • island_7.png
        • island_7_OL.png

Example to add the above assets to your island:

island:appendAssets("img/island/")

Island image file details:

Filename Description
island.png The base island image in zoomed-in view. Regions will be drawn on top of this
island1x.png The base island image in zoomed-out view
island1x_out.png The outline of the island in zoomed-out view. Used when highlighting the island
island_0.png The image for region 0
island_0_OL.png The image for the outline of region 0
island_1.png The image for region 1
island_1_OL.png The image for the outline of region 1
- and so on..

 

copy

  • void   copy(table other_island)

  Copies island variables from another island to this island.

Example:

-- First you must create an island object.
local island = easyEdit.island:add("island_example")

-- Then you must fetch the island object of an existing island.
local other_island = easyEdit.island:get("pinnacle")

-- Finally you can copy the variables from the other island to yours.
island:copy(other_island)

 

copyAssets

  • void   copyAssets(table other_island)

  Copies island assets from another island to this island.

Example:

-- First you must create an island object.
local island = easyEdit.island:add("island_example")

-- Then you must fetch the island object of an existing island.
local other_island = easyEdit.island:get("pinnacle")

-- Finally you can copy the assets from the other island to yours.
island:copyAssets(other_island)

 

Clone this wiki locally