PDA

View Full Version : Subsystem Weapons Creation Tutorial



ajlsunrise
17th Apr 09, 6:02 PM
Subsystem Creation Tutorial
Table Of Contents
Quick Introduction
Tools Needed
Part One: Extracting from Homeworld2.big
Part Two: Decompiling the files
Part Three: Creating the Subsystem
Part Four: Removing the turrets from the Destroyer
Part Five: Creating the Subsystem Scripts
Part Six: Adding the turret subsystems to the Destroyer
Part Seven: Making the Destroyer able to build the turret subsystems
Part Eight: Adding the Destroyer to the Starting Fleets for testing purposes
Part Nine: Testing (Phase One)
Part Ten: Fixing the Build Problem
Part Eleven: Testing (Phase Two)
Credits

--------

Quick Introduction
In response to a certain person's asking me how to create subsystems, I've made this (little) tutorial.

If this is helpful, let me know.
If it isn't, chew me out.
If you don't know, find out!
If you don't care, why are you even reading this topic???

Good luck, and have fun!!

In this tutorial,we will be making the Hiigaran's Destroyer Turrets into a subsystem.

Note: For ease of writing and reading, you will see "[data]". This is the location of the Homeworld2 Data folder.
Simply replace "[data]" with wherever you installed Homeworld2. (i.e. "[data]" becomes "C:\Sierra\Homeworld2\Data")

--------

Tools needed
Homeworld2 (duh!)
Any .BIG file extractor (I used Spooky's HW2ICArchive.exe)
LuaDC or CFLuaDC (used to decompile the files; I used LuaDC)
Text-Editing Program (I use Notepad++. Google it. It's AWESOME!)
CFHodEd (I used version 3.2.4, 3.1.5 will work too...)

This tutorial assumes you have all of these programs already installed.

--------

Part One: Extracting from Homeworld2.big

Start the .BIG file extractor.
Click on the button with the Homeworld Logo (either one).
Goto where you installed Homeworld2. For me, it's "C:\Sierra\Homeworld2".
Open the folder labeled "Data".
Double-click on "Homeworld2.big".
Wait while it loads. Occupy your time by singing the alphabet at the top of your voice.
"A B C D E F G, H I J K L-M-N-O-P, Q R S, T U V, W X, Y and Z. Now I've sung my A B C's. Next time please just sing with me!"
Now that it is finished loading and you have just made a fool of yourself, click on the plus-sign "[+]" beside the entry labeled "ship".
Find the entry labeled "hgn_destroyer" and click the "[+]" beside it.
Click on "hgn_destroyer.events". Click the button with the picture of just one diskette.
Click on "hgn_destroyer.hod". Click the button with the picture of just one diskette.
Click on "hgn_destroyer.ship". Click the button with the picture of just one diskette.
Find "[-] ship" and click on the "[-]".
Find "[+] subsystem" and click on the "[+]".
Find the entry labeled "hgn_battlecruiserionbeamturret" and click the "[+]" beside it.
Click on "hgn_battlecruiserionbeamturret.subs". Click the button with the picture of just one diskette.
Find "[-] subsystem" and click on the "[-]".
Find "[+] scripts" and click on the "[+]".
Find "[+] building and research" and click on the "[+]".
Find "[+] hiigaran" and click on the "[+]".
Click on "build.lua". Click the button with the picture of just one diskette.
Find "[-] building and research" and click on the "[-]".
Find "[+] startingfleets" and click on the "[+]".
Click on "hiigaran00.lua". Click the button with the picture of just one diskette.
Close the .BIG file extractor.


--------

Part Two: Decompiling the files.

Open Windows Explorer.
Goto where you installed Homeworld2. For me it's "C:\Sierra\Homeworld2\".
Open the "data" folder.
Inside, you should see another "data" folder. Open it.
Inside that folder you should see a "ship" folder and a "subsystem" folder. Select them. Press Ctrl+C.
Go back to "C:\Sierra\Homeworld2\data\". Press Ctrl+V.
Select the "ship" folder that you just copy-pasted. Open it.
Inside that folder you should see a "hgn_destroyer" folder. Open it.
Inside that folder you should see three files: "hgn_destroyer.events", "hgn_destroyer.hod", and "hgn_destroyer.ship".
Try double-clicking on one of them. Windows does not know what to do with these files, so choose "Select the program from a list" and click "OK".
http://ajlsunrise33.webs.com/err-hgn_destroyer-ship.jpg
Select Notepad or another text-editor.
What is all that nonsense????? We can't read that or do anything with it!!! Give up now!!! (Or read on if you must know how to overcome this problem.)
Close the text-editor.
Open the Start Menu. Goto Programs->Accessories. Click on "Command Prompt".
Type in where you installed LuaDC or CFLuaDC. For me, it's "C:\HW2 Toolbox\Lua\". Press enter.
Type in "LuaDC [data]\ship\hgn_destroyer\hgn_destroyer.events". Press Enter.
Type in "LuaDC [data]\ship\hgn_destroyer\hgn_destroyer.ship". Press Enter.
Type in "LuaDC [data]\subsystem\hgn_battlecruiserionbeamturret\hgn_battlecruiserionbeamturret.subs". Press Enter.
Type in "LuaDC [data]\scripts\building and research\hiigaran\build.lua". Press Enter.
Type in "LuaDC [data]\scripts\startingfleets\hiigaran00.lua". Press Enter.
Close the Command Prompt.
Go back to "[data]\ship\hgn_destroyer\". You should now see five files all starting with "hgn_destroyer". The endings should read ".events", ".events.LuaDC", ".hod", ".ship", and ".ship.LuaDC".
Note: If you used CFLuaDC the file endings will read "_DC.events" and "_DC.ship".
Delete ".events" and ".ship". We don't need them anymore.
Rename ".events.LuaDC" to ".events". Rename ".ship.LuaDC" to ".ship".
Try re-opening them. You should be able to read it now. But what do we do with it??? Patience, young one. We'll get to that soon.


--------

Part Three: Creating the Subsystem

Goto "[data]\ship\hgn_destroyer\".
Select "hgn_destroyer.events" and "hgn_destroyer.hod".
Press Ctrl+C.
Goto "[data]\subsystem\".
Rename the folder "hgn_battlecruiserionbeamturret" to "hgn_destroyerkineticburstcannonturret". Open it. Press Ctrl+V.
Delete "hgn_battlecruiserionbeamturret.subs".
Rename "hgn_battlecruiserionbeamturret.subs.LuaDC" to "hgn_destroyerkineticburstcannonturret.subs".
Rename "hgn_destroyer.events" to "hgn_destroyerkineticburstcannonturret.events".
Rename "hgn_destroyer.hod" to "hgn_destroyerkineticburstcannonturret.hod".
Start CFHodEd. Open "[data]\subsystem\hgn_destroyerkineticburstcannonturret\hgn_destroyerkineticburstcannonturret.hod".
Click on the "Geometry" tab.
Click on the list entry labeled "Root_mesh". Click the "Remove" button.
Repeat this for each entry EXCEPT the ones that start with "Weapon_TurretTop".
You should have three entries left: "Weapon_TurretTopSlave_Muzzle_mesh", "Weapon_TurretTop_Muzzle_mesh", and "Weapon_TurretTop_Position_mesh".
Click on the "Materials" tab.
Click on the list entry labeled "LOD2_TEX". Click the "Remove" button.
Repeat this for each entry EXCEPT "Hgn_Turret".
Click on the "Textures" tab.
Remove all but the first two entries.
Click on the "CM" tab.
Remove the only entry.
Click on the "Engine Glows" tab.
Remove all the entries.
Click on the "NavLights" tab.
Remove all the entries.
Click on the "Markers" tab.
Remove all the entries.
Click on the "Boundary Vertices" tab.
Click "Auto-Calculate".
Click on the "Hierarchy" tab.
Click on "Weapon_Torpedo_Position".
Click Remove.
Repeat this for each entry EXCEPT "Root" and the ones that start with "Weapon_TurretTop".
Click on "Weapon_TurretTop_Position".
You will see a bunch of textboxes to the right of the list. (Inside the Black Circle in the below Image).
Inside the Red Circle in the image below, there are three textboxes. Change the values in these to "0".
Repeat for "Weapon_TurretTopSlave_Position".
http://ajlsunrise33.webs.com/cfhoded.JPG
Click the "File" menu.
Click Save.


--------

Part Four: Removing the turrets from the Destroyer

(Somehow, this section got deleted... I'll fix it soon, but at the moment, I don't have the time...)

--------

Part Five: Creating the Subsystem Scripts

Open "[data]\ship\hgn_destroyer.ship". Find the line that says
StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretTop", "Weapon_TurretTop")The first set of quotes is the name of the weapon.
The second set is where the weapon is located.
The third set is the firing animation (if any).
For more information, click here (http://hw2wiki.net/wiki/index.php?title=FunctionStartShipWeaponConfig).
Keep this file open.
Open "[data]\subsystem\hgn_destroyerkineticburstcannonturret\hgn_destroyerkineticburstcannonturret.subs".
Find the lines:
NewSubSystemType.displayedName = "$2026"
NewSubSystemType.sobDescription = "$2027"What's that "$2026" and "$2027" supposed to mean???
Well, it tells the game to look up a string in a table somewhere. Obviously, since we're creating a new subsystem the game doesn't already know about, we need to change this. (Unless you REALLY want to think it's an Ion Cannon, build it, and be disappointed when it's not an Ion Cannon).
Change it to:
NewSubSystemType.displayedName = "Kinetic Burst Cannon"
NewSubSystemType.sobDescription = "Kinetic Burst Cannon"
Find this line:
NewSubSystemType.typeString = "BCIonBeamTurret"Obviously, this subsystem isn't an IonBeamTurret anymore, so change it to "DesKBCTurret" (DestroyerKineticBurstCannonTurret).
Scroll to the very bottom and you'll see this line:
StartSubSystemWeaponConfig(NewSubSystemType, "Hgn_BattleCruiserTurretedIonCannon", "Weapon_IonCan1", "Weapon_IonCan1")Hey! This looks a little familiar! It looks almost like the line in "hgn_destroyer.ship"! Only it says "SubSystem" instead of "Ship"!
Change the values inside the quotes to match the ones in "[data]\ship\hgn_destroyer.ship".
It should look like this:
StartSubSystemWeaponConfig(NewSubSystemType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretTop", "Weapon_TurretTop")Save and close.
Open "hgn_destroyerkineticburstcannonturret.events".
Look through the file to gain an idea of the structure before going on to the next step.
Replace the text in the file with the following block of code:

effects =
{
animations =
{
animation1 =
{
name = "Weapon_TurretTop",
length = 1.2,
loop = 0,
parent = "",
minimum = 0,
maximum = 0,
markers =
{ "", },
},
},
events =
{
event1 =
{
{ "anim", "Weapon_TurretTop", },
{ "animtime", "0", },
{ "marker", "Weapon_TurretTop_Muzzle", },
{ "fx", "muzzle_flash_combo_small_capital", },
{ "sound", "WEAPON/CARRIER/FIRE/WEAPON_DESTROYER_CANNON_SHELL", },
{ "fx_scale", "2", },
{ "fx_nlips", "on", },
},
event2 =
{
{ "anim", "Weapon_TurretTop", },
{ "animtime", "0.3", },
{ "marker", "Weapon_TurretTopSlave_Muzzle", },
{ "fx", "muzzle_flash_combo_small_capital", },
{ "sound", "WEAPON/CARRIER/FIRE/WEAPON_DESTROYER_CANNON_SHELL", },
{ "fx_scale", "2", },
{ "fx_nlips", "on", },
},
},
}
Save and close.


--------

Part Six: Adding the turret subsystems to the Destroyer


Goto "[data]\ship\hgn_destroyer\hgn_destroyer.ship".
Find the lines:
LoadModel(NewShipType, 1)
StartShipWeaponConfig(NewShipType, "Hgn_DestroyerTorpedoLauncher", "Weapon_Torpedo", "Weapon_Torpedo")
StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretTop", "Weapon_TurretTop")
StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretBottom", "Weapon_TurretBottom")
StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretFront", "Weapon_TurretFront")
StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretBack", "Weapon_TurretBack")
addShield(NewShipType, "EMP", 1000, 20)
StartShipHardPointConfig(NewShipType, "Engine", "Hardpoint_Engine", "System", "Innate", "Damageable", "Hgn_Des_Engine", "", "", "", "", "", "", "", "")

Comment out the 2nd, 3rd, 4th, and 5th "StartShipWeaponConfig" lines.
LoadModel(NewShipType, 1)
StartShipWeaponConfig(NewShipType, "Hgn_DestroyerTorpedoLauncher", "Weapon_Torpedo", "Weapon_Torpedo")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretTop", "Weapon_TurretTop")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretBottom", "Weapon_TurretBottom")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretFront", "Weapon_TurretFront")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretBack", "Weapon_TurretBack")
addShield(NewShipType, "EMP", 1000, 20)
StartShipHardPointConfig(NewShipType, "Engine", "Hardpoint_Engine", "System", "Innate", "Damageable", "Hgn_Des_Engine", "", "", "", "", "", "", "", "")
Move the "addShield" line to after the "StartShipHardPointConfig" line.
Add an empty line before and after the first "StartShipWeaponConfig" line.
Add three empty lines before and one empty lines after the "StartShipHardPointConfig" line.
It should now look like this:
LoadModel(NewShipType, 1)

StartShipWeaponConfig(NewShipType, "Hgn_DestroyerTorpedoLauncher", "Weapon_Torpedo", "Weapon_Torpedo")

--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretTop", "Weapon_TurretTop")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretBottom", "Weapon_TurretBottom")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretFront", "Weapon_TurretFront")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretBack", "Weapon_TurretBack")



