My Own Mod Update Troubleshooting/Feedback Thread

Rather than keep posting in random threads about my update troubles, or filling my main mod thread with it, here’s a new thread!

I haven’t gotten formations to work yet. I’ve got all the buttons there, but clicking them does nothing. This is a bit frustrating as I remember getting them working without much trouble in the beta before the hod compat break, but my access to that computer to check on what I did there is a bit limited at the moment.

Current output:

Tue Jun 21 09:55:40 2016
 Version 2.203, Build Number 38, Changelist Number 1244545 
 Loaded Archive: 'Homeworld2.big' 
 Failed to Load Archive '..\..\DATAUPDATES\UpdateHomeworld2.big' 
 Loaded Archive: 'HW1Ships.big' 
 Failed to Load Archive '..\..\DATAUPDATES\UpdateHW1Ships.big' 
 Loaded Archive: 'HW2Ships.big' 
 Failed to Load Archive '..\..\DATAUPDATES\UpdateHW2Ships.big' 
 Loaded Archive: 'HWBackgrounds.big' 
 Failed to Load Archive '..\..\DATAUPDATES\UpdateHWBackgrounds.big' 
 UTIL -- filepath failure, path doesn't exists 'C:\Games\Steam\steamapps\common\Homeworld\HomeworldRM\data\locale\English' 
 Loaded Archive: 'English.big' 
 Failed to Load Archive '..\..\DATAUPDATES\UpdateEnglish.big' 
 Failed to Load Archive '..\..\DATAUPDATES\Compatibility.big' 
 Uing ..profiles\ for profiles folder 
 GAME -- Using player profile EatThePath 
 Changing from a 32 bit colour depth in winNT (6.2 build 9200), 
 Display: (0, 0, 1920, 1080) - (0, 0) 
 Switching to a 1920x1080 32bit mode 
 GL Info: 4.5 - 4.5.0 NVIDIA 368.22 
 GL Vendor: NVIDIA Corporation 
 GL Renderer: GeForce GTX 970/PCIe/SSE2 
 GL Part ID: 970 
 GL Part EX: /PCIe/SSE2 
 Loaded Archive: 'EnglishSpeech.big' 
 Failed to Load Archive '..\..\DATAUPDATES\UpdateEnglishSpeech.big' 
 Loaded Archive: 'Music.big' 
 Failed to Load Archive '..\..\DATAUPDATES\UpdateMusic.big' 
 Build name: 
 Data path : C:\Games\Steam\steamapps\common\Homeworld\HomeworldRM\data 
 Font Load: data:UI\Font\Blender.rcf, 1920,1080 
 Font Attr: 14, Biu 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3Inside.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3InsideDisabled.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3Edge.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3EdgeDisabled.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3Edge.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3EdgeDisabled.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3EdgeOver.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3EdgePressed.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3EdgeOver.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3EdgePressed.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3InsideOver.tga) 
 Unable to retrieve UI (animated) texture (DATA:UI\NewUI\Styles\Button3\Button3InsidePressed.tga) 
 No mapping for font 'Blender' - using 'default' 
 StrikeGroupInfo field 'batchlingDockDelay' is missing, setting to default 
 TimingInfo field 'moveToHomeWaitTime' is missing, setting to default 
 Resetting fp PC control word. 
 CmdLine: -moddatapath hwatrepo\data -extPassFilter hwat_exp -nosound 
 3 Races Discovered 
 Race Filtering: HWAT_SANDBOX rules - @Deathmatch 
 Starting Level: DATA:\LevelData\Multiplayer\HWATTest\frs_Angel_Moon.level 
 HWAT_CNF_MSTHRONE is marked as captureable in the shiptuning but has no capture points! 
 HWAT_CNF_MSTHRONE is marked as repairable in the shiptuning but has no repair points! 
 HWAT_CNF_FFASSAULTADV is marked as captureable in the shiptuning but has no capture points! 
 HWAT_CNF_FFASSAULTADV is marked as repairable in the shiptuning but has no repair points! 
 could not find family Utility, All family names should be defined in data\scripts\FamilyList.lua.

Check that any families you've assigned to ships / subsystems / resources are defined in this lua file. 
 .ship file does not specify which display families the ship can build! please change it 
 HWAT_REP_DDION is marked as captureable in the shiptuning but has no capture points! 
 LOCALIZER -- Requested string range doesn't exists '13191' 
 EngineTrailStatic::getTweaks requesing index(0) that doesn't exist. 
 Font Load: data:UI\Font\SmallFonts7.rcf, 1920,1080 
 Font Attr: 14, Biu 
 HWAT_NUT_NAVBOUYHAX is marked as captureable in the shiptuning but has no capture points! 
 HWAT_NUT_NAVBOUYHAX is marked as repairable in the shiptuning but has no repair points! 
 HWAT_NUT_TSPHERE_1SPEC1REFL is marked as captureable in the shiptuning but has no capture points! 
 HWAT_NUT_TSPHERE_1SPEC1REFL is marked as repairable in the shiptuning but has no repair points! 
 HWAT_NUT_TSPHERE_1SPEC0REFL is marked as captureable in the shiptuning but has no capture points! 
 HWAT_NUT_TSPHERE_1SPEC0REFL is marked as repairable in the shiptuning but has no repair points! 
 HWAT_NUT_TSPHERE_0SPEC1REFL is marked as captureable in the shiptuning but has no capture points! 
 HWAT_NUT_TSPHERE_0SPEC1REFL is marked as repairable in the shiptuning but has no repair points! 
 HWAT_NUT_TSPHERE_0SPEC0REFL is marked as captureable in the shiptuning but has no capture points! 
 HWAT_NUT_TSPHERE_0SPEC0REFL is marked as repairable in the shiptuning but has no repair points! 
 HWAT_NUT_TARGETSPHERE is marked as captureable in the shiptuning but has no capture points! 
 HWAT_NUT_TARGETSPHERE is marked as repairable in the shiptuning but has no repair points! 
 HWAT_CNF_DDION is marked as captureable in the shiptuning but has no capture points! 
 HWAT_CNF_DDION is marked as repairable in the shiptuning but has no repair points! 
 LOCALIZER -- Requested string range doesn't exists '11575' 
 Warning, screen with name NewResearchMenu does not exist 
 Unable to retrieve UI (animated) texture () 
 Section name SelectAll does not exist for lua script file DATA:\UI\NewUI\NewTaskbar.lua 
 Error, LoadScreen failed to screen of type GameBalanceScreen when loading section GameBalanceScreen from file DATA:\UI\NewUI\Developer\GameBalanceScreen.lua 
 Unable to retrieve UI (animated) texture (data:ui\newui\research\HWAT_ResearchPanelBackground.tga) 
 Warning, screen with name InGameModScreen does not exist 
 Screen with that name was not found in the m_loadedScreens list InGameModScreen: 
 No mapping for font 'IGHeading2' - using 'default' 
 Display: (0, 0, 0, 0) - (-32000, -32000) 
 Restoring video mode 

I’ve spent a lot of time this morning whack-a-moleing errors from families that got added to the game. It’s enough to make me wish the familylist file got broken out into a folder of files, one for each family type. And stackable if possible, so mods could just add rather than having to copy the existing families, and remove with ext filters if needed. I definitely wish the error reporting told me what kind of familyit was when it hit an error. There are, for instance, five different families named just “Utility”.

For that matter, is there a limit to the number of entries in any of the family tables?

Oddly, once we added doscanpath ANY lua file can be stackable rather easily - you just replace the base file with one that says ‘scan this folder’, then put our original file there, along with any others which simply add to the base tables… So that is not in any way outside of the bounds for a Mod author.

Regarding error messages - I’ll see if I can update a couple of these in the patch_preview branch - certainly clarity with errors is good, and it is very easy/fast work.

2 Likes

Is there any guarantee to the ordering of doscanpath? I’d think that you’d have to ensure the original familylist lua file got evaluated first or there’d be problems.

doscanpath is most likely alphabetical, as file scan operations generally will be.

