Author Topic: Hardpoints editor with model preview.. work in progress!  (Read 20306 times)

Jernej

  • Guest
Re: Hardpoints editor with model preview.. work in progress!
« Reply #120 on: November 25, 2008, 06:05:08 PM »
MLeo: thanks for helping out, but that's hardly any better than parsing the actual original py script :(
 

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Hardpoints editor with model preview.. work in progress!
« Reply #121 on: November 25, 2008, 06:13:35 PM »
Like I said, it's only a start due to lack of time.

It can be refined. ;)

For example, there are no keyword arguments used.

So the __call__ can become this:
Code: [Select]
def __call__(self, *args):
  n = Mock("%s%s"%(self.__name, str(args)))
  print n
  return n

Then there is the fact that every method that starts with "Set" needs to record information:
Code: [Select]
def __getattr__(self, name):
  if name[:3] == "Set":
    return RecordingMock("%s.%s"%(self.__name, name), self)
  return Mock("%s.%s"%(self.__name, name)

The mock in itself is just the start.

What kind of format would you like to see?
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Jernej

  • Guest
Re: Hardpoints editor with model preview.. work in progress!
« Reply #122 on: November 25, 2008, 06:53:53 PM »
Something like this ini or sort of XML would be "ideal":
 
Code: [Select]
[RearPhaser1]
parent=Phaser
name=Rear Phaser 1
apply=1
MaxCondition=1000.000000
Critical=0
Targetable=1
Primary=1
Position=0.401015, -2.242150, -0.120000
Position2D=76.000000, 69.000000
RepairComplexity=7.000000
DisabledPercentage=0.750000
Radius=0.050000
Dumbfire=1
WeaponID=1
Groups=2
DamageRadiusFactor=0.150000
IconNum=363
IconPositionX=97.000000
IconPositionY=101.000000
IconAboveShip=1
FireSound="FedBurst"
MaxCharge=1.000000
MaxDamage=1200.000000
MaxDamageDistance=100.000000
MinFiringCharge=1.000000
NormalDischargeRate=200.000000
RechargeRate=0.400000
IndicatorIconNum=511
IndicatorIconPositionX=91.000000
IndicatorIconPositionY=96.000000
OrientationForward=-0.707107, -0.707107, 0.000000
OrientationUp=-0.374702, 0.000000, 0.927145
Width=0.140000
Length=0.001000
ArcWidthAngles=-1.221731, 0.261799
ArcHeightAngles=0.000000, 1.570796
PhaserTextureStart=0
PhaserTextureEnd=7
PhaserWidth=0.300000
OuterShellColor=1.000000, 1.000000, 0.501961, 1.000000
InnerShellColor=1.000000, 1.000000, 0.501961, 1.000000
OuterCoreColor=1.000000, 1.000000, 0.501961, 1.000000
InnerCoreColor=1.000000, 1.000000, 0.501961, 1.000000
NumSides=6
MainRadius=0.070000
TaperRadius=0.010000
CoreScale=0.350000
TaperRatio=0.250000
TaperMinLength=5.000000
TaperMaxLength=30.000000
LengthTextureTilePerUnit=0.500000
PerimeterTile=1.000000
TextureSpeed=2.000000
TextureName="data/phaserspecs3.tga"

 
I obviously have a lot to learn about python, i guess i know what i'll be doing the rest of this weekend now.
 

Jernej

  • Guest
Re: Hardpoints editor with model preview.. work in progress!
« Reply #123 on: November 26, 2008, 03:55:20 AM »
I found some python XML serializers, how would these work with BC structures?
 
http://code.activestate.com/recipes/440595/
http://www.strangegizmo.com/products/pyxslt/
 

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Hardpoints editor with model preview.. work in progress!
« Reply #124 on: November 26, 2008, 01:40:52 PM »
The first one would be the easiest.

If you create a mock that records everything then it's easy for the first.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Jernej

  • Guest
Re: Hardpoints editor with model preview.. work in progress!
« Reply #125 on: November 29, 2008, 01:29:09 PM »
I hacked my parser further, coming to this very nice output, i believe this is as good as near-perfect:
 
Code: [Select]
[VentralPhaser]
parent=Phaser
name=Ventral Phaser
apply=1
MaxCondition=1000.000000
Critical=0
Targetable=1
Primary=1
MatrixPosition=0.000000, 0.120000, -0.129000
SystemPosition=0.000000, 0.120000, -0.129000
Position2D=64, 53
RepairComplexity=7.000000
DisabledPercentage=0.750000
Radius=0.050000
Dumbfire=0
WeaponID=1
Groups=1
DamageRadiusFactor=0.150000
IconNum=363
IconPositionX=65
IconPositionY=74
IconAboveShip=0
FireSound="Sovereign Phaser"
MaxCharge=1.000000
MaxDamage=2200.000000
MaxDamageDistance=70.000000
MinFiringCharge=1.000000
NormalDischargeRate=200.000000
RechargeRate=0.400000
IndicatorIconNum=511
IndicatorIconPositionX=59
IndicatorIconPositionY=69
MatrixForward=0.000000, 0.000000, -1.000000
MatrixUp=0.000000, -1.000000, 0.000000
Width=0.340000
Length=0.360000
ArcWidthAngles=-0.698132, 0.698132
ArcHeightAngles=-0.698132, 0.698132
TextureStart=0
TextureEnd=7
BeamWidth=0.300000
OuterShellColor=1.000000, 0.501961, 0.000000, 1.000000
InnerShellColor=1.000000, 0.501961, 0.247059, 1.000000
OuterCoreColor=1.000000, 1.000000, 0.000000, 1.000000
InnerCoreColor=1.000000, 1.000000, 0.501961, 1.000000
NumSides=6
MainRadius=0.070000
TaperRadius=0.010000
CoreScale=0.350000
TaperRatio=0.250000
TaperMinLength=5.000000
TaperMaxLength=30.000000
LengthTextureTilePerUnit=0.500000
PerimeterTile=1.000000
TextureSpeed=2.000000
TextureName="data/phaserspecs3.tga"

Offline Starforce2

  • Master Hardpointer
  • Retired Staff
  • Posts: 1483
  • Cookies: 882
  • Skype: LizardWranger
    • Facebook
Re: Hardpoints editor with model preview.. work in progress!
« Reply #126 on: December 14, 2008, 02:24:30 AM »
I also notice during hping some more complicated vessels, in this case converting the C9A battlecruiser to the E7 hardpoint I would find a feature to reoder the list of systems usefull, this would allow me to clump all the enwly added beam weapons with the ones further up the list, all the pulse weapons of the same type together, ect. Keep that in mind for the new hp editor. Also, when the MPE goes into template mode, showing all the systems on the hp, rather than just the ones you have added (meaning they are deactivated but not physicly removed from the HP file) they should be in a different color text. IE green for active, red for inactive. This would make accedental deletion of a used system less likely.
I just realised something. I've released over 300 fully modded ships for bridge commander. Bow to your master :D
Read my mod blog!
http://bcs-tng.com/forums/index.php?action=viewblog;u=1129

Jernej

  • Guest
Re: Hardpoints editor with model preview.. work in progress!
« Reply #127 on: December 15, 2008, 05:05:29 PM »
I have completed the ini converter to generate a .py script again, it works good on smaller ships so far, but i havent tested any larger scripts yet.
 
You could easily create tools which used ini to manipulate, edit, reorder the hardpoints, and then convert it back to .py..
 
EDIT: actually my editor already does grouping when showing systems, i will show it soon when i make another release, or you can check the version released in other thread with the engine remake thread, that one already has that.
 

Offline Starforce2

  • Master Hardpointer
  • Retired Staff
  • Posts: 1483
  • Cookies: 882
  • Skype: LizardWranger
    • Facebook
Re: Hardpoints editor with model preview.. work in progress!
« Reply #128 on: December 15, 2008, 06:34:34 PM »
you may also want to incorporate a failsafe against this:
http://bc-central.net/forums/index.php/topic,4831.0.html

If you are to the stage where it allows you to specify an icon for the damage, that is must be a valid icon ID number or it will default to a standard one (such as a fwd arc) or something.
I just realised something. I've released over 300 fully modded ships for bridge commander. Bow to your master :D
Read my mod blog!
http://bcs-tng.com/forums/index.php?action=viewblog;u=1129

Jernej

  • Guest
Re: Hardpoints editor with model preview.. work in progress!
« Reply #129 on: December 16, 2008, 05:09:27 PM »
I am not sure what that means, the IconNum param?
 
Also, is there a sort of list of these IconNum types?
 

Offline Starforce2

  • Master Hardpointer
  • Retired Staff
  • Posts: 1483
  • Cookies: 882
  • Skype: LizardWranger
    • Facebook
Re: Hardpoints editor with model preview.. work in progress!
« Reply #130 on: December 16, 2008, 07:30:06 PM »
well, they are all listed clearly in mark allens tactical display. Every charge arc, ever targeted arc, and every damage iocn has an ID number and it is shown there.
I just realised something. I've released over 300 fully modded ships for bridge commander. Bow to your master :D
Read my mod blog!
http://bcs-tng.com/forums/index.php?action=viewblog;u=1129

Offline tiqhud

  • BCFiles File Poster
  • Posts: 1763
  • Cookies: 1067
  • San Francisco Shipyards (HPer) file manuiplater
Re: Hardpoints editor with model preview.. work in progress!
« Reply #131 on: December 17, 2008, 08:34:27 AM »
well, they are all listed clearly in mark allens tactical display. Every charge arc, ever targeted arc, and every damage iocn has an ID number and it is shown there.
Very handy little tool for that, and easy to use.
TiqHud
you sir, are unable to strike, the port or starboard parts of hull , of a bovine storage facility.
Canon , what people argue exists, that doesn't really  exist.
It is all the little details, that cause headaches.
"Never judge wealth with Money"
'Intelligence has Nothing to do with Politics'
it is Late, Do you know where your Towel is?

Offline Starforce2

  • Master Hardpointer
  • Retired Staff
  • Posts: 1483
  • Cookies: 882
  • Skype: LizardWranger
    • Facebook
Re: Hardpoints editor with model preview.. work in progress!
« Reply #132 on: December 24, 2008, 12:55:07 AM »
there is yet another annoying MPE feature that I am reminded of hardpoint these 100m ships...When you zoom in, and then try to rotate the ship, it rotates on an imaginary point in space (the center of the ship when it first is loaded by the mpe) causing the ship to swing wildly off screen. The pivot point should remain the 0,0,0 of the mesh, regardless of where you've rotated, zoomed or slid the model to on the viewer since you loaded it.

Property sizes should be viewable on all properties not just those that aren't weapons. You could add the ability for such size to be displayed the traditional way (the size of the crosshairs of each system) or in a cooler fashiong, a colored sphere. Spheres could be default color or changed to a different color (a red ball on a red ship will be hard to see) if needed.
I just realised something. I've released over 300 fully modded ships for bridge commander. Bow to your master :D
Read my mod blog!
http://bcs-tng.com/forums/index.php?action=viewblog;u=1129