How To Add Ion Turrets To HW2 Remastered Destroyers?

Greetings All:

I’m having issues trying to replace the top & bottom kinetic burst cannon turrets on HW2 destroyers with ion turrets. Here’s what I’ve attempted thus far:

  1. Created a new .wepn file called “hgn_destroyerturretedioncannon” based off the hgn_battlecruiserturretedioncannon.wepn file.

  2. Changed lines 152 and 155 in the hgn_destroyer.ship file to include the aforementioned ion cannon. See following example:

NewShipType,"Weapon_TurretTop","Hardpoint_TurretTop","Weapon","Innate","Ship","Hgn_KineticBurstCannonDestroyer","","","","","","","","");

Changed to this:

NewShipType,"Weapon_TurretTop","Hardpoint_TurretTop","Weapon","Innate","Ship","Hgn_DestroyerTurretedIonCannon","","","","","","","","");

Unfortunately, the game promptly crashes with the aforementioned changes. Hoping someone can point out what I’m doing incorrectly. Many thanks in advance!

OK, that won’t work that easily. Your destroyer is using a subsystem, AKA an entity that will be able to rotate, be animated and use weapons. It’s not a weapon.

What you want to do is to look for the .ship file from the battlecruiser and find the Ion Cannon turret it has mounted. Then, you look for the subsystem file associated to that turret. In that subsystem file, you will find the weapons used by the turret itself. Now you have two options:

  1. You want your standard destroyer turrets to use battlecruiser ion cannons, in which case you replace the weapon in the turret destroyer subsystem, without changing anything to the ship file of the destroyer.
  2. You want your destroyer to have battlecruiser ion cannon turrets, and you replace in the ship file of the destroyer the destroyer turret subsystems by battlecruiser ion cannon turret subsystems.

In case 1, you will have a standard looking destroyer that will fire ion beams from its guns while in case 2 you will have a different-looking destroyer, with heavier turrets mounted instead of the standard stuff.

Good luck, and be crazy! :slight_smile: (being crazy is useful to make awesome stuff, and drunk-coding can lead to huge mods - that’s what happened to me)

P.S.: in your shortcut, next to -overridebigfile, add -luatrace, it will allow you to get a lot of useful information in the HWRM.log file, itself in \Bin\Release\ when you crash your game (you will, a lot).

3 Likes

:joy:

1 Like

Seriously, that’s what happened. Discussing on a forum with friends, for some reason it went to Stargate and Star Wars when I was a bit drunk, so I plundered stuff from Warlords and Space Conflict to get them together in Mission 2 for some quick and easy screenshots. Ended up being reminded why I spent some time tinkering with the Wing Commander mod back in the time and I said “oh, why the fu** not, let’s port it to Remastered”.

At which point I knew pretty much nothing except how to edit text files to make an overridebigfile and had, well, everything to learn just as Remastered got released.

So, yeah, OP. Be crazy and you can do a lot of fun stuff. :slight_smile:

1 Like

Hey Rufus, thanks for your response! I “attempted” to follow your instructions, with mixed results:

[quote=“RufusShinraSB, post:2, topic:1553055”]

  1. You want your standard destroyer turrets to use battlecruiser ion cannons, in which case you replace the weapon in the turret destroyer subsystem, without changing anything to the ship file of the destroyer.
    [/quote] I tried something like this as follows:
  • Copied/pasted all three files ( i.e., the .events, .hod, and .subs files ) from the hgn_battlecruiserionbeamturret subsystem folder into the hgn_kineticburstcannondestroyer subsystem folder.

  • Renamed the three files appropriately ( e.g., hgn_kineticburstcannondestroyer.subs ). Made no changes to the destroyer’s ship file.

I ended up with a destroyer with improperly mounted ( and non-functional ) battlecruiser ion turrets. See attached .jpeg.

Next I tried replacing the destroyer turret subsystems in the destroyer’s ship file with the battlecruiser’s ion cannon subsystems, e.g.:

(NewShipType,"Weapon_TurretTop","Hardpoint_TurretBack","Weapon","Innate","Ship","Hgn_KineticBurstCannonDestroyer","","","","","","","","");
(NewShipType,"Weapon IonBeam 1","Hardpoint_IonBeam1","Weapon","Innate","Damageable","Hgn_BattleCruiserIonBeamTurret","","","","","","","","");

The game promptly crashed upon startup. So where am I going wrong? Ideally, I would like to replace the front and back turrets with the battlecruiser ion turrets, and leave the vanilla top and bottom kinetic burst turrets as they are. My intent is to simulate the original HM1 destroyer ( i.e., one with both kinetic and ion weaponry ).

I could be wrong, but at least the name of the hardpoint (aka “Hardpoint_TurretBack”) shouldn’t be changed, as it refers to a joint name into the destroyer hod file.

