Author Topic: py files?  (Read 3132 times)

Offline CDR_Daxian

  • Captain_Daxian
  • Posts: 142
  • Cookies: 3
  • On a Mac and still playing Bridge Commander.
    • Captain_Daxian Mods
Re: py files?
« Reply #20 on: October 19, 2010, 07:40:00 PM »
it works

thanx

another question:

how might you choose what type of weapons it has?
Captain_Daxian
BC Amateur Modder and mass consumer of Coca-Cola

All my mods are destroyed... Time to make new ones!

My Website


Offline Morgan

  • Moderator
  • Posts: 1340
  • Cookies: 65535
Re: py files?
« Reply #21 on: October 19, 2010, 09:10:53 PM »
how might you choose what type of weapons it has?
That would involve some hardpoint editing. Can you tell us what kinds of weapons you're looking to configure?

Offline CDR_Daxian

  • Captain_Daxian
  • Posts: 142
  • Cookies: 3
  • On a Mac and still playing Bridge Commander.
    • Captain_Daxian Mods
Re: py files?
« Reply #22 on: October 19, 2010, 09:14:06 PM »
as i might have mentioned before: i have km 1.0

and i wanted to configure the weapons to heavy phasers, plus i wanted to configure quamtum torpedoes used on the sovereign.
Captain_Daxian
BC Amateur Modder and mass consumer of Coca-Cola

All my mods are destroyed... Time to make new ones!

My Website


Offline Bren

  • DS9FX Team
  • Posts: 750
  • Cookies: 33
  • 6EQUJ5
Re: py files?
« Reply #23 on: October 19, 2010, 09:15:49 PM »
what exactly are you trying to accomplish?
let's start from there...

*Awards Jimmy the Cookie for 'Conspicuous Gallantry In A Thread Devoid Of Reasoned Enquiry'*
"The sky calls to us, if we do not destroy ourselves, we will, one day, venture to the stars." - Carl Sagan

Klingon Academy now works on XP/Vista/Win 7 thanks to one dude's patches, click here for details. I highly recommend it!

Offline dEjavU

  • Posts: 123
  • Cookies: 3
Re: py files?
« Reply #24 on: October 20, 2010, 12:45:38 AM »
..I wanted to configure the weapons to heavy phasers, plus i wanted to configure quantum torpedoes used on the sovereign....

Just open the .py file up with notepad, if all your doing is just adjusting the yield for the phasers and adding quantum torpedoes used by the Sovereign class. It's a good way to get better aqainted with the context of a typicle .py file. To adjust the phaser yields look for this line within each phaser entries....

DorsalPhaser3.SetMaxDamage(2100.000000)

..change the value within the parentheses to what ever you like(do that for all the phasers)for the torpedoe armaments look for something that looks like this within the Sovereign class' .py file....

#################################################
Torpedoes = App.TorpedoSystemProperty_Create("Torpedoes")

Torpedoes.SetMaxCondition(5000.000000)
Torpedoes.SetCritical(0)
Torpedoes.SetTargetable(0)
Torpedoes.SetPrimary(1)
Torpedoes.SetPosition(0.000000, 0.100000, -0.300000)
Torpedoes.SetPosition2D(82.000000, 64.000000)
Torpedoes.SetRepairComplexity(2.000000)
Torpedoes.SetDisabledPercentage(0.500000)
Torpedoes.SetRadius(0.200000)
Torpedoes.SetNormalPowerPerSecond(100.000000)
Torpedoes.SetWeaponSystemType(Torpedoes.WST_TORPEDO)
Torpedoes.SetSingleFire(0)
Torpedoes.SetAimedWeapon(1)
kFiringChainString = App.TGString()
kFiringChainString.SetString("")
Torpedoes.SetFiringChainString(kFiringChainString)
Torpedoes.SetMaxTorpedoes(0, 300)
Torpedoes.SetTorpedoScript(0, "Tactical.Projectiles.PhotonTorpedo1")
Torpedoes.SetMaxTorpedoes(1, 200)
Torpedoes.SetTorpedoScript(1, "Tactical.Projectiles.QuantumTorpedo1")
Torpedoes.SetMaxTorpedoes(2, 0)
Torpedoes.SetTorpedoScript(2, "Tactical.Projectiles.Tricobalt1")
Torpedoes.SetNumAmmoTypes(3)
App.g_kModelPropertyManager.RegisterLocalTemplate(Torpedoes)
#################################################

