2. To deal with FTech damper you should override the method. Check out 000-Expansion-RepairShip.py file as a sample it is located in autoload folder. It comes with DS9FX Xtended.
Thanks for the info. I'm hesitant to mess with other peoples scripts not only because I might mess them up but also because it'll expand this mod from just one script to a script and an overide of someone elses work

Before I screw about with others work I wanna pay attention to the handlers i'm using and what they do so onto...
1. Foundation.TriggerDef.ET_FND_CREATE_PLAYER_SHIP is triggered when a player ship is created and you can use it for qb restart scenarios.
I took the event you gave me, took the ShieldGen script out of the picture and did some testing in a seperate script.
In the script I used only these handlers:
Foundation.TriggerDef.
ET_FND_CREATE_PLAYER_SHIP with handler function
PlayerShipCreated()Foundation.TriggerDef.
ET_FND_CREATE_SHIP with handler function
NewShip()Aside from the handler functions above there was only
NewPlayerShip() with no specific calls to it in the script; just the function definition. Every function had the same stuff in it (except NewPlayerShip as it doesn't have pObject and pEvent) which was:
def functionname(pObject, pEvent):
print "%functionname%() ------------", App.g_kUtopiaModule.GetGameTime()
pShip = App.ShipClass_Cast(pEvent.GetDestination())
if not pShip:
return
print "Type =", GetShipType(pShip)
if pShip.IsPlayerShip():
print "-----------> Players ship"
print '\n\n'
pObject.CallNextHandler(pEvent)Here's the log broken down.
#1 Quick Battle is entered from the main menu. Quick Battle scene loads. There's no evidence in the log whatsoever, no handlers fire.
#2 Quick Battle is setup through Saffi's menu and game starts with selected ships.
####
NewShip() ------------ 1492.89257813
Type = CardHybrid
-----------> Players ship
####
####
PlayerShipCreated() ------------ 1492.89257813
Type = CardHybrid
-----------> Players ship
####
####
NewShip() ------------ 1492.89257813
Type = Freighter
####
^ As you can see NewShip() and PlayerShipCreated() are called for the same ship.
#3 I AddShip a Sovereign into the scene and transport to it using Transport2Ship from QBautostart.
####
NewShip() ------------ 1554.71875
Type = Sovereign
####
####
NewPlayerShip() ------------ 1586.49072266
Type = Sovereign
Okay.
#4 Now... I end combat through Saffi's menu and am greeted with an invisible ship, no bridge and Player still listed as a target with every targetable property set to 0 health.
Traceback (innermost last):
File ".\Scripts\QuickBattle\QuickBattle.py", line 2579, in EndSimulationEvent
EndSimulation()
####
####
File ".\Scripts\QuickBattle\QuickBattle.py", line 2628, in EndSimulation
RecreatePlayer()
####
####
File ".\Scripts\QuickBattle\QuickBattle.py", line 2284, in RecreatePlayer
vLocation = pPlayer.GetWorldLocation()
####
####
AttributeError: 'None' object has no attribute 'GetWorldLocation'
PlayerShipCreated() ------------ 1734.5703125
####
Interesting, no?
#5 Now I go through all the above steps up until #4 and then End Combat. It plays out exactly as it did in #1 with NewShip() firing first and then PlayerShipCreated() next both for the same (players) ship.
So in conclusion:> Foundation.TriggerDef.ET_FND_CREATE_PLAYER_SHIP fires only at the start and end of a Saffi setup QB. Not good if the player has AddShip installed and can have battles before setting up a Saffi battle.
> Foundation.TriggerDef.ET_FND_CREATE_SHIP fires for every ship type object whenever it's created, even if it's the players ship. Good for setting up anything that's added. Makes ET_FND_CREATE_PLAYER_SHIP redundant as .IsPlayerShip() and a simple variable can be used to determine if the ship has or hasn't been setup.
> NewPlayerShip() only ever fires when the player transports to another ship. Useful but misleading because of its name.
Right? I don't doubt Defiants claims of how NewPlayerShip() runs in KM but i've ran all these handlers with stock ships in 1.1 with Foundation (latest on BC files) and QBautostart extension (latest on BC files). The log is there and it doesn't lie.
For Your Info Defiant i'm running Foundation from BCUT version 1.7.5.0. QBautostart from your filefront
http://bridgecommander.filefront.com/file/;39736 0.9.1.