Miscellaneous

Replacing Pictures and Animations

More specific details are to be found in sections dealing with the particular reason for replacing that picture or animation.

Replacing CBM stills
XWA uses a compressed format for its pictures (*.cbm) which as far as I know is not a normal standard format (like GIF or JPEG) but fortunately someone noticed that in the list files these were listed as being bitmaps (*.bmp). Experimentation showed that if a 256 colour bitmap of that name was placed in the folder and the CBM renamed or deleted then when XWA was started it would automatically convert the BMP into a CBM.

If you want to use the original TG picture for reference then a program called XWA_CBM will convert the CBMs into BMPs.

Replacing CBM animations.
This is very similar to replacing stills except rather than it being BMP picture files that are converted by XWA it is FLC animation files. I normally use 15 frames-per-second which seems to work well though XWA does not seem fussy about the framerate as I have tried other values, including having a single frame "animation" at 1 fps.
Since some of the folders do not have list files, and it is so easy to convert a BMP into a single-frame FLC, I have not tried to make XWA look for a BMP instead in the case of single-frame animations like the TG Azzameen Crest.
Place the FLC in the appropriate directory, rename or delete the original TG animation, and start XWA to convert it.

Again if you want to use the original TG animation for reference then a program called XWA_CBM will convert the CBMs into a series of BMPs which can be viewed or even recombined into an animation.

Replacing DAT pictures
There are two programs available for editing XWAs DAT files and which you use depends on what you are doing. XWADatCust can edit far more of the DAT files than can DATech but DATech can also edit the XWA executable, provides guidance on picture sizes, and has a rather nifty Preview window to give and edit values in. Basically DATech does less but does it marginally better.

The most common things to do are Hull, Map, Ship, or Battle/Mission DAT files which (in my opinion) are best done in DATech. XWA looks for DAT file entries and uses the entry in the first DAT file that it finds listed in resdata.txt. This means that rather than editing one of the TG DAT files you can instead create and distribute a smaller custom DAT file with just the entry that you want replacing. This is useful as most new OPTs now have a new picture for the Skirmish Editor in a Ship DAT .
Click on New in DATech and then select the type required. Import the BMP and enter the numerical value either from the Preview window (see OPTs page) or based on the Battle/Mission numbers (see Missions page). Resdata.txt will have been edited so that your new DAT file is at the top of the list and so with luck this picture or these pictures will now be displayed instead of TGs.

With more general work (on the XWA Frontend) there is a problem as it seems that using a custom DAT file will mess up the positioning of the pictures. I noticed this problem when trying to replace the Panel Arms (the control consoles that swing up on various screens) which were displayed too high up the screen. When I checked by creating a custom DAT file containing several other entries I found that the full screen pictures (such as the concourse and the tech library) were okay but other pictures (such as pilot helmet and pilot uniform) were being shown in the upper lefthand corner.
Therefore I would advise that in this case it is better to edit TGs DAT files, so open the DAT file in XWADatCust and find the picture that you want to replace. Note the size of the picture and its numerical identifier. Make a 256 colour BMP of the correct size and then reopen the DAT file in XWADatCust and select the picture to be replaced again. Right-click, select Replace item with custom bmp..., select your new picture, and then click the Replace button.

Replacing DAT animations
You would always use XWADatCust for this as animations are outside scope of DATech. The process is the same other than your needing to make a BMP file for every frame of the animation and select and replace every entry for these frames.

Replacing SNM animations
For the large full-screen animations TG decided to use the same format as their cutscenes and XCR will also intercept these and play an AVI file of the same name (aside from the file extension being avi rather than snm) instead of the snm. All that is required is for the avis depicting a new medal ceremony, or a different simulator pod closing, or whatever to be placed into ..xwa\movies and they will be used. Most of these have sound (aside from the medal ceremony) so see both Frontend and Cutscenes for advice.

Section Links: DATech | XCR | XWA_CBM | XWADatCust

Hangar Craft

When I downloaded the excellent Imperial Hangar I noticed the disclaimer that said that no way to replace the fighter seen in the hangar had been found and I decided to see if this was something I could solve.

Results were rather strange as my first idea to use MXvTED to swap the X-Wing and Y-Wing with other fighters, so that the fighters in the first two shipslots would be different, didn't work as far as I remember and so I tried another idea. This time I tried having the X-Wing and Y-Wing use renamed OPT files (XWING2.OPT rather than XWING.OPT for instance) and copying/renaming different OPTs to be called XWING.OPT or YWING.OPT. This second idea seemed to work and I felt rather pleased.

But then I came back to XWA and discovered that although the hangar "Y-Wing" was still being shown as a TIE Bomber (as that was the OPT that had been copied/renamed in that case) the hangar "X-Wing" had reverted to being an X-Wing and therefore seemed to be using XWING2.OPT. The idea occurred that if it was using the same OPT as the flyable X-Wing that maybe it was determined in the same way, by which OPT that shipslot pointed.

Checking this idea by changing in BHE what the X-Wing slot pointed to did change what was displayed for the hangar "X-Wing" but I found that changing what the Y-Wing slot pointed to had no effect, it just used whatever was called YWING.OPT (Alt-Tab out, delete, copy something else, rename, back into XWA...changed). This seemed so strange that the fighters were behaving differently that I reinstalled XWA and this time the swapping of ships in MXvTED worked where previously it had not.

With some puzzlement as I had been sure the method wouldn't work I changed my notes to reflect that and decided that I had better put a disclaimer on the method. But then I came back and found that it had stopped working as the the Y-Wing had reappeared. XWA was back to showing whatever the the X-Wing slot pointed to and whatever OPT was called YWING.OPT. I also found that in the post-mission hangar the hangar "A-Wing" was whatever was called AWING.OPT (rather than being what the A-Wing slot pointed to).

So twice it had been working and twice during my next session fiddling with XWA it had stopped working. In the first case it had used XWING.OPT rather than going by what the X-Wing shipslot pointed to before changing to that. In the second case it had gone by what the Y-Wing shipslot had pointed to rather than what was called YWING.OPT before changing to that.
This is especially puzzling as that means that the first thing I tried of swapping ships around in MXvTED should have been a partial success since that had changed what the X-Wing shipslot was pointing to, but it had been a total failure.

All of this does not give me great confidence in the reliability of the method but at the moment what I can say that it appears that to replace the hangar "Y-Wing" and hangar "A-Wing" you would edit the Y-Wing and A-Wing so that they use differently named OPTs (like to be really imaginative AWING2.OPT), rename their OPTs to this, and have whatever OPTs you want to appear be called AWING.OPT and YWING.OPT.

To replace the hangar X-Wing though would be a total pain in the arse as since it is whatever the slot points to having something different would require you to move the X-Wing into a different shipslot. This would mess up the X-Wings s-foils, require you to edit the DAT files for skirmish editor picture, hull icon, and map icon, mess up every mission with an X-Wing in it, and since certain meshes on the X-Wing exterior are set to move (pilot and R2 heads) whatever OPT you placed in the slot would have meshes wiggling about.

So an unreliable method which would be a lot of work and would cause a number of side effects. This seems like a perfect candidate for taking the route of just explaining things away and simply saying that (for example) an Imperial ship has some captured X-Wings littering up the main hangar.

E-Mails

In the missions directory there is a file called email.txt which contains the information on when the e-mails "arrive" as well as the actual e-mails.

Each e-mail consists of the following elements.
First line is the mission number the e-mail is displayed after.
Second line contains who the e-mail is from.
Third line is the e-mail title.
Fourth (and possibly fifth, sixth, seventh etc.) line is the body of the message. I have noticed that there can be a fair amount of text per line of this, and up to six lines (for paragraphs) have been used. This should be plenty of text.

Remember though, as pointed out by OI Monk, that the screen in the family transport / quarters does not have a scroll bar so of you produce a message which is too long then the last parts of this message will not be displayed.

Whether you use e-mail in your campaign depends on what you are trying to do. Since it does not add a huge amount to a campaign you may feel that it is not worth doing if you would have to redo the entire cabin for it or risk spoiling the atmosphere of your campaign by having the standard look hit the player in the face.
TG did use the e-mails well though to add some personal touches which wouldn't have been appropriate for including in the mission descriptions / briefings / debriefings so you may benefit from the same use.

As Defiant says can be installed as part of missions XMOD as the InstallMission command which would normally be used to copy mission files to XWAs mission directory can also be used for copying the new mission.lst and email.txt to that directory.

Cruiser Insignia / Crests

If during your custom campaign the players pilot is not going to be flying from one of the three Calamari Cruisers (Defiance, Liberty, and Independence) or indeed is not an Azzameen then it would be strange for their insignias/crests to be displayed. That said though as there was the later MC-90 class Defiance which would have inherited the ships-insignia from the MC-80 then this insignia could be used and Independence is what TG were calling Home One (see note on downloads page) so again this could be used as we know this ship was still in use as late as the events of Isards Revenge, so this insignia could also be used.

If neither of those possibilities appeal and you decide to create your own insignia or crest then this is reasonably simple as they are normal animated CBMs which loop during their period of display (which means that as with the TG Azzameen crest you can simplify your task further and make a single-frame "animation" if you wish).

The first step is to decide what sort of insignia or crest you want to make, do you want it to be animated or still and what kind of organisation do you want to make it for (A family crest? A starship insignia? A squadron insignia? A corporate logo?). TG made a spinning gold insignia for each of the three cruisers and a static colour crest for the Azzameens but, other than a wish to remain consistent, you don't need to follow their example.

If you have the ability to produce animations then I would say that it is worth the extra work. A spinning insignia can be created by mapping a picture onto a box in a 3D modelling package and just spinning the box (zero lighting, black box, black background, texture with black background set to 100% self illumination), or pictures can be distorted in a paint package to provide a similar effect.

For a static insignia you should simply create the picture and then convert it to a single-frame FLC.
For an animated insignia I am not sure what frame rate TG use but have found that a 60 frame animation playing at 15 frames a second worked well.

You should then give your FLC (either single-frame still or multi-frame animated) a name like squad1.flc (or 2 or 3 or 4) and copy it to xwa/frontres/tour. Delete or copy to another directory the CBM file of the same name as your flc and then start XWA which will convert the CBM into a FLC when it needs to use it.

The final step is relatively optional as when the default mothership insignia of 0 is used this gives the label "Tour of Duty" which adequately describes what a pilot in military service is doing and therefore well be all you want. If you have gone to the trouble to make an special insignia though you may as well go the extra inch and open fronttxt.txt in a text editor and either edit the lines which start "!STR_CRUISER_" (which correspond to squad1-squad3 with the family base being squad4) so that the text after the second exclamation mark to the name of your ship or organisation.
Alternatively you could copy these into xwa.tab and edit those versions, which is what XIS will do if you tell it to as part of an XMOD installation of your mission set.

Either way the final step would be simply to select the appropriate mothership insignia in AlliED when building the mission.

XMODs

For more details on creating XMODs please see the XIS readme file. For an excellent and extensive guide to producing complex XMODs please see Darksabers site.

An XMOD is the file used by the X-Wing Installation System (XIS) to automatically install one, or more modifications, to XWA and is a renamed zip file containing the files to be installed plus a script file for XIS to use, a readme file for XIS to display, a picture for XIS to display as a banner file, and a ZT file for patching XWINGALLIANCE.EXE.

When the XWAU began the idea was to produce OPT packs, something which due to the slowness that people such as myself have been producing OPTs has been dropped in favour of individual releases, and the need was realised for a simple automatically installing way of distributing these OPT packs. It would have been quite easy to have decided that a program that could do just what was required would be good enough so thanks go to (the author) Defiant for his foresightedness in creating a program which has the ability and script commands for installing any sort of modification.

There are advantages and disadvantages to the XMOD format. Leaving aside that it is a very small amount of extra work the main disadvantage is actually the main advantage as well, the fact that it is an automated process.
Distributing "raw" files with instructions or things like MXvTED ship files (where the slot the ship is installed into can be chosen) allows the user to decide how to install the modifications and combine your work with other peoples in the way that they want. Obviously if you are doing a Total (or near total) Conversion then your modifications will be extensive enough that little combination would be possible but if you are just distributing a single OPT or a smaller modification then the inflexibility of the XMOD system could be more important.
That said distributing things as XMODs has become the normal procedure for the reason that many people do not want to do anything more complicated with a modification than simply install it and use it and therefore would rather have a simple process than a needlessly flexible but complex process.

The general process (of which there are far more details in the XIS help file) is to create a directory for your modification. In this folder you should place a 350*100 bitmap called banner.bmp which as the name suggests is for your banner image and a rich-text format text file called readme.rtf which again as the name suggests will be the readme displayed when the XMOD is loaded into XIS.
Within this directory you should create sub-directories into which the appropriate files for the modification (or set of related modifications) you are installing will be copied and within which a script file of the same name as the sub-directory. Each of these will be listed in XIS and can be selected and deselected so that the user can choose which to install and which not to. It is important to make it clear to the user if you are using this to provide alternate options (such as the differently centred cockpits for different resolutions for the XWAU TIEs) that they should not simply select everything.

