![]() |
Understanding and Adding Infocards - Printable Version +- Discovery Gaming Community (https://discoverygc.com/forums) +-- Forum: Discovery Development (https://discoverygc.com/forums/forumdisplay.php?fid=7) +--- Forum: Discovery Developers Forum (https://discoverygc.com/forums/forumdisplay.php?fid=183) +---- Forum: Freelancer Modding Tutorials (https://discoverygc.com/forums/forumdisplay.php?fid=36) +---- Thread: Understanding and Adding Infocards (/showthread.php?tid=204141) |
Understanding and Adding Infocards - jammi - 07-25-2024 This is a brief guide on how to use FL-IE and update infocards in Freelancer. 1. Using Freelancer Infocard Importer/Exporter. 2. Understanding infocards and XML. 3. Implementing base and object infocards. 4. Implementing rumours on bases. 1. Using Freelancer Infocard Importer/Exporter. First of all, you're going to need a copy of Freelancer Infocard Importer/Exporter. This can be used as both a viewer to search for particular keywords across game infocards, and also as ![]() NOTE: DO NOT MAKE CHANGES TO THE COPY OF THE GAME YOU CONNECT TO THE SERVER WITH. The file changes will be flagged by the anticheat and you'll cop a ban. Use a duplicate test build for any experimenting you want to do. First close any copies of Freelancer you have running, then open FL-IE. Every time you open FL-IE, you must load the infocards you want to use. To do this, copy and paste the file path to Freelancer's root directory into the "Freelancer path" box. Once this is done, click "Load". After this, FL-IE should provide a list of all the DLLs it has successfully loaded (or not), and how many infocards it has loaded. If any errors are reported and a DLL hasn't been loaded, this is likely because you have a copy of the game running, which is basically "locking" those files. FL-IE will remember the last file path you used, so you won't need to manually re-enter the Freelancer directory each time you use it. The next step will depend on whether you are an official Discovery developer, or simply working on your own project.
To do this, hit the "Import" button, and then select the .txt file you've been working on. FL-IE will present a before-and-after of all the infocards you have added or updated, and provide a confirmation of the number of unchanged, changed and entirely new infocards imported. If this looks right, hit "Save". FL-IE will again provide a log of all of the DLLs it is updating, with a confirmation of "Done" when it is finished. Again, if there are any errors during this process, it is usually because an instance of the game is running. Congratulations, your revised text is now saved to the game! We'll cover how you make this text appear where you want it later on. Finally, a basic but extremely useful feature can be found by clicking the Browse tab. This is the infocard viewer, allowing you to search all of the game's infocards using keywords. When you select an infocard, the top window on the right displays the raw text / XML, while the bottom window on the right displays the formatted end result. 2. Understanding infocards and XML. An infocard is basically a section of text that is linked to a unique serial number, called an IDS reference. This number is then use by the game to decide what text is presented where. There are two categories of infocard:
FL-IE reads infocards in a very simple way. Here is an example of both a NAME and INFOCARD for reference: Code: 33939 Every infocard starts with its unique IDS reference number, then either NAME or INFOCARD, and finally the text itself. Infocard text must all be written on a single line - line breaks in-game are added through text formatting. Including an actual line break in this .txt file will ruin the output when you try to display the infocard in-game. Formatting NAME text: NAME text is very simple, being displayed as plaintext. This means you cannot format them with colours, italics, bold, etc. The only formatting that NAME cards can use is linebreaks, which are added by including \n in the text. Formatting INFOCARD text: All infocards must be written in valid XML. Some important tips to remember:
3. Implementing Base and Object Infocards. Now we're going to look at how to assign text to an object in the actual game world. Where you have imported an edited infocards.txt using FL-IE, this means those infocards are now saved to the game's DLLs and associated with a unique IDS reference. This guide will be focusing on how to update the infocard of an existing base or object, rather than how to create new entities from scratch. This is also going to focus on how to use the game's .ini files, rather than system modding tools like Freelancer Mod Studio, although that may be covered in a later tutorial on system modding. Each system in the game has its own .ini file containing all of the bases, objects, zones, NPC encounters, etc inside that system. First, I would suggest opening up DarkStat. This is an incredibly powerful reference tool for all sorts of data in the game, however what we're mainly interested in right now are internal nicknames. Every system and entity within a system has a unique internal nickname. Looking on DarkStat's Bases tab, find a station you are interested in. You will notice that on the right, there is a column for base nickname, and system nickname. For now, lets look at Waterloo Station in New London. This is br01_04_base, with New London itself being br01. Next, in your experimental Freelancer build's main directory, navigate to: DATA\UNIVERSE\SYSTEMS In the SYSTEMS folder, every system in the game has its own subfolder. Open the Br01 folder, then Br01.ini - this is New London's system file. Once it's open, hit CTRL+F and enter br01_04_base. This will give you the following entry: Code: [Object] The parts that are currently of interest to us are IDS_name and IDS_info. As you might expect, IDS_Name is the object's name. Use CTRL+F in your infocards.txt and look up 196661 - you will see that this says "Waterloo Station". Overwriting the infocards.txt entry for this IDS reference, importing it into FL-IE and then saving will change the name of the station in-game. If you want to replace the IDS_name of a dockable base with a new number for some reason (or you are creating a new base), you must also edit another file. Open: DATA\UNIVERSE\universe.ini This file keeps track of which system dockable bases are located in, and makes their names appear properly in your contacts window. Having bases in the wrong system causes crashes, but for now all we're interested in is making sure the name is correct. Look up Waterloo's internal nickname again, and you will find the following entry: Code: [Base] All we need to do here is make sure the strid_name matches the IDS_name assigned in the system file. If you're changing the number, make sure to change it in both places. Next, the IDS_info value works slightly differently depending on whether the object is a dockable base or not. For dockable stations, the IDS_info data is the text that you can see using F9 before you dock with the base. Waterloo is a typical example, providing fluff information about the station class, amenities, crew, etc. Code: <?xml version="1.0" encoding="UTF-16"?><RDL><PUSH/><TEXT>CLASS: Zeus</TEXT><PARA/><TEXT>GRAVITY: Complete</TEXT><PARA/><TEXT>DOCKING: Yes</TEXT><PARA/><TEXT>AMENITIES: Yes</TEXT><PARA/><TEXT>CREW: 1090</TEXT><PARA/><POP/></RDL> The rest of the infocard is hidden until you dock. Interestingly, you'll notice that there is no third infocard parameter in Waterloo's Object entry in the system file. So how does the game know where to find the rest of the base description? For this, we need to look in another file: DATA\INTERFACE\InfocardMap.ini InfocardMap creates linked pairs of infocards for dockable stations. If you use CTRL+F and search for 65727 (Waterloo's IDS_info value), you will find this: Map = 65727, 65728 This is telling the game that when you dock on the object associated with IDS 65727, it must append IDS 65728 to the end of the station's description. If you are editing an existing station's infocard, you don't need to worry too much about this. If you are adding a brand-new station or changing a station's IDS_info number, you will need to add an InfocardMap entry too. Objects that aren't dockable stations are much more straightforward - the full infocard is simply included under a single reference in IDS_info. Note that some kinds of Objects are not able to display infocards. This depends on the Object's Archetype (Waterloo's is largestation1), which is defined in DATA\SOLAR\SolarArch.ini - this is really a system modding issue, so it will be covered in more detail in a later tutorial. An extreme simplification is that only Archetypes with the Type of either MISSION_SATELLITE or STATION can have both IDS_names and IDS_infocards freely assigned. Other types either cannot display infocards at all, or make use of specific hardcoded infocards for their name, infocard or both. 4. Implementing Rumours on bases. |