Author Topic: global ship addition via modular table or custom flag?  (Read 1442 times)

0 Members and 1 Guest are viewing this topic.

Offline Paegus

  • 23
global ship addition via modular table or custom flag?
i was wondering how complicated it would be to have the ability to have a ship or weapon automatically added to all campaign selections and multiplayer options so instead of having to go through every campaign file and add it manually you could just make a modular table filethat lists the object (ships or weapon) and how many and etc and have them appear as available in any loadout screen.
alternatively it could be done with a custom flag such as "global" which could be added to the ship or weapon in question using the existing -shp or -wep.tbm files.

or would this be too frowned upon by the mighty campaign constructors as you're not bloody well supposted to fly around beating down Shivans in a Colonial MkII Viper armed with phaser beams and proton missiles etc... ?
-Paeg

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: global ship addition via modular table or custom flag?
Adding the ship to every campaign is easy. Make a tbm for it and stick it in Data\Tables (or Mediavps\Data\Tables).

Getting it added to every campaign is not simple nor should it be really. Whether a ship is available should require work from the mission designer. This isn't an issue that should require a code change.

If you want to add it to all your missions you should add it by simply using search and replace on the .FS2 files replacing

Code: [Select]
$Ship Choices: (
with

Code: [Select]
$Ship Choices: (
"NameOfShip"               5


Then do the same thing with the .fc files but this time replace

Code: [Select]
+Starting Ships: (

with


Code: [Select]
+Starting Ships: ( "name of ship"

All you really need is a program with a good find in files option.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Paegus

  • 23
Re: global ship addition via modular table or custom flag?
Adding the ship to every campaign is easy.

Getting it added to every campaign is not simple nor should it be really.

that's kind of contradictory...
the process is both easy and simple if you use something like textpad and know where to look and what files have what in them. it's just much less modular than it could be.
i'm trying to have a completely compartmentalised ship whose data (.vp) you just drop in and can see how the ship preforms under various circumstances which is currently about as simple building a lego plane without the instructions since it seems everyone always expects everyone else to know everything about anything needed to do it. not you personally btw. it's just a general trend i've detected over the years.

but why exactly shouldn't it be both simple and easy? specifically for people who aren't born to program. the point is to load this or that ship in any campaign or multiplayer map without having to locate, extract and replace line after line in file after file for mod after mod after mod. it doesn't have the slightest bearing on the original campaign designer other than that you do this presumably after you've beaten the stock campaign...
-Paeg

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: global ship addition via modular table or custom flag?
Making the ship available to add in to a mission is the easy part, using modular table files.  Changing each mission so that they will allow the user to fly that craft in a campaign is the hard part.  That data is stored within a mission file (and campaign file sometimes) and there's no way to have the game automatically change all missions to make the new craft available.  The only option available for you, would be to include with your modular table files, edited versions of all missions and campaign files for all campaigns you want the user to be able to fly the new craft in.  You'd need to either have them all extracted to their proper folders to take prescedence over the mission files in the existing VPs, or combine the modular tables and edited missions into a drop-in VP file, which is named so that it will take prescendence over the other VPs.
The Trivial Psychic Strikes Again!

 
Re: global ship addition via modular table or custom flag?
Adding the ship to every campaign is easy.

Getting it added to every campaign is not simple nor should it be really.

that's kind of contradictory...
the process is both easy and simple if you use something like textpad and know where to look and what files have what in them. it's just much less modular than it could be.
i'm trying to have a completely compartmentalised ship whose data (.vp) you just drop in and can see how the ship preforms under various circumstances which is currently about as simple building a lego plane without the instructions since it seems everyone always expects everyone else to know everything about anything needed to do it. not you personally btw. it's just a general trend i've detected over the years.

but why exactly shouldn't it be both simple and easy? specifically for people who aren't born to program. the point is to load this or that ship in any campaign or multiplayer map without having to locate, extract and replace line after line in file after file for mod after mod after mod. it doesn't have the slightest bearing on the original campaign designer other than that you do this presumably after you've beaten the stock campaign...

You don't need to program anything. And it is incredibly easy to replace a few strings in the requisite files. Or is using Notepad akin to building Lego without instructions? What you're asking for is something that will save you time, and something that will not be of much use to many other people. Even if you are averse to editing files all the time, why not make a placeholder ship in the TBL, add it to your missions, then change the ship data to become whatever craft you want to test? At release time, you can tidy all the missions up and remove the placeholder.

Failing that, look at this program, or something like it. It performs search/replace operations across multiple files without you having to do the legwork manually.

  

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: global ship addition via modular table or custom flag?
I suppose that could have been more clear :)

Adding a tbm file that makes a new ship class physically available for use by all campaigns is simple. Once you've done the tbm step all the campaigns should be able to find the ship class, add it to the techroom and figure out which models and textures it uses.

However it should not be simple to add a ship to all the missions. There is no good reason why FS2 should have this ability. If you want a new ship to be usable in every campaign replace the myrmidon with it or something. There's no real reason why you should be able to have a ship able to force its way into every single mission of every single campaign except for the kind of heavy handed changes you want to make. It's not something that would be used by mission designers very often and it would in fact screw up their carefully designed missions if people could do it.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]