Aggregated from Steam, cross-tracked with Battle.net coverage on GamePatchNote.
August's Stable TML release is here with new API features & modernization, polishing, and a wagon of stability improvements.
API Backwards Compatibility
The TML Team has decided to make API changes back-compatible for at least one month following their merge where possible. Old APIs will be marked with producing a compile error to discourage their usage. However an effort will be made to make sure that mods which were compiled for the previous version of TML continue to load and run correctly for at least the next month.
Note that this is where possible. Sometimes there may be unavoidable incompatibilities in the new APIs, and some mod functionality may be lost during updates.
New Changes' Highlights
The following is a list of the most noteworthy pull requests and commits that have been pushed to 1.4-preview in July, and are now available on the default/stable branch.
• All 'right click to open' items (bags, crates, can of worms, etc.) now have a loot table like NPC drops. • Use Mod/GlobalItem.ModifyItemLoot just like you'd use ModifyNPCLoot for NPCs. • Currently, the loot table will be rolled on every right-click of an item (doing nothing if there is no table.) • Vanilla bags/crates have been translated. There may be bugs in translation. • A bunch of new ItemDropRule classes have been added for 'bag style' rolling.
• Allows mods to create custom interface hooks for ModPlayer instances, in line with support on GlobalItem, GlobalNPC, and GlobalProjectile. • PlayerLoader backends modernized and streamlined. You may get whooping 0.01% more performance! • Player.ModPlayers getter property added. Don't go crazy.
• Introduces ModPylon for adding your own pylons, and GlobalPylon for altering vanilla and modded pylons. • ModPylon extends from ModTile and works in hand with a subclass of TEModdedPylon. • Definitely check out the ExamplePylon if you're implementing a pylon of your own. • Provides a range of hooks relating to teleporting conditions, placement restrictions and map drawing.
• Completes the first major step in the Mod Pack Overhaul development that begun two months ago. • Adds a new feature: Freezing a copy of all mods inside of a mod pack. • Adds a new feature: Export all mods from the Mod Pack to a folder for usage on a server OR setting up an older tml instance.
• Introduces the new ModPlayer.ModifyFishingAttempt hook. • Allows mod developers to change information about the ongoing fishing attempts before caught items/NPCs are decided, but after all vanilla information has been gathered.
Sample Usages: • "Enhanced Crate Potion" that quadruples crate chance. • "Fishing License" accessory that increases the chance to get higher quality fish. • Catching lava/honey fish in water.
A number of audio issues on Windows have been fixed, for example: • Audio stuttering -- something we've previously fixed, but had to rollback the fix until now. • Audio devices sometimes not being detected by the game, requiring dances with a tambourine.
• Main.sectionManager.SectionLoaded can be used to determine if a tile section (200x150 tiles) has been sent from the server to the client or if the tiles are all air because the data hasn't yet been synced. • There is also sectionManager.TileLoaded and TilesLoaded which does the tile -> section conversion for you.
• RecipeCreationContext (passed to Mod/GlobalItem.OnCreate) now has a ConsumedItems field. • Recipe.OnCraftCallback now has List consumedItems as the last parameter. • Items taken from multiple stacks will appear multiple times in the list, with the partial amounts that were consumed.
• Changes Mod.PostSetupContent to run after SetuPContent has been called on all mod content, not just the one mod. • Makes PostSetupContent more useful for cross mod content. As an example, it should be safe to create item instances and lookup tables. A lot of mods end up using AddRecipes for stuff that should/could really go in PostSetupContent.
• ModPlayerPreHurt/Hurt/PostHurt now have an additional cooldownCounter parameter at the end indicating which immunity counter this strike is meant to trigger. • Can be used to implement accessories that add extra immunity time properly (see ExampleImmunityAccessory) • Remember to use ImmunityCooldownID.Bosses for damage done to players by your boss enemies! (see Example Minion Boss and the MinionBossEye projectile)
• Makes the local variables in WorldGen.GenerateWorldpublic static instead, e.g. WorldGen.dungeonLocation. • Makes many private static worldgen variables public, so you don't need to use reflection anymore.
• Tile.BlockType = ... had a bug where it set IsHalfBlock to true for slopes and solid and false for BlockType.HalfBlock • Guess no-one used it until now?
Note: Obsolete hooks have been left in for compatibility where possible, but they will be removed in following months, so please move away from these. As always, tModPorter is available to help providing hints and refactors.
• See the PR discussion for alternatives. The standard approach is to add callbacks to or modify recipes directly (e.g. like in PostAddRecipes.) • No backwards compatibility for this feature.
If the above doesn't apply or didn't help, try deleting the dotnet folder in the install directory, and try running TML again. There seems to be a bug with extracting needed libraries on some Windows devices, where it may take two attempts. We are actively investigating improvements to remedy this.
Frequently Asked Questions
How do I switch to the 1.4-preview or 1.3-legacy branches of TML?
To switch to anoter branch in steam, just do the following: 1. Right click on tModLoader in Steam and select 'Properties...', then 'BETAS'; 2. Select the branch you want in the drop-down menu on top; 3. Close the window. You don't need to enter any passwords. Please note:1.4-preview versions of TML are intended to only be used by mod developers and testers who know what they're doing. Some popular mods' authors do not intend for their mods to always work with it.
When will tModLoader be 64-bit???
It's already 64-bit! TML runs in AnyCPU mode with x86_64 natives on .NET 6.0+, using the FNA framework under a singular universal cross-platform release.
I have a 32-bit OS, will it be supported?
Plenty of work has now been done towards improving our handling of native libraries, to then add 32-bit Windows support after that. If everything goes well in testing, this will be pushed to the stable branch mid-month, with an announcement in our Discord.
Our Lovely Supporters
Special thanks to the following people who have supported us on Patreon in the last month:
Andrew Spinks, Marco, John Gabriel Wilson, Andrew Nelson, orian34, dinidini, Peter Doucette, Neuron, SheepishShepherd, Chris Cheeseman, Chris Book, absoluteZero, Steptimus Heap, Hao Wu, Toni Stache, Patcheresu, Hunter Amelink, Jeremy Weeks