StartShipHardPointConfig(NewShipType, "Engine", "Hardpoint_Engine", "System", "Innate", "Damageable", "Hgn_Des_Engine", "", "", "", "", "", "", "", "")

addShield(NewShipType, "EMP", 1000, 20)
Copy and paste the following line into the middle of the three empty lines:
StartShipHardPointConfig(NewShipType, "Weapon1", "Weapon_TurretTop", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")
Paste the line three more times.
Now look at the second set of quotes in those lines.
We don't really want four turrets all in the same spot...
So, look at the lines we commented out.
They have "Weapon_TurretTop", "Weapon_TurretBottom", etc...
So change these ones to match.
Note: If you followed Part Four, Step 6 (about feeling confident), click on the spoiler: Remember that you renamed the hardpoints to "Hardpoint_Weapon..." and that "Weapon_Turret..." no longer exists? Fix accordingly.
Change the first set of quotes in these lines to "Weapon1", "Weapon2", etc...
It should now look like this:
LoadModel(NewShipType, 1)

StartShipWeaponConfig(NewShipType, "Hgn_DestroyerTorpedoLauncher", "Weapon_Torpedo", "Weapon_Torpedo")

--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretTop", "Weapon_TurretTop")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretBottom", "Weapon_TurretBottom")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretFront", "Weapon_TurretFront")
--StartShipWeaponConfig(NewShipType, "Hgn_KineticBurstCannonDestroyer", "Weapon_TurretBack", "Weapon_TurretBack")

StartShipHardPointConfig(NewShipType, "Weapon1", "Weapon_TurretTop", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon2", "Weapon_TurretBottom", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon3", "Weapon_TurretFront", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon4", "Weapon_TurretBack", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")

StartShipHardPointConfig(NewShipType, "Engine", "Hardpoint_Engine", "System", "Innate", "Damageable", "Hgn_Des_Engine", "", "", "", "", "", "", "", "")

addShield(NewShipType, "EMP", 1000, 20)
If all checks out OK, save the file and close!


--------

Part Seven: Making the Destroyer able to build the turret subsystems