2 Likes

All right did some more experimenting, again with mixed results. I tried copying/pasting the hgn_battlecruiserturretedioncannon.wepn file into the hgn_kineticburstcannondestroyer weapon folder and renaming the file “hgn_kineticburstcannondestroyer.wepn”. No changes were made to the hgn_destroyer.ship file.

Noticed the following behaviors:

  • Vanilla destroyer turrets still used default burst cannon flash animation and fire sound, but no projectile was fired. See Image 1:

  • Every second shot the turrets fired ion beams, but the beams points of origin were off ( slightly in front of the muzzle ), and there was no firing sound associated with them. See Image 2:

In a vain attempt to address some of the aforementioned issues, I tried copying/pasting/renaming the hgn_battlecruiserionbeamturrent.events file into the hgn_kineticburstcannondestroyer subsystem folder. The game promptly crashed upon startup.

Oh boy, I did this some months ago…I’ll try to replicate it, and if successful, I will either post here or PM you with a checklist or something.

Yep, I had that same problem a while back, but it is fixable.

Okay, so what we have here is actually an incorrect .events file for the subsystem in play.

For now, restore your destroyer back to its original form, making sure all subsystem (turret) lines are repaired. I suggest just copying the original .ship file of the destroyer over your edited destroyer file.

Now, this may seem lengthy, but it is actually quite simple, and allows you to swap back to the original weapons through a simple edit to the .ship file.

Then, copy the original subsystem file for the destroyer into your mod susbsytem folder. It should be something like hgn_kineticburstcannondestroyer. Do the same for the weapon folder.

Now for the fun part. Pay close attention. (Basically add a ‘1’ to many locations so you can easily swap back and forth between the weapons)

  1. In the subsystem mod folder, rename
    hgn__kineticburstcannondestroyer to
    hgn__kineticburstcannondestroyer1

In the newly named subsytem folder, rename the files with the same name ending in .events, .hod, and .subs, such that a ‘1’ is after the destroyer bit.

Open the .subs file and notice the last line of the file. Add a 1 at the end of the destroyer bit again. This file tells the game which weapon file to use.

Now, to fix your turret effects issue, open the .events file, and paste this mess: (I’m having issues pasting this without it removing the indents and spacing. Can anyone help here? I’ll paste it anyway for now…)

[details=Copy into hgn_kineticburstcannondestroyer.events]effects =
{
animations =
{
animation1 =
{
name = “Weapon_TurretTop”,
length = 5,
loop = 0,
parent = “”,
minimum = 0,
maximum = 0,
markers = {""}
},
},
events =
{
event1 =
{
{ “anim”, “Weapon_TurretTop” },
{ “animtime”, “0” },
{ “marker”, “Weapon_TurretTop_Muzzle” },
{ “fx”, “ion_beam_charge_combo_bc” },
{ “sound”, “WEAPON/FRIGATE/FIRE/WEAPON_FRIGATE_ION_CANNON_BEAM” },
{ “fx_scale”, “2” },
{ “fx_nlips”, “on” },
},
event2 =
{
{ “anim”, “Weapon_TurretTop” },
{ “animtime”, “0.1” },
{ “marker”, “Weapon_TurretTopSlave_Muzzle” },
{ “fx”, “ion_beam_charge_combo_bc” },
{ “sound”, “WEAPON/FRIGATE/FIRE/WEAPON_FRIGATE_ION_CANNON_BEAM” },
{ “fx_scale”, “2” },
{ “fx_nlips”, “on” },
},
}
}[/details]

  1. In the weapon mod folder, rename
    hgn__kineticburstcannondestroyer to
    hgn__kineticburstcannondestroyer1

In the newly named destroyer weapon folder, rename the .wepn file such that a ‘1’ is after the destroyer bit.

Open the .wepn file, and paste this to get your ion:

