Bridge Commander Central

BC Forums => BC Scripting => Topic started by: starfox1701 on May 26, 2008, 10:54:59 PM

Title: Ship hardpoint scripts
Post by: starfox1701 on May 26, 2008, 10:54:59 PM
Ok this is a simple question, does each model need its own hardpoint script? By this I mean if I have say 4 different Galaxy MkII models do I need 4 different scripts if I only want to use one model at a time or will one script work for all the models as long as they all have the same named .NIF?
Title: Re: Ship hardpoint scripts
Post by: Picard_1 on May 26, 2008, 11:16:38 PM
Each model must have its own ship script, but they can all use the same hardpoint. The LC's Ambassador pack and Dr_McCoy's Constellation Pack are perfect examples.
Title: Re: Ship hardpoint scripts
Post by: MLeo on May 27, 2008, 01:21:43 PM
For the best effect for most mods, separate ship file (in scripts/Ships) and a separate plugin entry (scripts/Custom/Ships, but you can share files resulting in multiple plugins per file, but each must be unique, in fact, unless you want to replace a ship you need unique names).

Hardpoints can be shared, in fact, you can even extend a hardpoint for use with another ship. ;)

It's used for the "hero" ships in BC.
Title: Re: Ship hardpoint scripts
Post by: starfox1701 on May 28, 2008, 06:09:13 AM
But I don't have to change the script if I'm just changing the model like Replacing the SNS Galaxy with the DJ Galaxy. As long as the models are scaled and named the same the script will work fine? Also what do you mean by extending a hardpoint for use with another ship? Is that like having 2 ships using the same file at the same time?
Title: Re: Ship hardpoint scripts
Post by: Mandalore on May 28, 2008, 08:20:45 AM
The hardpoint script places the ships systems around the model. But since there are some differences from one model to another of the same shipclass (even if both are scaled correctly), some systems will be out of place if you just change the model (phaserarrays as example).
Title: Re: Ship hardpoint scripts
Post by: ACES_HIGH on May 28, 2008, 11:24:39 AM
the DJ galaxy and the SNS for example are based on two completely different studio models, the SNS being based off the original ILM model designed for the pilot (as used in Generations) and the DJ is an amalgam, largely based on the model designed after season 3 by Greg Jein, there are some subtle differences, so the hardpoints are not quite compatible, but they could be modified to fit each other
Title: Re: Ship hardpoint scripts
Post by: starfox1701 on May 28, 2008, 04:25:21 PM
So you pretty much need to take it on a case by case basis.
Title: Re: Ship hardpoint scripts
Post by: Picard_1 on May 28, 2008, 10:43:35 PM
While that is true, it is also not hard to use the SNS Galaxy HP in conjunction with the DJ Galaxy model. As Aces_High pointed out, there will be differences by they can be adjusted very easily.
Title: Re: Ship hardpoint scripts
Post by: MLeo on May 29, 2008, 11:25:22 AM
Ok, let's say, we have 4 ships, A, B, C and D.
A and C use hardponts 1, B uses 3 and D uses 2.

But 2 "extends" 1, and increases shield power.
And 3 "extends" 2 and adds an extra phaser array.


So, multiple ships can use the same hardpoint.
Title: Re: Ship hardpoint scripts
Post by: Picard_1 on May 29, 2008, 05:28:38 PM
I know that method is used for the SNS Galaxy, but exactly how do you tell the extension to point to the parent hardpoint?
Title: Re: Ship hardpoint scripts
Post by: MLeo on May 29, 2008, 05:35:25 PM
Like I said, Hero ships. ;)


Here are a couple of examples:
scripts/ships/Hardpoints/e2m0warbird.py
scripts/ships/Hardpoints/enterprise.py
scripts/ships/Hardpoints/geronimo.py
scripts/ships/Hardpoints/matankeldon.py
scripts/ships/Hardpoints/rankuf.py
scripts/ships/Hardpoints/biranustation.py

And those are just the generic ones, there are more (I believe) mission specific ones that are in the Maelstrom directory (or rather, subdirectories of that).
Title: Re: Ship hardpoint scripts
Post by: starfox1701 on May 30, 2008, 03:03:48 AM
So it like the include command in Armada. It tells the game use script 1 except what is changed in script 2. Can you also point multiple scripts at the same model for things like minor veriants and refits?
Title: Re: Ship hardpoint scripts
Post by: MLeo on May 30, 2008, 06:57:56 AM
The same model is always possible..


It's kinda like the include, except that this is all programming code.


