-
Notifications
You must be signed in to change notification settings - Fork 49
Adding New Ships to the Game
While helping out a fellow community member add new ships into their version of the game, I stumbled on to a late 2017 post from Irishdarkshadow that he made on the now defunct swgsource.com. I'm transposing it here for your usage (and likely enjoyment). All documentation past this point is in Irish's words.
NOTE: As the ships Irish mentions have since been implemented in Source, please refer to the following commit to see the modifications and how they were implemented: Space GCW Code Merge
While trying to learn how a ship is added to the game I had to hunt down the files involved for the various parts of the ship and also any configuration files involved in the process. The purpose of this is to learn how to restore, properly, the missing ships in our current version of the server code. The first missing ship I have my sights set on is the TIE Defender:
It's a master level ship and so I figured using the TIE Oppressor to figure out what files are involved would be a good start:
From working on restoring the Cloud City Pod Car I had some idea what was needed and I used that experience to break down the process into sections.
- Crafting Schematic
- Chassis Blueprints
- Ship Deed
- Datapad Object For The Ship
- The Actual Ship
...to be continued.
Over the course of the last couple of days I have been able to refine the list of files involved and populate them correctly. The TIE Defender now works as a player ship. The only limitation I have not found a way around just yet is the display model for the Hangar structure. The ship can be passed from your datapad to the Hangar storage but it doesn't show up as a decoration. It's not a functional issue so I've moved on to the next ship, the Havoc.
To give you some idea of the TIE Defender, here are some pics of it on the v2.9 server with the new v2.9 client.
Space Terminal:
Cockpit View:
This is a simplified version of the files involved that I've taken from the original list in this thread but refined based on what I now know about what's involved and the purpose of each file.
The big issue with the TIE Defender was that the weapons on it would all fire from the same position beneath the cockpit of the ship. In the game files there were three objects listed as attachments for weapons on the ship. When those were restored and the ship weapons were removed and re-added, the firing pattern was restored to showing the blasts coming from the wings. The Havoc has something similar in that it has a turret which will need an attachment restored. There will need to be another file created to define that turret as a position within the ship for a second player. When I have those details figured out I will post the details here.
I'm using the next ship being restored as the filename example.
sys.server
Crafting Schematic
dsrc/sku.0/sys.server/compiled/game/object/draft_schematic/space/chassis/havoc.tpf
Datapad Object
dsrc/sku.0/sys.server/compiled/game/object/intangible/ship/havoc_pcd.tpf
NPC Ship
dsrc/sku.0/sys.server/compiled/game/object/ship/havoc.tpf
Actual Ship
dsrc/sku.0/sys.server/compiled/game/object/ship/player/player_havoc.tpf
Chassis Blueprints
dsrc/sku.0/sys.server/compiled/game/object/tangible/ship/components/chassis/havoc_chassis_token.tpf
Ship Deed
dsrc/sku.0/sys.server/compiled/game/object/tangible/ship/crafted/chassis/havoc_deed.tpf
dsrc/sku.0/sys.server/compiled/game/datatables/ship/chassis_modifiers.tab
(defines flight characteristics like speed / yaw rate)
dsrc/sku.0/sys.server/compiled/game/datatables/ship/shiptype.tab
(defines in depth chassis stats such as targetable components)
dsrc/sku.0/sys.server/compiled/game/datatables/space_combat/ship_droid_assignments.tab
(sets astromech or flight computer)
dsrc/sku.0/sys.server/compiled/game/datatables/space_crafting/chassis_npc.tab
(Note: The rest was snipped off - please see the commit message in the introduction section of this document.)
I've now go the Havoc restored (almost completely). The ship can be crafted to get the blueprints, those can be converted to a deed by a chassis broker. The deed can then be extracted to your datapad (once you have neutral pilot 4). From there you can load equipment and fly the ship both atmospherically and in space as intended. The loadout is 3x guns, 2x missiles and 1 counter measure slot. One of the three guns is supposed to be a turret to allow a second player to board the ship with you and shoot at some targets. That is the piece I need to get working. For the moment the turret gun does show up on the roof of the shipo, it just won't fire until it has ben properly enabled. For ease of access I have also added the Havoc to the blue frog so you can get the deed with default stats on it.
Crafting Schematic:
Blueprints:
And the T-Wing is now restored too. It's a nippy little fighter along the lines of the JSF. It is now craftable and can also be claimed in deed form from the character builder terminal / blue frog.
Schematic / Blueprints:
Chassis Broker:
Made a breakthrough with the Havoc today and now the turret is working. There were two additional files involved:
-
dsrc/sku.0/sys.shared/compiled/game/abstract/slot/descriptor/ship_havoc.mif
This file defines a turret slot for the specified ship chassis. -
dsrc/sku.0/sys.server/compiled/game/datatables/ship/ship_start_locations.tab
This file, on the surface, looks like it specifies where players who board a POB ship are placed by providing cell name and xyz co-ordinates. It also contains entries for turret ships which specify the gunner position occupied by additional players who board these non-pob ships.
The mif file was possible to populate by examining the corresponding IFF file from the final day client. The tab file was populated by copying the entry for an existing turret ship (arc170) and changing the chassis reference to that of the Havoc. After a rebuild and reboot, everything worked as expected.
I did the testing using two clients running on the same pc simultaneously which looks like this:
This was the end of what Irish shared on swgsource.com. Unfortunately, this is all that I have for his journey. I do hope it helps!!
- Cekis