Jump to content

Linked submaps (submaps using other submaps)


llunak

Recommended Posts

X:CE 0.34 now supports making submaps use other submaps. Instead of making a submap contain everything, it can refer to another submap, and when the game loads the submap, the linked submap will be loaded at the given position as well.

The advantages of this are:

  • Saved work by having common objects available as submaps and using those in submaps, instead of repeatedly creating the objects manually.
  • Avoided/reduced duplication. Instead of creating several submaps that differ only in some details, use one submap for the shared parts, use other submaps for the differences, and link the submaps together as appropriate.
  • More variation. Since the game always selects a random submap variant if there is more than one, making a submap use another submap results in more randomization than directly adding objects to the submap.

How to link submaps together:

  • Have 2 submaps that should be used (create them from scratch as per the mapping howto, or use existing ones). In this example, we will create a new arctic submap that will contain a random mesa (provided by the arctic/props/mesa_large1 submap) and a random tree cluster (provided by the arctic/props/tree_cluster_3x3 submap).
  • Start the submap editor and create a new 10x10 submap (click 'New Sub-Map', name it, set size 10x10 and confirm). If necessary, refer to section "3) Your first submap." in the mapping howto.
  • Submaps are placed similarly to how other objects are placed. Specifically:
  • Click 'Link Submap', that will open a file dialog for selecting which submap. Select the appropriate submap, in this case 'arctic/props/mesa_large1' (select one of the .xml files in the directory, it doesn't matter which one).
  • Unlike the map layout editor, there is no distinction between different submap types (such as ground, building, etc.), they are all treated the same. However the submap must be in the same tileset.
  • The 'Link Submap' button will stay pressed. Now clicking on any tile in the shown submap will link the selected submap to that tile.
  • The linked submap itself is not shown, but the tile is marked by green, and the list of objects on the tile shows 'Submap: props/mesa_large1'.
  • Click on another tile to link the submap to another tile, or click the 'Link Submap' button to turn it off again.
  • The same way link arctic/props/tree_cluster_3x3 submap to another tile.
  • A submap link is deleted from a tile by selecting the tile, selecting the submap ('Submap: props/mesa_large1') in the object list and clicking 'Remove Layers/Submaps').
  • Work with the submap as usual (save it, add other objects, etc. ; again, see the mapping howto if necessary).
  • In order to actually see the linked submap used, it is necessary to load it either in the map layout editor or in the game.

If you want to see linked submaps used, all UFO submaps now use them, in a non-trivial way:

  • Both crashed (maps/ufos/Crashed/ufotype/ufotype_layout.xml) and landed UFO (maps/ufos/Landed/ufotype/ufotype_layout.xml) now only link 3 submaps:
    • The base submap (maps/ufos/shared/ufotype/base/ufotype_layout.xml), which provides the base UFO structure, without hull image, and without room contents. There is only one base submap for each UFO type, so there is no duplication.
    • The hull submap, either undamaged (maps/ufo/shared/ufotype/hull/ufotype_layout.xml) for landed UFOs or damaged (maps/ufo/shared/ufotype/hull_damaged/ufotype_layout.xml) for crashed UFOs. They provide only the hull picture. It is possible to have variation in hull pictures by having more submap variants (e.g. maps/ufo/shared/ufotype/hull_damaged/ufotype_layout2.xml , etc.).
    • The inside submap, which provides room contents, and variation for them. Since landed and crashed UFO use the same inside layout with the exception of the UFO's datacore being either intact or damaged, the inside submap (maps/ufos/shared/ufotype/inside/ufotype_layout.xml) only links the actual layout submap (maps/ufos/shared/ufotype/layout/ufotype_layout.xml) and add the datacore prop. Similarly there's an alternate inside submap, and damaged inside submaps do the same.

    [*]The actual inside layout of the UFOs is provided by the primary and alternate layout submaps (maps/ufos/shared/ufotype/layout/ufotype_layout.xml and maps/ufos/shared/ufotype/layout_alt/ufotype_layout_alt.xml). These do not provide anything provided by other submaps (i.e. no hull, no datacores).

Edited by llunak
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...