Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Moderator: MOD_Command

mikmykWS
Posts: 7185
Joined: Tue Mar 22, 2005 4:34 pm

Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by mikmykWS »

You can add new magazines to any ship, sub or facility using an INI config fil. This is basically a script that can apply various mods to the units in the scenario without having to edit the database.

To rebuild a scenario using an INI file you first need to make an INI template file. Go to Editor -> SBR -> Generate Template. This will generate a template file listing all units in the simulator. If you have manually altered magazines, mounts, etc, in the scenario editor, go to Editor -> SBR -> Generate Delta Template to only export the diff between the scenario setup and the database.

Then edit the exported INI file by opening it in Notepad. When you open the file it contains an entry for all platforms in the scenario. Delete everything except the unit you want to edit, like this:

<?xml version="1.0" encoding="utf-8"?>
<ScenarioUnits>
<Unit_a25be2bd-d06f-4162-959b-b3d7ccc1e5ff>
<!--LCS 1 Freedom (LCS 1 Freedom [1839])-->
</Unit_a25be2bd-d06f-4162-959b-b3d7ccc1e5ff>
</ScenarioUnits>

Note that 'Unit_a25be2bd-d06f-4162-959b-b3d7ccc1e5ff' is the unique identifier for the LCS 1 in the test scenario that I've used on this end. It will be different on your end. The line '<!--LCS 1 Freedom (LCS 1 Freedom [1839])-->' is a comment and can be altered as you see fit. It is good practice to always add comments for all lines in the INI.

Then add a 'Add Magazine' line, like this:

<MagAdd_240 /><!--Torpedo Magazine [Internal Tubes] -- USN, 2005-->

The above line will add Magazine #240 to the ship. I've also added a comment for future reference.

The full file look like this:

<?xml version="1.0" encoding="utf-8"?>
<ScenarioUnits>
<Unit_a25be2bd-d06f-4162-959b-b3d7ccc1e5ff>
<!--LCS 1 Freedom (LCS 1 Freedom [1839])-->
<MagAdd_240 /><!-- Torpedo Magazine Internal Tubes, USN 2005 -->
</Unit_a25be2bd-d06f-4162-959b-b3d7ccc1e5ff>
</ScenarioUnits>

Then go to Editor -> SBR -> Apply SBR to apply the changes. Open the Magazines window for the LCS and check that the magazine has been added.

Magazine with ID# 240 adds 8 Mk54s. If you want 18 torps used ID# 244, and for 30 torps use ID# 246.

Neat, huh :)
mikmykWS
Posts: 7185
Joined: Tue Mar 22, 2005 4:34 pm

RE: Adding a Magazine via config file

Post by mikmykWS »


emsoy
INI Config file commands are:

Add mount, ID# 434 used as an example. Note that Coverage has to be added as well, either each segment of a limited arc, or a full 360 deg arc:

<MountAdd_434>
<!--CADS-N-1 [3M87 Kortik]-->
<Cov>
Alternative 1:<Seg>PMA1,PMA2,PMF1,PMF2,PS1,PS2,PB1,PB2</Seg>
Alternative 2:<Seg>360</Seg>
</Cov>
</MountAdd_434>

Add magazine, ID# 240 used as an example:

<MagAdd_240 /><!-- Torpedo Magazine Internal Tubes, USN 2005 -->

Add sensor, ID# 4 used as an example. Note that Coverage has to be added as well, both search coverage and illumination/target tracking coverage (the two coverages have been given different arcs for illustration purposes):

<SensorAdd_4>
<!--Toad Stool [RBP-2]-->
<Cov>
<Seg>360</Seg>
</Cov>
<Cov_Ill>
<Seg>PMA1,PMA2,PMF1,PMF2,PS1,PS2,</Seg>
</Cov_Ill>
</SensorAdd_4>

Add comm link (typically missile guidance link), ID# 3 used as an example:

<CommAdd_3 /><!--SA-10 Missile Datalink-->

Delete mount, mag, sensor and comm link, item #3 on the unit used as an example, with ID#222 (a ship may carry several instances of a given mount/mag/etc, so have to specify exactly which one to remove):

<MountRemove_3_222 />
<MagRemove_3_222 />
<SensorRemove_3_222 />
<CommRemove_3_222 />

Edit, add and remove weapon record on mount, in mount magazines or in magazines. In this case mount #3 on the ship, which has ID# 552 and is a Sea Sparrow mount (as per comment). Also note that we're playing around with the mount magazine a bit:

