File Chain For Lightsaber Crystals - SWG-Source/swg-main GitHub Wiki

These are the files that make up lightsaber colour crystals:

tpf / iff

These files create the physical object for a crystal that the player can pickup and use inside a saber. The raw form of the file is in /dsrc under sys.server and has a tpf file extension. The contents of the file are basically just a pointer to the base object from which settings are inherited and a pointer to the client side file. When you build / compile the file the result will be found in /data at the same path but will now have an iff file extension.

dsrc/sku.0/sys.server/compiled/game/object/tangible/component/weapon/lightsaber/.tpf data/sku.0/sys.server/compiled/game/object/tangible/component/weapon/lightsaber/.iff

The client side file is found under sys.shared and will have a prefix of "shared_" on the filename. This will match the pointer found in the sys.server file. In terms of contents the client side file will have pointers to the various text (string) files and the appearance file for the object. As with the previous file, the compiled version is under /data with an iff file extension. This compiled file will need to be in the SWG client at the appropriate location.

dsrc/sku.0/sys.shared/compiled/game/object/tangible/component/weapon/lightsaber/shared_.tpf data/sku.0/sys.shared/compiled/game/object/tangible/component/weapon/lightsaber/shared_.iff

There are four different crystals to be found in these folders, one "base" crystal that is used to produce 34 out of the 37 colour crystals in the game and the remaining three need separate files as they each use a different shader to achieve their

tab files:

These are the datatables which attach functionality to the objects listed earlier. There are three files involved and each provides a different piece of the overall puzzle.

dsrc/sku.0/sys.server/compiled/game/datatables/jedi/crystal_color_damage.tab
dsrc/sku.0/sys.server/compiled/game/datatables/item/master_item/item_stats.tab
dsrc/sku.0/sys.server/compiled/game/datatables/item/master_item/master_item.tab

(1) crystal_color_damage.tab There are four columns in this file, (a) is a number that corresponds to a colour in the palette file we will look at later (b) is the elemental damage type (c) is the bonus damage % and (d) is for comments. The comments column includes some guidelines for how this file is used by the server.

(2) item_stats.tab There are only three columns that are of interest to us in this file (a) references the static name for the crystal which is defined in the master_item.tab file (d) is the objvars, object variables, which include the blade colour and (e) which sets the saber trail colour. The numbers used for the colours match to what we saw in the crystal_color_damage.tab file and ultimately they will match the index slots in the palette file used by the file chain of each crystal.

(3) master_item.tab There are three columns in this datatable that are of interest to us (a) this is the static name for the crystal which is used to spawn it, attach strings to it and item_stats.tab uses it to attach values (b) the object file used for the crystal (k) lists scripts attached to the crystal when it's spawned using the static name.

When you compile these files then end up in the following locations:

data/sku.0/sys.server/compiled/game/datatables/jedi/crystal_color_damage.iff
data/sku.0/sys.server/compiled/game/datatables/item/master_item/item_stats.iff
data/sku.0/sys.server/compiled/game/datatables/item/master_item/master_item.iff

stf files

These will be located in both the server (clientdata folder) and the client.

string/en/static_item_n.stf
  This links the static name from master_item.tab to the string / text shown in-game as the crystal name

string/en/static_item_d.stf
  This links the static name from master_item.tab to the string / text shown in-game as the crystal description

string/en/jedi_spam.stf
  This links the colour index number from earlier to the text that shows as the "Blade Color Modification" in-game

apt

This file provides the final appearance for the crystal object in-game. It needs to be present in both the server (clientdata folder) and the client.

lod

This file is used to decide which "model" for the object is displayed in-game based on various factors such as player distance from the object. In SWG there are typically 4 levels of detail (lod) which go from high quality to highly blurry as you get towards the bottom of the file. The file needs to be on the server and in the client.

mesh

This is the 3d object that provides shape to the crystal. The file needs to be on the server and in the client.

sht

The shader is used to configure graphical aspects of the object such as emissive qualities as well as pointing to the palette(s) and texture(s) used by the object. This file would not normally be used on the server but the new ACM (asset customization manager) process now requires it, it is required in the client.

There are 22 of the 25 special crystals that share the same shader but there are three crystals that require a custom shader in order to achieve their final look - lava crystal, blackwing crystal and the permafrost crystal.

pal

The key file for blade colour and saber trail colour is the /palette/wp_lightsaber.pal file. It can be opened using the palette editor in SIE and will show you a grid of boxes, each box having a colour. If you click on a colour box the pane on the right will display the "index" value for that colour. For example, if you click the first colour box on the third row you see a red colour with "10" on it which is the hexidecimal value and if you look to the right pane, under the colour wheel, you will see "16" which is the decimal index value. That decimal value is what you saw used in all of the files earlier.

dds

These are the textures that get wrapped around the mesh to provide the look of the object.