You should see, hardpoints, models, textures, projectiles as resources, completely seperate stuff, that gets bound in the ship file (scripts/ships) to form a ship.
Then you have a ship plugin, in scripts/Custom/Ships/ that points to a ship file and makes it known in BC with extra info needed to do that.
Title: Re: Ship hardpoint scripts
Post by: Picard_1 on June 01, 2008, 09:39:01 PM
Quote
You should see, hardpoints, models, textures, projectiles as resources, completely seperate stuff, that gets bound in the ship file (scripts/ships) to form a ship.

Making the hardpoint isn't too hard, but how to you create the scripts/ship.py that contains the model information from scratch. For example, the Antican fleet pack comes with models but no ship script or hp. I can use the MPE to create a hp but where do I begin with the ship.py?
Title: Re: Ship hardpoint scripts
Post by: starfox1701 on June 02, 2008, 07:15:12 AM
I guess that if you know how to code the scripts then its just a mater of looking at the model and deciding whats a gun and so forth.
Title: Re: Ship hardpoint scripts
Post by: MLeo on June 02, 2008, 01:51:44 PM
The ship script "simply" binds everything together, what you need to do is copy an existing one and fill in the blank spots (or rather, all the references that refer to the original use of the file).
Title: Re: Ship hardpoint scripts
Post by: Picard_1 on June 04, 2008, 12:27:27 AM
That's easy enough, but what about the LOD info. There are different values for different ship scripts. For instance, here's one taken from a Constellation and CE Galaxy. Does this make a difference or can I use any ship script?


Constellation
   
Code: [Select]
# Create the LOD info
if (not App.g_kLODModelManager.Contains(pStats["Name"])):
# Params are: File Name, PickLeafSize, SwitchOut Distance,
# Surface Damage Res, Internal Damage Res, Burn Value, Hole Value,
# Search String for Glow, Search string for Specular, Suffix for specular
pLODModel = App.g_kLODModelManager.Create(pStats["Name"])
pLODModel.AddLOD(pStats["FilenameHigh"], 10, 120.0, 15.0, 15.0, 400, 900, "_glow", None, "_specular")
pLODModel.AddLOD(pStats["FilenameMed"],  10, 300.0, 15.0, 15.0, 400, 900, "_glow", None, "_specular")
pLODModel.AddLOD(pStats["FilenameLow"],  10, 800.0, 15.0, 30.0, 400, 900, "_glow", None, None)

CE Galaxy
   
Code: [Select]
# Create the LOD info
if (not App.g_kLODModelManager.Contains(pStats["Name"])):
# Params are: File Name, PickLeafSize, SwitchOut Distance,
# Surface Damage Res, Internal Damage Res, Burn Value, Hole Value,
# Search String for Glow, Search string for Specular, Suffix for specular
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, "_glow", None, "_spec")
pLODModel.AddLOD(pStats["FilenameLow"],  10, 800.0, 15.0, 30.0, 400, 900, "_glow", None, "_spec")
Title: Re: Ship hardpoint scripts
Post by: starfox1701 on June 04, 2008, 02:06:47 AM
Not sure but I don't see why you need more than one script. Just because the detail of the model goes down doesn't mean she has any less systems or that they are in a diferent place.
Title: Re: Ship hardpoint scripts
Post by: SMBW on June 04, 2008, 09:15:35 AM
You need to check if the model you want to integrate uses specular textures. If it does you need to adapt the "_specular" suffix to whatever suffix is used for these specular textures (e.g. "_spec").

The other parameters change the visible damage and how far this model is viewable ingame. If you would like to know which number changes a specific thing you need to read the comment above:

Quote
# Params are: File Name, PickLeafSize, SwitchOut Distance,
# Surface Damage Res, Internal Damage Res, Burn Value, Hole Value,
# Search String for Glow, Search string for Specular, Suffix for specular

I don't think there is an ultimate ship.py which is perfect for every model but there might be one which is at least acceptable for most ships.
Title: Re: Ship hardpoint scripts
Post by: MLeo on June 04, 2008, 03:49:40 PM
Those options are there to optimize models for things like damage.

Some models are more complex than others, and can cause BC to crawl to a slow with the "right" damage (right as in, just right to cause BC to take the worst case senario for the damage generating algorithm). So tweaking those can in fact increase speed in BC.
Title: Re: Ship hardpoint scripts
Post by: starfox1701 on June 05, 2008, 01:27:22 AM
I guess thats a trile and error thing.