PDA

View Full Version : Adding new buildable subsystems to hgn_minelayer


kanesoban
3rd Sep 07, 8:45 AM
Helo

I'm trying to make the Hiigaran minelayer able to build one from two possible subsystems. As you can imagine, it dosen't works.

Here's what i've done so far:

-I added a new Hardpoint with HardED to hgn_minelayer.hod for the subsystem slot. I basically copied the hgn_carrier's "Generic 1" hardpoint. The only difference is, that since i don't want the subsystem to be visible i made Generic 1's position x=0 y=0 z=0.
- I dont want any other ship to be able to build these two subsystems, so i created a new buildfamily in family.lua called "Hgn_mine".
- I created the .subs files for the two new subsystems. Basically i copied another subsystem's .subs file, but i changed Buildfamily to "Mine_hgn". The two new subsystems are called "hgn_anticapshipmine.subs" and "hgn_antifightermine.subs"

- I added this line to hgn_minelayer.ship:
addAbility(NewShipType, "CanBuildShips", 1, "Mine_Hgn", "SubSystemModule")

And this line too:

StartShipHardPointConfig(NewShipType, "Generic 1", "HardpointGeneric1", "System", "Generic", "Destroyable", "", "Hgn_Anticapshipmine", "Hgn_Antifightermine")

- Finally i created the necessary directories, placed the files in them, and put the whole thing in /data/
And of course added -overrideBigFile to the shortcut.

I tried this out. The minelayer has a buildmenu for subsystems, but its empty. In the right bottom corner it is visible, that the minelayer has an empty module slot.

Now, anybody has any ideas what is wrong?

adamstrange
3rd Sep 07, 8:56 AM
I'm really not sure because for my mod all the subsystems are already built when the ships are launched but try this:

StartShipHardPointConfig(NewShipType, "Generic 1", "HardpointGeneric1", "System", "Generic", "Destroyable", "", "Hgn_Anticapshipmine", "Hgn_Antifightermine", "", "", "", "", "", "", "", "")

Caysi
3rd Sep 07, 9:39 AM
Make sure:
a- the subsystems are in the build menu
b- the subsystems have a unique build family(hgn_minsub or something like that)
c- the family is defined in family.lua
d- in the can build ability the family is mentioned
and then it should work, at least it did for me :)

ford6
3rd Sep 07, 7:18 PM
Looks like youve got everything in place in the ship and subsytem files. The fact that it shows the build menu empty tells me you forgot to add the neccessary info in the build.lua file.

Also, in the subs file subsystem.visable=0 will make the subsystem invisable and .healthbarstyle=3 will hide the subsystem healthbar.

There might be one more needed. I'll have to check in the morning when I get home.

Dim@
4th Sep 07, 1:04 AM
What everyone forgets when trying to add a buildable item is build.lua. MAKE SURE that you change build.lua
(scripts/build and research/Hiigarian/build.lua)
If you haven't worked with it before, you will have four files in that folder:
build.lua
build.lua.LUADC
research.lua
research.lua.LUADC
delete build.lua and rename build.lua.LUADC to build.lua.

now add your subsystem to the list, making sure that all the indents, commas and brackets are arranged correctly.

kanesoban
4th Sep 07, 5:32 AM
Dim@: i did all that, and now one of the two subsystems (hgn_anticapshipmine) is buildable.
I still can't see hgn_antifightermine, altough its in the build.lua and everywhere else as well.

EDIT: ok, now if i open the minelayer's buildmenu, i can see only one of the two buildable subsystems, BUT if i click on "Show all" then i can see and build both. And both are listed under "Module subsystems".

Caysi
4th Sep 07, 11:54 AM
Check the priorities, if one or more share the same priority one will not appear.