Mounting more Weapons

Allright got another question here, How can a person mount more weapons. I havent even bothered trying it yet, but in the future i do plan to mount more guns. I was curious to just how many steps woudl it take to accomplish this.
13,412 views 20 replies
Reply #1 Top
Firstly adding any weapon requires you to edit the ship in questions mesh file,
and the only successful importer that i am aware of is for 3ds Max.

Secondly, you can only have 3 discrete weapons per ship (Noting that a single weapon can have multiple instances)

If you're fine with those two, I can give you a brief run through of what it takes.
Reply #2 Top
I was not looking for more Types of weapons just more sides and angles that they can fire from. Maybe adding some more types for the smaller craft to add to there impact on the field. overall just more lazer guns pew pew!
Reply #3 Top
Then you need to add more weapon hardpoints to the mesh files. Terraziel seems to be on top of things, so ask him if you want to mess with ingame models.

An alternative solution, already done by some mods here, is to increase the rate of fire for existing weapons. Just be sure to adjust the burst count number, not the cooldown, or you will mess up the DPS. You can also introduce staggering. Current Sins weapons fire at a pretty steady and clockwork pace. By tweaking PointStaggerDelay and BurstDelay values, you can achieve a nice random firing effect. Makes weapon fire look like someone is actually squeezing a trigger...
Reply #4 Top
terraziel i would be in interested in that walktrought
if you could send me somehow
Reply #7 Top
Don't double post.
Don't triple post.
Reply #8 Top
Just an FYI,

I'm in the process of writing up the tutorial, I shall probably post it here in a couple of hours.
Reply #9 Top
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 Max

Things 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\exporter

Step Three

Extract Stannum's script to the Scripts subdirectory of 3ds Max

Step Four

Run 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 Five

Press "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 Ten

Unfreeze 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 Thirteen

Select 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 Sixteen

In 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 Eighteen

Now 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-Two

Before all the weapon definitions there is a line which reads

NumWeapons 1

Increase this by one so that it reads

NumWeapons 2

Step Twenty-Three

Scrolldown to the line which begins MeshName and change the entry from "Frigate_TechLight" to "Frigate_TechLightModified"

Step Twenty-Four

Save 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 Notes

There 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.
Reply #11 Top
sorry about the triple post but i had connections problems and i think thats why i had to post more
thanks for the tutorial
Reply #12 Top
How do you go about linking all dummys to the mesh? (Step 10) When i save my completed mesh i get a zero k mesh file and this splitmesh error: (Type Error: call needs function or class. got undefined) along with this if it helps

-- SPLITMESH OBJECT
sMesh = SplitMesh()

any help would be greatly appreciated
Reply #13 Top
For the splitmesh error, although I have absolutely no idea Why it happens (it seems to be a bug in the latest version of the script), i have found that if you simply run the script again it should allow you to export.

To link the dummys to the mesh you simply need to select All the dummy objects and then click the "Select and Link" icon (Two Squares chained together) in the toolbar, then click and drag from any of the dummy objects to the mesh (You will see dotted lines going from each dummy object to the cursor), the mesh will flash and your done.
Reply #14 Top
i have a little problem with step 11 and 12
can someone tell me how to apply the material to the mesh
im using 3ds max 9 and im having some difficulties with it
Reply #15 Top
How many emitters can you put on one mesh file?
Reply #16 Top
How many emitters can you put on one mesh file?
End of quote


As far as I am aware, there is no hardcoded limit on emitter numbers (Atleast I haven't reached it)

I have a little problem with step 11 and 12 can someone tell me how to apply the material to the meshim using 3ds max 9 and im having some difficulties with it
End of quote


Again taken from the exporter help


That in addition to my previous instructions, is unfortunately as simple for the complicated bit as it gets.

For how to apply materials to a mesh and how to apply choose a bitmap as a map I suggest following the built in Max help and tutorials, they will do a much better job than I.
Reply #17 Top
Hey Terraziel thanks for the info though for me a day late and a dollar short (only cause I figured most of this out by trial and error I'm sure you did to) but very in depth and a good reference tool for any one making a mod.
Reply #18 Top
How do you take multiple objects in a 'scene' and merge them into one object so it is eportable?
Reply #19 Top
I too am having problems applying material. I've done everything your tutorial says, but the material just won't apply. I've done everything the way you describe. Everything is in the right slots, but the material won't appear on the mesh.
Reply #20 Top
The first thing to note is that the textures set up as described in the tutorial will NOT appear in 3ds Max itself, they are solely done for reference by the exporter, and as such you have to play your mod each time to see if they have worked. Though, that said....

Second is that the latest version of the exporter is imperfect for many people (Myself included), but if you follow This Link you can download v1.0 which works perfectly for me