[SCRIPTING] Stop showing build menu for a ship?

In my mod, ships are able to leave the map and travel to different places. However, when a ship leaves in the middle of a mission, it still shows up as a builder in the build menu as if I could build from that ship. Is there a way I could keep the ship from appearing in the build menu, other than destroying it? Thanks.

I believe you can probably disable the canBuild ability with scripting, which might do the trick?

I tried SobGroup_AbilityActivate(squads_sobg, AB_Builder, 0) but the mothership still shows up in the menu.

Missions m03_staging.lua

function Rule_ShipyardDisableCommands()

local abilityList = {AB_Move, AB_Attack, AB_Guard, AB_Stop, AB_Hyperspace, AB_Retire, AB_Scuttle, AB_Builder, AB_Dock};

for j = 1, 7 do 
		SobGroup_AbilityActivate( "Shipyard", abilityList[j], 0 );
end
Rule_Remove ("Rule_ShipyardDisableCommands")

end

1 Like

As I said in my earlier post, I tried this, but the ship still appears when cycling through the build menu.

To point out, AB_Builder and AB_Dock aren’t disabled as they are indexed at 8 & 9 while the for loop only goes up to 7.