Documente Academic
Documente Profesional
Documente Cultură
Page 1 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Index Introduction................................................................................................................4 Tools required for this tutorial ............................................................................4 Explanation of the modding tools ..............................................................................4 X3 Mod Manager...................................................................................................4 TXT Editor.............................................................................................................5 Text Resource Editor .............................................................................................5 Galaxy Editor .........................................................................................................6 Enabling the in game editors ...............................................................................6 A note on scripts and why they are essential to modders ......................................6 Enabling the script editor .......................................................................................6 Enabling the galaxy editor .....................................................................................7 Making a mod step by step ........................................................................................7 Preparation .............................................................................................................7 Checking the unpacked files Creating a new ship .....................................................................8
...................................................................................9
Create your cat file ..................................................................................12 Using the in game galaxy editor ..............................................................................12 A map to work from ................................................................................12 Cheating in the editor...........................................................................................13 Creating a ship in the editor .................................................................................15 Saving your map ..................................................................................................16 Navigating the galaxy ..........................................................................................16 Importing map patch objects................................................................................17 Adding or deleting sector objects and adjusting station wares ............................17 Copy, Paste, and rotate objects ............................................................................19 Asteroids and planets ...........................................................................................19 Connecting Sectors with gates ..........................................................19
Galaxy Editor that comes with X3 Editor ...................................................20 Exploring the editor .............................................................................................21 Naming sectors.....................................................................................................22 Adding a new sector ................................................................................22 Joining your new sector to the galaxy..................................................................23 Making your sector appear in the galaxy map ..................................24
Adding your updated bod file to the cat file ...........................................27 Checking how the new sector looks.....................................................................27 Playing your mod in the game ..........................................................................29 Instructing your mod users...................................................................................30 Making a start up script ........................................................................30 Script editor commands .......................................................................................31 Page 2 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Editing the initplayer script..................................................................................32 Making your start up script work with your mod ...................................37 Cockpits, Guns and Turrets......................................................................................39 Adjust laser selections for your ships cockpits .......................................39
Adding extra lasers to your ship ................................................39 A note on turrets...................................................................................................43 Other ideas for your mod .....................................................................................44 Changing the game music tracks and sound effects ................................44
Converting bob files to bod using Doubleshadows x2bc .........................45 Appendices 1............................................................................................................47 Planet descriptions ...............................................................................................47
Page 3 of 49 02/05/2006
Introduction
Making game modifications for X3 Reunion might seem a little daunting to most fans who have played the game or would like more from the game. There are many good guides and tools for achieving this which will be explained further in this tutorial. Whether you would like to just mod the game for your own enjoyment or make a full blown mod for others to use, this guide will provide you with an explanation of what mod software you need, then through a step by step process on how to make a mod and hopefully advance many people wishing to mod. You might not become a modding guru as this comes with experience, but you will be able to mod almost anything in the game so that your preferred game play becomes a reality. Throughout the guide you will see star ratings for the complexity of each tutorial which change as the difficulty level changes, ranging from to . If you are new to modding, I would recommend focusing on the 1 to 2 star topics before trying 3 to 4 star.
X3 Mod Manager
The mod manager allows you to do the following with .cat files (short for catalogue files): Open and view a cat file
Page 4 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Extract the files from a .cat file, individually, by selection or all files. Add to or delete files from a cat Create and name a new cat
A cat file is basically information on the structure of a .dat file containing the game files in a directory structure that the game recognises. In the X3 game folder normally C:\Program Files\DeepSilver\X3 Reunion\ You will see cat files 01 to 07 if you have version 1.402 or 01 to 06 if you have version 1.4. Each cat file has an accompanying dat file with the same number. So 01.cat goes with 01.dat and so on. These data files contain many files the game uses e.g. game maps, graphics, 3d structures, text files, sound effects, etc. The files are in many formats, some well known and some not so well known. There are many editors available for manipulating these files e.g wav, jpg, xml, pck, bod, pbb. This guide will not teach you how to manipulate every file type as some are pretty self explanatory. However you will learn how to change the files you need to make a really good mod using the tools explained. When installing Modmanager the very last screen will prompt you to associate cat files with Modmanager. Make sure this is checked before clicking on close. This way all of your cat files will use Modmanager by default and they will show up with the black cat icon.
TXT Editor
This utility is used for changing the values in a text file through an easy to use interface. You can actually mod the text files using any standard text editor e.g wordpad or notepad, but this would take a long time to figure out what all the values are. This can be done with some patience if you want to spend the time and this will be covered in a later section of this tutorial. Text Editor makes it easy for you by translating all the values into easy read tables with names. A good example of this is the tships file in the types folder. Once this file is loaded up into the text editor you will see the whole list of ships on the left. The ship list is sorted from A to Z and you can view by name, race or type. Clicking on each ship will display the ship values in the right side of the editor. Here you can change the values of many things like shield type, laser type, speed, cargo, etc. This is quite a powerful tool for making your own custom ships. Before you go rushing off to edit your ships though, there is a lot more to know about this editor before it becomes an effective tool for you. This will be covered soon.
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php information listed on the left. The individual texts for these are displayed on the right; each text has its own ID number too which is important and explained later. You can edit each game text with your keyboard or add new texts by giving them a new ID number then tying in the text you want the game to display.
Galaxy Editor
This galaxy editor can change many things in your galaxy structure but is limited, so is best used in conjunction with the galaxy editor that comes with the game once enabled. See the next section for enabling the galaxy editor in the game. Some of the things you can do with the galaxy editor that comes with the X3 editor from Doubleshadow are, adding new sectors, deleting sectors, adding or deleting elements from sectors like suns, nebulas, planets, stations, gates, etc. You can also decide which race owns the sector or station within your galaxy.
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php name at the top will not change. If your name does change you have typed this in wrong. Now you can use the script editor by going to the ship menu, orders, and pressing s. The first time you enter this you will get a welcome message and you can skip this by pressing enter a couple of times. You activate a script with r or edit a script by scrolling to it and pressing enter. There are many great tutorials on script editing and how to use or launch scripts. The best one I have seen is the MSCI programmers handbook obtainable for the Xai Corporations website http://www.xai-corp.net/mscihandbook/ . You can also find many script tutorials by LV in the scripting and modding tutorials at the forum.
Using the in game galaxy editor is covered in section Using the in game galaxy editor on page 10.
Preparation
1. To make your mod easier to maintain and manage, create a folder on your desktop and name it northstar. For this exercise we will call this mod northstar. Not very imaginative but seems simple? Pick something original if you like but you must follow the naming protocol which will become obvious as we make our creation. Inside the northstar folder create another Page 7 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php folder called cats. This is where we will unpack all the cat files from x3. In side the cats folder. 2. You should have all the tools you need to make a mod by now if you followed the above sections. You should also have a basic knowledge of what the tools do. If you are not sure have another scan through, but do not worry, the learning process is much more effective by applying the techniques rather than reading about them. Make sure you have installed Doubleshadows X3 Editor which contains the tools you need. I installed mine in my mod folder the one we are calling northstar. This way you do not have to keep popping in and out to do everything. It would be best if you did the same.
3. Go to your C:\Program Files\DeepSilver\X3 Reunion folder (or wherever you installed it) and you will see the cat files 01 to 06 in the shape of a black cat if you associated cat files with modmanager as described earlier. If you forgot you can always associate them in modmanager by clicking on Options/Settings/File Associations. Double click on the 01.cat and it will automatically open up into mod manager. Click on extract and set the target path (the three dots) to your northstar\cats folder. The default is Decompress compressed files during extraction and Preserve file paths. You need to make sure these are checked. Then click ok and watch the progress of the extraction. This might take about one minute depending upon your system. Repeat this procedure for the other cat files 02, 03, etc. When prompted just click on overwrite all. This will ensure you only have one set of files up to the latest version of X3, making sure you place them into the cats folder northstar\cats.
Page 8 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Egosoft just created another page ID with the extra texts for X3. Have a look through both lists and notice that the ship description value we set to 3995 does not exist in either list. This is why I chose this value so that there will not be a conflict with other objects. Scripters often inform each other of this and reserve these ID numbers so that their scripts do not clash with one another. 10. Click back on ID number 17 Boardcomp objects and then in the right hand list of all the texts right click, then select add. In the ID field type 3995, then in the text area type a name for your ship. Call it what you like, (I chose Northstar Special) then click ok. You can now scroll down to that number and see it there in the list. Now right click again and enter an ID number of 3996 and type out a description for your ship. You could be short and sweet or you might want to give your mod players a full description of this awesome ship! You might wonder why ID of 3996? Well any name text ID 3995 in our case is always followed by the description. The X3 game reads the files this way and associates the next ID with the same object, whether it is a ship or a ware or a factory. 11. Now click on the save icon and close the text resource editor. You should be back in the TXT editor and ready to edit your ship further. So far you have created a copy of the Teladi Hauler and named it. If you do not see the new name for your ship do not worry it will be there when you enter the game and also if you come back to edit the ship a little more. Sometimes the editor reads the old name until it recognises the correct path to the right text file. 12. Still in the info section of the right hand window you can change Cargo type e.g. Small, Medium, Large or XL. The Teladi hauler can already carry XL so let us change the size of the cargo bay. Click on cargo max and set this to what you want. I set mine to 600. This is quite an advantage but one thing to bear in mind is if you make the ship too powerful your mod users might as well be in God mode! There are other values here that can be useful like Price modifier, value for NPC and player, as well as min notoriety. These things change the cost of the ship and at what level you must be to be able to buy it. Try playing around with the values and see the price differences in your mod. You can also get a clue for notoriety and cost by looking at the values for other ships. Do not change any values unless you know what they do or you can have crashes or errors in your mod which would not make it too popular. 13. Click on the Performance tab and set some values by double clicking on them here as follows: Max number of engine tunings 40, Max number of rudder tunings 20, Reactor output 880 MW. The only other things worth changing are acceleration and hull strength. 14. Click on the model tab. You can set the ship and cockpit to look like any of the other fighters here by, clicking on say the Mamba and using the right mouse button to copy its value then pasting it into your new ships value fields. Your special ship will have the same exterior and interior as the mamba then. Try different ship models with the cockpit you like best, so mix and match a Page 10 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php little. I left mine the same as I quite like the Falcon graphics. A word of warning, it is not recommended to use other ship type models that are not the same type e.g. an argon colossus on a Mamba as you will have many strange effects in your game. This would be crazy anyway, but I guess some of you will be tempted! 15. Now click on weapons and you will see you can adjust shields and laser power here. The shield is set at 1 x 125MW for the Falcon Hauler but if you must you could make it two. Also set your weapon energy and recharge rate. This will mean your lasers do not use as much energy and recharge quicker making you a strong contender in many a sector. Do not change the turret count or missile count as you will have problems with the ship model you have on your ship. 16. Now click on Front Lasers and remove or add what you like. You might want a Beta HEPT to fit your ship or you might quite like the mass driver cannon. The choice is yours whether to be god or not out there. Remember one thing though, the lasers you select will not be in the ship just able to buy and use. We can mod what we like into the ship later. 17. Save your file over the tships.txt file and exit. Ok, you now have an updated tships.txt that has a new ship with new specifications. You also have an updated 440001.txt that shows your new ships name and its description. You can add as many new ships as you like using the same method but do choose a free text ID as explained earlier for each ship you make and also try creating a new type Freighter or a special carrier, you get the idea? Other tfiles can be edited in the same way from the types folder using this method. Try creating a new factory or some new wares for your factory. You might want to play around with the specifications of the lasers or the missiles. It is up to you as a modder but always remember that if you make it too easy the game becomes less of a challenge. There are two more special text files that can be edited but just need renaming for now. Locate the two files as follows: in the cats\types folder rename the jobwings.txt to jobwings.northstar.txt and in the cats\types folder find the jobs.txt file and rename it as jobs.northstar.txt. These files are what make your game come alive with traffic and fighters. Without them your mod would be a very lonely mod, with nothing to fight or interact with. The reason for renaming them is so that they work with your mod map. They will only work with your mod if they have the same name inserted as shown.
Page 11 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Reunion\maps folder. The reason why you need to copy both maps is that I will be showing you how to combine the original map with the patch V1.3 patch map so that you have all of those little roids in your mod. Some players do not like these as it slows their game and others like them as they rely on drilling for more credits. The choice is yours but I prefer to have them all available. You could make two versions of your mod to please both parties. If the mod is for personal use then you do as you like but when you make mods for gamers then thinking of these up front benefits your users as well as yourself in the long run. You can now start up your game with your mod enabled by selecting mod package from the initial starting screen. If you have not already enabled the galaxy editor you need to do so by starting any game and typing your name in as Makeanapplepiefromscratch. See previous section for more information. Then exit the game and start a new game. The galaxy editor should now be at the end of the list.
Select Galaxy Editor and then select your Northstar map. Do not select new map or you will start with an empty galaxy. It is much easier to edit the existing galaxy but you might want to make your own. We will cover more galaxy editing in the next section. For now we just want to try out our new ship and make a few tweaks.
Most of what you need to do can be accessed from the editing menu using the keypad Enter button. Where ever else I mention Enter I mean the main keyboard Enter, but for the menu it is the keypad enter.
To begin with I want to show you how to cheat and this is required for getting around your mod galaxy easier. So enter the menu as above and enter on Your Current Ship or press Y. The keyboard shortcuts are always shown in the menus. Now scroll down with the down arrow cursor key until you reach cheat and enter on this.
You can now set your ship extensions to all, increase your cargo space, up your speed and more by moving to that option with the cursor key and pressing enter to change. So set your speed up and whatever else you feel is necessary. Make sure you set your cargo to max volume so you can hold energy cells for jumping around. Now press Esc to move back one menu. You notice there are two options Add Ware and Install Ware. Add ware puts things in your cargo hold, install ware installs them on your ship. Select Install Ware and scroll down the list and enter a jumpdrive. Now Esc and select Add Ware to add 260 Energy Cells to your cargo.
Page 14 of 49 02/05/2006
Ok we are now ready to jump around the lonely galaxy. You get about three jumps no matter how far or close a sector you jump to. All you need do is add more energy cells as required.
Scroll down the list of ships and find your new super fighter. You will be prompted where to place it with X then Y then Z coordinates. You are sitting at 0,0,0 which is dead centre of the sector so place it something like 20,20,20. Now eject from your Nova and go get in your new toy. Now while in your new Fighter you need to fit it with all upgrades, Jumpdrive and cells. It is all good practice until you know the key commands very well. You might want to give your new ship a test drive to see how the power fairs you gave it earlier. Now you need a way for your players to access this new ship. There are various ways to do this. Page 15 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Place it in shipyards for sale Place it as a one off in a secret sector Have the player start in the new ship with a start up script
By the end of this guide you will be able to apply all three of these.
Now select Export Galaxy and enter on it. This will overwrite the map name you chose on set galaxy file name. Now escape out back to your galaxy.
Page 16 of 49 02/05/2006
Page 17 of 49 02/05/2006
You can add objects to your sector by hitting the keypads enter, selecting Debug and choosing the add options as you did for adding a ship. You can then choose the stations properties by pressing P or as you would in the game when checking their prices and scroll down to add ware, add product, add primary or secondary resources. This is how you would add new ships to shipyards or new stations. This is also a great option for adding a new ware you might have created to a station. You need to dock with the station to buy or sell goods at the price you set with the price modifier in the text files we edited earlier. Have a play around with adding and removing products. If you add a new ware to say a pirate station, maybe missiles or lasers, you might see all the normal wares removed from the list. All you need do is add default wares and they will be back again along with the new product. I was shocked the first time I saw this too!
When adding wares or ships to a sector or your own ship you can use the filters to narrow down your search. In time you get to know where in the list the items are but using a filter is quicker. You can see above there are options to filter by type or race, making it easier if you are say adding items to a Teladi shipyard and only want to view Teladi ships.
Page 18 of 49 02/05/2006
A good tip for your mod and I am sure you will find this out is to add few pirate or yaki ships to shipyards in certain sectors. You might make them available at all shipyards or just certain races. The whole mod is your world and you shape it the way you enjoy.
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php prevent various oddities occurring in your game. Gates have variables that are set to manage all jumps to and from sectors. Gate ID 0 = N, 1 = S, 2 = W, 3 = E Target Sector Target Gate ID From this you can see that a North gate ID of 0 is compatible with a South gate ID of 1 and vice-versa. It would be invalid to have a gate ID of 1 connected to another 1 or a 1 to a 2. You can add gates to a sector following the above rules by hitting keypads enter, selecting Debug and selecting add gate. You will be prompted for the above information, so have a galaxy map available with coordinates. While modding you will find out that sector coordinates can differ between the galaxy editor and the text files. You can get a full sector map with two sets of coordinates on for modders from http://www.xperiment.co.uk/files/X3ModMap.xls. You might want to print a few off for spares to scribble on. I went through quite a few. This is my mod map showing new sectors but it has both sets of coordinates. The coordinates the Galaxy Editor uses are the inner ones where Kingdoms end is X0, Y0. Once you have placed your gates use the option on the debug menu to check gate validation. If everything is ok then it will tell you that. Otherwise you will have to delete the gate that is wrong and make another one.
The next section will cover more galaxy editing using the galaxy editor that comes with Doubleshadows X3 Editor. You will learn the easy way of creating new sectors and connecting them with gates. Now exit the galaxy editor and the game.
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php with gates option. This way you do not have to worry about validation. Try different ways but the following system works great for me.
Page 21 of 49 02/05/2006
Naming sectors
Close the universe screen and the sector screen and then click on the Text Res button. This should be a familiar sight from editing text files earlier. Again you will need to open up your 440001 file from northstar\cats\t. Then look at page IDs 7 the first one and 300007 for the existing sector names. The ones in page 7 being X2 names and the new ones in 300007 being the added sectors for X3. There are a few names in there you will not recognise which were never added to the game. Maybe these are for X4! Existing sector names can be changed and new sector names created now you know how. Sector descriptions are held in a different text page ID unlike the ships and wares. Look for pages 19 and 300019. Here you type whatever description you want for your new sectors. You could copy and paste another sectors description and just edit this a little. Now we are going to enhance our northstar map with a new sector. This next section will be a little more advanced but well worth learning to get your mod status up a little more.
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php backgrounds would be very handy. Someone might have a reference table or something but I have not seen one. Now click on the sector name in the left, [string 7:1020210] at the moment and change the race value to Split. You will also notice our coordinates are shown as per the galaxy map here as X9, Y1. One thing to note about race, the player race is UFO in this galaxy editor and Julian in the in game galaxy editor Open up another sector in the left hand list, anyone you like the look of and copy the sun by right clicking. Click on our new sector and paste it. You can do this with any of the objects from other sectors, planets, asteroids, gates or stations. But for now just copy the sun and some planets. Try a mix from other sectors, this way the new one will be original. Now open the Text res and make sure you edit the one from northstar\cats\t\440001.xml. Do not use the default that opens up, it is of no use. Now click on page ID 7 Boardcomp Sector and right click in the right hand window list of 102s, select add text and type the ID number as 1020210. Then give your sector a name in the text area, maybe Thuruks Wig or something saying as it is a split sector, I leave that up to you. Now scroll to page ID 19 Sector Description and right click, add text with an ID of 1030210. Type a description in the text area, maybe this sector is split. You will notice sector names start with 102 and sector descriptions 103. This is a sequence that the game recognises for the text names. Now save the 440001.xml file and exit the text res editor. Now save your Northstar map and we will go take a look at it shortly. Now that we have edited the text files further we need to replace the old one in our mods folder with the new one. Open Mod Manager and then open the northstar cat file from your X3 Reunion/mods folder. Right click on the t\440001 file and select delete. Now click on Add and point to your updated 440001 file in the northstar\cats\t folder and open. Set the folder name to t so that you now have the same files as before, the new version of the t file is now packed up ready to use. You should have types\tships.pck, types\jobwings.northstar.pck, types\jobs.northstar.pck and t\440001.xml. The files have the .pck extension when in the cat file as they are now packed files. Close the cat file and fire up X3.
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php with the cursor key you will see the new sector name show. Esc out of the galaxy map and press keypads enter, Debug then connect sectors with gates. The first prompt will ask you for the from sector which is where you are now Patriarchs Retreat, so just press enter. The next screen is asking for the to sector, so move the cursor up one until you see the new sector name and press enter. You should have a new north gate and you are now welcome to enter it and have a look at your new sector. When in your new sector, you might not like the sun or planets you chose. You can move them around a little by selecting them on the sector map and using the keypad numbers 2, 4, 6 and 8. You can always change backgrounds, planets and sun later. You can delete the sun or planets now and add them from the Debug menu. You can also add nebula and a few stations; fill them with goodies if you do not like the default goods. Just customise this any way you like; besides it is yours now ;) You might want to change the race to pirates, Khaak, xenon or Unknown. You can even make it a Goner sector. This way your mod players will gain recognition with the Goners for killing pirates in that sector. Something you cannot do in the current game. You could also rotate the gates and move them further out using the keypads /,*,-,+, Ins and Del keys. If you want to make a ship a freebie just make the owning race neutral. If you want it to belong to the player, make it Julian race. From this exercise you can see it is a lot easier to add your sectors in the X3 editor galaxy editor and join them in this Galaxy editor. You should now have a wealth of knowledge on both Galaxy editors and I am pretty sure you are raring to go make a full mod now. But you still need to make your sector appear on the galaxy map.
Page 24 of 49 02/05/2006
-1;
The bit of code we are interested in is highlighted. This code is for the sector Tharkas Sun. All others with the [Box, GEOMOBJECT_CLASS_ID] are the other sectors. These code blocks translate as follows: the / lines are all comments and are not really required but you could put your own text in here as notes on what the sector name is and where it is located. You could delete these but best leave them in so you get used to the structure and type of code. The useful part of this is the [Box, GEOMOBJECT_CLASS_ID] which means this line signifies a box graphic for the sector. P 2; Line number. This number is incremented by one for each sector in the galaxy map. B 904; is the sector position as x,y. It is important to ensure that a sector starting with 0 e.g. 01,01 has only three digits for this value. 01, 01 would be Kingdoms End but we would put 101 here. 201 would be Rolks Drift. N 0904; The same coordinates but with all 4 digits this time. { 0x2002; 50548; 6941; 2010; 0.000000; 0.000000; 0.000000; 0.000000; -1; -1; } // 0 The only part of this code you ever need to change is 50548; 6941; 2010; as these are the X,Y and Z coordinates for the graphic box on the map for the sector. The X is east to west, the Y is north to south and the Z is up or down. If you
Page 25 of 49 02/05/2006
Page 26 of 49 02/05/2006
Page 27 of 49 02/05/2006
Your sector screen shot might look different depending upon the sun and planets you chose. You might have a different background. There are some good red and green backgrounds. Blood red looks good in a dangerous pirate sector. I quite liked the planet slightly to the left. You could rotate yours so that it is behind the south gate, which looks quite effective. If you do not like the look of your planets choice then easily solved. Open the sector map while facing your planet, then select it from the all tab and press the enter key on the keypad to scroll through them all until you see something you like. Dont like the background of the sector? Then use the editor tab and move down to the sector background field, then press the keypad + key to scroll through them. You can also change sector radius, owner, core area on off and proposed factories on and off with the + and keys on the keypad. ;) All that is missing from mine are Asteroids and stations, but you already know how this is done.
Page 28 of 49 02/05/2006
To recap, the cat file is similar to a zip file, only the cat stores information on the files and folders stored in the dat file and is a means of opening and working with the stored files. The stored files and folder structure should look like this: types\tships.pck types\jobwings.northstar.pck types\jobs.northstar.pck t\440001.xml objects\cut\00749.pbd
You should now know what each of these files do and how they are used by the game. When you launch your X3 game, make sure you Select Mod Package on the starting screen choosing northstar. From the game menu select new, then go to the custom game menu and select northstar.
When ever you put a named cat file in your mods folder, this will show up on the Select Mod Package screen on initial start up. Using this mod package will mean that any files you have in the cat file will be used in place of the relevant game files. So if you forget to pack your tships.txt into your cat your custom ships will not be there. If you do not use the correct folder structure in your cat files e.g. types/tships then your ships will not be there either. So it is very important to get your files packed and in the correct folder structure. You will always know the correct structure as you have the same structure with your unpacked cat files in your modding folder. Selecting Page 29 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Custom Game from the new game menu loads the relevant map file for your mod. So if a different custom game is selected then your new sector will not be there only the elements of your mod, new ships, stations, wares, etc. Your starting position will be the default in Argon Prime for your mod map. In the next section you will learn how to make a simple script so that you can specify the starting conditions for your mod. You do not need to be a scripter or have knowledge of XML, Javascript, PHP etc. Egosoft have provided a very easy to use scripting editor that we will use for this.
Page 30 of 49 02/05/2006
You should now be looking at the code for this script and ready to do some editing.
We will now change the starting sector and starting ship type. Move to line 2 and to x=0 and press enter on the 0, scroll to number and press enter. Change this to a 9. Do the same for y=2 but change this to a 1.
Page 32 of 49 02/05/2006
Now scroll to line 004 and to Create ship: type = Unknown Ship and press enter. Scroll to Select ship type and press enter.
Now scroll down the list until you see your custom ship and press enter.
You can delete line 008 also. Then copy line 007 and paste using c then v. This will add another line after line 007.
Page 33 of 49 02/05/2006
Change the value of the ware to 2 units of Hurricane Missiles by moving the cursor to the 1 after add and pressing enter. Scroll down to number and press enter to change this to a 2.
Also change the ware of line 008 by pressing enter over the Boost Extension. Scroll down the list until you get to select ware.
Page 34 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Press enter then scroll to select Hurricane Missile. You should now have this.
Now we are going to change the starting notoriety of the player so that he is favoured by Argon but no so much by the Split. Copy line 003 and paste this as line 009. Change the comment to Change Notoriety up for Argon, down for Split. Then add another two lines with the insert key. On line 010 press enter and you will have a list of commands to choose from. Scroll down to General Commands and press enter.
Now scroll down to the ,Var/Race> add notoriety: race=<var/Race> value=<Var/Number> command as shown here.
Page 35 of 49 02/05/2006
Change the race before the add notoriety command to Argon by entering on the first value and scrolling to select race. Then change the second value to the julian race by following the same process. Julian race is the player race.
This will change the race to player. You then need to change the value to 500. Follow the same procedure with line 011 only this time set the race to Split and the value to -500. I also changed the comment at line 001 to show in our script where the starting sector is. You do not need comments but it helps yourself and others understand what the code means.
Page 36 of 49 02/05/2006
When all this is completed your script should be looking like this:
You can now save your script by pressing Esc and answering yes to the prompt.
You could enhance the script further by sending an incoming message to the player on start up or setting the players ship name and many others. Explore the other commands in the script editor just as you did with the set notoriety command. Now we will need to do a little more to this script to make it work in our mod.
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php galaxy.Example.initplayership.xml. This is the script you were just working on. There is a default packed script with the same name which when edited will save an xml copy of this which is basically what we just did. Double click on the galaxy.Example.initplayership.xml script and it will open up in your browser as it is an xml file. Now right click on this and select view source. You can also right click on the xml file and open with notepad. Look for the name tag near the top that has this piece of code: <name>galaxy.Example.initplayership</name> Change it to look like this: <name>galaxy.northstar.initplayership</name> Then just save it as galaxy.northstar.initplayership.xml. Now when you start your mod and select northstar from the custom game all your start conditions will be enabled. Because you renamed it as northstar and are running the Northstar mod and map it will be used instead of the standard Argon Prime script. Now this opens up all manner of possibilities for your mods. This Guide is not designed to teach you scripting but only to give you a small amount of knowledge so that you can test your mod and make small scripts. However you might want to learn scripting too, so check out my recommendations in the earlier sections of this guide. Scripts are very powerful and can achieve many things that mods cannot so a mixture of the two can make an excellent mod. There are some great scripts to use in the forum so a mixture of these and your mod can enhance game play further. You must always check with the script author if you want to use their scripts with your mod. It generally pays to distribute you mod and point out recommended scripts your players could use. A lot of hard work goes into scripting and authors like to be recognised for their work the same as you for your mods.
Page 38 of 49 02/05/2006
Page 39 of 49 02/05/2006
You will see that the Scorpion has 6 guns, and 6 gun positions. We are going to make these 8 guns and 8 positions. Click on add gun and the following gun edit table will appear:
Type the information in each field as follows: Count 1, Body ID ships\props\weapondummy, Path index 7, then click on OK. You should now see 7 guns in the ships turret. This ship has only one turret which is in the front cockpit and is referenced in the upper window. Double clicking on any of the guns will bring up the edit gun properties window. You will notice how we left the secondary Body ID field empty and the Path index for this has defaulted to -1. Secondary body IDs are only used for bigger ships like the M1, M2 and TLs. Now repeat this process by clicking add gun but make the Primary Path index 8. You can now save the Tships file and exit TXT editor.
Page 40 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php The addition of 2 extra guns in the Tships file for the Scorpion will mean that you can install two more guns to this ship in the game; however they will not be very effective as you will find they do not fire. To make them fire we need to add them to the ships scene file where all of the information is held for gun points using the ships model. The scene files are in bod (text files) format so we can edit these with windows wordpad, similar to what we did for the galaxy map. Open your cats\objects\ships\split\ folder and look for the file Split_M4_var1_scene.bod file. You should also see an associated bob file which is a binary encoded file and cannot be edited with a text editor unless you decompile the file to bod format first. Doubleshadow has also created a decompiler called x2bc.exe, if you did want to get into converting bob files to bod. This is required if you want to edit the ship models in GMAX or 3DS max. You also need the DBOX plugin so that the bod files can be imported into your 3d editor. For now though, all we require is to edit the Split_M4_var1_scene.bod file which is already decompiled. You will also notice we are using the var1 model which is the scorpion raider. The M4_scene is the ordinary scorpion, the var 2 is the vanguard and the var3 scene is the sentinel. You can easily determine this from the Tships file under the cockpits tab listed as Body ID. Right click on this file and open it up using wordpad. I use wordpad rather than notepad as it lines up the text better which makes it easier to read the code. Look for the following code blocks which I have colour coded to show each of them separately. They are the second two blocks of code in the text file:
/ Sat Oct 01 15:37:32 2005 / Node Bships\props\weapondummy_1f Class [Editable Mesh, GEOMOBJECT_CLASS_ID] P 3; B ships\props\weapondummy; C 1; N Bships\props\weapondummy_1f; b { 0x2002; -244; -1684; 536; 0.305556; -0.000680; -0.000476; 1.000000; 3333; 1; } // 1 { 0x2002; -244; -1684; 536; 0.305556; -0.000680; -0.000476; 1.000000; -1; -1; } // -1 / Sat Oct 01 15:37:32 2005 / Node Bships\props\weapondummy_1e Class [Editable Mesh, GEOMOBJECT_CLASS_ID] P 4; B ships\props\weapondummy; C 1; N Bships\props\weapondummy_1e; b { 0x2002; -87; -2050; 233; 0.305556; -0.000680; -0.000476; 1.000000; 3333; 1; } // 1 { 0x2002; -87; -2050; 233; 0.305556; -0.000680; -0.000476; 1.000000; -1; -1; } // 1
These are the first 2 of the six guns. We want to add two more to make 8 in total so that they all fire in the game when installed. Now we will take a closer look at each code block to understand what is happening.
/ /
Sat Oct 01 15:37:32 2005 Node Bships\props\weapondummy_1f Class [Editable Mesh, GEOMOBJECT_CLASS_ID]
The code block is headed by two comment lines which should be familiar to you if you edited the galaxy map in an earlier section. Again, these are just used as a reference by the coder to keep track of what the code is doing. These could read anything and will not be executed as long as the line begins with the forward slash /.
P 3; B ships\props\weapondummy; C 1; N Bships\props\weapondummy_1f; b { 0x2002; -244; -1684; 536; 0.305556; -0.000680; -0.000476; 1.000000; 1 { 0x2002; -244; -1684; 536; 0.305556; -0.000680; -0.000476; 1.000000; -1 3333; -1; 1; } //
-1; } //
Page 41 of 49 02/05/2006
P3; is the line numbers for the code, followed by the weapon dummy object paths. You will notice the
weapondummy_1f; part which has a unique identifier for this particular weapon point. In the second code block the gun is identified as 1e and so on for each of the six guns. They do not follow in alphabetical order as the guns on a Scorpion are placed in a circle around the body of the ship and all depends on the order they were joined to the ship model during creation. It does not really matter in which order they are identified as they will fire anyway when a laser is attached.
The coordinates -244; -1684; 536; are the X, Y and Z values in space around the ship where
the guns are placed. This diagram represents the ship and how the coordinates work with positive and negative values.
The only other parts of this code you need to know for information are the 0.305556; -0.000680; 0.000476; 1.000000; these are the rotational values for the gun objects. You do not need to altar these values unless you want some of your guns facing the rear or out to the side. I guess it could be fun shooting to the sides but could also have strange effects in the game. If you wanted to spend time working out the coordinates of each gun you should see the guns placed in a circular pattern around the ship body. The easiest way is to adjust the coordinates slightly and then try them in the galaxy editor later. You can do this in the game but risk being shot by pirates as you scribble down your adjustments! Press F1 in the game for an external view of the ship and rotate it using the keypad numbers to get a good idea where they are placed.
Now we know what the relevant code does we can edit the code. Copy one block of this code then paste it in twice just after the last of the six guns. Make sure you check exactly where to paste by hitting enter after the last gun code block to give yourself a space to paste into and also see what you are doing easier. Now you can backspace the dead line and renumber the lines. P8 is the last of the six guns so you need to renumber P9, P10, P11 etc, until all code blocks are in sequence. I guess you could paste the code at the end but pasting them in sequence means editing it in a few months will be a lot easier to read. The code for each scene file is only 28 30 blocks so it is very easy to renumber them. Now change the identifiers in each code block so that we have guns a to h as mentioned earlier like this C 1; N
Bships\props\weapondummy_1f, C 1; N Bships\props\weapondummy_1g and so on.
Page 42 of 49 02/05/2006
Visit our Forum for more help www.xperiment.co.uk/phpbb2/index.php Next adjust both sets of coordinates in each code block to move your new guns away from the others a little. You should be able to tell by comparing each of the guns coordinates roughly where to place them using the coordinate diagram above. I would suggest adjusting the Y coordinates a little first -244; -1684; 536; to
read -244; -1784; 536; Now before saving the file, check that you have the line numbers sequential otherwise your new guns will not fire. If you have three identical line numbers, only one of those will be executed. Save the file and add it to your cat file with the right path name: objects\ships\split\Split_M4_var1_scene.bod.
Ok, now for one last job, an easier one this time Now that your guns are fixed you need to delete the types\components.pck from cats 4, 5 and 6 in your X3 root directory. The components.txt holds all of the scene info and needs regenerating, otherwise the guns will still not work. Now load up your game and you will notice it takes longer to load up. It takes me 90 seconds more after adding two extra guns with my P4 3 Gig processor. The reason for the game loading slowly is because X3 is now creating a new components.txt based any changes made to the scene files. Once in the game, have a play with your new guns then exit. You will find that insode the types folder located in your X3 Game folder, there is a new components.txt. This has all the new info you provided. If you add more guns to other ships, all you need do is delete this components.txt and let the game create another. Please bear in mind, the more you add to the scene files the longer it takes to load the game the first time around, as your now components.txt is being created, so dont panic if you think your game has locked up at the loading screen If your guns worked ok, give your self a pat on the back and have a lie down after that long tutorial.
A note on turrets
Adding turrets to a ship can be very difficult to get them placed correctly. To add turrets you need also add a cameradummy the same way you would add guns. Just copy one from an M4 scene file along with a turret. Delete and create your components.txt as before.
Page 43 of 49 02/05/2006
Page 44 of 49 02/05/2006
Page 45 of 49 02/05/2006
I hope you have found this guide useful and are producing some good mods now. You can download one of my mods which have six starting positions and take a look see how I did things. Feel free to explore them and use some of the same ideas. You can find them at http://www.experiment.co.uk/downloads.htm This guide will also be available from the downloads page along with universe maps. I will be updating it from time to time and if anyone has anything to add to this guide please let me know. Enjoy and best of luck with the mods. You can also get help online at our community forum http://www.xperiment.co.uk/phpbb2/index.php Northstar mailto:northstar@xperiment.co.uk
Page 46 of 49 02/05/2006
Appendices 1
Planet descriptions
Note: Orbital means huge and very close to the sector so that it looks like the player is in orbit. Doubleshadows In game Galaxy Type Properties Description Galaxy Editor Sub Editor Sub Type Type
PL1 PL2 PL3 PL4 PL5 PL6 PL7 PL8 PL9 PL10 PL11 PL12 PL13 PL14 PL15 PL16 PL17 PL18 PL19 PL20 PL21 PL22 PL23 PL24 PL25 PL26 PL27 PL28 PL29 PL30 PL31 PL32 PL33 PL34 PL35 PL36 PL37 PL38 PL39 PL40 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Planet Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Close Distant Distant Distant Distant Distant Distant Distant Distant Distant Distant Distant Distant Distant Distant Distant Acid world Awk world Copper World Crater World Curosant Death star Desert Frosty Gaseous Gas Giant2 Gas Giant 3 Green Rock Grey Rock Home land Ice Outpost Ice White Jungle World Lava Rock Oasis Oceanica Outworld Red Pools Rock Lands Water World Acid World Awk World Copper World Crater World Curosant Death star Desert Frosty Gaseous Gas Giant2 Gas Giant3 Green Rock Grey Rock Home World Ice Outpost Ice World
Page 47 of 49 02/05/2006
Page 48 of 49 02/05/2006
Page 49 of 49 02/05/2006