[Alpha 5.1 Guide] Adding other ships to the ship store

General discussion for SC:Galaxies!
Post Reply
User avatar
denghis
Space Cadet
Space Cadet
Posts: 1
Joined: Mon Sep 21, 2015 11:32 am

[Alpha 5.1 Guide] Adding other ships to the ship store

Post by denghis » Mon Sep 21, 2015 12:47 pm

Greetings fellow Captains!

I have tinkered with the game over the weekend, and i have mostly figured out how to add some of the other ships in the game to the station store. This does not work for all ships, i have only tested the Tutorial ship, and a Trilaxian medium ship. But the process should work for most ships that you see flying around.

[Disclaimer]
Modify gamefiles at your own risk.
When the game updates, be prepared for the posiblity that edited files to be overwritten
[/Disclaimer]

Step 1: Locate a suitable ship
Most ships are located in the following folder:
Star Command Galaxies\StarCommandGalaxies_Data\StreamingAssets\Templates\Ships

And a mapfile and ususally an image of the ship will be located here:
Star Command Galaxies\StarCommandGalaxies_Data\StreamingAssets\Templates\Maps

For the sake of this tutorial, we will take a look at the Trilaxian medium ship.
Please note that this ship has two variations, we will use number two. so the files to look out for are:
Star Command Galaxies\StarCommandGalaxies_Data\StreamingAssets\Templates\Ships\TrilaxMedium2.xml"
and
Star Command Galaxies\StarCommandGalaxies_Data\StreamingAssets\Templates\Maps\TrilaxMedium2.xml

Step 2: Add your ship to the list of buyable ships
Locate this file: Star Command Galaxies\StarCommandGalaxies_Data\StreamingAssets\LuaScripts\Trade\BuyableShip.lua
Open the file in your favourite text editor, it should look something like this:

Code: Select all

require 'Base/Base.lua'

BuyableShipDefaults = {

}

BuyableShip = Define(BuyableShip, {	
	ExteriorImage = "string", --The Exterior Hull image of the ship
	InteriorImage = "string", --The Interior Image of the ship
	
	ShipName = "string", --The original name of the ship
	ShipMap = "string", --The map template of the ship
	ShipCost = "number", --The cost of purchasing said ship
			
}, BuyableShipDefaults, "Type")

BuyableShip{
	Type = "Nebulus",
	ExteriorImage = "Visuals/Sprites/Ships/Nebulus",
	InteriorImage = "Visuals/Sprites/Ships/Internal Hulls/nebulus_internal",
	ShipName = "TechnoSpec Nebulus GX-1",
	ShipMap = "Templates/Ships/PurchaseShip1",
	ShipCost = 6400,
	Ship
}

BuyableShip{
	Type = "Galaxa",
	ExteriorImage = "Visuals/Sprites/Ships/Galaxa",
	InteriorImage = "Visuals/Sprites/Ships/Internal Hulls/galaxa_internal",
	ShipName = "CON-SOLAR Galaxa",
	ShipMap = "Templates/Ships/PurchaseShip3",
	ShipCost = 6400,
}

BuyableShip{
	Type = "Korsu",
	ExteriorImage = "Visuals/Sprites/Ships/Korsu_3x",
	InteriorImage = "Visuals/Sprites/Ships/Internal Hulls/korsu_internal",
	ShipName = "Menicorp Korsu T-779",
	ShipMap = "Templates/Ships/PurchaseShip2",
	ShipCost = 6400,
}
Copy one of the buyable ship blocks, paste it at the bottom of the file and modify it so it looks something like this:

Code: Select all

BuyableShip{
	Type = "TrilaxMedium",
	ExteriorImage = "Visuals/Sprites/Ships/trilax_medium_4x",
	InteriorImage = "Visuals/Sprites/Ships/Internal Hulls/korsu_internal",
	ShipName = "Trilaxian Medium",
	ShipMap = "Templates/Ships/TrilaxMedium2",
	ShipCost = 500,
}
The edits we did above where the following:
Created a new type of buyable ship, remember this for later, because we will tell the shop to stock this ship.
Set an exterior image, this is the image you see when zooming all the way out, and in the shop
Set an interrior image, this is the image you see in the shop when clicking the button to see the interior (i just used the korsu one)
Set the name of the ship as it will be written in the store
Set the map for the ship, this is very important, as it tells the game what ship layout to use
Set the cost of the ship, no need for explanation on that one i hope.

3 Add your ship to the store!

Locate the merchant file: "Star Command Galaxies\StarCommandGalaxies_Data\StreamingAssets\LuaScripts\Merchants\HumanShipDealer.lua"
It should look like this:

Code: Select all

require 'Base/MerchantBase.lua'

Merchant{
	Type = "HumanShipDealer",
	Name = "Ship Dealer",
	ShopkeeperTemplate = "Templates/Characters/Merchants/HumanShipDealer",
	ShowroomTemplate = "Templates/Maps/store_footprint_small",
	
	WillPurchase = {},
	ForSale = {},
	ShipsForSale = { "Galaxa", "Nebulus", "Korsu" },
}
Simply change ships for sale to include your ship "TrilaxMedium" ShipsForSale = { "Galaxa", "Nebulus", "Korsu", "Trilaxmedium" }
The result should look like this:

Code: Select all

require 'Base/MerchantBase.lua'

Merchant{
	Type = "HumanShipDealer",
	Name = "Ship Dealer",
	ShopkeeperTemplate = "Templates/Characters/Merchants/HumanShipDealer",
	ShowroomTemplate = "Templates/Maps/store_footprint_small",
	
	WillPurchase = {},
	ForSale = {},
	ShipsForSale = { "Galaxa", "Nebulus", "Korsu" , "TrilaxMedium"},
}
Step 4, Copy the ship image
In order for the game not to lockup when you buy the ship, copy the trilax UI image from:
"Star Command Galaxies\StarCommandGalaxies_Data\StreamingAssets\Visuals\Sprites\UI\OrbitUI\Ships\Trilax\TrilaxMediumShip.png"
And paste it into: "Star Command Galaxies\StarCommandGalaxies_Data\StreamingAssets\Visuals\Sprites\UI\OrbitUI\Ships\Human\"
There is probably a cleaner way to do this bit, but i found this to be a quick fix.

Step 5 Buy the ship!
Once all the steps above are done, and files saved/copied etc. Then all you need to do is go to the Store in "The Center of the universe" (the first station), speak with the ship trader, and exchange 500 credits for a shiny big ship.

If it does not work then one of the following has likely occured:
1) The game has patched and my method does not work.
2) There is a typo in the guide, i am sorry.
3) You forgot to copy a file, edit another or did not save one or more files.
4) ?????

At this point you can try to follow my approach to add other ships to the store, or even being brave enough to edit one of the mapfiles so you can change the items on the ship.

I guess that is it, Good luck! Fly safe!
(And please excuse my non native English)

Since i am not allowed to post images, a few can be found at imgur/a/e0ySS

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest