Improved Team Loadout

From FreeSpace Wiki
Revision as of 14:05, 5 March 2012 by MjnMixael (talk | contribs) (Clarification)
Jump to: navigation, search

Revision information.....

FSO Revision: 8566
Note: Please update the version when the page is updated. If your edit had nothing to do with new code entries then please do not edit the version


Team Loadout has been improved to allow the use of variables as well as numbers to determine how many ships will be available and if any weapons are required for the mission. The heart of the new system is the updated Team Loadout panel of course.

Required Weapon

Another new feature is having a weapon required for the mission without locking the entire loadout. This feature however does not yet have a FRED dialog and must be done in notepad. The syntax follows...

   +Required for mission: ( "Subach HL-7" "Rockeye" "Tempest" )

and must be placed just after '+Weaponry Pool:'

NOTE: This feature simply requires the weapon to be somewhere in the loadout and not necessarily on any particular ship.

Variables and Numbers

TeamLoadoutEditor.jpg

The most important addition is the Set Amount from Variable. The list presented to the player shows all the available number SEXP variables. In the example shown the NumberOfHercIIs variable has been set to 5, but since this is a persistent variable, any previous mission could set this to another number.

The From Variable list gives you access to another powerful feature. Not only can the number of ships available be set from a variable. The class of the ship itself can also be set from a string variable. That means you can determine the loadout of one mission in the one preceeding it.

The Team Loadout Editor only affects the number of ships that will be available in game but it won't touch the ships that have been specified in the mission file by default. If you set up Alpha wing to consist of 4 GTF Ares that's what you will get by default. If, however, you go to the Ship Editor and select the Set Class Dynamically the ship class will be set based on what is left in the Loadout.

SetClassDynamically.jpg

For every ship that has the Set Class Dynamically box ticked the game does the following : -

  1. Check if the ship specified in the mission file was set to be available in the loadout and if there are any left. If so the number left is decreased by one.
  2. Check if the ship fits one of the Alt Ship Classes (more on these later). If so the ship is changed to that class.
  3. Loop through the loadout in the order they appear in Ship.tbl and set it to first class that it can find any ships available for.
  4. If all the above has been unsuccessful, the game sticks with what was supplied in the mission file.

Note that the game does this for every ship that has been told to Set Class Dynamically not just Alpha, Beta and Gamma wings. It is quite possible to use this feature to set the class of any ship in the mission (although using it with anything other than ship classes that the player can fly is pointless)

AltShipClassEditor.jpg

The Alternate Ship Classes Editor gives the mission designer a way to fine tune which ships will be selected by the game. Alt Class Type 1 acts as a suggestion. The game will try to set the ship class to that if there are any ships of that class remaining. Alt Class Type 2, however, is more of an order. If one of these is given that will be the ship class that the ship ends up with if it couldn't find a match earlier on. Note that Alt Classes are completely optional.

Here's a run down of what will happen for the ship that the Alt Ship Class Editor pictured above belongs to.

  1. Check the class in the mission file has any remaining ships.
  2. Check the first type one alt class (if any). In this case it's a Herc Mark II.
  3. Check 2nd and 3rd type one alt classes. In this case that's an Erinyes and whatever the AltClass01 String Variable holds
  4. If the above steps have failed the game then notices that the GTF Hercules has been specified as the Type 2 Alt Classs. The ship will be a Herc. Had no Type 2 been specified, the game would then start looping through the entire loadout as described above.


Setting Up The Next Mission

When it comes to setting up the team loadout variables, you have several options. You can roll your own events to set up everything, but this could get tedious. Work on constructing SEXPs to alter the the loadout depending on ships which departed or were destroyed are on their way. Till then the deal-with-ship-loadout will automatically sort out the loadout variables for any destroyed ship that had set the Team Loadout Store Status box clicked for it. Don't release anything using this SEXP, though, since it is subject to change or removal.