Help fixing Naval Pathfinding Bug

Everything about mods can be found here.

Moderator: Morax

Help fixing Naval Pathfinding Bug

Postby Centurin » 17 May 2018, 17:02

I'm trying to fix a naval movement bug that appears in a few mods for Vanilla SC.

Basically, the bug is that the units ignore movement commands when selected with multiple units. The only way to get the units to move is to select them individually. They also don't show up in formations when holding the right mouse button down.

An example mod with this problem is the Cybran Ennui Class sub by Anus Panda. I can't post a link because my account is new, but the mod is on gamewatcher.

I've looked at the BP files between working units and non-working units and I don't see anything that would cause this. I'm no expert on SC modding so I'm not sure what to look for either. I know you guys prefer FA, but this is really the only SC forum in town. Any help or some guidance on what to look for would be greatly appreciated. Thanks
Centurin
 
Posts: 6
Joined: 17 May 2018, 16:37
Has liked: 1 time
Been liked: 0 time
FAF User Name: Centurin

Re: Help fixing Naval Pathfinding Bug

Postby Uveso » 17 May 2018, 18:15

https://www.gamewatcher.com/mods/supreme-commander-mod/cybran-ennui-class-1-1

Errors from 1 minute playing:

Code: Select all
INFO: *FORMATION DEBUG: Unit urs_encl does not match any Naval categories.
INFO: *FORMATION DEBUG: Unit urs_encl does not match any Naval categories.
INFO: *FORMATION DEBUG: Unit urs_encl does not match any Naval categories.
INFO: *FORMATION DEBUG: Unit urs_encl does not match any Naval categories.
INFO: *FORMATION DEBUG: Unit urs_encl does not match any Naval categories.
WARNING: Error running OnStopBeingBuilt script in Entity urs_encl at 19ccf708: Invalid bone name "Right_Projectile".
WARNING: Error running OnStopBeingBuilt script in Entity urs_encl at 2018ce08: Invalid bone name "Right_Projectile".
WARNING: Error running OnMotionVertEventChange script in Entity urs_encl at 19ccf708: Invalid bone name "URS_EnCl".
WARNING: Error running OnMotionVertEventChange script in Entity urs_encl at 2018ce08: Invalid bone name "URS_EnCl".
WARNING: Error running OnMotionVertEventChange script in Entity urs_encl at 19ccf708: Invalid bone name "URS_EnCl".
WARNING: Error running OnMotionVertEventChange script in Entity urs_encl at 2018ce08: Invalid bone name "URS_EnCl".
WARNING: Error running OnMotionVertEventChange script in Entity urs_encl at 19ccf708: Invalid bone name "Right_Projectile".
WARNING: Error running OnMotionVertEventChange script in Entity urs_encl at 2018ce08: Invalid bone name "Right_Projectile".


This is clearly a Copy&Paste Unit mod. The unit was renamed, also some attachment points, but the model and bone names was not changed.
Also the unit can't use formations, because its not a naval unit :)
It has NAVAL as category but no sub category like Destroyer, Carrier, Cruiser etc.

Also this mod is a .SCD mod. not needed for a simple unit hook.

Please remove the .scd mod from your gameData folder and install the linked mod as normal mod in your mod folder:
http://faforever.uveso.de/forum/URSEnnuiClassModbyAnusPanda.zip

Greetings, Uveso.

PS: i did not get the formation bug in FAF, so you still need to test this!
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Help fixing Naval Pathfinding Bug

Postby Centurin » 17 May 2018, 21:12

Thank you so much! You're right. Many of the vanilla SupCom mods were simple copy and paste jobs. FA got most of the love ;) I totally forgot about the in game logger. This should give enough to start fixing some other mods. Thanks again!
Centurin
 
Posts: 6
Joined: 17 May 2018, 16:37
Has liked: 1 time
Been liked: 0 time
FAF User Name: Centurin

Re: Help fixing Naval Pathfinding Bug

Postby Centurin » 18 May 2018, 01:24

So come to find out, the fix didn't work. However, I managed to find out what did. I looked at some other mods that had working Naval units (Hawks Mod has a few) and discovered they all had a unit category relating to the unit it was most like. For example, a T3 UEF cruiser would have 'ues0202' as a unit category. By adding 'urs0203' (Cybran t1 sub) as a unit category, movement and formation ability was restored. I tried adding the Cybran aircraft carrier at first thinking it used the same model, but that didn't work either. With this knowledge, I should be able to fix the rest of the units from other mods with the same problem.
Centurin
 
Posts: 6
Joined: 17 May 2018, 16:37
Has liked: 1 time
Been liked: 0 time
FAF User Name: Centurin

Re: Help fixing Naval Pathfinding Bug

Postby Uveso » 18 May 2018, 15:44

Hello Centurin,

even if this work, don't add unitID's as Category to a unit blueprint.
The unitID is added by the c-engine, not by LUA.

This will confuse the AI Buildplatoons and AI Buildcondition monitor.

This is the buildtemplate for the Cybran T1 sub:
Code: Select all
T1SeaSub1={
            "T1SeaSub1",
            "AttackForceAI",
            { "urs0203", -1, 3, "attack", "GrowthFormation" }
        },

If you tell the AI, it should build a "T1SeaSub" then it will build a unit where it will find the UnitId "urs0203" inside the Categories array.
If you have 2 units with this ID, then the AI don't know what to build.

Worst scenario, you have a TECH1 factory, but the template leads to a TECH3 Ship. Then the whole buildchain is stalled.

I am sorry, but this fix will not work.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest