* Star Trek: Bridge Commander aka BCFiles is back! Now on Gamefront! https://www.gamefront.com/games/bridge-commander
Hiya! This is a separate thread, so that it can be sticky'd. This is a tutorial for scripting your own solar systems! Please let me know if anything is unclear, and I can be contacted for assistance. I have left the System Packs uncompiled, so that you can take them apart and use them for experimenting. This is also available as its own .TXT file at the location below. Have fun!http://www.maui.net/~discord/bc/tutorial.txtSolar System Creation KitThis document is intended as an informal and unofficial guide to creating new stellar systems in Activision/Totally Game's video game "Star Trek: Bridge Commander." Neither party has anything to do with this, so you will be experimenting at your own risk.Requirements:Star Trek: Bridge Commander version 1.0 or 1.1Foundation version 5.26.02 or laterText editorWhen using a text editor, NOTEPAD is actually prefered! Do NOT use advanced editors like Microsoft Word or WordPad. Those programs will include more than just plain text. BC requires plain text! There are some editors, like UltraEdit, that can work directly with plain text, without trying to embellish it. To create a new PYTHON script, simply save your text file as "FileName.py" and that is it. You can also open any raw Python ".PY" file with your plain text editor. You may NOT open a compiled Python ".PYC" file. This means that if you want to alter any of the stock in-game systems, you will need to get the SDK, which contains all of the uncompiled ".PY" files for everything. Each BanzaiZAP System Pack comes uncompiled, so you can take them apart to see how they work.To make any system, you'll need to make a new folder to keep your files in. Find your Bridge Commander folder, and dig down into the scripts and systems folders. It should look something like this:C:/ Program Files / Activision / Bridge Commander / scripts / Systems / Pick-a-systemCreate a new folder inside the Systems folder, and name it as your new system's name. Keep it simple - just letters and numbers. Symbols like apostrophe's and quotes can really confuse the BC engine.An example would be the Banzai System from the System Packs:Bridge Commander / scripts / Systems / Banzai / Banzai1.py (and other python scripts inside the folder)Each solar system requires a few files:_init_.pySystemName.pySystemName1.pySystemName1_S.pyYou may try creating these from scratch, but it is MUCH easier to start off by copying an existing system's files, pasting them into your new folder, changing the names, and dive into those to see how they work. It helps eliminate typos, and means that you're not constantly retyping the same words! Copy and Paste is the Programmer's Friend! This way, you can also figure out how details like asteroids and nebulae work: pick a system that already has one, and see what you need!Here's what all of the files do:-------------------_init_.pyThis is simply required by the BC game. It's safest just to copy it from another system. No modifications necessary.-------------------SystemName.pyThis is the file that tells the game how many locations are in this system. For example, there is only one place to warp in at in the Banzai system. The Region name in the in-game menu will be in blue. Some systems have several planets, for example Alibera has 3 points listed. It's menu name is in orange, and you will open it's submenu to choose Alibera 1, or Alibera 2, or Alibera 3. Each is it's own self-contained map, but are representing different planets in one solar system. Some maps, like Banzai, have many planets, but they are all in the same map.If you open up this file, it looks like this:import Appdef CreateMenus():import Systems.Utilsreturn Systems.Utils.CreateSystemMenu("Banzai", "Systems.Banzai.Banzai1", "Systems.Banzai.Banzai1")The first line "import App" simply gives your system access to the main game scripts. The next section sets up the in-game Menu in the "Regions" screen of the Quick Battle Set Up. Your main concern is the parenthases. The first option "Banzai" is the system's name. The second option is the TOTAL number of subsystems in this location. A system with three warpable "planets" would say "Systems.Alibera.Alibera3". Finally, you will need to list each and every subsystem. Banzai only has the one location, so it only says the names once. Alibera's parentheses looks like this:("Alibera", "Systems.Alibera.Alibera3", "Systems.Alibera.Alibera1", "Systems.Alibera.Alibera2", "Systems.Alibera.Alibera3")-------------------SystemName1.pyThis is the Locations script - which items go where in the map. It also contains info for asteroid fields, nav points, and the backdrops. Each warpable map has it's own Locations script. The first section of this code loads in the object scripts and game scripts. Make sure your own system name and number appears in all the places in this script.The middle section is where you'll do most of the work. The first item or two is the directional and ambient lights in this map. The Translate/Forward/Up XYZ coordinates give the locations and directions of your light. These numbers are relative to your ship, at relative 0,0,0. X being to the left and right. Y being forward/behind the ship. Z going up and down. The line "kThis.ConfigAmbientLight(0.100000, 0.100000, 0.100000, 0.2)" controls the color and brightness. The first three numbers are the amounts of Red, Green and Blue in the color (ranging from 0.0 to 1.0), and the fourth number is the brightness (0.0 being dark, 1.0 being blindingly bright)Next in the script comes the locations for all objects, including stars, stations, wrecked ships, single asteroids, and nav points. Again, the Translate/Forward/Up XYZ give the locations, and also the orientation. "Translate" is the actual location, with the player start at relative 0,0,0. You may move fractions of a unit, and each unit is fairly large, around half a kilometer. You can go for long distances, but fine tuning can be tedious. "Forward" is the facing-front of the object being placed. If you place a ship, it will be facing in this direction. "Top" being the direction of the top of the model. Nav Points also require the line: kThis.SetNavPoint(1)Try NOT to have anything overlap. That can confuse the game, but sometimes you can get away with it!Here is an example location of a star:# Location called "Sun" Make sure each location has a DIFFERENT name!kThis = App.Waypoint_Create("Sun", sSetName, None)kThis.SetStatic(1)kThis.SetTranslateXYZ(0.0, 70000.0, 0.0)kForward = App.TGPoint3()kForward.SetXYZ(0.000000, 1.000000, 0.000000)kUp = App.TGPoint3()kUp.SetXYZ(0.000000, 0.000000, 1.000000)kThis.AlignToVectors(kForward, kUp)kThis.SetSpeed(25.000000)kThis.Update(0)kThis = None# End location "Sun"The bottom part of this script handles the starfield and the backdrops. Each item gets a refernce as to which texture, location on the world-sphere, orientation, and how much of the sky it covers. With the actual starfield, you also control how many times it repeats itself, so you can have very dense starfields, or very disperse.Here is an example backdrop:# Backdrop Sphere "Backdrop treknebula"kThis = App.BackdropSphere_Create()kThis.SetName("Backdrop treknebula")kThis.SetTranslateXYZ(0.000000, 0.000000, 0.000000)kForward = App.TGPoint3()# This "kForward" and "kUp" will set where the nebula appears on the background sphere.kForward.SetXYZ(1.0, 0.0, 0.5)kUp = App.TGPoint3()kUp.SetXYZ(0.5, 0.00, 1.0)kThis.AlignToVectors(kForward, kUp)kThis.SetTextureFileName("data/backgrounds/treknebula.tga")kThis.SetTargetPolyCount(256)# The Horizontal and Vertical Span is how big the nebula will be. 1.0 will fill the entire sky!kThis.SetHorizontalSpan(0.494477)kThis.SetVerticalSpan(0.404660)kThis.SetSphereRadius(300.000000)kThis.SetTextureHTile(1.000000)kThis.SetTextureVTile(1.000000)kThis.Rebuild()pSet.AddBackdropToSet(kThis,"Backdrop treknebula")kThis.Update(0)kThis = None# End Backdrop Sphere "Backdrop treknebula"-------------------SystemName1_S.pyThis contains the Objects information, including models, nebulae, ships and bases, and stellar objects. Again, each location has its own Objects script. The number corresponds with the location scripts. Most of these object must have a location listed in the Location Script. The code PlaceObjectByName(" ") gets the actual name you used in the Location script. Each object should have its own location.Here is an example star:#Star info reads as (radius, corona height, ???, "which star texture", "which star-flare texture")pSun = App.Sun_Create(7000.0, 5000, 500, "data/Textures/SunRed.tga", "data/Textures/Effects/SunFlaresRed.tga")#This adds your star to the map, and gives it a namepSet.AddObjectToSet(pSun, "Banzai Prime")# Place the object at the specified location - this is one of your locations in the Locations Script!.pSun.PlaceObjectByName( "Sun" )pSun.UpdateNodeOnly()Here is an example planet:#Planet info reads as (radius, "which planetary model to use")pPlanet1 = App.Planet_Create(600.0, "data/models/environment/TanPlanet.nif")pSet.AddObjectToSet(pPlanet1, "Banzai 2")pPlanet1.PlaceObjectByName("Planet2 Location")pPlanet1.UpdateNodeOnly()Here is an example nebula:#Nebula info reads (Red, Green, Blue, Vision-distance, Sensor interference, "neblua texture", "nebula external texture")pNebula = App.MetaNebula_Create(30.0 / 255.0, 160.0 / 255.0, 45.0 / 255.0, 40.0, 10.5, "data/Backgrounds/nebulaoverlaygreen.tga", "data/Backgrounds/nebulaexternalgreen.tga")# Set nebula damage/sec to Hull/Shields.pNebula.SetupDamage(10.0, 50.0)# Next line is (location X, loction Y, location Z, radius of nebula sphere)pNebula.AddNebulaSphere(300.0, 800.0, -300.0, 125.0)pSet.AddObjectToSet(pNebula, "Nebula1")-------------------One Other Important File:In order to get it to show up in game, you need to tell Foundation that this new system exists. Look for your "Custom" folder in your game folder. Here's what it might look like:C:/ Program Files / Activision / Bridge Commander / scripts / Custom / AutoloadYou need to put this new file into that "Autoload" folder! Give it whatever name is appropriate. I call mine "SystemPack.py" so I'd appreciate it if you choose something else. Wink Here's what it should say:import Foundationmode = [ Foundation.MutatorDef('BanzaiZAP SystemPack') ]Foundation.SystemDef('ArenaA', 1, dict = { 'modes': mode } )Foundation.SystemDef('Banzai', 1, dict = { 'modes': mode } )Foundation.SystemDef('BriarPatch', 1, dict = { 'modes': mode } )The "mode" variable is the actual name of your own personal Mutator button.The parentheses contain your system name, the number of warpable maps (subsystems) and "dict = { 'modes': mode }" which does something else. The full System Pack 11 has a list of 14 places to add to the game.
Wait, the BCU forums are still there? I thought Raven had deleted everything when they had to close down.