[details=Copy into hgn_kineticburstcannondestroyer.wepn]StartWeaponConfig(NewWeaponType,“AnimatedTurret”,“InstantHit”,“IonBeam”,“Normal”,0,5300,0,5,2,0,20,0,1,7,0,0,1,1,29,29,0.1,“Normal”,1,0,1000);
AddWeaponResult(NewWeaponType,“Hit”,“DamageHealth”,“Target”,535,535,"");
setMagneticFieldPenetration(NewWeaponType,-900,{MagneticField,-900});
setPenetration(NewWeaponType,30,1,
{PlanetKillerArmour=0},
{SwarmerArmor=0.10},
{SpaceMineArmor=1},
{TorpedoArmor=0},
{HeavyMissileArmor=0},
{SmallMissileArmor=0},
{SubSystemArmour=0.3},
{Unarmoured=1.0},
{Unarmoured_hw1=1.0},
{LightArmour=0.30},
{LightArmour_hw1=0.30},
{MediumArmour=1.0*1.05},
{HeavyArmour=1.0},
{ResArmour=0.7},
{HeavyArmour=1.0});
setAccuracy(NewWeaponType,1,
{Swarmer=0.01},
{SpaceMine=0.01},
{Torpedo=0},
{HeavyMissile=0},
{SmallMissile=0},
{Fighter=0.04},
{Fighter_hw1=0.04},
{Corvette=0.09},
{Corvette_hw1=0.09},
{Frigate=1.0},
{SmallCapitalShip=1.0},
{BigCapitalShip=1.0},
{Resource=0.75},
{munition=0.01});
setAngles(NewWeaponType,0,-120,120,-2.5,60);
setMiscValues(NewWeaponType,2.5,0.5);
addAnimTurretSound(NewWeaponType,“Data:Sound/SFX/ETG/SPECIAL/SPECIAL_ABILITIES_TURRET_ON”);
setFireMultFactor(NewWeaponType, 1.0);[/details]

  1. Open your destroyer’s .ship file, and locate four lines that reference the default destroyer subsystem. Add a ‘1’ to this bit at in the lines involving the hardpoints:
    “Hardpoint_TurretTop”,“Weapon”,“Innate”,“Ship”,“Hgn_KineticBurstCannonDestroyer” to
    "Hardpoint_TurretTop",“Weapon”,“Innate”,“Ship”,“Hgn_KineticBurstCannonDestroyer1”

If you find crashes or issues, change these four values back to revert to the old destroyer weapons.

Then, test it out!

2 Likes

That would be much appreciated, thanks CryCoh.

I don’t know if the .events file will work without the spacing, so you might want to manually copy/paste the different lines in to make it work, and edit any number change such as the initial 'length = " in the beginning.

Again, sorry for the pasting issue, I guess I’m missing something for pasting. This is what I did almost to the letter.

Now, I do encourage you to check out this awesome fx tool, courtesy of the handiwork by @radar3301. I haven’t fiddled with it too much as I enjoy the manual editing, but it has some pretty cool features, and makes work easy.

And, just in case you want to edit the weapon stats, check this site. You can search through and find almost anything related to Homeworld editing. The related pages towards the bottom are very helpful, especially the function reference page.

4 Likes

Thanks for the detailed tutorial, CryCoh. Followed your instructions to the letter, but unfortunately the game promptly crashes upon startup. I’ve included a link the error log text file that was generated, perhaps you can make sense of it?

We need HwRm.log. The ErrorLog.txt file is of no use.

Also, that link is no good (it takes me to my home page).

Video of working example (8 minutes, from 6:00 to 6:14, the screen goes black; the game is just loading):

I realize it’s a bit fast and there isn’t any audio or instructions, but that’s the great thing about videos, you can pause them and rewind! (lol)

There’s a few extra things in there (like me having to kill the Steam Updater, and some other stuff I’m working on), but it even shows you the creation of a new ship (and adding it to my full-fleet starting fleet I already had set up).


With the ship patching, you can change the Y-offset of the hardpoints so that the turrets aren’t floating above the ship, but I don’t know how to do that. Someone else can help here!

1 Like

Hmm, I’ll look through and see if there is something I missed. PM me if you want, and I can add you on steam and make a simple mod with it enabled just so you can see what was missed.

@radar3301, do you have a preferred link? Also, I see that you reuse battle cruisers, while my method integrates a new weapon effect and type for the new ship. @lazarusmage, either one of these would work, really (though the bc turrets just look hilarious on a destroyer).

Also, the dropbox link isn’t loading for me, I don’t think I have a drop box account.

What do you mean?

Coming right up!

I took this to mean the link to the fx tool was no good.

A side thought, has there been or is there modding tutorials from the basics to the complexities for Hw since the most recent patch? I think some nice community-made guides with pictures would suite many players from now until the end of Homeworld. Something like How To’s of extracting big files, subsystem editing, weapon editing, custom effects, custom ship stats, ui editing, race research and build edits, etc. I know there are posts and link for these things, but when I first started it was hard to locate a central place for all beginner’s resources, so I imagine it could be just as difficult now (though I might be wrong here)

No, he posted https://www.dropbox.com/home?preview=12-30-2016_14_27_56_ErrorLog.txt as the link. dropbox.com/home takes you to your personal home page.


Most recent FX tool is this post.

Ah, thanks. I updated the other link to match.

I found a good link. Turns out someone had an idea a while ago to help me out without realizing it. Though, I don’t know how applicable these are right now.

Modding Tutorials Master Thread

The ship patching tutorial is relevant to this topic.

1 Like