Author Topic: Help with editing ship.  (Read 1245 times)

Offline Tng_Fan

  • Posts: 11
  • Cookies: 0
Help with editing ship.
« on: March 29, 2020, 02:48:05 PM »
So I am new to editing ships and am trying to edit the shields and weapons for the Sovereign using MPE. I think I was able to figure out what I need to do but still had a few questions. When I went to open the ship model there were multiple files for the Sovereign such as high low medium and not sure which was the correct one but just opened the one that said Sovereign.nif. Is this the correct one I need to edit?

Also after editing the properties I wanted, I went to save the changes and it was going to save it as a .py file instead of a .pyc does this mean I delete the original Sovereign.pyc file so I just have the Sovereign.py file or do I keep both?

Thanks for the help

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Help with editing ship.
« Reply #1 on: March 29, 2020, 05:06:05 PM »
Quote
So I am new to editing ships and am trying to edit the shields and weapons for the Sovereign using MPE. I think I was able to figure out what I need to do but still had a few questions. When I went to open the ship model there were multiple files for the Sovereign such as high low medium and not sure which was the correct one but just opened the one that said Sovereign.nif. Is this the correct one I need to edit?

Chosen nif is correct.

Quote
Also after editing the properties I wanted, I went to save the changes and it was going to save it as a .py file instead of a .pyc does this mean I delete the original Sovereign.pyc file so I just have the Sovereign.py file or do I keep both?

Save as py. Game will compile this py into pyc once you run it again and overwrite the old one.
Acta, non verba.
aka USS Sovereign

Offline Tng_Fan

  • Posts: 11
  • Cookies: 0
Re: Help with editing ship.
« Reply #2 on: March 29, 2020, 06:32:22 PM »
Chosen nif is correct.

Save as py. Game will compile this py into pyc once you run it again and overwrite the old one.

Thanks for the quick reply. Not sure what I am doing wrong but for some reason whatever I edit in MPE doesn't seem to have any effect in the game. For example, I opened up the shield generator on the Sovereign and increased the shield strength as well as there recharge rate for each of the shields and tried to lower how much power it draws as well as editing the power output for the warp core. Then I opened up the game and went to quick battle and added in a Romulan warbird. I let them attack me and my shields seemed to go down just as fast as they would normally and still used just as much power from the warp core. Can't remember exactly what number I changed the shield strength too but I think it was something rediculously high like a few hundred thousand.

Any ideas what I am doing wrong?

Offline eclipse74569

  • Roger Smith of the U.S.S. Lollypop, a good ship
  • Webmaster
  • Posts: 2240
  • Cookies: 65535
Re: Help with editing ship.
« Reply #3 on: March 30, 2020, 07:06:34 AM »
Thanks for the quick reply. Not sure what I am doing wrong but for some reason whatever I edit in MPE doesn't seem to have any effect in the game. For example, I opened up the shield generator on the Sovereign and increased the shield strength as well as there recharge rate for each of the shields and tried to lower how much power it draws as well as editing the power output for the warp core. Then I opened up the game and went to quick battle and added in a Romulan warbird. I let them attack me and my shields seemed to go down just as fast as they would normally and still used just as much power from the warp core. Can't remember exactly what number I changed the shield strength too but I think it was something rediculously high like a few hundred thousand.

Any ideas what I am doing wrong?

I know he said to keep the .pyc file, but I usually delete it as the game automatically generates a pyc file for it.  Try deleting the pyc file and see if that helps!
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 Tng_Fan

  • Posts: 11
  • Cookies: 0
Re: Help with editing ship.
« Reply #4 on: March 30, 2020, 01:35:08 PM »
I know he said to keep the .pyc file, but I usually delete it as the game automatically generates a pyc file for it.  Try deleting the pyc file and see if that helps!

Thanks for the tip.

So I tried what you suggested and deleted the pyc for the Sovereign with no luck. The weird thing though is that BC never generated another pyc file for the ship yet I was able to load up a QB and play as that ship. When I looked in the hardpoints folder afterwards there was no pyc file just the py file that was generated by MPE.

Seems like the problem might be with BC not compiling the python script and generating a proper file but not sure.

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Help with editing ship.
« Reply #5 on: March 30, 2020, 03:21:06 PM »
Post sovereign.py from scripts\ships here, it seems as though the hps are in a different location.
Acta, non verba.
aka USS Sovereign

Offline Tng_Fan

  • Posts: 11
  • Cookies: 0
Re: Help with editing ship.
« Reply #6 on: March 30, 2020, 05:12:14 PM »
Post sovereign.py from scripts\ships here, it seems as though the hps are in a different location.

Going to have to re-install the game as something I just did caused everything to mess up and now the game won't start. Luckily I only had the KM mod installed so it shouldn't take too long.

So I will attach the py file but from what you said it sounds like it should be saved to the scripts/ships folder instead of the scripts/ships/hardpoint folder. Is that correct?

Thanks

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Help with editing ship.
« Reply #7 on: March 30, 2020, 07:27:12 PM »
This isn't the file I was looking for. I wanted the one from scripts\ships.