The familylist is built at runtime and then indexed - in theory order isn’t an issue for any given execution (you always use the symbolic name, which is located to create the index). The one place it could cause trouble is save/load - but I think that is also not a huge deal, with a few minor edits.

I mean, for example - instead of having the ‘smart’ family list gathering replacement just doscanpath right away, you could do this:

-- familylist.lua
dofilepath("scripts\familylist_GBX.lua") -- clone of old familylist.lua
doscanpath("scripts\families", "*.lua") -- find mod additions...

Now the order is almost certainly safe, and should be load-save stable. Indeed there are other ways to do this with a bit more code that would be even more capable of sorting/priority of that’s a concern. I won’t go into that here now, but I could if need be.

1 Like

Am I correct in thinking ships need cost in one of the Layout supply families to actually get put in formations?

Hmm…

HomeworldRM\HWATRepo\data\ship>dir /B HWAT_BEN_FFWar HWAT_BEN_MSTrade HWAT_CNF_DDIon HWAT_CNF_FFAssault HWAT_CNF_FFAssaultAdv HWAT_CNF_FFIon HWAT_CNF_FFIonAdv HWAT_CNF_MSThrone HWAT_CZA_CACarrier HWAT_CZA_DDStandard HWAT_CZA_FTInterceptor HWAT_CZA_FTTag HWAT_FRN_CABoss HWAT_FRN_CACarrier HWAT_FRN_CAHeavy HWAT_FRN_CAStorm HWAT_FRN_DDMissile HWAT_FRN_DDStandard HWAT_FRN_DRStandard HWAT_FRN_FFAssault HWAT_FRN_FFCloak HWAT_FRN_FFDrone HWAT_FRN_FFIon HWAT_FRN_FFMine HWAT_FRN_FFSupport HWAT_FRN_FFSupportTurbo HWAT_FRN_FTAssault HWAT_FRN_FTInterceptor HWAT_FRN_FTScout HWAT_FRN_NCProbe HWAT_FRN_SDGun HWAT_IMP_DDMissile HWAT_IMP_DDStandard HWAT_IMP_FFAssault HWAT_IMP_FFIon HWAT_IMP_FTInterceptor HWAT_KAD_FFHunter HWAT_KAD_FFIon HWAT_NUT_Crate HWAT_NUT_CratewreckA HWAT_NUT_NavBouy HWAT_NUT_NavBouyA HWAT_NUT_NavBouyB HWAT_NUT_NavBouyHax HWAT_NUT_SurvivalSpawner HWAT_NUT_TargetSphere HWAT_NUT_Testcube HWAT_NUT_TSphere_0Spec0Refl HWAT_NUT_TSphere_0Spec1Refl HWAT_NUT_TSphere_1Spec0Refl HWAT_NUT_TSphere_1Spec1Refl HWAT_REP_DDIon HWAT_REP_DDMissile HWAT_REP_FFAssault HWAT_REP_FFIon HWAT_REP_FTInterceptor HWAT_REP_FTInterceptor2 HWAT_REP_FTScout HWAT_REP_NCLightFreighter HWAT_SIM_FTInterceptor HWAT_Starter HWAT_TBR_CAStrike HWAT_TBR_FFAssault_Adv HWAT_TBR_FTInterceptor HWAT_TRN_FFIon HWAT_TRN_FTInterceptor HWAT_UNH_CABoss HWAT_UNH_CACarrier HWAT_UNH_CAStandard HWAT_UNH_CTHeavy HWAT_UNH_CTIon HWAT_UNH_CTMinelayer HWAT_UNH_CTRepair HWAT_UNH_CTSalvage HWAT_UNH_CTStandard HWAT_UNH_DDCargo HWAT_UNH_DDCloaked HWAT_UNH_DDDrone HWAT_UNH_DDMissile HWAT_UNH_DDQShip HWAT_UNH_DDStandard HWAT_UNH_DerelictInterdictor HWAT_UNH_DRBomber HWAT_UNH_DRStandard HWAT_UNH_FFAssault HWAT_UNH_FFDrone HWAT_UNH_FFIon HWAT_UNH_FFSupport HWAT_UNH_FTBomber HWAT_UNH_FTCBomber HWAT_UNH_FTCDefender HWAT_UNH_FTCloaked HWAT_UNH_FTDefender HWAT_UNH_FTInterceptor HWAT_UNH_FTScout HWAT_UNH_interdictor HWAT_UNH_MSDread HWAT_UNH_MSFifteen HWAT_UNH_NCCivHarvester HWAT_UNH_NCCloak HWAT_UNH_NCController HWAT_UNH_NCGrav HWAT_UNH_NCHarvester HWAT_UNH_NCProbe HWAT_UNH_NCProxSensor HWAT_UNH_NCSensorArray HWAT_VAY_CABattle HWAT_VAY_CABoss HWAT_VAY_CACarrier HWAT_VAY_CAEscort HWAT_VAY_CTFlare HWAT_VAY_CTGun HWAT_VAY_CTHeavy HWAT_VAY_CTMissile HWAT_VAY_CTMulti HWAT_VAY_CTSalvage HWAT_VAY_DDCarrier HWAT_VAY_DDGun HWAT_VAY_DDIon HWAT_VAY_FFAssault HWAT_VAY_FFAssaultAdv HWAT_VAY_FFIonArray HWAT_VAY_FFIonCannon HWAT_VAY_FTBomber HWAT_VAY_FTEscort HWAT_VAY_FTHeavy HWAT_VAY_FTLight HWAT_VAY_FTSuper HWAT_VAY_FTTech HWAT_VAY_NCController HWAT_VAY_NCHarvester HWAT_VAY_NCHeavy icons TestInhibitor1 TestInhibitor2
…yeah, I think I’m going to have to write script to tidy all this up if it’s ever going to get done.

