VoidExpanse/Adding Ships: Difference between revisions

From AtomicTorchWiki
Line 121: Line 121:


== Useful things ==
== Useful things ==
To define physics for this ship you can use [[https://atomictorch.com/Files/PhysicsAdjuster.zip|VE Physics Adjuster]].
To define physics for this ship you can use [[VoidExpanse/physics_adjuster|VE Physics Adjuster]].
If you have problems running this please install Visual C++ 2012 Redistributive [http://www.microsoft.com/en-us/download/details.aspx?id=30679 download from Microsoft].
You could also open .OBJ-file by providing it's path as a launch parameter: ''VoidExpansePhysicsAdjuster.exe ModelName.obj''


{{Modding}}
{{Modding}}

Revision as of 05:59, 27 August 2015


This article is a draft and may contain incomplete or even incorrect information. You can help by expanding it.

The easiest way to get a feel for modifying the available hulls within the game, is to look at the core game files and use them as examples/templates.

Core Game Mod

The game is designed to incorporate mods easily, and the single-player/main game is designed as a standard mod that is loaded by default. In the main VoidExpanse directory, there is a ModsConfig.xml file, which looks something like this...

 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <mods>
 <mod>core_0.1.0</mod>
 </mods>

You need to edit this file to include each mod you wish to add to your game, which I'll explain below.

Notice the only mod it loads by default is core_0.1.0; You can find this mod in your VoidExpanse main folder under /Mods/core.cpk

Core.cpk includes all of the basic game files, such as hulls, weapons, and devices, but also includes AI behavior and basic game scripts. The game package also provides two example 'mods' in the /Mods/ directory, but these are listed as .mpk files (devmod.mpk & masacre.mpk)

Both of these mod/pack files (.cpk and .mpk) are basically .zip files that contain the game information

Open the Core.cpk file as you would a .zip file, and you'll see two folders, plus a headers.xml

Your headers.xml file should look like this, straight out of core.cpk...

 <?xml version="1.0" encoding="utf-8"?>
 <root>
 <id>core</id>
 <title>Core Game Data</title>
 <author>AtomicTorch Studio</author>
 <description>Base mod for VoidExpanse. Contains all required game data to play the game.</description>
 <version>0.1.0</version>
 <updated>20.08.2013</updated>
 <modtype>2</modtype> 
 </root>

Make a copy of that headers.xml file, but don't change the name. Now make a basic compressed file, let's say called testmod.mpk and edit your copy of headers.xml... The only important thing to change is the ID, which should match your .mpk filename. So, for this example it should look like this:

 <?xml version="1.0" encoding="utf-8"?>
 <root>
 <id>testmod</id>
 <title>Core Game Data</title>
 <author>AtomicTorch Studio</author>
 <description>Base mod for VoidExpanse. Contains all required game data to play the game.</description>
 <version>0.1.0</version>
 <updated>20.08.2013</updated>
 <modtype>2</modtype> 
 </root>

Now, when you place your testmod.mpk file into the /Mods directory with the rest of the game files (core.cpk and the other .mpk files), it will load when you begin the game. Right now, though, there is nothing inside the mod file to load!

The final step is making sure the mod gets loaded. Open up the ModsConfig.xml from the main game directory. We need that ID and VERSION here... If my mod file was testmod.mpk and I left the <version> at 0.1.0, my ModsConfig.xml should look like this:

 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <mods>
 <mod>core_0.1.0</mod>
 <mod>testmod_0.1.0</mod>
 </mods>

Don't forget the underscore between the id/filename and the version info.

Simple, right?


Actually Adding a Ship

Now that you have an empty .mpk file (except for the headers.xml), you can start adding things like ships and weapons. There are three basic requirements for adding a ship item to the game:

 1.Item Data
 2.Model Data
 3.Texture Data

If there was a 4th requirement, it might be the sound effects, but I'm not sure.


The easiest way to begin is to make a copy of the starter shuttlecraft, since it costs nothing and is available immediately. You can skip the last two(/three) requirements by just copying the basic Item Data file and making slight adjustments...

Open up core.cpk and you'll see two directories: Data and Content

For now, you just want Data...Go further, into /items, and you'll see the files for each usable item/cargo in the game. In this case, we want to just copy the hull_shuttle.xml file. Copy it somewhere, and rename it to something else...For these purposes, it will be renamed to hull_skiff.xml.

After renaming it, open up the file and you'll see quite a bit of stuff in there. Ignore it all for now, and focus on the top bit...It should look something like this:

 <root>
 <header>
 <game_version>1.0.0</game_version>
 <id>hull_shuttle</id>
 <title>Civilian shuttle hull</title>
 <description>It would probably be a good idea to get rid of this as soon as you can...</description>

The important thing here is to rename the <id> like we did before, when creating the mod file. In this case, my <id> line would look like this:

 <id>hull_skiff</id>

And change the <title> to something else, so you can verify that it works later on

 <title>Civilian Skiff</title>


Save that .xml file (hull_skiff.xml), and open up your mod file .mpk... The game looks through your .mpk file the same way it looks through the core .cpk game files, so your new hull_skiff.xml needs to be placed in /data/items inside your mod file (the same file path where we got the original hull_shuttle.xml).

So finally, if you kept the same naming conventions as I did here, you should have:

 1. A compressed/zip file named testmod.mpk
 2. A modified headers.xml file inside testmod.mpk
 3. A modified ModsConfig.xml file that includes your mod
 4. A /data/items/hull_skiff.xml file inside your mod .mpk

This should be enough for the game to register and load your new Civilian Skiff, which is almost identical to the starter shuttle...except for the name. But hey, everything is in the brand, right?

Check out the breakdown of the hull .xml file here

Useful things

To define physics for this ship you can use VE Physics Adjuster.


VoidExpanse Modding (Edit template)

Using mods: Installing and using mods

Overview articles: Modding (main article), Package files structure

Topic specific articles: Assets modding, Content Modding, Scripting overview, Scripting API, Scripting Events system, Localization

Detailed scripting articles: Internal scripts, Global scripts, object scripts, Device scripts, Consumable scripting

Tools: VE Physics Adjuster, VE Mod Uploader (Steam), AT Localization Utility