Author Topic: Bridge SubMenu Plugin Yields Unexpected Results  (Read 650 times)

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Bridge SubMenu Plugin Yields Unexpected Results
« on: October 12, 2023, 06:56:22 PM »
Hey all, so I downloaded and installed this:
https://www.bc-central.net/forums/index.php/topic,2373.msg219304.html#msg219304
Now my bridge selection menu looks like this:
https://photos.onedrive.com/share/722A72E34A78F868!28177?cid=722A72E34A78F868&resId=722A72E34A78F868!28177&authkey=!AANByUqGBaqjtwM&ithint=photo&e=DBooTU
and my console looks like this:
Code: [Select]
Outdated Foundation, updating functions
Outdated Foundation, installing FolderManager
Repairing ship description outputs...
Foundation Tech loaded
Galaxy Charts v1.5 is online
Gravity FX has been loaded.
BridgeFX Enabled...
CameraFX Enabled...
ExplosionFX Enabled...
SpecialFX Enabled...
WarpFX Enabled...
Slipstream Drive 20070905 Initializing...
DS9FX Initializing...
Fixing Jaggies
AttributeError: PreLoadAssets
Setting Stock System Planets Random Density.
Traceback (innermost last):
  File ".\Scripts\Custom\Autoload\LoadNanoFX.py", line 254, in __call__
    import Systems.DryDock.DryDockSystem
  File ".\Scripts\Systems\DryDock\DryDockSystem.py", line 6
    return Systems.Utils.CreateSystemMenu('Dry Dock', 'Systems.DryDock.DryDock'
                                                                              ^
SyntaxError: invalid syntax
Slipstream: Quick Battle is running... Mod is starting up...
DS9FX: Kobayashi Maru is Installed. Deleting DS9FX Docking Function!
DS9FX: You're not currently running a QB Mission. DS9 Set cannot be reached by Warp!
Trying to clean memory
Traceback (innermost last):
  File ".\Scripts\Custom\QBautostart\AddShipGUI.py", line 618, in CreateAddShipsWindow
    CreateWindowInterieur()
  File ".\Scripts\Custom\QBautostart\AddShipGUI.py", line 438, in CreateWindowInterieur
    BuildShipSelectWindow()
  File ".\Scripts\Custom\QBautostart\AddShipGUI.py", line 379, in BuildShipSelectWindow
    ships_list[iIndex] = Ship.GetShipFile(), ShipLongName
AttributeError: GetShipFile
Traceback (innermost last):
  File ".\Scripts\AI\PlainAI\IntelligentCircleObject.py", line 132, in Update
    return CircleObject.CircleObject.Update(self)
  File "c:\utopia\current\build\scripts\AI\PlainAI\CircleObject.py", line 100, in Update
  File ".\Scripts\App.py", line 10850, in ObjectClass_GetObject
TypeError: Expected None or string, instance found
Trying to clean memory
Trying to clean memory
Trying to clean memory
Trying to clean memory
Trying to clean memory

Did I miss some dependencies? Should I not download random plugins from Jimmy? Is there a better, more current bridge submenu implementation? idk  :hithead:

Thank you all.

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #1 on: October 13, 2023, 12:31:44 AM »
It seems to start from this: DryDockSystem.py
There's a syntax error there somewhere. Fix that and retry and bring a fresh console report.
Acta, non verba.
aka USS Sovereign

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #2 on: October 13, 2023, 05:48:28 AM »
Think I may have it. I modified it to have it show as "Dry Dock" and not "DryDock" and accidentally deleted the closing parenthesis.  :hithead:

Code: [Select]
import App

def CreateMenus():
import Systems.Utils
return Systems.Utils.CreateSystemMenu('Dry Dock', 'Systems.DryDock.DryDock'

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #3 on: October 13, 2023, 06:10:06 AM »
Ok, fixing that goof yields no change to the bridge menu.

Console dump:
Code: [Select]
Outdated Foundation, updating functions
Outdated Foundation, installing FolderManager
Repairing ship description outputs...
Foundation Tech loaded
Galaxy Charts v1.5 is online
Gravity FX has been loaded.
BridgeFX Enabled...
CameraFX Enabled...
ExplosionFX Enabled...
SpecialFX Enabled...
WarpFX Enabled...
Slipstream Drive 20070905 Initializing...
DS9FX Initializing...
Fixing Jaggies
AttributeError: PreLoadAssets
Setting Stock System Planets Random Density.
Slipstream: Quick Battle is running... Mod is starting up...
DS9FX: Kobayashi Maru is Installed. Deleting DS9FX Docking Function!
DS9FX: You're not currently running a QB Mission. DS9 Set cannot be reached by Warp!
Trying to clean memory
Traceback (innermost last):
  File ".\Scripts\Custom\QBautostart\AddShipGUI.py", line 618, in CreateAddShipsWindow
    CreateWindowInterieur()
  File ".\Scripts\Custom\QBautostart\AddShipGUI.py", line 438, in CreateWindowInterieur
    BuildShipSelectWindow()
  File ".\Scripts\Custom\QBautostart\AddShipGUI.py", line 379, in BuildShipSelectWindow
    ships_list[iIndex] = Ship.GetShipFile(), ShipLongName
AttributeError: GetShipFile
Traceback (innermost last):
  File ".\Scripts\AI\PlainAI\IntelligentCircleObject.py", line 132, in Update
    return CircleObject.CircleObject.Update(self)
  File "c:\utopia\current\build\scripts\AI\PlainAI\CircleObject.py", line 100, in Update
  File ".\Scripts\App.py", line 10850, in ObjectClass_GetObject
TypeError: Expected None or string, instance found

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #4 on: October 13, 2023, 09:24:41 AM »
Ok, next is the AddShipGui. It seems to be outdated or modified? Can you reinstall that part or restore from backup?
Acta, non verba.
aka USS Sovereign

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #5 on: October 13, 2023, 02:25:28 PM »
It's unmodified from the KM 1.0 release. Could the error be in the calling script? Do you know of an efficient way to search py file contents that may be calling AddShipGUI?

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #6 on: October 14, 2023, 02:31:22 PM »
It has to be modified in some way. Can you download a clean 1.0 release and do a winmerge compare of both to see the list of changes?
Acta, non verba.
aka USS Sovereign

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #7 on: October 15, 2023, 05:43:37 PM »
Ok, so I did something we always used to tell folks not to do back in the day, and went off the rails of proper troubleshooting. I realized there was a more current KM build, 2011.10, so I installed it. Now, I did painstakingly, over the course of a couple of hours, verify changes between all of the files and checked for any problems that could arise for the overwrite. The result was: no change.

So I opened up 000-Fixes20071109-BridgeSubListV2Foundation and did a full comment out (""") of the file's contents. That restored my bridge menu to normal, with no submenus. I did not, however, eliminate the console error.

I wondered if I could possibly be missing a shipFile definition in one of my ship plugins and that Foundation was not throwing an error on startup. So, I went through every one and verified the definition in all, excluding stock ships. None were missing, so it was time for another idea.

Finally, I commented out the contents of 000-Fixes20071007-ShipSubListV5Foundation, and that eliminated the error from the console.

So, I guess I'm back to square zero.

But as I was typing this, I think I may have caught the origin of the issues, please let me know if my thought process is incorrect. In  000-Fixes20071007-ShipSubListV5Foundation, line 135, GetShipName is called.
Code: [Select]
shipName = GetShipName(ship, self)GetShipName is not defined until line 210.
Code: [Select]
def GetShipName(ship, self):Shouldn't the definition come first?

Thanks again, Mario. Appreciate you talking through this with me.

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #8 on: October 16, 2023, 12:53:10 AM »
000-Fixes20071007-ShipSubListV5Foundation v5? I only know of v3. Post the file.
Acta, non verba.
aka USS Sovereign

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #9 on: October 16, 2023, 04:54:48 AM »
Here you go.

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Bridge SubMenu Plugin Yields Unexpected Results
« Reply #10 on: October 16, 2023, 01:58:50 PM »
The differences are huge between these between versions. Anyway I was misreading, you were looking into the wrong location the method failing is GetShipFile not GetShipName.
Acta, non verba.
aka USS Sovereign