<Mount_3_552><!--Mk29 Sea Sparrow-->
<WeaponRecAdd_5188 /><!--RIM-8J Talos-->
<WeaponRecAdd_1557 /><!--RUM-139A VLA [Mk46 Mod 5]-->
<WeaponRecAdd_2626 /><!--Roland 3-->
<WeaponRecAdd_944 /><!--RUR-5A Mod 3 ASROC RTD [10kT Nuclear DC]-->
<WeaponEdit_1687_2 /><!--RIM-7M Sea Sparrow-->
<WeaponEdit_885_22 /><!--RIM-8J Talos-->
<WeaponEdit_1643_77 /><!--RUR-5A Mod 3 ASROC RTD [10kT Nuclear DC]-->
<WeaponRemove_233 /><!--Mk182 SRBOC Chaff [Seduction]-->
<MountMag>
<WeaponRecAdd_5188 /><!--RIM-8J Talos-->
<WeaponRecAdd_154 /><!--RUM-139C VLA [Mk54]-->
<WeaponRecAdd_4015 /><!--S-8KO 80mm Rocket-->
<WeaponRecAdd_2765 /><!--SAM-3 Kin-SAM [Type 93]-->
<WeaponEdit_885_3 /><!--RIM-8J Talos-->
<WeaponEdit_1193_88 /><!--SAM-3 Kin-SAM [Type 93]-->
<WeaponRemove_233 /><!--Mk182 SRBOC Chaff [Seduction]-->
</MountMag>
</Mount_3_552>

<Mag_1_717><!--Mk36 SRBOC-->
<WeaponRecAdd_2541 /><!--Generic Chaff Salvo [5x Cartridges]-->
<WeaponRecAdd_5188 /><!--RIM-8J Talos-->
<WeaponRecAdd_154 /><!--RUM-139C VLA [Mk54]-->
<WeaponRecAdd_4015 /><!--S-8KO 80mm Rocket-->
<WeaponRecAdd_2765 /><!--SAM-3 Kin-SAM [Type 93]-->
<WeaponEdit_232_222 /><!--Mk182 SRBOC Chaff [Seduction]-->
<WeaponEdit_885_3 /><!--RIM-8J Talos-->
<WeaponEdit_1193_88 /><!--SAM-3 Kin-SAM [Type 93]-->
<WeaponRemove_233 /><!--Mk182 SRBOC Chaff [Seduction]-->
</Mag_1_717>
User avatar
Jorm
Posts: 546
Joined: Tue Jun 25, 2002 5:40 am
Location: Melbourne

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by Jorm »

brilliant.. thanks for the pointer :-)

you guys really do give excellent support to the game.. huzahhh !!!
User avatar
Sardaukar
Posts: 11324
Joined: Wed Nov 28, 2001 10:00 am
Location: Finland/Israel

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by Sardaukar »

It's great, even when bit complicated.

Now we just need someone to make a program or "feature" that does this "automagically"...[:D]
"To meaningless French Idealism, Liberty, Fraternity and Equality...we answer with German Realism, Infantry, Cavalry and Artillery" -Prince von Bülov, 1870-

Image
mikmykWS
Posts: 7185
Joined: Tue Mar 22, 2005 4:34 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by mikmykWS »

You can add and delete weapons, mounts, records and sensors from within the game already. Add magazine is on our list.
thanks!

Mike
User avatar
Sardaukar
Posts: 11324
Joined: Wed Nov 28, 2001 10:00 am
Location: Finland/Israel

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by Sardaukar »

ORIGINAL: mikmyk

You can add and delete weapons, mounts, records and sensors from within the game already. Add magazine is on our list.
thanks!

Mike

I meant easier editing of INI config files. [8D]
"To meaningless French Idealism, Liberty, Fraternity and Equality...we answer with German Realism, Infantry, Cavalry and Artillery" -Prince von Bülov, 1870-

Image
blh42
Posts: 96
Joined: Wed Jul 10, 2013 4:40 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by blh42 »

ORIGINAL: mikmyk

You can add and delete weapons, mounts, records and sensors from within the game already. Add magazine is on our list.
thanks!

Mike

Is it possible to add thing as helo landing capability too?

Blh
mikmykWS
Posts: 7185
Joined: Tue Mar 22, 2005 4:34 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by mikmykWS »

Not yet but there are really a ton of ship hulls in the game that would probably match what you're looking for.

If its an error or something missing in a db post to the relevant string and we can bang out a fix in a build or two.

Mike
orca
Posts: 526
Joined: Wed Nov 06, 2013 4:59 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by orca »

I know someone posted a link with the datalink id's. I searched but can't seem to find it. Does anyone know that link?
User avatar
ClaudeJ
Posts: 754
Joined: Wed Mar 08, 2006 5:38 pm
Location: Bastogne

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by ClaudeJ »

ORIGINAL: orca