....copy and paste only the name of the quantum torpedoe over to your ships' corresponding .py file torpedoe armament section. If you feel it's eazier to use programs to edit your .py files then read back a couple of posts and do what Nero and Nebula had been saying.    ;)

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: py files?
« Reply #25 on: October 20, 2010, 08:01:12 AM »
*Awards Jimmy the Cookie for 'Conspicuous Gallantry In A Thread Devoid Of Reasoned Enquiry'*
lol :D

Offline Vladko1

  • Posts: 1148
  • Cookies: 72
  • The trekkie of steel
    • Modders of Steel Shipyards Homepage!
Re: py files?
« Reply #26 on: October 20, 2010, 08:16:04 AM »
I think the .py and the .pyc (in python) are with close properties to the .jad and the .class files (in java). The .pyc and the .class files can't be edited simply because, they have some strange kind of compression. MPE edits .pyc because it's made from the builders of the game and they know how the python compression works. About the .class files, a Bulgarian made a program several years ago, with wich you can open the .class files.

Offline CDR_Daxian

  • Captain_Daxian
  • Posts: 142
  • Cookies: 3
  • On a Mac and still playing Bridge Commander.
    • Captain_Daxian Mods
Re: py files?
« Reply #27 on: October 20, 2010, 06:11:17 PM »
thanks for the help, might need more on this subject though

never know.

all help appreciated :) :)
Captain_Daxian
BC Amateur Modder and mass consumer of Coca-Cola

All my mods are destroyed... Time to make new ones!

My Website


Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2197
  • Cookies: 1706
  • Life is life
Re: py files?
« Reply #28 on: October 20, 2010, 06:57:51 PM »
Quote
I think the .py and the .pyc (in python) are with close properties to the .jad and the .class files (in java). The .pyc and the .class files can't be edited simply because, they have some strange kind of compression. MPE edits .pyc because it's made from the builders of the game and they know how the python compression works.
It is not compressed but compiled to bytecode. Bytecode is intermediary language between assembly language and high level language.

Quote
About the .class files, a Bulgarian made a program several years ago, with wich you can open the .class files.
And the thing you're talking about is a dissasembler or decompiler. There are few python dissasemblers floating around the internet also.
Acta, non verba.
aka USS Sovereign

Offline Bren

  • DS9FX Team
  • Posts: 750
  • Cookies: 33
  • 6EQUJ5
Re: py files?
« Reply #29 on: October 21, 2010, 12:21:38 AM »
However, as I recall, the code they produce is practically unreadable, being very oddly formatted. Also, most scripters include the .py source files for their projects in their mods, usually letting BC Just-In-Time compile them for the user when they run them.

When .pyc files are distributed, it's usually because the scripter wants to keep the files private, for one reason or another, so decompiling those is seen as rude.

KM is a bit different, and as has been mentioned, th source files are provided along with it. All the original PYC files shipped with BC have equivalent PY files in the Bridge Commander Software Development Kit (or BC SDK), it also contains tools like the MPE and documentation on coding for BC. It was created by the original developers of the game, Totally Games, and can be dowloaded from BC-Files.com.
"The sky calls to us, if we do not destroy ourselves, we will, one day, venture to the stars." - Carl Sagan

Klingon Academy now works on XP/Vista/Win 7 thanks to one dude's patches, click here for details. I highly recommend it!