TModLoader is an API for Terraria that provides a way to create and load mods without having to work with Terraria's source code directly. This means you can easily make mods that are compatible with other mods and save yourself the trouble of having to decompile then recompile Terraria.exe.
Contents.OverviewSome mod changes have to be made by altering the hex code of the game executable file (.exe) directly, or by replacing original game files. As a consequence, every time a patch to the game is released, or Steam 'verifies' the game files, any such mods will be removed when the original (or 'vanilla') version of the files are restored, and eventually you will find it necessary to reapply many, if not all of your desired mods. Steam's 'phone-home' capability has been known to override only some elements of a mod, producing mixed results for no apparent reason. This 'phoning home' occurs every time the game is launched, and is independent of patches. To prevent this from happening unexpectedly, you must assert control over when Steam performs such steps.Steam has demonstrated that they will ignore the disabled 'auto update' settings for a game without warning (at least sometimes) when the game vendor releases a patch. The only reliable method to avoid unwanted or unexpected patches is to run the game in Off-Line mode. If you have mods that are not easily re-installed, it is advisable to have a complete backup of the game folder tree, so you can revert when a patch does get forced upon you.Retaining ControlFirst, see for WHY and HOW TO move your Steam folder out of the Program Files folder tree if you haven't done so already.
Simply disabling Windows User Account Control (UAC) or folder permissions is not sufficient.Here is how to take control of Steam updates:Ensure your Steam application is unable to 'phone home' via a network connection to automatically perform verification updates behind your back (intended to prevent cheating in multi-player games) that will overwrite part of the mod(s). There are two ways to do this, and both may prove necessary (i.e. If you have an active WiFi connection, your computer is always networking in the background even if the Steam App is in 'Offline Mode', so you MUST apply the hosts file fix as well):Offline ModeEasier to accomplish. This prevents the Steam App from connecting to it's servers, but you won't be able to chat, play multi-player, register achievements, or update other games until you switch back to 'Online' mode. See the official Steam Support instructions for the type of computer running Windows OS. Here are the very basics, but read the Steam Support instructions first.
There is more to a first time setup:. Start the Steam App. Select the Library (second menu line), which will display your library of installed Steam games. Select a game title (i.e. XCOM: Enemy Unknown) and right-click on it to display the context menu.
Select Properties from the context menu. Select the Updates tab. In the Automatic updates field, click on the upside-down triangle at the right edge, and select Do not automatically update this game.(This will prevent updates except as you determine the timing. If you wish to engage in multi-player mode, this may be all you can do besides modifying the hosts file. Disabling automatic updates by itself: people have still had issues.).
Close the Properties window. Select the Steam Menu (top left, first line) Go Offline Restart the Steam App in offline mode. When the Steam Launcher App (the one that brings up the Steam web site, or your game library in off-line mode) is updated, it appears to reset all game specific settings to their defaults, which means it is re-enabling automatic updates. This means you must go to each game you do not want updating and disable that feature again.Modifying hosts filePrevents Steam from connecting to it's update servers behind your back.
Slightly more complicated, but lets you use the Steam Apps's online functions such as multi-player, and is only required once. It is not affected by patches or re-installing Steam and does not affect your ability to get updated when you go back to 'Online' mode.To determine where your game attempts to communicate, you want to examine your My GamesLogsLaunch.log file.
You are looking for lines similar to these. 0027.91 DevHTTP: FHttpDownload resolve complete to: 65.118.245.165:80 0027.91 DevHTTP: FHttpDownload resolve complete to: 65.118.245.165:80 0027.91 DevHTTP: FHttpDownload resolve complete to: 65.118.245.165:80. 0028.15 DevHTTP: FHttpDownload::StateParsingHeader: Got unknown status code 503 URL: prod.xcom.firaxis.com:80/News.ashx 0028.19 DevHTTP: FHttpDownload::StateParsingHeader: Got unknown status code 503 URL:The entries marked like so are:. The Server IP address: 65.118.245.165. The Server DNS Name: prod.xcom.firaxis.comThese are what you will place into the hosts file to block attempts to connect.
Start Menu Right click on 'Notepad' (or any ), select 'Run as Administrator'. File Open %systemroot%system32driversetchosts. The hosts file has no '.' Suffix, so make sure you don't add.txt or anything else. Also,%systemroot% on most systems is C:Windows, but the exact folder name may vary by OS version. The value of the global%systemroot% on your system can be determined by entering 'set' on the Windows command line, or as it's shortcut is called, the. But the variable%systemroot% (including the percent '%' signs) can safely be used without knowing it's actual value.
How To Download Mods From Steam Workshop
Add these three lines to the hosts file:(The first line is a comment. The next two lines do the actual work, but are specific to XCOM:Enemy Unknown 2012. Other games may have their own DNS names i.e. Prod.xcom.firaxis.com and IP addresses i.e. The '127.0.0.1' IP address is a local loopback address the prevents attempts to connect to either of the other addresses from ever leaving your computer.).
# Prevent Steam from Phoning Home. 127.0.0.1 prod.xcom.firaxis.com. 127.0.0.1 65.118.245.165.
Save the file. NOTE: As an example, the 'Enemy Within' (EW) DLC expansion to XCOM:EU 2012 (EU) uses it's own DNS and IP address entries:. 127.0.0.1 prod.xcom-ew.firaxis.com. 127.0.0.1 65.118.245.139'Save game' synching with Cloud Storage still functions correctly, even with these addresses disabled.The XCOM-EW expansion is proof that other DNS and IP addresses can be utilized by the same or different games. Care should be taken to check the Launch.log file as outlined above for changes with each patch or major release.Always disable both the original and any additional related hosts file addresses. For instance, EW is a DLC for EU, and as such shares files with it. Allowing one to 'phone home' but not the other is highly likely to cause conflicts with no apparent cause.DNS and IP addresses for other games can be posted here for reference.Restoring to VanillaEventually you will need to patch your game and re-apply your mods, sometimes because you will desire to apply different mods or apply them in a different order.
Here is how to restore your game to the latest version of the vanilla game:Remove any and all installed ModsThis step is needed to ensure there are no conflicts that the following restoration of vanilla steps won't catch. Follow the uninstall instructions provided with each Mod. Check the My GamesXCOM - Enemy Unknown subfolders and backup any save game files from the XComGameSaveData folder. In particular, DLCs install files under this folder and verify cache does not touch it.
Remove any mod files or simply delete all the subfolders under My GamesXCOM - Enemy Unknown. They will be recreated when you run the game again.Take Steam back Online. Start Steam, and when prompted remain OFFLINE. Select the Library (second menu line), which will display your library of installed Steam games. Select a game title (i.e. XCOM: Enemy Unknown) and right-click on it to display the context menu. Select Properties from the context menu.
Select the Updates tab. In the Automatic updates field, click on the upside-down triangle at the right edge, and select Always keep this game up to date.(This will restore automatic updates.). Select the Steam Menu (top left, first line) GO ONLINE Restart the Steam App.Update the Game. Select the Library (second menu line), which will display your library of installed Steam games. Select a game title (i.e. XCOM: Enemy Unknown) and right-click on it to display the context menu.
Select Properties from the context menu. Navigate to the LOCAL FILES tab and Select Verify integrity of game cache.(Progress is indicated on the filename in the Steam Library).
When the verification is completed the number of files needing to be reacquired will be indicated. NOTE: Some players have reported 'crash to desktop' (CTDs) attempting to start the game after applying the mod in order to play EU with some older mods. Among other things, for unknown reasons this mod requires remaining in 'Online' mode to function correctly. At least one player was able to get past this crash by the following steps:. Restart the Steam client.
Right click XCOM on your Games library and select Properties. Go to the Updates tab. Uncheck the box marked 'Enable Steam Cloud synchronization for XCOM: Enemy Unknown.' . Now try starting the game again.BackgroundSteam Cloud is used to backup config files and save games online in order to access them from every computer you register with Steam.