I know someone posted a link with the datalink id's. I searched but can't seem to find it. Does anyone know that link?

That one?

Image
fb.asp?m=3441817
Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz, NVIDIA GeForce GTX 1650 4 Go, Windows 10 64bits, 32 GB RAM, Regional settings = French, Belgium
(Previously known as JanMasters0n)
orca
Posts: 526
Joined: Wed Nov 06, 2013 4:59 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by orca »

Yes. Thanks.
User avatar
VistaJohn1
Posts: 33
Joined: Fri Jun 23, 2006 8:48 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by VistaJohn1 »

This is a great tool! Have learned to use it to add comms, took a bit before I understood the exact steps required. Your examples have the information, just takes some trial and error to see the "/" added to the end of changes. Multiples can be done as long as you remember to end the changes for each unit. Can you post an example of how a loadout is changed via the ini file. Weapons and quantity please. Can you export and import these to a file for use in other scns? Thanks for a great game! It goes where I always wanted Harpoon to go. The changes in the last update really fixed the things I found frustrating with air operations[:)].
In Reply to mikmyk
Rudd
Posts: 468
Joined: Wed Jul 10, 2013 10:34 am

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by Rudd »

ORIGINAL: VistaJohn

...Can you export and import these to a file for use in other scns? Thanks for a great game! It goes where I always wanted Harpoon to go. The changes in the last update really fixed the things I found frustrating with air operations[:)].
In Reply to mikmyk


You can copy and paste specific info from those, to use in others... tm.asp?m=3766341&mpage=1&key=modifications&#65533;
User avatar
VistaJohn1
Posts: 33
Joined: Fri Jun 23, 2006 8:48 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by VistaJohn1 »

Thanks for the info. I have no problem with mounts, sensor, or comms. Cannot figure out how to change weapons/quantities for aircraft loadouts. For example, change all the aim-120 load out for carrier aircraft to all be the 120D instead of a mix. F-24A, F-35C, A-12A aircraft. I can change the quantities to for the 120c to zero, but when I add the record for the 120d, it goes into the defensive stores mount. How do I get it to go into the weapons mount for aims.
User avatar
Mgellis
Posts: 2162
Joined: Sat Aug 18, 2007 2:45 pm
Contact:

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by Mgellis »

In case anyone needs this information...

<MagAdd_120 /> adds a carrier magazine
<MagAdd_10 /> adds a helicopter magazine

(Both come with certain weapons, but you can delete those and add whatever weapons you want to include, then use the delta template command to record those changes to the .ini file so when the scenario is updated to new versions of the database the changes are not erased/reset to the default. But these work well as sort of "generic" magazines if you want to add a magazine to a ship that does not have any at all. I'm sure there are others, but these are the ones I've found so far.)




User avatar
VistaJohn1
Posts: 33
Joined: Fri Jun 23, 2006 8:48 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by VistaJohn1 »

Thanks for the response. I am trying to edit aircraft as was explained for ships. It seems to work for planes aloft, but not for ones on a base or carrier. The script runs without error, but only the planes aloft are changed. I copied the unit info from the template to the delta template and made the changes to jammers I wanted. Save the file and run the SBR script, says it's done. Save the scn., then load as a game. The airborne planes are good, the ones on the base and carrier are unaffected. Am I missing something? Is it just not possible to change planes not airborne? Anyone with an answer, please respond.
Thanks

orca
Posts: 526
Joined: Wed Nov 06, 2013 4:59 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by orca »

Thanks Mgellis for info on magazines.

Is there a link with a list of all magazines similar to the link out there for datalinks?
jptheronmd
Posts: 15
Joined: Sun Apr 19, 2015 4:51 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by jptheronmd »

Sorry for the dumb question, but I am trying to change one sensor for another on a particular ship but don't know how to look up sensors in the DB in the first place. Any ideas?
Splinter00S
Posts: 9
Joined: Wed Jul 15, 2015 11:40 pm

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by Splinter00S »

What you can do is add the sensor through the mission editor, make a delta ini for that ship, then the sensor being added should be listed with it's relevant id.

Anyone know if you can add properties (e.g. refuel, replenish, etc.) in the same way you can add sensors weapons and mags? If so, does anyone know the property reference number for refuel from port/starboard and replenish from port/starboard?
taffthomas
Posts: 31
Joined: Thu Dec 21, 2006 8:02 pm
Location: UK

RE: Adding Ship Components via Config File (Add Magazine, Add Comms, Add Weapons etc).

Post by taffthomas »

Can I bump the last request
I would like to replenish Frigates & destroyers with munitions They will refuel but not replenish so do I need to add a From port/starboard to their properties?
Post Reply

Return to “Useful Material”