Testing appears to bear that idea out. It also looks like you can have ships cost multiple supply, but not negative supply. Negative appears to be treated as zero supply, and defined zero supply means it doesn’t have any supply cost but you still can’t build it if you’re out of that supply family. Not sure how someone would use that behavior, but modders can come up with weird stuff sometimes, so who knows? However it’d be pretty cool to be able to make cata-like support modules(or support ships) that you have to build to increase your supply capacity in areas. @bitvenom Are there any new functions that could be used to do that, or is that unsupported behavior at this time?

Prior to 2.0 I (as I did the unit supply system) was very close to having made modules/research able to change supply levels. I may try to work that into the patch_preview - but that’ll have to be after the current round of issues, some weird stuff that’s been reported, etc. It was REALLLLY close to working - indeed all of the parts required were put in place.

1 Like

Makes sense. I’d love to have it, but I can’t argue with having it being lower priority than the other things that are being worked on there right now.

At the moment I have really only one blocker to getting a working HWR2.0 HW@ version out, and that’s the mysteriously missing resource counter. http://images.akamai.steamusercontent.com/ugc/261588346138348382/27A779A82B1C2B5FD4C561F43D33F87EB93D3D36/

Been a while since I really messed with UI stuff, so if anyone knowledgable could suggest where to start troubleshooting this issue, I’d be thankful.

I bet @dwarfinator knows… :smiley:

1 Like

Ahah, you’ll make me blush ^^

What’s the problem exactly ?
I see in your screenshot that nothing seems to appear where the RU number should be.