Goto "[data]\scripts\building and research\hiigaran\build.lua". Open it.
It should look something like this:
Ship = 0
SubSystem = 1
build =
{
{
Type = SubSystem,
ThingToBuild = "Hgn_C_Production_Fighter",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "$7000",
Description = "$7001", },
{
Type = SubSystem,
ThingToBuild = "Hgn_MS_Production_Fighter",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "$7000",
Description = "$7001", },
...
...
...
Copy the enlarged text and paste it again.
Change: "Hgn_C_Production_Fighter" to "hgn_destroyerkineticburstcannonturret".
Change: "$7000" to "Destroyer Turret".
Change: "$7001" to "Kinetic Cannon Turret".
It should now look similar to this:
Ship = 0
SubSystem = 1
build =
{
{
Type = SubSystem,
ThingToBuild = "hgn_destroyerkineticburstcannonturret",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "Destroyer Turret",
Description = "Kinetic Cannon Turret", },
{
Type = SubSystem,
ThingToBuild = "Hgn_C_Production_Fighter",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "$7000",
Description = "$7001", },
{
Type = SubSystem,
ThingToBuild = "Hgn_MS_Production_Fighter",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "$7000",
Description = "$7001", },
...
...
...
Save and close.


--------

Part Eight: Adding the Destroyer to the Starting Fleets for testing purposes


Goto "[data]\scripts\startingfleets\".
Delete "hiigaran00.lua".
Rename "hiigaran00.lua.LuaDC" to "hiigaran00.lua". Open it.
It will look like this:
PersistantData =
{
StrikeGroups = {},
Squadrons =
{
{
type = "Hgn_MotherShip",
subsystems = {},
shiphold = {},
name = "",
size = 1, },
{
type = "Hgn_ResourceCollector",
subsystems = {},
shiphold = {},
name = "",
size = 1,
number = 6, },
{
type = "Hgn_Carrier",
subsystems = {},
shiphold = {},
name = "",
size = 1,
number = 1, },
},
Research = {}, }
Copy the enlarged text and paste it again.
Change "Hgn_ResourceCollector" to "Hgn_Destroyer".
Change "number = 6" to "number = #", where # is the number of ships you want. (I used 3) Just remember that ALL Hiigaran computer players will start with these as well.
The file should now look like this:
PersistantData =
{
StrikeGroups = {},
Squadrons =
{
{
type = "Hgn_MotherShip",
subsystems = {},
shiphold = {},
name = "",
size = 1, },
{
type = "Hgn_ResourceCollector",
subsystems = {},
shiphold = {},
name = "",
size = 1,
number = 6, },
{
type = "Hgn_Destroyer",
subsystems = {},
shiphold = {},
name = "",
size = 1,
number = 3, },
{
type = "Hgn_Carrier",
subsystems = {},
shiphold = {},
name = "",
size = 1,
number = 1, },
},
Research = {}, }
Save and close.


--------

Part Nine: Testing (Phase One)


Find your Homeworld 2 Shortcut.
Select it and copy-paste it.
Right-click on the new shortcut and select Properties.
In the box next to the Target label add "-overrideBigFile" to the end. (without quotes).
Click "OK".
Rename the shortcut to "Homeworld 2 - overrideBigFile".
Double-click on the shortcut.
Start a Player vs CPU game.
Click on the Destroyer. Build the Turrets.
Now you're probably saying something along the lines of: "What!!?? I can only click on one of them!!?? WHY!!!!????"
That's okay. We'll fix that. Exit out of Homeworld 2.


--------

Part Ten: Fixing the Build Problem


Goto "[data]\subsystem\".
Copy the "hgn_destroyerkineticburstcannonturret" folder. Paste it three times.
Rename them to "hgn_destroyerkineticburstcannonturret#", where # is 0, 1, 2, or 3.
Open each folder and rename the files inside to match the folder name, making sure to keep the extensions intact.
Goto "[data]\scripts\building and research\hiigaran\". Open "build.lua".
Copy and paste the "hgn_destroyerkineticburstcannonturret" section three times and add 0, 1, 2, or 3 to the end of "hgn_destroyerkineticburstcannonturret".
Change the DisplayPriority for each to a different number than each other.
It should look like this:
Ship = 0
SubSystem = 1
build =
{
{
Type = SubSystem,
ThingToBuild = "hgn_destroyerkineticburstcannonturret0",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "Destroyer Turret",
Description = "Kinetic Cannon Turret", },
{
Type = SubSystem,
ThingToBuild = "hgn_destroyerkineticburstcannonturret1",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 1,
DisplayedName = "Destroyer Turret",
Description = "Kinetic Cannon Turret", },
{
Type = SubSystem,
ThingToBuild = "hgn_destroyerkineticburstcannonturret2",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 2,
DisplayedName = "Destroyer Turret",
Description = "Kinetic Cannon Turret", },
{
Type = SubSystem,
ThingToBuild = "hgn_destroyerkineticburstcannonturret3",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 3,
DisplayedName = "Destroyer Turret",
Description = "Kinetic Cannon Turret", },
{
Type = SubSystem,
ThingToBuild = "Hgn_C_Production_Fighter",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "$7000",
Description = "$7001", },
...
...
...
Save and close.
Goto "[data]\ship\hgn_destroyer\". Open "hgn_destroyer.ship".
Find:
StartShipHardPointConfig(NewShipType, "Weapon1", "Weapon_TurretTop", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon2", "Weapon_TurretBottom", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon3", "Weapon_TurretFront", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon4", "Weapon_TurretBack", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret", "", "", "", "", "", "", "")
Add 0, 1, 2, or 3 to the end of "hgn_destroyerkineticburstcannonturret". It should now look like this:
StartShipHardPointConfig(NewShipType, "Weapon1", "Weapon_TurretTop", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret0", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon2", "Weapon_TurretBottom", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret1", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon3", "Weapon_TurretFront", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret2", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon4", "Weapon_TurretBack", "Weapon", "Generic", "Destroyable", "", "hgn_destroyerkineticburstcannonturret3", "", "", "", "", "", "", "")
Save and close.


--------

Part Eleven: Testing (Phase Two)


Double-click your "Homeworld 2 - overrideBigFile" shortcut.
Start a Player vs CPU game.
Click on the Destroyer. Build the Turrets.
Yay! You've done it!
But.. You'll notice the AI/Computer players won't build the turrets. Enabling them to do so is another tutorial. Oh, well... At least you now know how to add buildable subsystems (I hope).


--------

Credits:
Bentusi_Core, for inspiring me to write the tutorial.
Zatch, for all of his moderating help.
Phatboygeo, for reminding Zatch to apply a thick layer of glue to this thread.
Everyone else, who created the tools I use to mod the Homeworld series.
And all the other giants on whose shoulders I stand.
And last, but very far from being least, RELIC for creating such amazing games.

Riess
5th May 09, 2:57 PM
You can delete your own posts, you know.

Phatboygeo
6th May 09, 6:22 AM
It doesnt work on my PC, it comes up and says error blah blah blah and firefox shuts down, i have to do it at school

crazyhumanpeopl
24th May 09, 12:20 PM
Umm, I meant to put yes.

ajlsunrise
30th May 09, 9:26 PM
:bump:

TUTORIAL COMPLETED!!!!!!

Phatboygeo
31st May 09, 3:52 PM
:idea: STICKY!!!! :idea:

Zatch
10th Jun 09, 2:57 PM
*applies a thick layer of glue*

Great job ajlsunrise :)

ajlsunrise
10th Jun 09, 4:38 PM
gee, thanks. i'm almost speechless. :p

*mmmm... glue...*

Phatboygeo
11th Jun 09, 4:12 AM
Yes, ajl, I reminded Zatch. (Thank you PhatBoyGeo)

Eagle1_Division
12th Jun 09, 5:32 PM
This is extremely helpfull, I believe sticky is fully deserved. I got working buildable/destroyable turrets! Btw; You forgot to mention adding the ability for the ship to make things, and ATM if I build one turret all the others grey out... I'll poke at the coding for the battlecruiser, for that though.

ajlsunrise
12th Jun 09, 6:12 PM
@Eagle1_Division: read part 10.

EDIT:
heh. after re-reading through this, I saw that I forgot a couple of things... Hmmm... Now to fix it.

Eagle1_Division
12th Jun 09, 6:22 PM
That's the odd thing, I did everything exactly the same, except in the build.lua I changed the name to each one such as Top mount: Kinetic Turret, Bottom mount: Kinetic Turret, etc. I really doubt that'd do anything, though...

By all data it shouldn't grey out like this.

ajlsunrise
12th Jun 09, 7:11 PM
send it over (if you don't mind), lemme see if i can figure something out with it.
*PMs email address*

ajlsunrise
13th Jun 09, 12:37 AM
Somehow, the "Part Four: Removing the turrets from the Destroyer" section got deleted... I'll fix it soon, but at the moment, I don't have the time...

Phatboygeo
13th Jun 09, 9:22 AM
(hint)ajl: thank you phatboy, for reminding zatch to sticky this thread
me:No probs

ajlsunrise
13th Jun 09, 6:41 PM
is someone fishing for a thank-you?? *Stares intently at phatboygeo*
*innocently:* you didn't notice the mention in the credits section???

*AHEM*

THANK YOU PHATBOYGEO for reminding Zatch to apply a thick layer of glue to this thread.

Phatboygeo
14th Jun 09, 4:55 AM
Sorry
I dont read credits, especially off films

roflaherty
9th Nov 09, 11:49 AM
CAN SOMEBODY FINISH PART 4!!!!

Phatboygeo
9th Nov 09, 12:03 PM
Go into cf hod ed and delete the turrets....

roflaherty
10th Nov 09, 2:59 PM
Sorry, ive got it working! Just figured it out!

Aerolight
22nd Apr 10, 9:38 PM
I tried to follow this guide with my custom-made capital ship. Trying to equipped it with Sajuuk's phased (heavy) cannon as a weapon turret subsystem. But the game crash and I got the following error: Got any solution?

Homeworld2.exe caused an Access Violation in module Homeworld2.exe at 001b:0047baca.
Error occurred at 4/22/2010 23:29:06.
Homeworld2.exe, run by Huan Cao.
Microsoft Windows XP?.
2 processor(s), type 586.
2047 MBytes physical memory.
Read from location 00000010 caused an access violation.

MiniDump saved to file 'F:\Homeworld2\Bin\Release\4-22-2010_23_29_06_MiniDump.dmp'

Registers:
EAX=00000000 CS=001b EIP=0047baca EFLGS=00010293
EBX=04f90258 SS=0023 ESP=0012c7d4 EBP=0012ca0c
ECX=04050f40 DS=0023 ESI=04f8ffa0 FS=003b
EDX=00000001 ES=0023 EDI=04f904d0 GS=0000
Bytes at CS:EIP:
8b 40 10 51 50 57 ff 75 e8 e8 68 f7 ff ff 8b 4d

Call Stack:
0x0047BACA: GSLobbySessionDesc::operator= ()
0x003E46B5: lua_error ()
0x003E4749: lua_error ()

0x003E4751: lua_error ()
0x003E47EE: lua_error ()
0x003E481E: lua_call ()
0x003E4A13: lua_dobuffer ()
0x0046CB81: GSLobbySessionDesc::operator= ()
0x0048D1BF: GSLobbySessionDesc::operator= ()
0x0048D3FA: GSLobbySessionDesc::operator= ()
0x004316A1: GSLobbySessionDesc::operator= ()
0x00541B86: GSTracker::operator= ()
0x005424C6: GSTracker::operator= ()
0x00578204: getLibraryID ()
0x00579086: getLibraryID ()
0x0059865E: getLibraryID ()
0x00599CDD: getLibraryID ()
0x004952A1: GSLobbySessionDesc::operator= ()
0x00490C11: GSLobbySessionDesc::operator= ()

0x004911D2: GSLobbySessionDesc::operator= ()


Stack dump:



Module list: names, addresses, sizes, time stamps and file times:
F:\Homeworld2\Bin\Release\Memory.dll, loaded at 0x00330000 - 33280 bytes - 3fe0ce01 - file date is 12/17/2003 13:43:30
F:\Homeworld2\Bin\Release\Platform.dll, loaded at 0x00340000 - 98304 bytes - 3fe0ce5f - file date is 12/17/2003 13:45:04
C:\WINDOWS\system32\Normaliz.dll , loaded at 0x00360000 - 23552 bytes - 44a3ec46 - file date is 1/7/2009 19:20:36
F:\Homeworld2\Bin\Release\Debug.dll, loaded at 0x00370000 - 10752 bytes - 3fe0cdfd - file date is 12/17/2003 13:43:26
F:\Homeworld2\Bin\Release\Localizer.dll, loaded at 0x00380000 - 94208 bytes - 3fe0ce59 - file date is 12/17/2003 13:44:58
F:\Homeworld2\Bin\Release\FileIO.dll, loaded at 0x003a0000 - 155648 bytes - 3fe0ce52 - file date is 12/17/2003 13:44:50
F:\Homeworld2\Bin\Release\ZLib.dll , loaded at 0x003d0000 - 49152 bytes - 3fe0ce3b - file date is 12/17/2003 13:44:28
F:\Homeworld2\Bin\Release\lua.dll , loaded at 0x003e0000 - 73728 bytes - 3fe0ce66 - file date is 12/17/2003 13:45:12
F:\Homeworld2\Bin\Release\Homeworld2.exe, loaded at 0x00400000 - 5562368 bytes - 527a5220 - file date is 12/23/2003 20:21:42
F:\Homeworld2\Bin\Release\luaconfig.dll, loaded at 0x00970000 - 57344 bytes - 3fe0ce6b - file date is 12/17/2003 13:45:16
F:\Homeworld2\Bin\Release\divxmedialib.dll, loaded at 0x00980000 - 86016 bytes - 3f3bc007 - file date is 8/14/2003 18:08:56
F:\Homeworld2\Bin\Release\DivxDecoder.dll, loaded at 0x009a0000 - 397312 bytes - 3f3bc002 - file date is 8/14/2003 18:08:56
F:\Homeworld2\Bin\Release\FileParser.dll, loaded at 0x00a10000 - 86016 bytes - 3f3bc005 - file date is 8/14/2003 18:08:56
F:\Homeworld2\Bin\Release\util.dll , loaded at 0x00a30000 - 36864 bytes - 3fe0ce7e - file date is 12/17/2003 13:45:34
F:\Homeworld2\Bin\Release\hw2box.dll, loaded at 0x00a40000 - 9728 bytes - 3fe0ce78 - file date is 12/17/2003 13:45:28
F:\Homeworld2\Bin\Release\objects.dll, loaded at 0x00a50000 - 1093632 bytes - 3fe0cfaa - file date is 12/17/2003 13:50:36
F:\Homeworld2\Bin\Release\console.dll, loaded at 0x00c00000 - 5632 bytes - 3fe0cf2d - file date is 12/17/2003 13:48:30
C:\WINDOWS\system32\xpsp2res.dll , loaded at 0x020b0000 - 2897920 bytes - 4802454c - file date is 4/13/2008 12:39:24
F:\Homeworld2\Bin\Release\GL.dll , loaded at 0x02990000 - 294912 bytes - 3fe0cfbd - file date is 12/17/2003 13:50:54
F:\HOMEWO~2\Bin\Release\seFDAudio.dll, loaded at 0x03840000 - 40960 bytes - 3fe0cee8 - file date is 12/17/2003 13:47:20
F:\Homeworld2\Bin\Release\gslobby.dll, loaded at 0x10000000 - 135168 bytes - 3fe0cf28 - file date is 12/17/2003 13:48:24
C:\WINDOWS\system32\urlmon.dll , loaded at 0x1a400000 - 1206784 bytes - 49b3ad4e - file date is 3/8/2009 05:34:56
C:\WINDOWS\system32\dxdiagn.dll , loaded at 0x4f680000 - 2113536 bytes - 4802a0b6 - file date is 4/13/2008 19:11:52
C:\WINDOWS\system32\dbghelp.dll , loaded at 0x59a60000 - 640000 bytes - 4802a0b2 - file date is 4/13/2008 19:11:52
C:\WINDOWS\system32\uxtheme.dll , loaded at 0x5ad70000 - 218624 bytes - 4802a11e - file date is 4/13/2008 19:12:08
C:\WINDOWS\system32\NETAPI32.dll , loaded at 0x5b860000 - 337408 bytes - 48f61b90 - file date is 10/15/2008 11:34:24
C:\WINDOWS\system32\comctl32.dll , loaded at 0x5d090000 - 617472 bytes - 4802a0c8 - file date is 4/13/2008 19:11:52
C:\WINDOWS\system32\iertutil.dll , loaded at 0x5dca0000 - 1985024 bytes - 49b3acb8 - file date is 3/8/2009 05:32:22
C:\WINDOWS\system32\opengl32.dll , loaded at 0x5ed00000 - 713728 bytes - 4802a11a - file date is 4/13/2008 19:12:02
C:\WINDOWS\system32\LPK.DLL , loaded at 0x629c0000 - 22016 bytes - 4802a0e5 - file date is 4/13/2008 19:11:56
C:\WINDOWS\system32\WININET.dll , loaded at 0x63000000 - 914944 bytes - 49b3ad54 - file date is 3/8/2009 05:34:58
C:\WINDOWS\system32\GLU32.dll , loaded at 0x68b20000 - 122880 bytes - 4802a0be - file date is 4/13/2008 19:11:54
C:\WINDOWS\system32\nvoglnt.dll , loaded at 0x69500000 - 8769536 bytes - 481c0173 - file date is 5/2/2008 23:46:00
C:\WINDOWS\system32\WS2HELP.dll , loaded at 0x71aa0000 - 19968 bytes - 4802a164 - file date is 4/13/2008 19:12:10
C:\WINDOWS\system32\WS2_32.dll , loaded at 0x71ab0000 - 82432 bytes - 4802a163 - file date is 4/13/2008 19:12:10
C:\WINDOWS\system32\WSOCK32.dll , loaded at 0x71ad0000 - 22528 bytes - 4802a170 - file date is 4/13/2008 19:12:10
C:\WINDOWS\system32\msacm32.drv , loaded at 0x72d10000 - 20480 bytes - 3b7dfe2a - file date is 8/3/2004 20:07:00
C:\WINDOWS\system32\wdmaud.drv , loaded at 0x72d20000 - 23552 bytes - 4802a12c - file date is 4/13/2008 19:12:46
C:\WINDOWS\system32\DDRAW.dll , loaded at 0x73760000 - 279552 bytes - 4802a0b8 - file date is 4/13/2008 19:11:52
C:\WINDOWS\system32\DCIMAN32.dll , loaded at 0x73bc0000 - 8704 bytes - 4802a0b7 - file date is 4/13/2008 19:11:52
C:\WINDOWS\system32\KsUser.dll , loaded at 0x73ee0000 - 4096 bytes - 4802a0d6 - file date is 4/13/2008 18:11:56
C:\WINDOWS\system32\dsound.dll , loaded at 0x73f10000 - 367616 bytes - 4802a0f6 - file date is 4/13/2008 19:11:52
C:\WINDOWS\system32\MSCTF.dll , loaded at 0x74720000 - 297984 bytes - 4802a12c - file date is 4/13/2008 19:11:58
C:\WINDOWS\system32\USP10.dll , loaded at 0x74d90000 - 406016 bytes - 4802a11d - file date is 4/13/2008 19:12:08
C:\WINDOWS\system32\wbem\wbemsvc.dll, loaded at 0x74ed0000 - 43520 bytes - 4802a129 - file date is 4/13/2008 19:12:08
C:\WINDOWS\system32\wbem\wbemprox.dll, loaded at 0x74ef0000 - 18944 bytes - 4802a128 - file date is 4/13/2008 19:12:08
C:\WINDOWS\system32\wbem\wbemcomn.dll, loaded at 0x75290000 - 214528 bytes - 4802a122 - file date is 4/13/2008 19:12:08
C:\WINDOWS\system32\msctfime.ime , loaded at 0x755c0000 - 177152 bytes - 4802a12d - file date is 4/13/2008 19:10:06
C:\WINDOWS\system32\wbem\fastprox.dll, loaded at 0x75690000 - 472064 bytes - 4802a0ba - file date is 4/13/2008 19:11:54
C:\WINDOWS\system32\MSVCP60.dll , loaded at 0x76080000 - 413696 bytes - 4802a187 - file date is 4/13/2008 19:12:02
C:\WINDOWS\system32\IMM32.DLL , loaded at 0x76390000 - 110080 bytes - 4802a0e7 - file date is 4/13/2008 19:11:54
C:\WINDOWS\system32\NTDSAPI.dll , loaded at 0x767a0000 - 67072 bytes - 4802a117 - file date is 4/13/2008 19:12:02
C:\WINDOWS\system32\winmm.dll , loaded at 0x76b40000 - 176128 bytes - 4802a13c - file date is 4/13/2008 19:12:10
C:\WINDOWS\system32\WINTRUST.dll , loaded at 0x76c30000 - 176640 bytes - 4802a12a - file date is 4/13/2008 19:12:10
C:\WINDOWS\system32\imagehlp.dll , loaded at 0x76c90000 - 144384 bytes - 4802a0d8 - file date is 4/13/2008 19:11:54
C:\WINDOWS\system32\DNSAPI.dll , loaded at 0x76f20000 - 147968 bytes - 485bed11 - file date is 6/20/2008 12:46:58
C:\WINDOWS\system32\WLDAP32.dll , loaded at 0x76f60000 - 172032 bytes - 4802a12e - file date is 4/13/2008 19:12:10
C:\WINDOWS\system32\CLBCATQ.DLL , loaded at 0x76fd0000 - 498688 bytes - 4802a0b9 - file date is 4/13/2008 19:11:50
C:\WINDOWS\system32\COMRes.dll , loaded at 0x77050000 - 792064 bytes - 4802a0ce - file date is 4/13/2008 19:11:52
C:\WINDOWS\system32\oleaut32.dll , loaded at 0x77120000 - 551936 bytes - 4802a112 - file date is 4/13/2008 19:12:02
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll, loaded at 0x773d0000 - 1054208 bytes - 4802a094 - file date is 4/13/2008 19:12:52
C:\WINDOWS\system32\ole32.dll , loaded at 0x774e0000 - 1287168 bytes - 4802a111 - file date is 4/13/2008 19:12:02
C:\WINDOWS\system32\CRYPT32.dll , loaded at 0x77a80000 - 599040 bytes - 4802a0d7 - file date is 4/13/2008 19:11:52
C:\WINDOWS\system32\MSASN1.dll , loaded at 0x77b20000 - 57344 bytes - 4802a126 - file date is 4/13/2008 19:11:58
C:\WINDOWS\system32\midimap.dll , loaded at 0x77bd0000 - 18944 bytes - 4802a0ec - file date is 4/13/2008 19:11:58
C:\WINDOWS\system32\MSACM32.dll , loaded at 0x77be0000 - 71680 bytes - 4802a117 - file date is 4/13/2008 19:11:58
C:\WINDOWS\system32\version.dll , loaded at 0x77c00000 - 18944 bytes - 4802a11d - file date is 4/13/2008 19:12:08
C:\WINDOWS\system32\msvcrt.dll , loaded at 0x77c10000 - 343040 bytes - 4802a188 - file date is 4/13/2008 19:12:02
C:\WINDOWS\system32\ADVAPI32.dll , loaded at 0x77dd0000 - 617472 bytes - 4802a0b2 - file date is 4/13/2008 19:11:48
C:\WINDOWS\system32\RPCRT4.dll , loaded at 0x77e70000 - 584704 bytes - 4802a106 - file date is 4/13/2008 19:12:04
C:\WINDOWS\system32\GDI32.dll , loaded at 0x77f10000 - 285184 bytes - 4802a0be - file date is 4/13/2008 19:11:54
C:\WINDOWS\system32\SHLWAPI.dll , loaded at 0x77f60000 - 474112 bytes - 4802a116 - file date is 4/13/2008 19:12:06
C:\WINDOWS\system32\Secur32.dll , loaded at 0x77fe0000 - 56320 bytes - 4802a11b - file date is 4/13/2008 19:12:06
F:\Homeworld2\Bin\Release\MSVCR70.dll, loaded at 0x7c000000 - 344064 bytes - 3c36e574 - file date is 8/14/2003 18:08:58
C:\WINDOWS\system32\kernel32.dll , loaded at 0x7c800000 - 989696 bytes - 4802a12c - file date is 4/13/2008 19:11:56
C:\WINDOWS\system32\ntdll.dll , loaded at 0x7c900000 - 706048 bytes - 4802a12c - file date is 4/13/2008 19:11:24
C:\WINDOWS\system32\SHELL32.dll , loaded at 0x7c9c0000 - 8461312 bytes - 4802a111 - file date is 4/13/2008 19:12:06
C:\WINDOWS\system32\USER32.dll , loaded at 0x7e410000 - 578560 bytes - 4802a11b - file date is 4/13/2008 19:12:08

MatthCoFreak
23rd Apr 10, 12:10 AM
Minidump is useless. Add -luatrace to your shortcut and show us the hw2.log

Aerolight
23rd Apr 10, 12:21 AM
Here is my hw2.log: (the game crash during the loading screen in multiplayer skirmish)

Fri Apr 23 00:39:02 2010
Loaded Archive: 'Homeworld2.big'
UTIL -- filepath failure, path doesn't exists 'F:\HOMEWO~2\data\locale\english'
Loaded Archive: 'english.big'
Uing ..profiles\ for profiles folder
GAME -- Using player profile Aerolight
Changing from a 32 bit colour depth in winNT (5.1 build 2600), Service Pack 3
Using NVIDIA Corporation's 2.1.2 GeForce 8600 GT/PCI/SSE2 renderer (Suspected driver is nvoglnt.dll 6.14.11.7516)
Loaded Archive: 'englishSpeech.big'
Loaded Archive: 'Music.big'
SOUND -- created destination [ fdaudio ], handle [ 4 ] with [ 48 ] channels created
SOUND -- created destination [ fda streamer ], handle [ 5 ] with [ 8 ] channels created
Build name: The Dust Wars - AutoBuild3569 - Ordered by smmatte
Built by : mrbuild
Data path : F:\HOMEWO~2\data
Resetting fp control word.
CmdLine: -overrideBigFile -luatrace
Starting Level: data:LevelData\Multiplayer\Deathmatch\2P_HOSTILITIES_END.LEVEL

MatthCoFreak
23rd Apr 10, 12:38 AM
Hum, no visible error. Sounds like a hod-related crash to me. Try to check if there are any error in the hod of your subsystem, and if everything points to a existing hardpoint (ie if in the .ship the StartShipHardPointConfig and in the .subs if the StartSubSystemWeaponConfig are correctly set and points to existing hardpoints).

And also, Sajuuk's cannon is a fixed weapon, so be advised that your turret will only fire straight forward.

TON_Viper
23rd Apr 10, 6:11 AM
I think it would be a good idea to add a link to the new Decompiled data folder download thread in this tutorial:
http://forums.relicnews.com/showthread.php?t=245398

That way you can skip decompiling it all over again.

Aerolight
23rd Apr 10, 9:01 AM
I think there are multiple errors somewhere, but do not know exactly (in detail) where and what. Here are the following files below being displayed:

Here is my hardpoint in the CFhodEd for my custom ship:
http://img708.imageshack.us/img708/812/myshiphodhardpointsincf.jpg (http://img708.imageshack.us/i/myshiphodhardpointsincf.jpg/)

Here is my aera_superdreadnaughtcannonturret.subs file:

NewSubSystemType = StartSubSystemConfig()
NewSubSystemType.displayedName = "Phased Beam Cannon"
NewSubSystemType.sobDescription = "Phased Beam Cannon"
NewSubSystemType.tacticalIcon = "hexagon"
NewSubSystemType.tacticalIconMinSize = 0.0035
NewSubSystemType.tacticalIconMinFadeSize = 0.0045
NewSubSystemType.tacticalIconMaxFadeSize = 0.008
NewSubSystemType.groupMergeSize = 0.001
NewSubSystemType.mouseOverMinFadeSize = 0.045
NewSubSystemType.mouseOverMaxFadeSize = 0.1
NewSubSystemType.maxhealth = 35000
NewSubSystemType.regentime = 250
NewSubSystemType.nlips = 0
NewSubSystemType.nlipsRange = 0
NewSubSystemType.nlipsFar = 0
NewSubSystemType.nlipsFarRange = 0
NewSubSystemType.meshRenderLimit = 0.004
NewSubSystemType.minimumZoomFactor = 0.68
NewSubSystemType.selectionLimit = 5000
NewSubSystemType.preciseATILimit = 5000
NewSubSystemType.selectionPriority = 37.5
NewSubSystemType.type = "Weapon"
NewSubSystemType.typeString = "BCIonBeamTurret"
NewSubSystemType.collateralDamage = 100
NewSubSystemType.inactiveTimeAfterDamage = 90
NewSubSystemType.activateHealthPercentage = 0.1
NewSubSystemType.costToBuild = 500
NewSubSystemType.timeToBuild = 35
NewSubSystemType.isResearch = 0
NewSubSystemType.visible = 1
LoadHODFile(NewSubSystemType, 1)
NewSubSystemType.BuildFamily = "SubSystem_Hgn"
NewSubSystemType.AttackFamily = "SubSystem"
NewSubSystemType.DockFamily = "CantDock"
NewSubSystemType.DisplayFamily = "SubSystemModule"
NewSubSystemType.ArmourFamily = "SubSystemArmour"
StartSubSystemWeaponConfig(NewSubSystemType, "Hgn_Aerasuperdreadnaughtcannon", "Weapon_TurretTop", "Weapon_TurretTop")

Here is my aera_superdreadnaughtcannonturret.events file:

effects =
{
animations =
{
animation1 =
{
name = "Weapon_TurretTop",
length = 6,
loop = 0,
parent = "",
minimum = 0,
maximum = 0,
markers =
{ "", }, },
},
events =
{
event1 =
{
{ "anim", "Weapon_TurretTop", },
{ "animtime", "0", },
{ "marker", "Weapon_TurretTop_Muzzle", },
{ "fx", "super_beam_lensflare", },
{ "fx_scale", "0.6", },
{ "gameEv", "playBgLightAnim,super_beam_background_ring", },
},
event2 =
{
{ "anim", "Weapon_TurretTop", },
{ "animtime", "0.93", },
{ "marker", "Weapon_TurretTopSlave_Muzzle", },
{ "fx", "super_beam_lensflare", },
{ "fx_scale", "0.6", },
},
},
}

Here is my aera_superdreadnaught.ship file:

NewShipType = StartShipConfig()
NewShipType.displayedName = "Aera Megalith Superdreadnaught"
NewShipType.sobDescription = "A mammoth Progenitor warship capable of immense wrath."
NewShipType.maxhealth = 3000000
NewShipType.regentime = 300
NewShipType.minRegenTime = 300
NewShipType.sideArmourDamage = 1
NewShipType.rearArmourDamage = 1
NewShipType.isTransferable = 0
NewShipType.useEngagementRanges = 0
NewShipType.unitCapsNumber = 1
NewShipType.paradeData = "hgn_carrier_parade"
NewShipType.SquadronSize = 1
NewShipType.passiveFormation = "Spear"
NewShipType.defensiveFormation = "Delta"
NewShipType.aggressiveFormation = "Claw"
NewShipType.mass = 5000
NewShipType.collisionMultiplier = 1
NewShipType.thrusterMaxSpeed = 120
NewShipType.mainEngineMaxSpeed = 120
NewShipType.rotationMaxSpeed = 20
NewShipType.thrusterAccelTime = 2
NewShipType.thrusterBrakeTime = 1
NewShipType.mainEngineAccelTime = 2
NewShipType.mainEngineBrakeTime = 1
NewShipType.rotationAccelTime = 1
NewShipType.rotationBrakeTime = 0.2
NewShipType.thrusterUsage = 1
NewShipType.accelerationAngle = 20
NewShipType.mirrorAngle = 0
NewShipType.secondaryTurnAngle = 0
NewShipType.maxBankingAmount = 5
NewShipType.descendPitch = 5
NewShipType.goalReachEpsilon = 25
NewShipType.slideMoveRange = 100
NewShipType.controllerType = "Ship"
NewShipType.tumbleStaticX = 0
NewShipType.tumbleStaticY = 0
NewShipType.tumbleStaticZ = 0
NewShipType.tumbleDynamicX = 0
NewShipType.tumbleDynamicY = 0
NewShipType.tumbleDynamicZ = 0
NewShipType.tumbleSpecialDynamicX = 0
NewShipType.tumbleSpecialDynamicY = 0
NewShipType.tumbleSpecialDynamicZ = 0
NewShipType.relativeMoveFactor = 1
NewShipType.useTargetRandom = 1
NewShipType.targetRandomPointXMin = -0.7
NewShipType.targetRandomPointXMax = 0.7
NewShipType.targetRandomPointYMin = -0.4
NewShipType.targetRandomPointYMax = 0.4
NewShipType.targetRandomPointZMin = -0.9
NewShipType.targetRandomPointZMax = 0.8
NewShipType.dustCloudDamageTime = 0
NewShipType.nebulaDamageTime = 0
addAbility(NewShipType, "CanDock", 1, 0)
NewShipType.MinimalFamilyToFindPathAround = "MotherShip"
NewShipType.BuildFamily = "Shipyard_Hgn"
NewShipType.AttackFamily = "BigCapitalShip"
NewShipType.DockFamily = "Shipyard"
NewShipType.AvoidanceFamily = "SuperCap"
NewShipType.DisplayFamily = "Capital"
NewShipType.AutoFormationFamily = "SuperCap"
NewShipType.CollisionFamily = "Big"
NewShipType.ArmourFamily = "HeavyArmour"
NewShipType.UnitCapsFamily = "Capital"
NewShipType.fighterValue = 0
NewShipType.corvetteValue = 0
NewShipType.frigateValue = 0
NewShipType.neutralValue = 0
NewShipType.antiFighterValue = 0
NewShipType.antiCorvetteValue = 0
NewShipType.antiFrigateValue = 0
NewShipType.totalValue = 0
NewShipType.buildCost = 100
NewShipType.buildTime = 5
NewShipType.buildPriorityOrder = 100
NewShipType.retaliationRange = 9000
NewShipType.retaliationDistanceFromGoal = 1000
NewShipType.visualRange = 4000
NewShipType.prmSensorRange = 9000
NewShipType.secSensorRange = 12000
NewShipType.detectionStrength = 1
NewShipType.TOScale = 1
NewShipType.TODistanceFade0 = 14439.382317879
NewShipType.TODistanceDisappear0 = 14266.1179698217
NewShipType.TODistanceFade1 = 5250
NewShipType.TODistanceDisappear1 = 5000
NewShipType.TODistanceFade2 = 35108.024691358
NewShipType.TODistanceDisappear2 = 38802.469135802
NewShipType.TOGroupScale = 1
NewShipType.TOGroupMergeSize = 0
NewShipType.healthBarStyle = 2
NewShipType.nlips = 0
NewShipType.nlipsRange = 85000
NewShipType.nlipsFar = 0
NewShipType.nlipsFarRange = 95000
NewShipType.SMRepresentation = "Mesh"
NewShipType.alwaysInRenderList = 1
NewShipType.meshRenderLimit = 5000000
NewShipType.dotRenderLimit = 10
NewShipType.visibleInSecondary = 1
NewShipType.minLOD = 1
NewShipType.goblinsStartFade = 13000
NewShipType.goblinsOff = 13000
NewShipType.upLOD = 16000
NewShipType.downLOD = 20015
NewShipType.minimumZoomFactor = 0.35
NewShipType.preciseATILimit = 7176.37507192516
NewShipType.selectionPriority = 65
NewShipType.militaryUnit = 0
NewShipType.alternativeHyperspaceV = "hyperspace_gate_kpr"
NewShipType.alternativeHyperspaceA = "etg/special/SPECIAL_ABILITIES_HYPERSPACE_IN"
NewShipType.alternativeHyperspaceTime = 12.5
NewShipType.ignoreRaceWhenDocking = 1
addAbility(NewShipType, "MoveCommand", 1, 0)
addAbility(NewShipType, "CanDock", 1, 0)
addAbility(NewShipType, "CanLaunch")
NewShipType.launchTimeBetweenTwoFormations = 1
NewShipType.launchTimeBeforeStart = 2
NewShipType.launchNrOfShipsInDockFormation = 1
NewShipType.launchFormation = "delta"
addAbility(NewShipType, "ShipHold", 1, 150, 20, "rallypoint", "", 150,
{
SuperCap = "1000",
},
{
Frigate = "800",
},
{
Frigate = "800",
},
{
Frigate = "800", })
addAbility(NewShipType, "ParadeCommand", 1)
addAbility(NewShipType, "WaypointMove")
addAbility(NewShipType, "HyperSpaceCommand", 1, 2, 100, 400, 5, 5)
addAbility(NewShipType, "CanBuildShips", 1, "SubSystem_Hgn", "SubSystemModule")
addAbility(NewShipType, "HyperspaceViaGateCommand", 1, 3, 1, 0.3)
addAbility(NewShipType, "CanBeRepaired")
LoadModel(NewShipType, 1)
StartShipHardPointConfig(NewShipType, "Weapon1", "Hardpoint_TurretTop", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret", "", "", "", "", "", "", "", "")
NewShipType.sobDieTime = 45
NewShipType.sobSpecialDieTime = 1
NewShipType.specialDeathSpeed = 40
NewShipType.chanceOfSpecialDeath = 0
NewShipType.deadSobFadeTime = 0
NewShipType.trailLinger = 3
setEngineBurn(NewShipType, 9, 0.2, 0.5, 300, 1.02, 0.1, 0.25, 380)
setEngineGlow(NewShipType, 1, 1, 1.01, 15, 325, 50, 1.75, { 1, 0.47, 0, 0.2, })
loadShipPatchList(NewShipType, "data:sound/sfx/ship/misc/", 0, "Engines/AerasuperdreadnaughtEng", "")
loadShipPatchList(NewShipType, "data:sound/sfx/ship/misc/", 1, "Ambience/AerasuperdreadnaughtAmb", "")

Here is my hgn_aerasuperdreadnaughtcannon.wepn file:

StartWeaponConfig(NewWeaponType, "AnimatedTurret", "InstantHit", "Super_BeamSaj", "Normal", 0, 20000, 0, 8, 4, 0, 30, 0, 1, 15, 0, 0, 0, 0, 0, 0, 0.1, "Bypass", 1, 0, 1000000)
AddWeaponResult(NewWeaponType, "Hit", "DamageHealth", "Target", 75000, 75000, "")
AddWeaponResult(NewWeaponType, "Hit", "Push", "Target", -1000, -1000, "")
setPenetration(NewWeaponType, 100, 1)
setAccuracy(NewWeaponType, 1, {Fighter = 0}, {Corvette = 0}, {munition = 0})
setAngles(NewWeaponType, 5, 0, 0, 0, 0)

MatthCoFreak
23rd Apr 10, 9:13 AM
StartSubSystemWeaponConfig(NewSubSystemType, "Hgn_Aerasuperdreadnaughtcannon", "Weapon_TurretTop", "Weapon_TurretTop")
Should be Hardpoint_TurretTop given that it's the name of your hardpoint in your hod.

Aerolight
23rd Apr 10, 9:26 AM
Done. But the game still crashes the same way, unfortunately.

MatthCoFreak
23rd Apr 10, 10:06 AM
Hum no wait, the hod is that of your ship right ? not that of your subsystem ?
Then the thing in bold in my previous post should be the name of the hardpoint in the hod of your subsystem.

To better narrow the problem, I suggest you try to replace your subsystem with hgn_battlecruiserturretedioncannon and see if it works. If it works, then revert back to your new subsystem but replace your weapon with any vanilla weapon, and so on. Try to eliminate potential causes.

Aerolight
23rd Apr 10, 11:25 AM
For examples of subsystem turret hod files, do I look up the hgn_battlecruiser ion turrent hod file?
I think I remember seeing that example turret folder in the Data/ship folder instead of the Data/subsystem folder.

MatthCoFreak
23rd Apr 10, 12:48 PM
the one in the /ship folder is a shit they forgot to remove before packing the game up. You can look at hgn_battlecruiserionbeamturret and hgn_battlecruiserkineticburstcannon. Event if the latter isn't used ingame, it works perfectly.

Aerolight
23rd Apr 10, 11:59 PM
Ok, i got in the game, got the turret built, but the custom weapon subsystem turret doesn't fire at all when i tell the ship to attack....

http://img72.imageshack.us/img72/9925/ss00002.jpg (http://img72.imageshack.us/i/ss00002.jpg/)

MatthCoFreak
24th Apr 10, 12:13 AM
And also, Sajuuk's cannon is a fixed weapon, so be advised that your turret will only fire straight forward.
So I suggest you have a look at the setAngles part of your .wepn. Karos (http://hw2wiki.net/wiki.hw2.info/FunctionsetAngles.html) will help you :)

Aerolight
24th Apr 10, 1:02 AM
Ok, I found that:
#1. having zero target tracking speed in the wepn file
#2. having very low or zero allowable angle of rotation for the turret in the wepn file
causes my turret not to fire, which seems logical. Here is the successful firing below: (By the way, is the yellow beam animation of the turret firing enabled by the events file of the subsystem or something else? I was wondering about that.)

http://img153.imageshack.us/img153/1572/ss00004.jpg (http://img153.imageshack.us/i/ss00004.jpg/)

MatthCoFreak
24th Apr 10, 1:58 AM
(By the way, is the yellow beam animation of the turret firing enabled by the events file of the subsystem or something else? I was wondering about that.)
Yes, try to have a look at Sajuuk's or the Dreadnaught's events.

Aerolight
25th Apr 10, 7:30 PM
Ok, is there a quick way/shortcut to adjust the scale size of the subsystem turret besides manually scaling it in CFhodEd?

MatthCoFreak
25th Apr 10, 10:59 PM
No, but scaling a hod in CFHodEd is a 5 sec job, go in Tools > Scale Hod

Aerolight
26th Apr 10, 1:12 AM
I followed part 10 very closely but I still could not build more than 1 turret even though I can select any of the multiple turrets. I already added the following line in my ship file:
addAbility(NewShipType, "CanBuildShips", 1, "SubSystem_Hgn", "SubSystemModule")
Am I really missing something?

MatthCoFreak
26th Apr 10, 2:31 AM
Make sure you have as many subsystem hardpoints as required, and a StartShipHardPointConfig line for each of those hardpoints.

Also, if all your turrets are supposed to be the same subsystem, you're gonna have a problem because the way the building interface is made in HW2 makes that you can't build more than one of each subsystem on a ship - try to build two identical subsystems on any vanilla ship, even if you have empty subsystem slots remaining, and you'll get what I mean. Basically, you need to duplicate your turrets in the /subsystem folder, with different names.

Aerolight
26th Apr 10, 12:55 PM
Aaaarrrrggghhhh, I did all that, but still could not build more than 1 turret (build 1 then all the others grey out). Maybe you can help spot something.

Here is my build.lua:

Ship = 0
SubSystem = 1
build =
{
{
Type = SubSystem,
ThingToBuild = "hgn_aerasuperdreadnaughtcannonturret0",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "Phased Cannon Turret [Top-Rear]",
Description = "Dual heavy beam turret.", },
{
Type = SubSystem,
ThingToBuild = "hgn_aerasuperdreadnaughtcannonturret1",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 1,
DisplayedName = "Phased Cannon Turret [Top-Middle]",
Description = "Dual heavy beam turret.", },
{
Type = SubSystem,
ThingToBuild = "Hgn_C_Production_Fighter",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 0,
DisplayedName = "$7000",
Description = "$7001", },...

Here is the section of my ship file:

addAbility(NewShipType, "CanBuildShips", 1, "SubSystem_Hgn", "SubSystemModule")
addAbility(NewShipType, "HyperspaceViaGateCommand", 1, 3, 1, 0.3)
addAbility(NewShipType, "CanBeRepaired")
LoadModel(NewShipType, 1)
StartShipHardPointConfig(NewShipType, "Weapon1", "Hardpoint_TurretTop1", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret0", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon2", "Hardpoint_TurretTop2", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret1", "", "", "", "", "", "", "")

Here is the section of hgn_aerasuperdreadnaughtcannonturret0.subs file:

NewSubSystemType.costToBuild = 100
NewSubSystemType.timeToBuild = 2
NewSubSystemType.isResearch = 0
NewSubSystemType.visible = 1
LoadHODFile(NewSubSystemType, 1)
NewSubSystemType.BuildFamily = "SubSystem_Hgn"
NewSubSystemType.AttackFamily = "SubSystem"
NewSubSystemType.DockFamily = "CantDock"
NewSubSystemType.DisplayFamily = "SubSystemModule"
NewSubSystemType.ArmourFamily = "SubSystemArmour"
StartSubSystemWeaponConfig(NewSubSystemType, "Hgn_AerasuperdreadnaughtCannon", "Weapon_TopPhasedBeamTurret0", "Weapon_TopPhasedBeamTurret0")

Here is the section of hgn_aerasuperdreadnaughtcannonturret1.subs file:

NewSubSystemType.costToBuild = 100
NewSubSystemType.timeToBuild = 2
NewSubSystemType.isResearch = 0
NewSubSystemType.visible = 1
LoadHODFile(NewSubSystemType, 1)
NewSubSystemType.BuildFamily = "SubSystem_Hgn"
NewSubSystemType.AttackFamily = "SubSystem"
NewSubSystemType.DockFamily = "CantDock"
NewSubSystemType.DisplayFamily = "SubSystemModule"
NewSubSystemType.ArmourFamily = "SubSystemArmour"
StartSubSystemWeaponConfig(NewSubSystemType, "Hgn_AerasuperdreadnaughtCannon", "Weapon_TopPhasedBeamTurret1", "Weapon_TopPhasedBeamTurret1")

MatthCoFreak
26th Apr 10, 11:51 PM
Don't have a clue on this one, it should work with what you have. I'm going to run a few tests on my end to see what could go wrong.

Anyone else have an idea ?

mololu
27th Apr 10, 12:01 AM
I would say this is causing the problem:



StartShipHardPointConfig(NewShipType, "Weapon1", "Hardpoint_TurretTop1", "Weapon", "Innate", ...


I don't think working with 'innate' is designed to allow buildable subsystems. You'd have to look up what the correct line is.

Apart from that, I really don't know what's causing the problem.

MatthCoFreak
27th Apr 10, 12:07 AM
The possible values here are Innate, Generic and Sensors. Try Generic.

Aerolight
27th Apr 10, 12:29 PM
Ok, when I changed from "Innate" to "Generic", the problem still remains.
But when I shift "hgn_aerasuperdreadnaughtcannonturret0" to the left a little bit where the resultant lines like the one below:

StartShipHardPointConfig(NewShipType, "Weapon1", "Hardpoint_TurretTop1", "Weapon", "Generic", "Damageable", "hgn_aerasuperdreadnaughtcannonturret0", "", "", "", "", "", "", "", "")

the result is, for some reason, that all the turrets are already built as my gigantic custom ship hyperspace in when built.

mololu
27th Apr 10, 12:32 PM
That would be that the first slot sets the subsystem that should come on the ship when it is built.

Aerolight
27th Apr 10, 12:35 PM
Yea, but if I leave the first slot blank like: "",
then, the problem comes back where I cannot build more than 1 subsytem turret.

Aerolight
2nd May 10, 8:02 PM
Any good solutions anyone?

KeyBored
3rd May 10, 8:12 AM
Change this:


StartShipHardPointConfig(NewShipType, "Weapon1", "Hardpoint_TurretTop1", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret0", "", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon2", "Hardpoint_TurretTop2", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret1", "", "", "", "", "", "", "")

To this

StartShipHardPointConfig(NewShipType, "Weapon1", "Hardpoint_TurretTop1", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1", "", "", "", "", "", "")
StartShipHardPointConfig(NewShipType, "Weapon2", "Hardpoint_TurretTop2", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret0", "", "", "", "", "", "")

What it means, is weapon 1 can be turret 0 OR 1 and weapon 2 can be Turret 1 OR 0, thus removing your problem, hopefully, dont quote me on that :P

Aerolight
3rd May 10, 8:37 PM
To this
Code:

StartShipHardPointConfig(NewShipType, "Weapon1", "Hardpoint_TurretTop1", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1", "", "", "", "", "", "") StartShipHardPointConfig(NewShipType, "Weapon2", "Hardpoint_TurretTop2", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret0", "", "", "", "", "", "")

What it means, is weapon 1 can be turret 0 OR 1 and weapon 2 can be Turret 1 OR 0, thus removing your problem, hopefully, dont quote me on that :P
Sorry to quote you KeyBored =D, but.......
What if I have like 5 or 10 turrets to build, which in my case with be 14+ autoguns and 17+ heavy beam turrets for my big custom progenitor ship? lol =D

KeyBored
4th May 10, 7:40 AM
Just do it lots


StartShipHardPointConfig(NewShipType, "Weapon", "Hardpoint_TurretTop", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret2", "hgn_aerasuperdreadnaughtcannonturret3", "hgn_aerasuperdreadnaughtcannonturret4", "hgn_aerasuperdreadnaughtcannonturret5", "hgn_aerasuperdreadnaughtcannonturret6", "hgn_aerasuperdreadnaughtcannonturret7")
StartShipHardPointConfig(NewShipType, "Weapon1", "Hardpoint_TurretTop1", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret7", "hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret2", "hgn_aerasuperdreadnaughtcannonturret3", "hgn_aerasuperdreadnaughtcannonturret4", "hgn_aerasuperdreadnaughtcannonturret5", "hgn_aerasuperdreadnaughtcannonturret6")
StartShipHardPointConfig(NewShipType, "Weapon2", "Hardpoint_TurretTop2", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret6", "hgn_aerasuperdreadnaughtcannonturret7", "hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret2", "hgn_aerasuperdreadnaughtcannonturret3", "hgn_aerasuperdreadnaughtcannonturret4", "hgn_aerasuperdreadnaughtcannonturret5")
StartShipHardPointConfig(NewShipType, "Weapon3", "Hardpoint_TurretTop3", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret5", "hgn_aerasuperdreadnaughtcannonturret6", "hgn_aerasuperdreadnaughtcannonturret7", "hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret2", "hgn_aerasuperdreadnaughtcannonturret3", "hgn_aerasuperdreadnaughtcannonturret4")
StartShipHardPointConfig(NewShipType, "Weapon4", "Hardpoint_TurretTop4", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret4", "hgn_aerasuperdreadnaughtcannonturret5", "hgn_aerasuperdreadnaughtcannonturret6", "hgn_aerasuperdreadnaughtcannonturret7", "hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret2", "hgn_aerasuperdreadnaughtcannonturret3")
StartShipHardPointConfig(NewShipType, "Weapon5", "Hardpoint_TurretTop5", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret3", "hgn_aerasuperdreadnaughtcannonturret4", "hgn_aerasuperdreadnaughtcannonturret5", "hgn_aerasuperdreadnaughtcannonturret6", "hgn_aerasuperdreadnaughtcannonturret7", "hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret2")
StartShipHardPointConfig(NewShipType, "Weapon6", "Hardpoint_TurretTop6", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret2", "hgn_aerasuperdreadnaughtcannonturret3", "hgn_aerasuperdreadnaughtcannonturret4", "hgn_aerasuperdreadnaughtcannonturret5", "hgn_aerasuperdreadnaughtcannonturret6", "hgn_aerasuperdreadnaughtcannonturret7", "hgn_aerasuperdreadnaughtcannonturret0", "hgn_aerasuperdreadnaughtcannonturret1")
StartShipHardPointConfig(NewShipType, "Weapon7", "Hardpoint_TurretTop7", "Weapon", "Innate", "Damageable", "","hgn_aerasuperdreadnaughtcannonturret1", "hgn_aerasuperdreadnaughtcannonturret2", "hgn_aerasuperdreadnaughtcannonturret3", "hgn_aerasuperdreadnaughtcannonturret4", "hgn_aerasuperdreadnaughtcannonturret5", "hgn_aerasuperdreadnaughtcannonturret6", "hgn_aerasuperdreadnaughtcannonturret7", "hgn_aerasuperdreadnaughtcannonturret0")

if you have more than 8, just add more quotations, and remeber you need the same lines as number of turrets

Did it work though?

namboy1989
13th May 10, 9:34 AM
I follow all the tutorial, it is ok to build turrets. But when my ship engage enemy, the turret does not turn around or shot, it just stays there, silent like a stone :o. What should I do ?

MatthCoFreak
13th May 10, 9:38 AM
Turrets are very special case. I should do a tutorial about it (there are so many things I should do a tutorial about >.>)

KeyBored
13th May 10, 10:37 AM
Matth, wanna join forces on that one?

MatthCoFreak
13th May 10, 10:48 AM
Don't know, I don't feel like doing it any time soon. Go ahead if you feel like.

mololu
13th May 10, 11:23 AM
Turrets are a little wonky. The thing is they require:

A type weapon hardpointon the host ship

A corresponding type string in the subsystem ("BCIonBeamTurret" seems to work fine)

(Obvious) A weapon of the type AnimatedTurret on the subsystem

There may be more to it but copying the hiigy BC turret and working from there seems to work quite fine.

MatthCoFreak
13th May 10, 11:30 AM
A corresponding type string in the subsystem ("BCIonBeamTurret" seems to work fine)
I'm not sure about this one.


There may be more to it but copying the hiigy BC turret and working from there seems to work quite fine.
You'd rather want to start from hgn_battlecruiserkineticburstcannon if you want barreled turrets.

mololu
13th May 10, 11:33 AM
Or that.

I'm not 100% sure about the type string either but I've had some trouble when I didn't have that one for some reason, though this may have been related to something else.

CNR4806
22nd May 10, 6:35 AM
For some odd reasons, the additional weapon subsystems that I intended to make buildable on capital ships' generic/production slots simply doesn't work. The build options keep going grey when one of them are built.

Part of my HBC's .ship file:

...
StartShipHardPointConfig(NewShipType, "Generic 1", "HardpointGeneric1", "System", "Generic", "Destroyable", "", "Hgn_C_Module_Hyperspace", "Hgn_C_Module_CloakGenerator", "Hgn_C_Module_HyperspaceInhibitor", "Hgn_C_Module_FireControl", "hgn_pulsarturret1", "hgn_pulsarturret2", "", "")
StartShipHardPointConfig(NewShipType, "Generic 2", "HardpointGeneric2", "System", "Generic", "Destroyable", "", "Hgn_C_Module_Hyperspace", "Hgn_C_Module_CloakGenerator", "Hgn_C_Module_HyperspaceInhibitor", "Hgn_C_Module_FireControl", "hgn_pulsarturret2", "hgn_pulsarturret1", "", "")
...

Part of my hiigarian/build.lua: (11 identical turrets in total since my initial estimation for the turret-mounting capability of a HSY is 11)

...
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret1",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 200,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret2",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 201,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret3",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 202,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret4",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 203,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret5",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 204,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret6",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 205,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret7",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 206,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret8",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 207,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret9",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 208,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret10",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 209,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
{
Type = SubSystem,
ThingToBuild = "hgn_pulsarturret11",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 210,
DisplayedName = "Pulsar Turret",
Description = "Turreted Hiigarian rapid-firing pulsar", },
...

hgn_pulsarturret#.subs is not shown as it doesn't really matter AFAIK...

TON_Viper
22nd May 10, 8:57 AM
there are so many things I should do a tutorial about

That reminds me that I should really make a list of the things I've been intending to make tutorials about.

I have a bad habit of forgetting these things if I don't get around to them right away. :(

Griffen
19th Jun 10, 5:08 AM
wheres part 4 of this tutorial?

ajlsunrise
19th Jun 10, 8:18 AM
hiding

actually somehow it got deleted between me copying from notepad and pasting it here... and notepad doesn't have that part either...

Griffen
20th Jun 10, 4:21 AM
ok can you somehow remeber wht to do and paste it in there?

MatthCoFreak
20th Jun 10, 4:30 AM
I wish I could to that. Remembering, and bam, Ctrl+V, pasted it :p

ajlsunrise
20th Jun 10, 9:19 PM
I'll get on it ASAP.

Griffen
21st Jun 10, 7:18 AM
thanks :)

Terry3030
7th Jul 10, 2:03 AM
I seen some people have problems with building more than one subsystem.
ex: after changing the starting ion cannons on the hgn-battlecruiser to ion cannons you have to build. in testing, one ion is built, then the other grays out.

I think I found the problem.
look for this in your SubSystem .sub file

NewSubSystemType.typeString = "BCIonBeamTurret"
The typestring can not be the same as the other ion cannon on your battlecruiser. I added a 1 to the BCIonBeamTurret on one of them, and left the other alone. and now they work fine.

Hopes this helps! :D

PS: this is my first post EVER, on anything. so i hope i didn't mess up to bad.

TON_Viper
7th Jul 10, 7:25 AM
In this specific case, it would probably be better to name them upper and lower ion, so the player can tell which one is going to be built.

ajlsunrise
7th Jul 10, 10:43 PM
@$%#. I keep forgetting about this... I keep promising to do part 4. Someone PM me and remind me.


Terry3030: strange, I can't seem to recall haveing that problem...

Griffen
14th Aug 10, 4:35 AM
How do you pm then??

saladin1973
14th Aug 10, 6:46 AM
Click their underscored name on the left (above the avatar) and you get a drop down menu. Private Message is one of the options.

power5000
14th Dec 10, 5:40 PM
plz fic part 4....

I got BC'ed
26th Jul 11, 4:00 AM
I used HW2ICArchive.exe bu can't find it's unpack directory, It's no where you stated in the tutorial any ideas anyone?

Edit: Fixed it Win 7 is so annoying when it blocks the file "Grrr" to win 7

ajlsunrise
31st Jul 11, 6:24 PM
You need to run HW2ICArchive.exe in Administrative mode.

I got BC'ed
9th Aug 11, 5:41 AM
does anyone have a function sheet for this language, it would be VERY helpful

ajlsunrise
9th Aug 11, 4:25 PM
"function sheet for this language"? What are you asking about?

There is the Karos Graveyard (http://hw2wiki.net/wiki/index.php?title=KarosGraveyard). Browsing through that might be pretty useful.

TON_Viper
13th Aug 11, 11:13 AM
I just checked, and Karos Graveyard is down. The question is if this is temporary, or possibly the link may have been changed? Or is it taken down permanently?

ajlsunrise
13th Aug 11, 12:18 PM
It's back up and running now, TON.

TON_Viper
14th Aug 11, 3:43 PM
I should have known. Seems to happen from time to time, but it's the first time I've seen it while it happened.

I got BC'ed
18th Aug 11, 3:54 AM
As far as a "function Sheet" is concerned I'm after a list of expressions that can be used in the .ship and .subsystem files and their relevant arguments.

ajlsunrise
18th Aug 11, 9:10 AM
Download the RDN toolkit, and the ShipTuning.xls (http://www.mediafire.com/?jc9cgls22a42sc5) has a list of pretty much most of the functions available in the ship files, and the SubSystemTuning.xls (http://www.mediafire.com/?osocfdaa523mwkq) has the SubSystem ones.

As for reference, use http://hw2wiki.net/wiki/index.php?title=FunctionXXX, where XXX is the name of the function.

I got BC'ed
19th Aug 11, 1:10 AM
many thanks

I got BC'ed
19th Aug 11, 1:32 PM
I request help with a mod I am developing to make Homeworld2 Hgn and Vgr carriers more useful in a combat situation and provide them with the tools to fulfil their role as fighter support. It will consist of various Subsystem and Research additions to the game, however I don't wish to reveal any more at this time. I request assistance in adding and modifying the ships abilities as modules are installed. This is nothing really complex however my knowledge of Lua is limited to what I learnt on this thread and completing the tutorial. I am also asking for the help of a modeller to put the finishing touches on.

lmsmi1
15th Sep 11, 2:33 PM
Phenomenal fantastic awesomely good work ajlsunrise! This is way more awesome than my stupid tutorials. I suck, I know, but you. YOU'RE AWESOME!!! :D