Build menu for custom race wont pop up

Howdy all,

I seem to have forgotten how to add a new build capable ship to an existing fleet. I’ve added the CanBuildShips ability in my new ships’ .ship file, but the build menu will only toggle between the existing carrier and mothership.

I have a feeling it’s something simple I’ve overlooked, just can’t remember what that might be. Do I need to add the new build capable ship to classdef.lua or anything like that?

EDIT: And figured it out right after I posted - my ship was a CS_ prefix, so it couldn’t build when it was in a KUS_ fleet. I am fuzzy on how to get around that (ie building the enemy race’s ships), so i’ll pose that question and leave the thread going.

-Stefan-

I’m not sure if cross-race build is actually possible. It’s long enough ago that the details are foggy, but I’m pretty sure this is one of the things that compelled Homeworld:@ to switch over to the single-race workaround.

1 Like

Going by a vague memory from years ago I think somebody modded a unique subsystem to be built for “reverse engineering” enemy tech. It either worked by duplicating and allowing the enemy unit research tree, or by allowing research to duplicate it with the additional desired units added with shared models and the extra ship files added with the correct race’s prefix. Sorry, but it was years ago

IIRC, the game is hardcoded so that you can only build from ships that start with the prefix of your selected race, ie hgn_, vgr_, etc. as defined in race.lua

The workaround is indeed to have all ships and races use the same prefix.

Jea … Changing the prefixes in Race.lua and renaming only the the builder ships might do it.

Maybe there are some docking issues then that might have to be fixed but this should be enough to get it done fast.

The rest of the Build list should remain unchanged as you can tell build other races ships without the need to have the same prefix. So it’s only important for the builders.

I also seem to remember that although you can define multiple prefixes per race in race.lua, it only looks up the first one for build capability. Not 100% sure about that though, and not sure what the additional prefixes would be used for.

And a followup question - besides race.lua, familylist.lua, and adding the CanBuildShips ability, what other scripts do I have to modify to get my custom race to build ships? Even poring over the relicforums archives I haven’t been able to find a solution.

-Stefan-

a lot of stuff in the AI folder

classdef
cpubuild
cpubuildsubsytem
cpuresearch

I actually build a new build AI for warlords replacing all of those file because I was having so much trouble tweaking things and getting it to use my custom classes. Though I didn’t care about the standard races or subsystem construction for the most part so those were left as stubs. I do have issues with the AI building too many production vessels though and when I get some time I am going to start with the new AI files and try to expand on them instead of replacing them

1 Like

My bad for not clarifying. The build menu isn’t displaying for my custom race (CS_) when I push “B” or click the Build menu button. I noticed it’s a common newbie issue, but I don’t see what I’m missing compared to say the old B5 mod. When I looked back at my last BrickSpace releases, turns out I never figured it out for them either and just overwrote the HGN and VGR races.

Research menu works.

The CPU stuff is only necessary to get singleplayer skirmish working, right?

-Stefan-

Data\scripts\BuildAndResearch’racename’\ needs a build.lua and research.lua file

this is the name you put in the races.lua, not the prefix

The other stuff is needed for the AI to build

yup, ive got the buildandresearch folders populated. the custom research.lua is working but the build.lua right next to it refuses to pop up. sadface

here is my lolcat race files…

no edits to family list to add anything for the new race (to prove the point that cross race is just linked by naming in the build lua and classes in the can build/buildfamily)

though having the building ship have the same prefix does seem to be important

if I used REP_FIGHTERSHIPYARD in starting fleets it wouldn’t expand the build menu, I had to make a KAT_FIGHTERSHIPYARD for it to work

races.lua entry

{ "LOLKAT", "LOLKAT", "hyperspace_gate_IMP2", "etg/HYPER_OUT", 0, Playable, 1, "KAT_"}, 

buildandresearch/LOLKAT/ (Republic gunship added just to show you can build ships from other races with no issue based on classes or prefixes as long as everything lines up in the build.lua)

Ship = 0
SubSystem = 1
build = {

	{
	Type = Ship,
	ThingToBuild = "KAT_LAZERKAT",
	RequiredResearch = "",
	RequiredShipSubSystems = "",
	DisplayPriority = 1,
	DisplayedName = "LAZER KAT",
	Description = "",
	},
	{
Type = Ship,
ThingToBuild = "rep_corellian_gunship",
RequiredResearch = "",
RequiredShipSubSystems = "",
DisplayPriority = 31,
DisplayedName = "Corellian Gunship",
Description = "",
},
}

in the shipyard which is added from the starting fleets file, copy pasted with no changes from another working production ship to show that you can modify custom races with different build classes (‘heavy_corvette_Rep’ build class doesn’t match the CIS ones nor KAT_, but does match the ship build class I want it to build and buildfamily for the shipyard doesn’t match the KAT_ prefix either)

NewShipType.BuildFamily = "Shipyard_Rep"
addAbility(NewShipType,"CanBuildShips",1,"DroidFighter_CIS, Fighter_CIS,Corvette_CIS,Heavy_Corvette_Rep,Utility_CIS,Shipyard_CIS,Platform_CIS,Probe_Ben,Resource_CIS","Utility,Fighter,corvette,platform")

in the KAT_LAZERKAT.ship not even the right class (copy pasted from another custom race)

NewShipType.BuildFamily = "Heavy_Corvette_Rep"

I just realized how messed up this example is :smiley:

Don’t ask me how to set up subsystem builds I don’t use them that way

1 Like

It seems I may have forgotten about a 3-letter restriction to the race prefixes.

My build menu appears to be working now, after changing CS_ to CLS_ for the race prefix…