[SOLVED][CUSTOM GAMERULE] KUS mothership is stuck and won't move

I just noticed during testing a weird issue.

I am unable to issue the Move command to the Kushan mothership. Seems that is the only ship affected. I have not modified the .ship file.

No scripting errors in the log.

The default Gearbox game types work fine. No problem there.

Any idea what might be the cause?

Single Player campaign or Multiplayer?

Multiplayer

I tried different maps as well.

Waypoint move doesn’t work either. I can set the waypoints, but the ship does not move.

I was able to narrow it down to the sobgroups_init() function in “data\leveldata\multiplayer\lib\lib.lua”. If you don’t call that function in your game rule, the Kushan mothership won’t move. Even in multiplayer.

You have to add that script to your custom game rule.

Here is the comment for that piece of code:

--to keep compatibility with test levels, can be removed with the shipping of the game

It’s due to this in “data::HW1Ships\ship\kus_mothership\kus_mothership.lua”:

	if Player_GetNumberOfSquadronsOfTypeAwakeOrSleeping(-1, "Special_Splitter" ) == 0 then
		SobGroup_AbilityActivate(CustomGroup, AB_Move, 0)
		SobGroup_AbilityActivate(CustomGroup, AB_Dock, 0)				
		--btn hyperspace
		if UI_IsNamedElementVisible("NewTaskbar", "btnHW1SPHyperspace") == 1 then		
			--SobGroup_AbilityActivate("Player_Ships0", AB_Hyperspace, 1)
		else
			SobGroup_AbilityActivate("Player_Ships0", AB_Hyperspace, 0)
		end	
	else
		SobGroup_AbilityActivate(CustomGroup, AB_Move, 1)
		SobGroup_AbilityActivate(CustomGroup, AB_Dock, 1)	
	end

Along with SobGroup_Create("Special_Splitter") in sobgroups_init() in data\leveldata\multiplayer\lib\lib.lua.


LOL! There’s a function in the gamerules lib SobGroup_SplitGroupFromGroup… It’s practically the same as Apollyon470’s SobGroup_SplitGroup/SobGroup_SplitGroupReference functions…

@BitVenom: I thought I saw somewhere that you had said that was a terribly ineffective way of getting single ships and you were looking into providing a more effective way?

Does that mean without the script nothing can dock with the mothership as well?

No, just that it can’t dock. (eh? What is it going to dock with anyways?)

So how do I fix kus_mothership.lua? I don’t know what code to remove.

Well, to keep compatibility with the HW1 campaign, nothing.

Just dofilepath on data\leveldata\multiplayer\lib\lib.lua. It won’t hurt to have it there.