Basic Weapon Adding Guide(adds an anti-fighter weapon to the TEC Light Frigate)
I'm assuming you already have created the basics of a mod in the relevant folders, If not there are other guides out there covering that. I'm also assuming some knowledge of 3ds MaxThings you require - 3ds Max and Stannum's Script, and the Beta Mod tools
Step One In your mods folder Create a subdirectory called "Mesh", The path will look something like this
"....Ironclad Games\Sins of a Solar Empire\Mods\[Your Mod]\Mesh"
Step Two Download Stannum's importer\exporterStep Three Extract Stannum's script to the Scripts subdirectory of 3ds Max
Step FourRun 3ds Max
Go to Utilities tab (little hammer icon) --> MAXScript --> Run Script (Browse to\Select SINS_tool.mzp)
Select Soase MaxTool in Utilities dropdown (directly beneath Run Script button)
Step FivePress "Import .mesh" then browse to your main Sins directory's mesh subfolder (NOT the beta MOD tools mesh directory) and select "FrigateTechLight"
Step Six A Blue mesh and a array of dummy objects should now have appeared in Max.
First thing you should notice is that the model is orientated with the z-axis up,
Second, the dummy objects all have Specific names, These are the references the game uses to attach things to the mesh.
Step Seven Select the Mesh and Freeze it (as we dont want to edit it in anyway)
Under the Hierarchy tab click "Affect Pivot Only" and select all of the dummy objects
DO NOT MODIFY ANYTHING
Notice that extending from each of the Dummy Objects there is now a Blue Arrow (ignore the green and red arrows), this is the direction that the dummy object is facing, and is especially important for weapons.
Turn off Affect Pivot Only
Step Eight At the front of the ship (at the top of the mesh when viewed from the front viewport) there are two Dummys called "Weapon-0"
Select one of these objects, Clone it, and place the new Dummy at any location on\near the mesh (I placed it on the front\top of the mesh for ease)
Step Nine Rename the new Dummy to "Weapon-1"
Turn on Affect Pivots Only again and check that the Blue arrow is pointing forwards ie the same direction as the "weapon-0" dummys
If it isnt, Turn off Affect Pivots Only and rotate the dummy until it is.
Step TenUnfreeze the Mesh and Link ALL the Dummys to it
Effectively Now you have added a single barreled weapon to the mesh, but getting it ready for export requires a bit more work
Step Eleven In Windows, browse to the textures subdirectory of your main Sins directory, and find the relevant texture files, In this case FrigateTechLight-cl.dds,FrigateTechLight-da.dds and FrigateTechLight-nm.dds
In Max open the Material Editor ( now paraphrased from the importer tools info)
Materials:
FrigateTechLight-cl.dds uses the Diffuse Color slot
FrigateTechLight-da.dds uses the Specular Level slot
FrigateTechLight-nm.dds uses the Bump slot
Add a "bitmap" to each slot but don't point to an image file (when the Select Bitmap Image File window pops up click Cancel), Instead change the slot name to the filename (see above)
Step Twelve Apply the material to the mesh
Step ThirteenSelect the mesh, and use the "Export .mesh" button in the Soase MaxTool
Name it "Frigate_TechLightModified" so as not to interfere with main game files, save to the "Mesh" folder created in the Step One.
Step Fourteen Wait for the export to finish and close Max (no you don't need to save the scene)
Thats the 3ds Max related bits finished
Step Fifteen Browse to the "....Ironclad Games\Sins of a Solar Empire\Mods\[Your Mod]\GameInfo" folder
Open the file FrigateTechLight.entity in a text editor, in another window open the FrigateTechAntifighter.entity file
Step SixteenIn the FrigateTechAntifighter.entity file scroll down until you see a line which simply reads
Weapon
Select this line and everything staggered from it. ("WeaponType" through to "projectileTravelEffectName") and copy it
Step Seventeen In the FrigateTechLight.entity scroll down to beneath the first Weapon entry and paste in the text you copied from the Antifighter entity.
Directly beneath the "projectiletraveleffectname" line of the first weapon should now be a line saying "Weapon"
You can now close the FrigateTechAntiFighter.entity window as we no longer need it.
Step EighteenNow there is a lot of information in the text we just added, but for now concentrate on DamagePerBank, PreBuffCooldownTime and CanFireatFighter
Firstly Damage Per Bank, you should have text that looks like this
DamagePerBank:FRONT 21.250000
DamagePerBank:BACK 21.250000
DamagePerBank:LEFT 21.250000
DamagePerBank:RIGHT 21.250000
Each bank requires a dummy object orientated in the right direction as defined earlier in 3ds Max, e.g. for the left bank to work you require a dummy attached to the mesh pointing left (as viewed from the top of the mesh)
For the record i have yet to experiment with the specific angles
Step Nineteen Currently as only a Front facing emitter has been defined change it to
DamagePerBank:FRONT 21.250000
DamagePerBank:BACK 0.000000
DamagePerBank:LEFT 0.000000
DamagePerBank:RIGHT 0.000000
Step Twenty Just beneath the "DamagePerBank" lines is "PreBuffCooldownTime", this is how often the damage from the weapon is applied to the targeted ship, essentialy its the reload time on the weapon but it has no bearing on the visual weapon effects.
(As i am aware) Damage per second (what is shown in game) is calculated as DamagePerBank/PreBuffCooldownTime
Step Twenty-One Directly beneath the PreBuffCooldownTime is CanFireAtFighter, which is exactly as it sounds
Set it to TRUE to allow the weapon to fire at squads, and set it to FALSE to stop the weapon firing at squads.
Step Twenty-TwoBefore all the weapon definitions there is a line which reads
NumWeapons 1
Increase this by one so that it reads
NumWeapons 2
Step Twenty-ThreeScrolldown to the line which begins MeshName and change the entry from "Frigate_TechLight" to "Frigate_TechLightModified"
Step Twenty-FourSave the file.
At this point you have now completely added a single front firing anti-fighter autocannon to the front of the Tec Light Frigate (Cobalt). Well Done
Final NotesThere are lots of Additional things that go into totally modifying a weapon, this tutorial is designed only to get you started.
The engine only recognises three weapons emitters "Weapon-0", "Weapon-1" and "Weapon-2", but you can have as many copies of each emitter as you like.
What weapon is attached to what emitter is dependant solely on the order they are placed in the entity file
e.g in the guides example the added anti-fighter autocannon only applied to "Weapon-1" because it was placed AFTER the Cobalts default weapon, had it been placed BEFORE then you would end up with two anti-fighter autocannons (as there are two "Weapon-0" emitters) and one copy of the cobalts default weapon.
Again as I am Aware, the number of Emitters does NOT effect damage, ie in the example just given it would have had no effect on the damage output of each weapon, except in so far as firing arcs are concerned.