I’ve checked the resource.lua file, and there is a difference between pre-2.0 and now.
The pre-2.0 file has an onUpdate field with a Player_GetRU( Universe_CurrentPlayer(), but the same field is commented out in 2.1, so I wouldn’t be surprised if that’s connected to it.

I don’t know how the UI counter is updated now, still digging…

Edit : there’s been a lot of edits in ui files between pre2.0 and now. The first thing you should do is check all the original HWRm files you edited for your mod, and compare them with their 2.1 counterparts for discrepancies

We don’t have a resource.lua in the mod files :frowning:

Yes, I know, but the update is not done anymore directly in this file, so if it has been moved into another one (like a gamerule for example) which you have changed, perhaps the modification pertaining to the 2.x updates is missing in your mod.

that’s strange, I don’t find any update of the ui label anywhere in the 2.1 code…
Could it have been hardcoded ?

Must be something else somewhere that trigger the update now, instead of the onUpdate from before… the thing is to find what it is. Still searching !

1 Like

I tried running the mod without the ui directory present and the resources label came back, so it’s something in there. there aren’t particularly many files to dig through, so I ought to be able to fix this in a day or two.

ah, good news !

Could you make a zip of the ui folder and send it my way ? I’ll take a look, as I still have all the pre-2.0 lua files. I’m really curious as to what could have done this !

edit :
additionnal question : it was working correctly before the 2.0 patch ?

Found it.

In data/ui/newui/uisettings.lua, this

	{
		name = "ResourceMenu",
		filename = "DATA:\\UI\\NewUI\\Resource.lua",
		activated = 0,
	},	

has become this

	{
		name = "ResourceMenu",
		filename = "DATA:\\UI\\NewUI\\Resource.lua",
		activated = 0,
		type = "ResourceMenu",
	},	

Add that extra line in, and now it works.

2 Likes

arggghhh, I didn’t think of this change, even though I clearly remember having seen it during some previous lua file digging !

But great, at least it’s resolved now :slight_smile:

Well. Here’s one that’s rather involved, but I can’t crack it for the life of me, so here I’m tossing it out here in hopes that someone might have a bolt of inspiration.

The following is a chunk of code from my WIP single player mission. I’ll describe what it does in broad strokes since the comments aren’t comprehensive.

[code]-------------------------------------------------------------------------------
– PIRATE BEHAVIOR CODE –

function InitPirates()
–Put any pirate group sobs into despawn
Player_SetGlobalROE(2,AggressiveTactics)
Rule_AddInterval(“Rule_SpawnPirates”,1)
Rule_AddInterval(“Rule_HandlePirates”,1)
Spawn_Wave_1()
Spawn_Wave_2()
Spawn_Wave_3(“a”)
Spawn_Wave_3(“b”)
Spawn_Wave_3(“c”)
–Spawn_Fighter_Pirates()
–Spawn_Frigate_Pirates()
–Spawn_Corvette_Pirates()
–Spawn_Heavy_Pirates()
end

g_pirateTicks = 0

a = random(7)
b = random(7)
while b == a do
b = random(7)
end
c = random(7)
while c == b or c == a do
c = random(7)
end
d = random(7)
while d == b or d == c or d == a do
d = random(7)
end
print("************************************")
print(a)
print(b)
print©
print(d)
ps1 = "p_test1"
ps2 = "p_test2"
ps3 = "p_test3"
ps4 = “p_test4”

ps1 = “p_pa_a”…random(4)
ps2 = “p_pa_b”…random(2)
ps3 = "p_pa_c1"
ps4 = "p_pa_c2"
ps5 = “p_pa_c3”

g_groups_active = 0

g_entry_times = {}
g_entry_times[1] = 120
g_entry_times[2] = g_entry_times[1]+150
g_entry_times[3] = g_entry_times[2]+150
g_entry_times[4] = g_entry_times[3]+5
g_entry_times[5] = g_entry_times[4]+5

g_entry_times[1] = 5
g_entry_times[2] = 5
g_entry_times[3] = 5
g_entry_times[4] = 5
g_entry_times[5] = 5
function Rule_SpawnPirates()
g_pirateTicks = g_pirateTicks+1
print("")
print("Pirate spawn timer = "…g_pirateTicks)
print(“Pirate groups spawned = “…g_groups_active)
print(””)
–Final behavior, have a countdown and spawn them in sets
–if g_pirateTicks > 4 and g_groups_active < 1 then
if g_pirateTicks > g_entry_times[1] and g_groups_active < 1 then
g_music=STATE_START_FIGHT
Rule_AddInterval(“Rule_Pirate_Victory_Check”,1)
Exit_Pirates(ps1,“w1_caps”)
g_groups_active = g_groups_active + 1
–Event_Start(“FirstPirate”)
AddEventToQueue(“FirstPirate”)
–SobGroup_SetTactics(“Player_Ships2”,AggressiveTactics)
wake_unit(units,“w1_sob”)

elseif g_pirateTicks > g_entry_times[2] and g_groups_active < 2 then 
	Exit_Pirates(ps2,"w2_sob")
	g_groups_active = g_groups_active + 1
	NewPirateEvent()
	wake_unit(units,"w2_sob")
	
elseif g_pirateTicks > g_entry_times[3] and g_groups_active < 3 then 

	Exit_Pirates(ps3,"w3_caps_a")
	g_groups_active = g_groups_active + 1
	NewPirateEvent()
	wake_unit(units,"w3_sob_a")

elseif g_pirateTicks > g_entry_times[4] and g_groups_active < 4 then 

	Exit_Pirates(ps4,"w3_caps_b")
	g_groups_active = g_groups_active + 1
	--NewPirateEvent()
	wake_unit(units,"w3_sob_b")

elseif g_pirateTicks > g_entry_times[5] and g_groups_active < 5 then 

	Exit_Pirates(ps5,"w3_caps_c")
	g_groups_active = g_groups_active + 1
	--NewPirateEvent()
	wake_unit(units,"w3_sob_c")

	Rule_AddInterval("Rule_Victory_Check",1)
	Rule_Remove("Rule_SpawnPirates")
end

end

gn_interceptor = "HWAT_IMP_FTInterceptor"
gn_scout = "HWAT_REP_FTScout"
gn_light = "HWAT_VAY_CTGun"
gn_heavy = "HWAT_VAY_CTHeavy"
gn_ion = "HWAT_IMP_FFIon"
gn_assault = "HWAT_IMP_FFAssault"
gn_support = “HWAT_FRN_FFSupportTurbo”

–Fighter
–10 ints, 20 scouts, 3 support frigates to carry
function Exit_Pirates(location,group)
print("Exiting pirates: “…group…” at “…location)
SobGroup_ExitHyperSpace(group, location)
SobGroup_FormStrikeGroup(group,“wall”)
print(” Ping " … Ping_AddSobGroup(“Pirate Contact”,“anomaly”,group) )
–wake_unit(units,group)
end

–New ■■■■■■■■
function Spawn_Wave_1()
–2x support, 2x heavy, 2x light, 8x scout
sup_a = "w1_sup_a"
sup_b = "w1_sup_b"
core_sob = "w1_sob"
support_sob = "w1_caps"
vette_sob = "w1_vets"
SobGroup_Create(vette_sob)
SobGroup_Create(core_sob)
SobGroup_Create(support_sob)
SobGroup_Create(sup_a)
SobGroup_Create(sup_b)
SobGroup_SpawnNewShipInSobGroup(2,gn_support,sup_a,sup_a,“p_pstaging”)
SobGroup_SpawnNewShipInSobGroup(2,gn_support,sup_b,sup_b,“p_pstaging”)
SobGroup_Despawn(sup_a)
SobGroup_Despawn(sup_b)
SobGroup_SobGroupAdd(support_sob,sup_a)
SobGroup_SobGroupAdd(support_sob,sup_b)
targetShips = 8
i = 0
while i < targetShips do
if i < targetShips then
–We do this because Create makes the ship in the target group, it doesn’t add it do it
–it returns a ‘runtime sobgroup’ that contains it, so we take that return value and add it back
SobGroup_SobGroupAdd(sup_a,SobGroup_CreateShip(sup_a,gn_scout))
i=i+1
end
if i < targetShips then
SobGroup_SobGroupAdd(sup_b,SobGroup_CreateShip(sup_b,gn_scout))
i=i+1
end
end

i = 0
targetShips = 2
while i < targetShips do
	SobGroup_SpawnNewShipInSobGroup(2,gn_light, vette_sob,vette_sob,"p_pstaging")
	i = i+1
end
i = 0
targetShips = 2
while i < targetShips do
	SobGroup_SpawnNewShipInSobGroup(2,gn_heavy, vette_sob,vette_sob,"p_pstaging")
	i = i+1
end
SobGroup_SobGroupAdd(core_sob,sup_a)
SobGroup_SobGroupAdd(core_sob,sup_b)
SobGroup_SobGroupAdd(support_sob,vette_sob)
SobGroup_SobGroupAdd(core_sob,support_sob)
SobGroup_Despawn(support_sob)
new_unit(units,core_sob)

end
function Spawn_Wave_2()
– 1x support, 1x ion, 2x assault
core_sob = "w2_sob"
SobGroup_Create(core_sob)

SobGroup_SpawnNewShipInSobGroup(2,gn_support,core_sob,core_sob,"p_pstaging")
SobGroup_SpawnNewShipInSobGroup(2,gn_assault,core_sob,core_sob,"p_pstaging")
SobGroup_SpawnNewShipInSobGroup(2,gn_assault,core_sob,core_sob,"p_pstaging")
SobGroup_SpawnNewShipInSobGroup(2,gn_ion,core_sob,core_sob,"p_pstaging")

SobGroup_Despawn(core_sob)
new_unit(units,core_sob)

end
function Spawn_Wave_3(a)
– 1x support, 2x scout, 8x int
core_sob = “w3_sob_”…a
support_sob = “w3_caps_”…a
SobGroup_Create(core_sob)
SobGroup_Create(support_sob)

SobGroup_SpawnNewShipInSobGroup(2,gn_support,core_sob,core_sob,"p_pstaging")
SobGroup_SobGroupAdd(support_sob,core_sob)
SobGroup_Despawn(core_sob)
targetShips=2
i = 0
while i < targetShips do
	--We do this because Create makes the ship in the target group, it doesn't add it do it
	--it returns a 'runtime sobgroup' that contains it, so we take that return value and add it back
	SobGroup_SobGroupAdd(core_sob,SobGroup_CreateShip(core_sob,gn_scout))
	i=i+1
end
	targetShips=8
i = 0
while i < targetShips do
	--We do this because Create makes the ship in the target group, it doesn't add it do it
	--it returns a 'runtime sobgroup' that contains it, so we take that return value and add it back
	SobGroup_SobGroupAdd(core_sob,SobGroup_CreateShip(core_sob,gn_interceptor))
	i=i+1
end
SobGroup_Despawn(core_sob)
new_unit(units,core_sob)

end [/code]

So InitPirates is called in the beginning of the mission, and creates five attack groups, pared out into the spawn functions. Each one varies a little bit in exact detail due to different types of groups needing different handling to come out all pretty. Everything is created at a point far off the map, then ‘despawned’ into hyperspace. The new_unit() calls in the wave setup functions are related to my group AI management code and can be more or less be ignored right now. They work.

Rule_SpawnPirates then runs as part of the mission flow and spawns in attackers over time. Currently the times are set to something stupid for rapid testing. When each time milestone is hit another group gets brought in with Exit_Pirates. wake_unit() is another one of my AI things, also ignorable.

Now the headache: This all worked. Perfectly, in HW2C… It now almost all works. Every single group comes out of hyperspace where it’s supposed to, and is managed by the AI how it’s supposed to, and gets a ping like it’s supposed to. Voice lines play when they show up to warn you. EXCEPT. One support frigate in wave two doesn’t spawn. It stays in hyperspace. Or maybe it never enters hyperspace. Actually I can check which of those it is, hang on…

…Okay, I moved the staging point into the level, and now know more about exactly what’s going on, the support frigate in wave 2 is exiting hyperspace, at the staging point rather than at the proper destination point. Every other ship in it’s group is exiting at their proper destinations, and every other support frigate in the other groups is behaving properly too. In fact if I cut wave 2 down to just a support frigate, then it behaves properly too.

I’ve tried several premutations, such as spawning each ship in wave 2 in seperate SOB groups and then despawning them seperately and merging the groups together, or re-ordering their spawnings. Since that ship is coming out at the right time but in the wrong place, maybe there’s some formation thing to do with how ships exit hyperspace as groups? That’s the only idea I have though, and I have no idea how to test such a hunch.

Does each squadron have a unique name? Maybe the game is getting confused because you have multiple squadrons with the same name.

http://hw2bsg.org/wiki.hw2.info/FunctionSobGroup_SpawnNewShipInSobGroup.html