Jump to content

Tutorial - Adding UFO with crash site


SoulFilcher

Recommended Posts

Adding landing and crash sites for new UFOs isn't possible for any current Xenonauts version, but I have been testing it for a possible Community Edition update (I will edit this tutorial later when this feature goes live). I want to thank Ilunak for sharing the necessary files for this test.

For now I will assume you have previous experience with modding and adding new UFOs to the game, so I won't cover all parts in a detailed way. I will post a list of things that need to be done though, to make sure you (and me) won't forget anything.

- aircrafts.xml: This is the file with all aircraft stats, create a new UFO as usual. The 2 important stats here are "CanLand" and "SpawnCrashsite", both should be set as "Yes".

- aircraftweapons.xml: In case your new UFO uses a new weapon remember to add it here.

- AM_BaseAttack, AM_BombingRun and so on: These control which UFO types are used for each mission type and when. You can also define which UFOs are actually going for the mission and which ones are just possible escorts.

- items.xml: Remember to add items for the UFO's datacore, new weapons, and anything new that could be recoverable from your UFO.

- maptypes.xml: This is the file that changes everything, with it (and the new code) the game will be able to load maps and submaps for you UFO. Add it to the list with the same name you used in aircrafts.xml.

- researches.xml: Add the research for your new datacore, as well as any other related to new items.

- strings.xml: Add entries for the UFO name, datacore item name and things like that.

- xenopedia.xml: Add the entry for you UFO.

Now let's check the list of files that should go inside other folders.

- aircraft/aircombat/: The image for air combat, it should be used by your new entry in aircrafts.xml.

- aircraft/UFOs/: The image that appears when your UFO is intercepted, it should be used by your new entry in aircrafts.xml.

- maps/artic, maps/desert and so on: You will new to edit maps or create new ones so they can be used by your UFO. Not having a possible map for a specific terrain type will cause bugs when your UFO lands or crashes on that terrain type. I will explain how to add UFOs later.

- maps/ufos/Crashed and maps/ufos/Landed: Inside these folders you need to create a folder with your UFO's name to contain submaps. There can be two submap variations for each folder, but smaller UFOs have the two files as exact copies.

- tiles/UFO/: Here you also need to create a folder with your UFO's name, to contain the tile images and spectres that will be used in your submaps. The spectres can point to other folders so you don't need to create copies if you are going to use things from other UFOs, but there are a few files that MUST be here or it won't work.

- ufocontents/: This folder holds the XML files that define UFO crews. You need to create one for each race that can use your UFO. Not all types are used by all races (i.e. Light Scouts are not used by Androns, that's why there's no file for this case). The files' names are simply airplane.alien.yourUFOname.casean, or sebillian, or andron. With my tests I found that you can actually use any of the races in any combination you like, there's to need to have caesans strictly in caesan crews. I suspect that it works better that way though, as the game will be able to choose correctly which race to use against you.

- xenopediaimages/: Remember to add an image for you xenopedia entries.

This is the whole list of changes. You should be able to do most of these by comparing how they are done for the other UFOs in the game. The XML files also explain what most values do. Now we need to create UFO submaps and then add them to maps. I will assume you have worked with those, if you haven't I'm afraid I'm not the best person to explain, as I have just started myself, but there are other tutorials to help you.

- Submap: UFO submaps can be created and edited using the submap editor included with Xenonauts. The files are named "yourUFOname_layout" and "yourUFOname_layout_alt", and you must have these for the Landed and Crashed folders. These are the only files that you absolutely need to have in the folder with your UFO name, anything your submaps use can actually be placed in other folders inside the tiles/ folder. To make things easier use a size (width x length) of an existing UFO, because adding them to maps is very limited right now.

- Maps: Every map has a list of UFO types (and by consequence their submaps) that can use them. The map editor will not be able to add your new UFO, so you need to manually add it in the map's XML file. That's why I suggested using a submap size of an existing UFO, this way you can just copy the entry of that UFO and rename it, enabling the same spawn locations for both UFOs. If your submap uses a different size it will spawn out of location and the game will probably crash at some point (for me it was when I ended my first turn). You could probably edit the values to fix it for different submap sizes, but I haven't tested it.

Remember to add at least 1 map for each terrain type, except town and soviettown as those are only used by terror missions.

- WARNING - The following mod does not work with current versions of the game. If you want to test it read the thread about modding UFOs and download the files provided by Ilunak. It looks like maptypes.xml does not work if placed inside the mod's folder. Copy it to your assets folder before testing.

Here is an example mod with a small UFO I created. In the files its called "runner" but I decided to go with "Visitor" in game. Feel free to suggest improvements or additions to this tutorial or the mod. Some of the maps used were made by Skitso and tundra maps were made my Khall.

Edited by SoulFilcher
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...