Once you have all your sub-directories containing the appropriate files and the corresponding script files created the next step is to zip them. Select all the sub-directories, the readme, and the banner image and then use the appropriate command (I'd do the same as Defiant, right-click and select Add to Zip). As Defiant says do not select your main directory and zip this as that will add an extra layer of directories to the zip-file structure and this will prevent the XMOD from working.

Open this zip file in whichever zip-file program you use and check that the readme and banner image are in the root and that each modification (or set of modifications) are shown as being in sub-directories. If they are not then check that if your zip-file program has an option for this that it is set to "include subdirectories" and check that you are not creating any extra layers of directory structure by accident.

Once this is done then the final stage would be to simply rename the zip file to have the extension *.XMOD rather than *.ZIP.

Missions

An XMOD for installing a set of custom missions should contain the mission files, custom briefing icons if custom OPTs used, mission.lst, possibly mission voices, possibly a new pilot, and possibly the file for the pilot quarters e-mail.
Create the subdirectory and place the files within it.
The mission files, mission.lst, and email.txt are all installed using the InstallMission command in the script file (e.g. InstallMission 1B9M1.TIE will copy that mission file to \xwa\missions\).
The custom briefing icons are installed using InstallFrontRes with <directory> equalling mapicons. Script file lines should be InstallFrontres LBLU_4.CBM mapicons, InstallFrontres LGRN_4.CBM mapicons, InstallFrontres LPRP_4.CBM mapicons, InstallFrontres LRED_4.CBM mapicons, and InstallFrontres LYEL_4.CBM mapicons.
Mission voices are installed with the InstallMissionVoice command using either the directory name (of the same name as the mission file) for the wave files to be installed to this sub-directory under ..\xwa\wave\missionvoice or using "." as the directory name for the mission voice lst file which will then be placed in ..\xwa\wave\missionvoice.
If your mission set is not set onboard one of the TG Calamari cruisers then AddString should be used to add the lines containing the new cruiser name to XWA.TAB. You may also want to use InstallFrontRes with <directory> equalling tour to install a new cruiser insignia.
Finally the pilot file is installed using InstallPilot.

OPTs

For an XMOD for installing custom OPTs you should include the OPT files themselves, ZT patches for XWINGALLIANCE.EXE, and DAT file(s) for the skirmish editor picture and map icon (and if a fighter a hull icon).
Create the subdirectory for each OPT in the pack and place the files within it.
The OPT files are installed using the InstallOPT command which will copy the OPT files to ..\xwa\flightmodels. The AddToCraftList command is also used to place flightmodels/filename on a given line in SPACECRAFT0.LST if you are adding a new craft.
If you are installing a new ship or have (as with the XWAU) added a cockpit whose X/Y/Z position needs to be defined then the PatchFile command will also need to be used to modify XWINGALLIANCE.EXE with the ZT file for that ship. This file should be created with TIE Patch or ZT Patcher rather than MXvTED.
If you are installing a new ship or have decided to modify some part of the ships description (such as changing Imperial Star Destroyer to Imperator Star Destroyer or MC-80a Calamari Cruiser to MC-80 (Reef Home) Calamari Cruiser) then you will also need to use AddString to add this information to XWA.TAB which will override the information in specdesc.txt, strings.txt, and shiplist.txt.
The InstallResData command will also be required to copy the DAT files to ..\xwa\resdata\ if you are installing a new ship (or wish to change the picture used for the ship to reflect your new model) and the AddToResData command to add a mention of these new DAT files to the beginning of ResData.txt which is XWAs list of DAT files.

Cutscenes

An XMOD with cutscenes in it is likely to be rather large and I might have recommended splitting it into a separate XMOD for each cutscene were it not for that people have shown that they are willing to download a file as huge as the 180MB Ultimate Craft Patch, and so you may as well have a single XMOD. This file will contain the avi files for the cutscenes (which will be played thanks to XCR), possibly dummy snm files if you are adding rather than replacing TG cutscenes (these dummy files will be seen by XCR which will then play the avis instead), cbm files for the thumbnails for the cutscenes, a new cutscene.lst, and a new cutscene.txt.
The avis and the dummy snm files are installed using the InstallMovie command which will copy them to ..\xwa\movies\.
The cbms thumbnails for the cutscenes, the new cutscene.txt, and the new cutscene.lst will be installed with the InstallFrontRes command with <directory> equalling cutscene, which will copy those files to ..\xwa\frontres\cutscene.

Frontend

XMODs for this purpose will contain mainly CBM files with some avis (which XCR will play instead of the snm files for the large animations) and some DAT files.
The avis will be installed with the InstallMovie command which will copy them to ..\xwa\movies. Since you will be replacing existing animations there is no need for any dummy files.
The CBM files will be installed with the InstallFrontRes command with <directory> equalling the different directories, depending on what you are replacing (see Frontend page for more details).
You will probably have renamed various parts of the screen so use AddString to add this information to XWA.TAB which will override the information in fronttxt.txt.
Finally DAT files will be installed with InstallResData and will mostly be modified versions replacing TGs own rather than new DAT files as I have found that with DAT pictures that are not full screen the position of the picture is messed up if a new DAT file is used. However if you are only replacing full screen pictures such as the concourse backdrop then you may want to use a new DAT file and so need to use the AddToResData command to add the name of this new DAT file to the top of ResData.txt.

Section Links: Darksabers X-Wing Station | Defiants Flying Temple

Problems

hangar entry/exit problem with mothership not in CRS slot

For some reason XWA seems to have a problem judging the position of the players craft compared with whatever hangar OPT it is using if the players mothership is not installed in either of the two Calamari Cruiser slots. Although the game will pick up correctly on the fact that the player craft is by the hangar on whatever ship has been set as the mothership when the player enters the hangar they will find their end position being in parking in empty space and the various hangar camera positions also being incorrect.

This does seem to be a peculiarity of what shipslot the mothership is installed in as if the same OPT which has been giving this problem in a non-CRS slot is installed instead into one of the CRS slots then the player will stop in the correct position. It is not a flaw with custom-OPTs or installing ships in slots which are not used by default as TG OPTs in TG slots behave in the same manner in both not working in their normal slot and working if installed into a CRS slot.

99.99km separation in Skirmishes

When using custom OPTs the skirmish editor can get confused about how much clearance the various ships need to avoid collisions and decide to play it safe to the extent of separating them by what is displayed as 99.99km. This is a little annoying as although the skirmish editor is rather limited you do sometimes just want to have a quick fight and to involve custom OPTs.

A partial solution seems to be juggling the order in which the Flight Groups are arranged in the skirmish editor and trying to sandwich custom ships between standard XWA ships.

A more reliable solution would be to build up a little library of mission files created by the skirmish editor for TG opts and to edit these to change ship types to use the custom OPTs, save as temp.tie, and then make temp.tie read-only so the skirmish editor cannot overwrite it. Remember though that the player craft in the skirmish you use to launch this seems to need to be the same as the player craft in the mission file or a new skirmish is created (though temp.tie is not overwritten).

Problems with Dual-Warhead launchers

This was something that I discovered when I created the T-42 and only applies to if the craft is being used in a mission where the player launches from a hangar and the player tries to change his warhead loadout. XWA seems to change the wrong set of warheads and then to forget that the craft has dual-launchers.

This is not a problem with custom OPTs as even the Skipray and the Missile Boat do not work properly in this respect.

The Skipray works as badly as a craft with dual launchers installed in a custom slot.
The Missile Boat does provide an option to change both the Primary and Secondary warheads, which partially works. Changing the missiles works and you end up with the combined total of heavy-rockets for both launchers. However the other option causes the same problem as with the other ships.

The dual-warhead craft work fine in skirmishes and it is easy enough to just not give the option to change the warheads in a custom mission so this is not a huge problem.

hangar wave files, and being called Azzameen

Various of the wave files that are played when you return to the hangar during or after a mission include the name "Azzameen" which could be rather jarring in a custom mission-set where the player is not an Azzameen. Fortunately this is rather easy to solve.

There is a list file called HangarVoiceSFX.lst in the Wave folder on the CD and (as the name implies) this controls what voice wave files are heard in the hangar and fortunately it seems that only two of these voices have the dreaded word "Azzameen" in them.

If a folder called wave is created in your XWA directory then the game will use the copy of HangarVoiceSFX.lst placed in this folder in preference to that on the CD and so by editing line 1ine 1 (Rebel_Pilot8/G4P8001.wav) and line 6 (Rebel_Pilot8/G4P8006.wav) to read "unused" you can prevent the offending wave files from being played.

Pilot returning to beginning of mission set when using BriefingLauncher

On my system and some other peoples FindFile() returns a filename to BriefingLauncher which has been shortened. This can can be discovered if when starting with BriefingLauncher the list of pilots has the "~" in it to indicate this. For example John Myers0.plt gets shortened to johnmy~1.plt or Ace Azzameen gets shortened to aceazz~1.plt.

This shortened pilot filename then gets written to config.cfg as the pilot for XWA to use, but BriefingLauncher can sometimes only overwrite the first name and other times only partially overwrite the second name. For example it changes lastpilot John Myers to lastpilot johnmy~ Myers or lastpilot Ace Azzameen to lastpilot aceazz~ Azzam.

And so when XWA launches it thinks "Eeek! I can't find the pilot" and rather than crashing creates a new one with that name, which obviously is a fresh pilot whose position is right back at the start of the game. For the previous examples this would mean that johnmy~ Myers0.plt or aceazz~ Azzam0.plt would be created.

So what you need to do is have a pilot whose name and filename is short enough (either when created or by editing with XWA Piloteer) to not be shortened by this strange problem with the filename passing. You may also have to edit config.cfg to delete the second word if the previous pilot you were using had two names defined rather than just surname.

This is a rather puzzling problem as I encountered it on a Windows98 machine and Flaming_Imp developed BriefingLauncher on a Windows98 machine, and for him and his testers this worked perfectly even with the same default pilot of Ace Azzameen. You may have the problem or you may not, but it is not a major problem as in some ways it would be better to create a new pilot for a custom mission set anyway.