Author Topic: New Maelstrom Mod with modifying the python code from BC-SDK  (Read 1980 times)

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
New Maelstrom Mod with modifying the python code from BC-SDK
« on: March 04, 2018, 06:04:40 AM »
Hello, I working on a new mod for Bridge Commander since the last 5 years.

Originally, I used Kobayashi Maru 2011 as my starting point. However, this is extremely difficult to debug, because in my opinion there are far too many function overrides at runtime. I'm not a fan of that.

That's why I've started to rewrite my mod based on the SDK and Dashers Foundation. However, I have packed all the function overrides from the autoload folder into the respective Python files. I overwrote the foundation ityself and equipped it with the subsequently installed changes from autoload. I find this way better, because it offers a clear und simply to debug source code. Additional basic functions I have incorporated into the MissionLib, such as a revised AddShip method for AddShip-GUI.

The goal is to make all additional changes available in the maelstrom missions. For example the Advanced Power Management or alle the torpedo techs.
I also replaced the spaceships in the missions. The obsolete Ambassador class taken out and considered the starship classes from Star Trek First Contact. So USS Excalibur and USS Zhukov are now Steamrunner class ships, the USS Khitomer is a Norway class and the USS Berkeley and USS Cambridge are a Saber class ships. The USS Nighingale as a rescue ship is now Olympic class ship.

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Here the new AddShip-Method
« Reply #1 on: March 04, 2018, 06:48:54 AM »
###############################################################################
#   AddShipToPlayerSet(iShipType, bName = None)
#   
#   Add a ship to actual set of player.
#   
#   Args:   sShipType      - the class of ship
#         sName         - name of ship to add
#         sSide         - neutral, friendly or enemy
#   
###############################################################################
def AddShipToPlayerSet(sShipType, sName = None, sSide = None):
   debug(__name__ + ", AddShipToPlayerSet")
   import AI.SelfDefenseAI   
   
   try:
      loadspacehelper.PreloadShip(sShipType, 1)
   except:
      print "Sorry, was unable to preload ship: %s " % (ShipType)      
      
   pPlayer = GetPlayer()
   if not pPlayer:
      print "Error: No Player!"
      return   
      
   pPlayerSet = GetPlayerSet()
   if not pPlayerSet:
      print "Error: No PlayerSet!"
      return      
      
   if sName:
      pcName = sName
   else:
      iShipNum = 1
      pcName = str(sShipType) + " " + str(iShipNum)
      while(GetShip(pcName)):
         iShipNum = iShipNum + 1
         pcName = str(sShipType) + " " + str(iShipNum)
   pNewShip = loadspacehelper.CreateShip(sShipType, pPlayerSet, pcName, "", 1)
   pAIShip = App.ShipClass_GetObject(pPlayerSet, pcName)      
   if not pAIShip:
      print "Sorry, was unable to add ship: %s (%s)" % (ShipType, pcName)
      return         

   RandomMax = 1000
   kLocation = App.TGPoint3()
   X = App.g_kSystemWrapper.GetRandomNumber(RandomMax) * (-1) ** App.g_kSystemWrapper.GetRandomNumber(2)
   Y = App.g_kSystemWrapper.GetRandomNumber(RandomMax) * (-1) ** App.g_kSystemWrapper.GetRandomNumber(2)
   Z = App.g_kSystemWrapper.GetRandomNumber(RandomMax) * (-1) ** App.g_kSystemWrapper.GetRandomNumber(2)
   kLocation.SetXYZ(X, Y, Z)
   
   i = 0
   while (pPlayerSet.IsLocationEmptyTG(kLocation, pAIShip.GetRadius()*2, 1) == 0):
      X = App.g_kSystemWrapper.GetRandomNumber(RandomMax) * (-1) ** App.g_kSystemWrapper.GetRandomNumber(2)
      Y = App.g_kSystemWrapper.GetRandomNumber(RandomMax) * (-1) ** App.g_kSystemWrapper.GetRandomNumber(2)
      Z = App.g_kSystemWrapper.GetRandomNumber(RandomMax) * (-1) ** App.g_kSystemWrapper.GetRandomNumber(2)
      kLocation.SetXYZ(X, Y, Z)
      i = i + 1
      if i == 10:
         i = 0
         RandomMax = RandomMax + 100
   
   pAIShip.SetTranslate(kLocation)
   pAIShip.UpdateNodeOnly()
   
   pAIShip.SetTargetable(1)
   pAIShip.SetHailable(1)   
   pAIShip.SetScannable(1)   
   
   pAIShip.SetAI(AI.SelfDefenseAI.CreateAI(pAIShip))   
   
   if (sSide == 'neutral'):
      pGroup = GetNeutralGroup()
      pGroup.AddName(pcName)
   elif (sSide == 'friendly'):
      pGroup = GetFriendlyGroup()
      pGroup.AddName(pcName)
   elif (sSide == 'enemy'):
      pGroup = GetEnemyGroup()
      pGroup.AddName(pcName)
   else:
      return   