Quote
So I will attach the py file but from what you said it sounds like it should be saved to the scripts/ships folder instead of the scripts/ships/hardpoint folder. Is that correct?
No. I was trying to ascertain if the hp file for the ship you're editing is located on a different path or the filename and the scripts\ships\sovereign.py should have told me that.
Acta, non verba.
aka USS Sovereign

Offline Tng_Fan

  • Posts: 11
  • Cookies: 0
Re: Help with editing ship.
« Reply #8 on: March 30, 2020, 08:00:59 PM »
This isn't the file I was looking for. I wanted the one from scripts\ships.
No. I was trying to ascertain if the hp file for the ship you're editing is located on a different path or the filename and the scripts\ships\sovereign.py should have told me that.

Don't have a sovereign.py file in scripts/ships folder just sovereign.pyc so hopefully that's what you meant and have attached it.

I save the py file from MPE to the hardpoints folder

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Help with editing ship.
« Reply #9 on: March 30, 2020, 08:33:40 PM »
This is what is going wrong:
Code: [Select]
import App
import Multiplayer

def GetShipStats():
    kShipStats = {'FilenameHigh': 'data/Models/Ships/WCNemEntE/WCNemEntE.nif', 'FilenameMed': 'data/Models/Ships/WCNemEntE/WCNemEntE.nif', 'FilenameLow': 'data/Models/ships/WCNemEntE/WCNemEntE.nif', 'Name': 'WCNemEntE', 'HardpointFile': 'WCNemEntE', 'Species': Multiplayer.SpeciesToShip.SOVEREIGN}
    return kShipStats


def LoadModel(bPreLoad=0):
    pStats = GetShipStats()
    if not App.g_kLODModelManager.Contains(pStats['Name']):
        pLODModel = App.g_kLODModelManager.Create(pStats['Name'])
        pLODModel.AddLOD(pStats['FilenameHigh'], 10, 200.0, 15.0, 15.0, 400, 900, '_glow', None, '_spec')
        pLODModel.AddLOD(pStats['FilenameMed'], 10, 400.0, 15.0, 15.0, 400, 900, None, None, None)
        pLODModel.AddLOD(pStats['FilenameLow'], 10, 800.0, 15.0, 30.0, 400, 900, None, None, None)
        if bPreLoad == 0:
            pLODModel.Load()
        else:
            pLODModel.LoadIncremental()
    return


def PreLoadModel():
    LoadModel(1)

Note the hardpoint file part. That's the filename you're looking for.

Code: [Select]
'HardpointFile': 'WCNemEntE'
Acta, non verba.
aka USS Sovereign

Offline Tng_Fan

  • Posts: 11
  • Cookies: 0
Re: Help with editing ship.
« Reply #10 on: March 30, 2020, 09:33:26 PM »
This is what is going wrong:
Code: [Select]
import App
import Multiplayer

def GetShipStats():
    kShipStats = {'FilenameHigh': 'data/Models/Ships/WCNemEntE/WCNemEntE.nif', 'FilenameMed': 'data/Models/Ships/WCNemEntE/WCNemEntE.nif', 'FilenameLow': 'data/Models/ships/WCNemEntE/WCNemEntE.nif', 'Name': 'WCNemEntE', 'HardpointFile': 'WCNemEntE', 'Species': Multiplayer.SpeciesToShip.SOVEREIGN}
    return kShipStats


def LoadModel(bPreLoad=0):
    pStats = GetShipStats()
    if not App.g_kLODModelManager.Contains(pStats['Name']):
        pLODModel = App.g_kLODModelManager.Create(pStats['Name'])
        pLODModel.AddLOD(pStats['FilenameHigh'], 10, 200.0, 15.0, 15.0, 400, 900, '_glow', None, '_spec')
        pLODModel.AddLOD(pStats['FilenameMed'], 10, 400.0, 15.0, 15.0, 400, 900, None, None, None)
        pLODModel.AddLOD(pStats['FilenameLow'], 10, 800.0, 15.0, 30.0, 400, 900, None, None, None)
        if bPreLoad == 0:
            pLODModel.Load()
        else:
            pLODModel.LoadIncremental()
    return


def PreLoadModel():
    LoadModel(1)

Note the hardpoint file part. That's the filename you're looking for.

Code: [Select]
'HardpointFile': 'WCNemEntE'

So you're saying that the hardpoint file I should be editing?

Thanks

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2186
  • Cookies: 1706
  • Life is life
Re: Help with editing ship.
« Reply #11 on: March 30, 2020, 10:14:06 PM »
So you're saying that the hardpoint file I should be editing?

Yes.
Acta, non verba.
aka USS Sovereign

Offline Tng_Fan

  • Posts: 11
  • Cookies: 0
Re: Help with editing ship.
« Reply #12 on: March 31, 2020, 12:07:13 AM »
Yes.

Awesome!

I was finally able to get it to work and now have a souped up version of the ship.

Thanks again  :)