TML 2022 August Stable Update
August's Stable TML release is here with new API features & modernization, polishing, and a wagon of stability improvements.
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 [Obsolete(msg, true)] 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.
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.
[h3]New Workshop Menu Icons by Rijam[/h3]
[h3]Grab Bag Loot Modernization by TheLuxure[/h3]
[h3]Modernize PlayerLoader, support custom ModPlayer hooks by Mirsario[/h3]
[h3]Modded Pylons: ModPylon & GlobalPylon by MutantWafflez[/h3]
[h3]Mod Pack Revamp Part 1 of 2 by Solxanich[/h3]
[h3]Add ModPlayer.ModifyFishingAttempt hook by direwolf420[/h3]
[h3]Update FAudio and use WINSDK IAudio backend isntead of FFMPEG by Chicken-Bones[/h3]
[h3]Merge Recipe Groups with the same Name by jopojelly[/h3]
[h3]Fix players/NPCs falling through map in MP by Chicken-Bones[/h3]
[h3]Add consumed items list to Recipe.OnCraft and RecipeCreationContext by andro951[/h3]
[h3]Run SetupContent on all content from all mods before PostSetupContent by Chicken-Bones[/h3]
[h3]Add cooldownCounter for PreHurt, Hurt and PostHurt (Player) by Crapsky233[/h3]
[h3]Add PlayerLoader.HoverSlot hook by Crapsky233[/h3]
[h3]Added a public 'in SoundStyle?' overload for SoundEngine.PlaySound by Mirsario[/h3]
[h3]Publicize WorldGen local variables & private variables by MutantWafflez[/h3]
lyc-Lacewing: Localization support for ModConfig
• Brazilian Portuguese - Thanks to Pixelnando.
• German - Thanks to CriddleZap.
• Russian - Thanks to Ved-s.
• Spanish - Thanks to Wolf-Igmc4.
[h3]Fix mod syncing on fast connections, poor errors on dropped packets by Chicken-Bones[/h3]
[h3]Fix TileWallWireStateData/Tile.BlockType setter inverted IsHalfBlock by Chicken-Bones[/h3]
starspritechippy: Update steamcmd setup to use full paths turtletowerz: Fix modpacks not saving for duplicate configs Antirhinnum: Reset Projectile.ContinuouslyUpdateDamage jackbondpreston: Fix some UPNP issues ExterminatorX99: Prevent registering a recipe twice absoluteAquarian: Fixed color chat tags being ignored by ChatManager methods... absoluteAquarian: NPC Dialogue Fixes direwolf420: Various ExampleMod fixes direwolf420: Exclude missing NoSync mods from ModNetDiagnosticsUI, fixing exception Solxan: Add support for Linux x86 formally by adding libsteamapi.so Solxan: Fix a missing true in Directory.Delete for 9999 folders Solxan: Final Fix for #2660 jopojelly: Quick Fix for #2407 until someone works on controller support jopojelly: Fix an issue with modded chests having tiles corrupted jopojelly: Protect against bad mod name response from workshop jopojelly: Log OS version, catch more ControlledFolderAccess errors jopojelly: Fix orphan or incorrectly assigned recipe groups. Chicken-Bones: Better fix for docker in non-interactive mode Chicken-Bones: Fix TileWallWireStateData/Tile.BlockType setter inverted IsHalfBlock Chicken-Bones: Add error screen when server connection is lost during mod reload Chicken-Bones: Fix mod syncing on fast connections, poor errors on dropped packets... Chicken-Bones: Add more graceful handling & logging for corrupt worlds on servers (Fixes #2693) Chicken-Bones: Fix players/NPCs falling through map in MP Chicken-Bones: Make ModSystem.SetupContent call SetStaticDefaults by default Chicken-Bones: Use IAudio backend again, this time with speakermask fix Chicken-Bones: Fix crash on some clients due to broken output stream Chicken-Bones: Fix ExampleFoodItem using ConsumeItem rather than OnConsumeItem
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.
[h3]Mod.AddRecipes/AddRecipeGroups/PostAddRecipes[/h3]
[h3]Remove GlobalRecipe[/h3]
[h3]Mod/GlobalItem.OpenVanillaBag/PreOpenVanillaBag [/h3]
[h3]My game doesn't launch, and I'm on Windows![/h3]
[h3]How do I switch to the 1.4-preview or 1.3-legacy branches of TML?[/h3]
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.
[h3]When will tModLoader be 64-bit???[/h3]
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.
[h3]I have a 32-bit OS, will it be supported?[/h3]
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.
Special thanks to the following people who have supported us on Patreon in the last month:
See you in Autumn, tomorrow!
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 [Obsolete(msg, true)] 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.
[h3]New Workshop Menu Icons by Rijam[/h3]
Neat!
[h3]Grab Bag Loot Modernization by TheLuxure[/h3]
• 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.
Porting Notes: #preview-update-log in Discord
[h3]Modernize PlayerLoader, support custom ModPlayer hooks by Mirsario[/h3]
• 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.
Examples: #preview-update-log in Discord
[h3]Modded Pylons: ModPylon & GlobalPylon by MutantWafflez[/h3]
• 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.
Porting Notes: #preview-update-log in Discord
[h3]Mod Pack Revamp Part 1 of 2 by Solxanich[/h3]
• 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.
Porting Notes: #preview-update-log in Discord
[h3]Add ModPlayer.ModifyFishingAttempt hook by direwolf420[/h3]
• 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.
[h3]Update FAudio and use WINSDK IAudio backend isntead of FFMPEG by Chicken-Bones[/h3]
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.
[h3]Merge Recipe Groups with the same Name by jopojelly[/h3]
• If two mods call RecipeGroup.RegisterGroup with the same name, they will be merged.
[h3]Fix players/NPCs falling through map in MP by Chicken-Bones[/h3]
• 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.
Porting Notes: #preview-update-log in Discord
[h3]Add consumed items list to Recipe.OnCraft and RecipeCreationContext by andro951[/h3]
• 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.
Porting Notes: #preview-update-log in Discord
[h3]Run SetupContent on all content from all mods before PostSetupContent by Chicken-Bones[/h3]
• 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.
[h3]Add cooldownCounter for PreHurt, Hurt and PostHurt (Player) by Crapsky233[/h3]
• ModPlayer PreHurt/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)
Porting Notes: #preview-update-log in Discord
[h3]Add PlayerLoader.HoverSlot hook by Crapsky233[/h3]
• Allows mods to change the behavior of the shift-click slot event (e.g. to fast-transfer an item to a custom UI.)
[h3]Added a public 'in SoundStyle?' overload for SoundEngine.PlaySound by Mirsario[/h3]
• You can now just write SoundEngine.PlaySound(in item.UseSound, ...) instead of having to wrap calls like that in a null check block.
• That is all.
[h3]Publicize WorldGen local variables & private variables by MutantWafflez[/h3]
• Makes the local variables in WorldGen.GenerateWorld public static instead, e.g. WorldGen.dungeonLocation.
• Makes many private static worldgen variables public, so you don't need to use reflection anymore.
Porting Notes: #preview-update-log in Discord
Localization Updates
lyc-Lacewing: Localization support for ModConfig
• Brazilian Portuguese - Thanks to Pixelnando.
• German - Thanks to CriddleZap.
• Russian - Thanks to Ved-s.
• Spanish - Thanks to Wolf-Igmc4.
Bug Fixes
[h3]Fix mod syncing on fast connections, poor errors on dropped packets by Chicken-Bones[/h3]
Sending mods from servers on join works again now. No more evil Bad Header errors.
[h3]Fix TileWallWireStateData/Tile.BlockType setter inverted IsHalfBlock by Chicken-Bones[/h3]
• 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?
Porting Notes: #preview-update-log in Discord
starspritechippy: Update steamcmd setup to use full paths turtletowerz: Fix modpacks not saving for duplicate configs Antirhinnum: Reset Projectile.ContinuouslyUpdateDamage jackbondpreston: Fix some UPNP issues ExterminatorX99: Prevent registering a recipe twice absoluteAquarian: Fixed color chat tags being ignored by ChatManager methods... absoluteAquarian: NPC Dialogue Fixes direwolf420: Various ExampleMod fixes direwolf420: Exclude missing NoSync mods from ModNetDiagnosticsUI, fixing exception Solxan: Add support for Linux x86 formally by adding libsteamapi.so Solxan: Fix a missing true in Directory.Delete for 9999 folders Solxan: Final Fix for #2660 jopojelly: Quick Fix for #2407 until someone works on controller support jopojelly: Fix an issue with modded chests having tiles corrupted jopojelly: Protect against bad mod name response from workshop jopojelly: Log OS version, catch more ControlledFolderAccess errors jopojelly: Fix orphan or incorrectly assigned recipe groups. Chicken-Bones: Better fix for docker in non-interactive mode Chicken-Bones: Fix TileWallWireStateData/Tile.BlockType setter inverted IsHalfBlock Chicken-Bones: Add error screen when server connection is lost during mod reload Chicken-Bones: Fix mod syncing on fast connections, poor errors on dropped packets... Chicken-Bones: Add more graceful handling & logging for corrupt worlds on servers (Fixes #2693) Chicken-Bones: Fix players/NPCs falling through map in MP Chicken-Bones: Make ModSystem.SetupContent call SetStaticDefaults by default Chicken-Bones: Use IAudio backend again, this time with speakermask fix Chicken-Bones: Fix crash on some clients due to broken output stream Chicken-Bones: Fix ExampleFoodItem using ConsumeItem rather than OnConsumeItem
Removed Hooks/Features
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.
[h3]Mod.AddRecipes/AddRecipeGroups/PostAddRecipes[/h3]
• Use ModSystem.AddRecipes/AddRecipeGroups/PostAddRecipes instead.
[h3]Remove GlobalRecipe[/h3]
• 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.
[h3]Mod/GlobalItem.OpenVanillaBag/PreOpenVanillaBag [/h3]
• Replaced with a drop rule system similar to NPC drops. See ModifyItemLoot hooks.
Known Issues
[h3]My game doesn't launch, and I'm on Windows![/h3]
- If you're on Windows 7 or 8.X, or an older Windows OS, installing .NET pre-requisites listed in Microsoft's website might very much help. Especially the KB3063858 update.
- 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
[h3]How do I switch to the 1.4-preview or 1.3-legacy branches of TML?[/h3]
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.
[h3]When will tModLoader be 64-bit???[/h3]
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.
[h3]I have a 32-bit OS, will it be supported?[/h3]
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
See you in Autumn, tomorrow!