Offline CMDR CHESS

  • Posts: 34
  • Cookies: 3
  • "With the first link, the chain is forged..."
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #2 on: March 05, 2018, 12:08:35 PM »
That actually look way interesting - I've been looking for a way to remod the whole game, other than KM or Quincentennial. Because I have found too many instabilities in almost all of them. With Nanofx 2.0 being the main issue, right now (because frustration for all the crashing) have been using original nanofx with the plasma and quick battle. NEVER A CRASH. But, liking a lot of mods in KM, but not wanting to replace or kill a lot of ships in fear of breaking it somehow. So, how are getting around all that?

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #3 on: March 05, 2018, 12:45:42 PM »
I have exactly the same problem as you. Under Wine and Linux the original game is going very well, but KM is very problematic. The whole code is a mess. There were far too many authors and far too many code snippets. Everything works more badly together. That's why I rejected the idea of improving KM and starting with zero, or better, with SDK and Foundation. I will not consider any mods based on NanoFX, QBautostart or FoundationTech.

I build my weapon mods on the RealTech mod by Glen Fletcher (glenflet). Later (when all other mods will work), I will rewrite DS9FX and GalaxyCharts to work without NanoFX and FoundationTech. If necessary, I do without a few features like the Bajoran wormhole or the Slipstream. It's all just bauble anyway, which have no advantage for the game flow. At that time, when there was still a big modder community, such a universal framework with the many overrides still made sense. So the mods were almost all compatible with each other. Meanwhile, I think it's better to code things hard, like new buttons and new menus. This makes the code more stable and easier to debug.

Therefore, I make it clear right from the start that I do not put value to the compatibility with other mods.

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #4 on: March 05, 2018, 02:08:07 PM »
Your work sounds promising.  NanoFX 2 never made it out of beta, so there's a lot of instabilities there.  Mario, MLeo, and Defiant have made some small fixes here and there to help stabilize it, or at least extend the length of time between crashes, and DS9FX includes some general game fixes to help clean memory.  But everything seems to come back to NanoFX 2, which despite its instabilities is needed for pretty much everything due to it enabling warp in quickbattle.

Take out NanoFX 2, and the game gets MUCH more stable, but you lose just about everything else.  Usually the work around is just to leave everything disabled except warp, but if you come up with something much more stable, it might get some life back in the game.

Offline Tethys

  • -=USF=- Co-Leader
  • Posts: 256
  • Cookies: 89
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #5 on: March 05, 2018, 02:16:36 PM »
I myself am very excited to see these developments. Going to keep my eye on this one here as I might make use of it eventually :)

Offline eclipse74569

  • Roger Smith of the U.S.S. Lollypop, a good ship
  • Webmaster
  • Posts: 2240
  • Cookies: 65535
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #6 on: March 07, 2018, 09:56:04 PM »
Looking forward to seeing your work!
Humankind cannot gain anything without first giving something in return, to obtain, something of equal value must be lost.  That is alchemy's first law of equivalent exchange.  In those days we really believed that to be the world's one and only truth~Alphonse Elric

Offline CMDR CHESS

  • Posts: 34
  • Cookies: 3
  • "With the first link, the chain is forged..."
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #7 on: March 08, 2018, 03:25:37 AM »
Every time I feel like diving into this. I see loads of committed work well beyond .... TIME!!! I don't want to fall into the same failing as Excalibur. And that is exactly how I feel about submitting my own work (for myself) to submit for others for criticism. "You suck, go back to the barnyard with your toys." or something. So I just toil and jitter on my own. Because I have a few different Hardpoint formulas but ... I fear (fear). For as long as at least 2010 I have hardpointed and retextured so many people's work that I can redo the WHOLE game. I know the problems with NanoFx, I know KM and what/how they use things in a way that bogs and weighs down the game's own weight limit. And How much the smallest, "usually the BOP's Modeling" standards are for her own HP. For example, has anyone else notice how she loses more pieces than what is destroyed? Well, it's that kinda thing that I've worked with for so long. And Still, finding that exact compromise of everyone without making several for every difficulty. And, I don't believe in balance -SHOOT me NOW - True ... But, really. The Captain of that little Miranda HAS no Business picking a fight with that full on GALAXY CLASS. That fool is insane and deserves getting shot by his first officer ... dead cold.  LOL

Offline Darkthunder

  • Vice Administrator
  • Posts: 2321
  • Cookies: 1527
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #8 on: March 09, 2018, 06:42:15 PM »
A 1.1GB mod, with no screenshots, no information on what it actually contains?

Call me paranoid, but I require additional information before downloading something like that.
Official BCC Discord ยท https://discord.gg/nJAx4HNQ2G
Ad Astra Per Aspera

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #9 on: March 09, 2018, 08:02:16 PM »
A 1.1GB mod, with no screenshots, no information on what it actually contains?

Call me paranoid, but I require additional information before downloading something like that.

It contains the folders data, script and sfx. 90% of them comming from original game. I included it only because I renamed some stock files and partly moved them in new folders. It doesn't work with stock data or data from KM, although I use parts of these.

The mod contains the original game script with complete SDK, my modified version of Foundation Plugin System, some ships from KM2011 like Saber and Steamrunner for use in the Maelstrom Missions and some new scripts I made. I removed the outdated Ambassador class and added some buttons and functions to Helm, Science and Engineer interface.

It is only a non-binding pre-publication. Shall show the current work status.

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Here some screenshops
« Reply #10 on: March 09, 2018, 08:21:40 PM »
Most entries are localized. I made a new global TGLDatabase-Script that automatically use the strings from TGL or otherwise use directly the string from source code if no localisation is found. So some buttons are in German and some in English on my Screenshots.


Kiska got new menus. I added a Target-Menu (Ziel) and a Maneuver-Menu (Manoever) to group the buttons.


Felix got a new weapon menu (Waffen). Instead of the PhaserOnly-toggle, you can now toggle beams, pulse weapons and projectile weapons separatly. So its possible to combine all of them freely. (You can use only phasers or only pulse phasers or both of them or pulse phasers with torpedos but without phasers or phasers with torpedos without pulse phaser, etc.)

The other to toggles switches between single-fire for beams (phasers) or all at once and between single-fire for pulse weapons (pulse phasers) or all at once.


Miguel can now also launch shuttles and decoys and not only probes. But for this functions your ship hp need three different object emitter properties (probe launcher, shuttle launcher and decoy launcher). I added all of them to Sovereign class for testing.


Brex finally got a new emergency repair button (Notreparatur), but this don't work at the moment properly. There some bugs in code.
Then I added the silent running (Energiesparmodus) and some shield energy functions and energy transfer between main and backup and a quick reload function for main power and backup battery. This shut down the warp core temporary and reload them in a very quick time.

All these function are hardcoded in the Python files in scripts/bridge. So it can also be used in Maelstrom missions.

Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #11 on: March 10, 2018, 01:36:28 AM »
Wonderful to see some scripting work for BC!  I look forward to trying this out  :yay:

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #12 on: March 14, 2018, 04:27:33 PM »
So what exactly are the changes for those people that want technical details? You've dumped the dynamic indexes of the old foundation? Remove other mod dependency of QBAutostart?
Acta, non verba.
aka USS Sovereign

Offline CMDR CHESS

  • Posts: 34
  • Cookies: 3
  • "With the first link, the chain is forged..."
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #13 on: March 15, 2018, 05:26:01 PM »
Your work sounds promising.  NanoFX 2 never made it out of beta, so there's a lot of instabilities there.  Mario, MLeo, and Defiant have made some small fixes here and there to help stabilize it, or at least extend the length of time between crashes, and DS9FX includes some general game fixes to help clean memory.  But everything seems to come back to NanoFX 2, which despite its instabilities is needed for pretty much everything due to it enabling warp in quickbattle.

Take out NanoFX 2, and the game gets MUCH more stable, but you lose just about everything else.  Usually the work around is just to leave everything disabled except warp, but if you come up with something much more stable, it might get some life back in the game.

MIGHT Get Some Life Back Into The Game - Is an Understatement. There is nothing really wrong with it. With the right scripts and Models, ship behaviors so forth it would be perfectly fine ...  It's the fear of getting into it just to get kicked out. I feel like a waste of time sometimes, literally feeling discouraged from starting it in the first place. Like example. I never start my CS:GO when downloading or running scan, in fear that this might be the launch that will blackout forcing me to log off PC and Back on.

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #14 on: March 16, 2018, 04:12:19 AM »
So what exactly are the changes for those people that want technical details? You've dumped the dynamic indexes of the old foundation? Remove other mod dependency of QBAutostart?

First of all, I cleaned up the Autoload directory. I have incorporated the subsequent overrides and additions directly into the Scripts Foundation, MissionLib, loadspacehelper and so on. This makes the code easier to read and to debug. The second step was rather banal. I have renamed a few directories. From "ships" I made "AutoloadShips", from Qbautostart I did "AutoloadScript" and from "Techs" I did "AutoloadTech". All directories that are automatically load, get the prefix "AutoLoad" in the name.

I emptied the file StaticDefs, except of line:
Code: [Select]
Foundation.ShipDef.Unknown = Foundation.ShipDef ('Unknown', App.SPECIES_UNKNOWN, {'modes': [Foundation.MutatorDef.StockShips], 'hasTGLName': 1, 'hasTGLDesc': 1 } )

Instead, I've created a MissionSpecificShips.py file in the Maelstrom directory. This contains the foundation definitions of the spaceships needed for mission mode.

Code: [Select]
from bcdebug import debug

import App
import Foundation

# Player ships
Foundation.ShipDef.USSDauntless = Foundation.FedShipDef('USSDauntless', App.SPECIES_GALAXY, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Galaxy', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSDauntless.friendlyDetails[2] = "QBFriendlyGalaxyDestroyed"
Foundation.ShipDef.USSDauntless.enemyDetails[2] = "QBEnemyGalaxyDestroyed"

Foundation.ShipDef.USSSovereign = Foundation.FedShipDef('USSSovereign', App.SPECIES_SOVEREIGN, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Sovereign', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSSovereign.friendlyDetails[2] = 'QBFriendlySovereignDestroyed'
Foundation.ShipDef.USSSovereign.enemyDetails[2] = 'QBEnemySovereignDestroyed'

# Canonical ships
Foundation.ShipDef.USSEnterprise = Foundation.FedShipDef('USSEnterprise', App.SPECIES_SOVEREIGN, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Sovereign', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSEnterprise.friendlyDetails[2] = "QBFriendlyEnterpriseEnter"
Foundation.ShipDef.USSEnterprise.enemyDetails[2] = "QBEnemyEnterpriseEnter"

Foundation.ShipDef.USSPhoenix = Foundation.FedShipDef('USSPhoenix', App.SPECIES_NEBULA, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Phoenix', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSPhoenix.friendlyDetails[2] = 'QBFriendlyNebulaDestroyed'
Foundation.ShipDef.USSPhoenix.enemyDetails[2] = 'QBEnemyNebulaDestroyed'

Foundation.ShipDef.USSVenture = Foundation.FedShipDef('USSVenture', App.SPECIES_GALAXY, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Galaxy', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSVenture.friendlyDetails[2] = "QBFriendlyGalaxyDestroyed"
Foundation.ShipDef.USSVenture.enemyDetails[2] = "QBEnemyGalaxyDestroyed"

#Starfleet ships
Foundation.ShipDef.USSNightingale = Foundation.FedShipDef('USSNightingale', App.SPECIES_NEBULA, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Olympic', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSNightingale.friendlyDetails[2] = "QBFriendlyPeregrineEnter"
Foundation.ShipDef.USSNightingale.enemyDetails[2] = "QBEnemyPeregrineEnter"

Foundation.ShipDef.USSSanFrancisco = Foundation.FedShipDef('USSSanFrancisco', App.SPECIES_GALAXY, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Galaxy', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSSanFrancisco.friendlyDetails[2] = "QBFriendlyNebulaDestroyed"
Foundation.ShipDef.USSSanFrancisco.enemyDetails[2] = "QBEnemyNebulaDestroyed"

Foundation.ShipDef.USSDevore = Foundation.FedShipDef('USSDevore', App.SPECIES_AKIRA, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Akira', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSDevore.friendlyDetails[2] = "QBFriendlyAkiraDestroyed"
Foundation.ShipDef.USSDevore.enemyDetails[2] = "QBEnemyAkiraDestroyed"

Foundation.ShipDef.USSGeronimo = Foundation.FedShipDef('USSGeronimo', App.SPECIES_AKIRA, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Akira', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSGeronimo.friendlyDetails[2] = "QBFriendlyGeronimoEnter"
Foundation.ShipDef.USSGeronimo.enemyDetails[2] = "QBEnemyGeronimoEnter"

Foundation.ShipDef.USSKhitomer = Foundation.FedShipDef('USSKhitomer', App.SPECIES_AMBASSADOR, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Norway', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSKhitomer.friendlyDetails[2] = 'QBFriendlyAkiraDestroyed'
Foundation.ShipDef.USSKhitomer.enemyDetails[2] = 'QBEnemyAkiraDestroyed'

Foundation.ShipDef.USSBerkeley = Foundation.FedShipDef('USSBerkeley', App.SPECIES_AMBASSADOR, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Saber', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSBerkeley.friendlyDetails[2] = 'QBFriendlyNebulaDestroyed'
Foundation.ShipDef.USSBerkeley.enemyDetails[2] = 'QBEnemyNebulaDestroyed'

Foundation.ShipDef.USSCambridge = Foundation.FedShipDef('USSCambridge', App.SPECIES_AMBASSADOR, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Saber', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSCambridge.friendlyDetails[2] = 'QBFriendlyNebulaDestroyed'
Foundation.ShipDef.USSCambridge.enemyDetails[2] = 'QBEnemyNebulaDestroyed'

Foundation.ShipDef.USSExcalibur = Foundation.FedShipDef('USSExcalibur', App.SPECIES_AMBASSADOR, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Steamrunner', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSExcalibur.friendlyDetails[2] = 'QBFriendlyAkiraDestroyed'
Foundation.ShipDef.USSExcalibur.enemyDetails[2] = 'QBEnemyAkiraDestroyed'

Foundation.ShipDef.USSZhukov = Foundation.FedShipDef('USSZhukov', App.SPECIES_AMBASSADOR, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Steamrunner', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.USSZhukov.friendlyDetails[2] = 'QBFriendlyAkiraDestroyed'
Foundation.ShipDef.USSZhukov.enemyDetails[2] = 'QBEnemyAkiraDestroyed'


# Unique alien ships. 
Foundation.ShipDef.E2M0Warbird = Foundation.RomulanShipDef('E2M0Warbird', App.SPECIES_WARBIRD, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Warbird', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.E2M0Warbird.friendlyDetails[2] = "QBFriendlyE2M0WarbirdDestroyed"
Foundation.ShipDef.E2M0Warbird.enemyDetails[2] = "QBEnemyE2M0WarbirdDestroyed"

Foundation.ShipDef.Chairo = Foundation.RomulanShipDef('Chairo', App.SPECIES_WARBIRD, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Warbird', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.Chairo.friendlyDetails[2] = 'QBFriendlyWarbirdDestroyed'
Foundation.ShipDef.Chairo.enemyDetails[2] = 'QBEnemyWarbirdDestroyed'

Foundation.ShipDef.Chilvas = Foundation.RomulanShipDef('Chilvas', App.SPECIES_WARBIRD, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Warbird', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.Chilvas.friendlyDetails[2] = 'QBFriendlyWarbirdDestroyed'
Foundation.ShipDef.Chilvas.enemyDetails[2] = 'QBEnemyWarbirdDestroyed'

Foundation.ShipDef.JonKa = Foundation.KlingonShipDef('JonKa', App.SPECIES_VORCHA, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Vorcha', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.JonKa.friendlyDetails[2] = 'QBFriendlyVorchaDestroyed'
Foundation.ShipDef.JonKa.enemyDetails[2] = 'QBEnemyVorchaDestroyed'

Foundation.ShipDef.Krayvis = Foundation.FerengiShipDef('Krayvis', App.SPECIES_MARAUDER, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Marauder', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.Krayvis.friendlyDetails[2] = 'QBFriendlyMarauderDestroyed'
Foundation.ShipDef.Krayvis.enemyDetails[2] = 'QBEnemyMarauderDestroyed'

Foundation.ShipDef.MatanKeldon = Foundation.CardShipDef('MatanKeldon', App.SPECIES_KELDON, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Keldon', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.MatanKeldon.friendlyDetails[2] = "QBFriendlyMatanKeldonEnter"
Foundation.ShipDef.MatanKeldon.enemyDetails[2] = "QBEnemyMatanKeldonEnter"

Foundation.ShipDef.Mavjop = Foundation.KlingonShipDef('Mavjop', App.SPECIES_BIRD_OF_PREY, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'BirdOfPrey', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.Mavjop.friendlyDetails[2] = "QBFriendlyRanKufEnter"
Foundation.ShipDef.Mavjop.enemyDetails[2] = "QBEnemyRanKufEnter"

Foundation.ShipDef.RanKuf = Foundation.KlingonShipDef('RanKuf', App.SPECIES_BIRD_OF_PREY, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'BirdOfPrey', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.RanKuf.friendlyDetails[2] = "QBFriendlyRanKufEnter"
Foundation.ShipDef.RanKuf.enemyDetails[2] = "QBEnemyRanKufEnter"

Foundation.ShipDef.Soryak = Foundation.RomulanShipDef('Soryak', App.SPECIES_WARBIRD, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Warbird', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.Soryak.friendlyDetails[2] = 'QBFriendlyWarbirdDestroyed'
Foundation.ShipDef.Soryak.enemyDetails[2] = 'QBEnemyWarbirdDestroyed'

Foundation.ShipDef.Tawsun = Foundation.RomulanShipDef('Tawsun', App.SPECIES_WARBIRD, { 'modes': [ Foundation.MutatorDef.StockShips ], 'iconName': 'Warbird', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
# Revise the destroyed message
Foundation.ShipDef.Tawsun.friendlyDetails[2] = 'QBFriendlyWarbirdDestroyed'
Foundation.ShipDef.Tawsun.enemyDetails[2] = 'QBEnemyWarbirdDestroyed'

# Other mission ship classes
Foundation.ShipDef.CardHybrid = Foundation.CardShipDef('CardHybrid', App.SPECIES_CARDHYBRID, { 'modes': [ Foundation.MutatorDef.StockShips ], 'name': 'Card Hybrid', 'iconName':'Hybrid', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
Foundation.ShipDef.CardHybrid.RegisterQBShipMenu('Maelstrom', mode = Foundation.MutatorDef.StockShips)
Foundation.ShipDef.CardHybrid.RegisterQBPlayerShipMenu('Maelstrom', mode = Foundation.MutatorDef.StockShips)
# Revise the destroyed message
Foundation.ShipDef.CardHybrid.friendlyDetails[2] = 'QBFriendlyCardHybridDestroyed'
Foundation.ShipDef.CardHybrid.enemyDetails[2] = 'QBEnemyCardHybridDestroyed'

Foundation.ShipDef.KessokHeavy = Foundation.KessokShipDef('KessokHeavy', App.SPECIES_KESSOK_HEAVY, { 'modes': [ Foundation.MutatorDef.StockShips ], 'name': 'Kessok Heavy', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
Foundation.ShipDef.KessokHeavy.RegisterQBShipMenu('Maelstrom', mode = Foundation.MutatorDef.StockShips)
Foundation.ShipDef.KessokHeavy.RegisterQBPlayerShipMenu('Maelstrom', mode = Foundation.MutatorDef.StockShips)

Foundation.ShipDef.KessokLight = Foundation.KessokShipDef('KessokLight', App.SPECIES_KESSOK_LIGHT, { 'modes': [ Foundation.MutatorDef.StockShips ], 'name': 'Kessok Light', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
Foundation.ShipDef.KessokLight.RegisterQBShipMenu('Maelstrom', mode = Foundation.MutatorDef.StockShips)
Foundation.ShipDef.KessokLight.RegisterQBPlayerShipMenu('Maelstrom', mode = Foundation.MutatorDef.StockShips)

Foundation.ShipDef.KessokMine = Foundation.KessokShipDef('KessokMine', App.SPECIES_KESSOKMINE, { 'modes': [ Foundation.MutatorDef.StockShips ], 'name': 'Kessok Mine', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
Foundation.ShipDef.KessokMine.RegisterQBShipMenu('Maelstrom', mode = Foundation.MutatorDef.StockShips)

Foundation.ShipDef.SunBuster = Foundation.ShipDef('Sunbuster', App.SPECIES_SUNBUSTER, { 'modes': [ Foundation.MutatorDef.StockShips ], 'name': 'Sun Buster', 'hasTGLName': 1, 'hasTGLDesc': 1 } )
Foundation.ShipDef.SunBuster.RegisterQBShipMenu('Maelstrom', mode = Foundation.MutatorDef.StockShips)

In the Maelstrom missions I have replaced the references to ship classes by references to single ships. Explicitly spaceships like "USS Dauntless", "USSSanFrancisco" or "USS Sovereign" are loaded instead of "Galaxy" or "Sovereign". This has the advantage that you can use different hardpoints for the missions than for the Quickbattle mode.

The file MissionLib I rearranged a little and built a additional helper function to add a ship into player set. (Using by Add Ship GUI)


Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #15 on: March 16, 2018, 04:22:12 AM »
I have incorporated all dynamic changes to the interface in the respective interface scripts in the folder Bridge. I renounce in my mod on dynamic changes to the interface and code all buttons and menus hard. I also make thirdparty libraries like LibEngineering or GUIutils obsolete by using the stock BridgeUtils for all new interface modifications.

I also localized all interface strings with a new TGLDatabase-script. Incidentally, the script has the advantage that no "???" arise when a string is missing in the TGL. Instead, the hard-coded string is taken from the source code. So I can translate all the strings at some point in future and insert them into the TGLs. Until then, I have in my installation just a mixture of English and German.

Quote
from bcdebug import debug
import App
import string

def BridgeString(pText):
   debug(__name__ + ", BridgeString: " + str(pText))
   pDatabase = App.g_kLocalizationManager.Load("data/TGL/Bridge Crew General.tgl")   
   if(pDatabase is None):
      return 0   
   if (pDatabase.HasString(pText)):
      pString=pDatabase.GetString(pText)
   else:
      pString=App.TGString(pText)   
   App.g_kLocalizationManager.Unload(pDatabase)   
   return pString
   
def MenuString(pText):
   debug(__name__ + ", MenuString: " + str(pText))
   pDatabase = App.g_kLocalizationManager.Load("data/TGL/Bridge Menus.tgl")   
   if(pDatabase is None):
      return 0   
   if (pDatabase.HasString(pText)):
      pString=pDatabase.GetString(pText)
   else:
      pString=App.TGString(pText)   
   App.g_kLocalizationManager.Unload(pDatabase)   
   return pString
   
def SystemString(pText):
   debug(__name__ + ", SystemString: "  + str(pText))   
   pDatabase = App.g_kLocalizationManager.Load("data/TGL/Systems.tgl")   
   if(pDatabase is None):
      return 0   
   if (pDatabase.HasString(pText)):
      pString=pDatabase.GetString(pText)
   else:
      pString=App.TGString(pText)   
   App.g_kLocalizationManager.Unload(pDatabase)   
   return pString

def ShipNameString(pText):
   debug(__name__ + ", ShipNameString: "  + str(pText))   
   pDatabase = App.g_kLocalizationManager.Load("data/TGL/Ships.tgl")   
   if(pDatabase is None):
      return 0   
   if (pDatabase.HasString(pText)):
      pString=pDatabase.GetString(pText)
   else:
      pString=App.TGString(pText)   
   App.g_kLocalizationManager.Unload(pDatabase)   
   return pString   
   
def SubsystemsString(pText):
   debug(__name__ + ", SubsystemsString: "  + str(pText))   
   pDatabase = App.g_kLocalizationManager.Load("data/TGL/Subsystems.tgl")   
   if(pDatabase is None):
      return 0   
   if (pDatabase.HasString(pText)):
      pString=pDatabase.GetString(pText)
   else:
      pString=App.TGString(pText)   
   App.g_kLocalizationManager.Unload(pDatabase)   
   return pString   

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #16 on: March 16, 2018, 04:33:18 AM »
What I have newly added is a SystemEventHandler in the Systems folder. There I set different scripts that are to be started automatically, a spaceship enters a certain set. Currently this script does nothing more than play an automatic welcome message. I simply removed a few speaches from the missions and moved them into this script.

So when you enter certain systems, Kiska automatically says, "We have achieved XY." Unfortunately, the programmers of the game have not deposited such a voice message for all sets. But with some systems like Vesuvi, Tevron, Starbase12 or Serris it works.

Code: [Select]
from bcdebug import debug
import App
import MissionLib
import loadspacehelper
import Bridge.BridgeUtils
import Bridge.HelmMenuHandlers
import Bridge.Characters.Graff

###############################################################################
# SetupEventHandlers()
#
# Set up event handlers used by the Starbase 12 set.
#
# Args: pSet - The Starbase 12 set.
#
# Return: none
###############################################################################
def SetupEventHandlers():
debug(__name__ + ", SetupEventHandlers")
try:
pGame = App.Game_GetCurrentGame()
if pGame:
pEpisode = pGame.GetCurrentEpisode()
pPlayer = MissionLib.GetPlayer()
if pPlayer:
pSet = pPlayer.GetContainingSet()

# Ship entrance event
App.g_kEventManager.AddBroadcastPythonFuncHandler(App.ET_ENTERED_SET, pSet, __name__ + ".EnterSet")
# Ship exit event
App.g_kEventManager.AddBroadcastPythonFuncHandler(App.ET_EXITED_SET, pSet, __name__ + ".ExitSet")
except:
pass


###############################################################################
# EnterSet(pObject, pEvent)
#
# Event handler for player's ship entering this set.
# Create the Starbase 12 Control Room Set when the player enters.
#
# Args:
#
# Return:
###############################################################################
def EnterSet(pObject, pEvent):
debug(__name__ + ", EnterSet")
pMission = MissionLib.GetMission()
pBridge = App.g_kSetManager.GetSet("bridge")
pHelm = App.CharacterClass_GetObject(pBridge, "Helm")
pSequence = App.TGSequence_Create()
pPreLoad = App.TGScriptAction_Create("MissionLib", "PreloadSequenceLines")
try:
# Get ship entering set.
pShip = App.ShipClass_Cast(pEvent.GetDestination())
pName = pShip.GetName()
pID = pShip.GetObjID()
# Get player.
pPlayer = MissionLib.GetPlayer()
except AttributeError:
# Ship or Player is None.  Nothing to do here.
return

if pPlayer and (pID == pPlayer.GetObjID()):
if pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Starbase12":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E1M1ArriveStarbase1", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 1/E1M1.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
MissionLib.SetupGraffSet()
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Beol4":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E2M1PlayerInBeol1a", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 2/E2M1.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Biranu2":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E2M6ArriveBiranu1", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 2/E2M6.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Savoy1":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E3M1L058", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 3/E3M1.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Savoy3":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E3M1ArrivedSavoy3", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 3/E3M1.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Serris2":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E2M2ArriveSerris2-1", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 2/E2M2.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Serris3":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E2M2ArriveSerris3-1", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 2/E2M2.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Tevron2":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E2M0ArriveTevron1", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 2/E2M0.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Vesuvi4":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E3M2ShouldHail", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 3/E3M2.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Vesuvi5":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E2M1ArriveGeki1", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 2/E2M1.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
elif pShip.GetContainingSet() and pShip.GetContainingSet().GetName() == "Vesuvi6":
pKiskaArrive = App.CharacterAction_Create(pHelm, App.CharacterAction.AT_SAY_LINE, "E1M2ArriveHaven1", "Captain", 1, pMission.SetDatabase("data/TGL/Maelstrom/Episode 1/E1M2.tgl"))
pSequence.AppendAction(pKiskaArrive)
pSequence.Play()
App.TGActionManager_RegisterAction(pSequence, "Generic")
else:
return
else:
SetupAIHandler(pShip)


###############################################################################
# ExitSet(pObject, pEvent)
#
# Event handler for player's ship exiting this set.
# Delete the Starbase 12 Control Room Set when the player enters.
#
# Args:
#
# Return:
###############################################################################
def ExitSet(pObject, pEvent):
debug(__name__ + ", ExitSet")
try:
# Get ship exiting set.
pShip = App.ShipClass_Cast(pEvent.GetDestination())

# Get player.
pPlayer = App.Game_GetCurrentPlayer()

if pShip.GetObjID() != pPlayer.GetObjID():
# This ship isn't the player's ship.  We're done.
return
except AttributeError:
# Ship or Player is None.  Nothing to do here.
return

# The player's ship is exiting a set.  Check if it's exiting
# the Starbase 12 set...
if pEvent.GetCString() == "Starbase12":
# Delete the Starbase 12 Control Room Set.
pStarbaseControlSet = App.g_kSetManager.GetSet("FedOutpostSet_Graff")
if pStarbaseControlSet:
App.g_kSetManager.DeleteSet("FedOutpostSet_Graff")

Bridge.Characters.Graff.RemoveEventHandlers()

# Disable dock button.
pButton = Bridge.BridgeUtils.GetDockButton()
if(pButton):
pButton.SetDisabled()

###############################################################################
# SetupAIHandler(pShip)
#
# Event handler for AI ship entering this set.
#
# Args:
#
# Return:
###############################################################################
def SetupAIHandler(pShip):
debug(__name__ + ", SetupAIHandler")
if pShip:
MissionLib.AddCommandableShip(pShip.GetName())
print pShip.GetObjID(), pShip.GetName(), "is not player - no arrive message for: ", pShip.GetContainingSet().GetName()
return

###############################################################################
# IsPlayerInsideStarbase12
#
# Check if the player's ship is inside the Starbase12 starbase.
#
# Args: None
#
# Return: True if the player is in the starbase, false if not.
###############################################################################
def IsPlayerInsideStarbase12():
# Check if the player and starbase 12 are in the Starbase12 set...
debug(__name__ + ", IsPlayerInsideStarbase12")
pPlayer = App.Game_GetCurrentPlayer()
if not pPlayer:
return 0

pSet = pPlayer.GetContainingSet()
if not pSet:
return 0
if pSet.GetName() != "Starbase12":
return 0

pStarbase = App.ShipClass_GetObject(pSet, "Starbase 12")
if not pStarbase:
return 0

# Both are.  Check if the player is inside the starbase.
import AI.Compound.DockWithStarbase
return AI.Compound.DockWithStarbase.IsInViewOfInsidePoints(pPlayer, pStarbase)

###############################################################################
# HailStarbase12
#
# Hail Starbase 12.
#
# Args: pAction - The action triggering this function.
#
# Return: 0 or 1.
###############################################################################
def HailStarbase12(pAction):
# Get Player
debug(__name__ + ", HailStarbase12")
pPlayer = MissionLib.GetPlayer()
if pPlayer is None:
return 0

# Setup a sequence for Graff's stuff.
pSequence = App.TGSequence_Create()

# Set the viewscreen to watch Graff.
pSequence.AppendAction(App.TGScriptAction_Create("MissionLib", "ViewscreenOn", "FedOutpostSet_Graff", "Graff"))

# Have Graff say his greeting.
pSequence.AppendAction(App.TGScriptAction_Create("Bridge.Characters.Graff", "SayGreeting"))

# Turn off the viewscreen.
pSequence.AppendAction(App.TGScriptAction_Create("MissionLib", "ViewscreenOff"))

# pAction is done when pSequence is done.
pDoneEvent = App.TGObjPtrEvent_Create()
pDoneEvent.SetEventType(App.ET_ACTION_COMPLETED)
pDoneEvent.SetDestination(App.g_kTGActionManager)
pDoneEvent.SetObjPtr(pAction)
pSequence.AddCompletedEvent(pDoneEvent)

MissionLib.QueueActionToPlay(pSequence)

return 1

###############################################################################
# DockStarbase12(pAction)
#
# Similar to HailStarbase12 script action, but used for when the
# player docks with the starbase, rather than just hailing it.
#
# Args: pAction - The action calling this function.
# pGraffAction - If this isn't None, this action will be played
#   in place of Graff's usual greeting action.
# bNoRepair - If true, no repairing will be done, only reloading.
#
# Return: none
###############################################################################
def DockStarbase12(pAction, pGraffAction = None, bNoRepair = 0, bFadeEnd = 1):
debug(__name__ + ", DockStarbase12")
# Get Player
pPlayer = MissionLib.GetPlayer()
if pPlayer is None:
return 0

# Take down Helm menu and turn character back.
pBridgeSet = App.BridgeSet_Cast(App.g_kSetManager.GetSet("bridge"))
pHelm = App.CharacterClass_GetObject (pBridgeSet, "Helm")
if pHelm is None:
return 0
pHelm.MenuDown()
pHelm.TurnBack()

# Setup a sequence for Graff's stuff.
pSequence = App.TGSequence_Create()

# Make sure the rendered set is the Bridge.
sOldSet = App.g_kSetManager.GetRenderedSet().GetName()
pSequence.AppendAction(App.TGScriptAction_Create("Actions.CameraScriptActions", "ChangeRenderedSet", "bridge"))

# Set the viewscreen to watch Graff.
pSequence.AppendAction(App.TGScriptAction_Create("MissionLib", "ViewscreenOn", "FedOutpostSet_Graff", "Graff"))

# Have Graff say his greeting.
if pGraffAction is None:
pSequence.AppendAction(App.TGScriptAction_Create("Bridge.Characters.Graff", "SayGreeting"))
else:
# debug("Triggering custom Graff action.")
pSequence.AppendAction(pGraffAction)

# Automatically reload & repair the player's ship.
if not bNoRepair:
pSequence.AppendAction(App.TGScriptAction_Create("Actions.ShipScriptActions", "RepairShipFully", pPlayer.GetObjID()))
pSequence.AppendAction(App.TGScriptAction_Create("Actions.ShipScriptActions", "ReloadShip", pPlayer.GetObjID()))

# Fade out...  Something else will fade us back in later.
if bFadeEnd:
pSequence.AppendAction( App.TGScriptAction_Create("MissionLib", "FadeOut") )

# Turn off the viewscreen.
pSequence.AppendAction(App.TGScriptAction_Create("MissionLib", "ViewscreenOff"))

# Change the rendered set back to whatever it used to be.
pSequence.AppendAction(App.TGScriptAction_Create("Actions.CameraScriptActions", "ChangeRenderedSet", sOldSet), 0.5)

# pAction is done when pSequence is done.
pDoneEvent = App.TGObjPtrEvent_Create()
pDoneEvent.SetEventType(App.ET_ACTION_COMPLETED)
pDoneEvent.SetDestination(App.g_kTGActionManager)
pDoneEvent.SetObjPtr(pAction)
pSequence.AddCompletedEvent(pDoneEvent)

pSequence.Play()

return 1



Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #17 on: March 16, 2018, 11:14:49 AM »
That sounds very interesting.

Would any current/past scripting mod be compatible with your new system out of the box or would any adjustments be required?

Off-topic: Servus from Austria. :)
TaH pagh, Tah be.

Offline Mark McWire

  • Posts: 83
  • Cookies: 1010
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #18 on: March 16, 2018, 11:52:30 AM »
That sounds very interesting.

Would any current/past scripting mod be compatible with your new system out of the box or would any adjustments be required?

Off-topic: Servus from Austria. :)

It would be required adjustments. I override the Foundation itself and some of the stock files. But I want to rescript Galaxy Charts and DS9FX to work with my mod. You can like to comment here in the thread wishes, which other Mods I should incorporate. I will then adjust accordingly. At the moment, I included RandomEnc and RHCD as Custom Single Player Missions and the Custom QuickBattleGame. This three mission mods can be played.

Additional spaceships and maps are all compatible. Its just required to move the plugin script from Custom/ships to Custom/AutoloadShips to load.
(Because I renamed this folder in the Foundation.)

The UnifiedMainMenu is currently not included and would have to be adapted yet. All mods, which need this, can not be started yet. Mods that currently do not work and maybe would not work are NanoFX2, ShuttleLaunchFramework, Sneakers WarpCoreEject and Sneakers MVAM.
This is mainly because Sneaker uses its own libraries for the interface changes for its mods, which are not compatible with my interface changes.

I tested the FoundationTech, and it does not work anymore, because I've made some profound changes to the Foundation. Thats why I removed all related scripts to FoundationTech.

I want to install my own ShuttleLaunchFramework, based on stock shuttle launch scripts.

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: New Maelstrom Mod with modifying the python code from BC-SDK
« Reply #19 on: March 16, 2018, 08:17:51 PM »
That sounds very interesting.

Would any current/past scripting mod be compatible with your new system out of the box or would any adjustments be required?

Off-topic: Servus from Austria. :)

I don't see any mods working out of the box with the change set he specified.

Good luck with your project.
Acta, non verba.
aka USS Sovereign