Last Update: 2023-08-01
API Changelog
This document tracks significant API changes between Don't Starve Together versions.
API Version 624447 (2023-08-01)
Builder Component Changes
- Added support for recipes unlocked by skill tree skills
- All existing skill tree builder tags have been removed in favor of builder skills
- New methods:
builder:AddBuilderSkill(skill_name)
- Add a builder skill from a character's skill treebuilder:RemoveBuilderSkill(skill_name)
- Remove a builder skillbuilder:HasBuilderSkill(skill_name)
- Check if builder has a specific skill
Recipe System Changes
- Recipe configuration now prefers
builder_skill
overbuilder_tag
for skill tree integration - Example update:
-- Old method (pre-624447)
Recipe2("item", ingredients, tech, {builder_tag="character_skill"})
-- New method (624447+)
Recipe2("item", ingredients, tech, {builder_skill="character_skill"})
New TUNING Constants
- Added
TUNING.ANTLION_DEAGGRO_DIST
- Distance at which Antlion deaggros
API Version 619045 (2023-07-06)
Initial documented API version.
How to Read This Changelog
Each entry follows this format:
- Version: The game version where the change was introduced
- Date: When the change was released
- Type: Whether it's an addition, modification, removal, or deprecation
- Component/System: Which part of the API was affected
- Description: Detailed explanation of the change
- Impact: How this might affect existing mods
Version History
Game Version 517850 (August 31, 2022)
Added
- Component: Added
shard_player
component for handling player transitions between shards- New methods:
SetMigrationData()
,DoMigration()
- Allows for transferring player data between shards
- New methods:
Modified
- Component: Updated
hunger
component- Added
hungerrate
property to allow for more granular control of hunger drain - Changed how
burning
property interacts with hunger drain calculation
- Added
Deprecated
- Global Function:
GetPlayer()
is now deprecated- Use
ThePlayer
global variable instead - Will be removed in a future update
- Use
Fixed
- Component: Fixed issue with
inventoryitem
component whereOnDropped
event wasn't firing consistently
Game Version 517725 (July 15, 2022)
Added
- Global Object: Added
TheNet:GetClientTable()
method- Returns information about all connected clients
- Includes userids, names, and prefabs
Modified
- Component: Updated
health
component- Added
SetInvincible(bool)
method - Modified
DoDelta()
to respect invincibility state
- Added
Removed
- Component: Removed deprecated
sleeper.hibernate
property- Use
sleeper:SetHibernate(bool)
method instead
- Use
Game Version 517600 (June 2, 2022)
Added
- System: Added support for custom minimap icons
- New function
AddMinimapAtlas(atlas_path)
- New component property
minimap.icon
to set custom icons
- New function
Modified
- Component: Updated
combat
component- Changed how attack cooldown is calculated
- Added
min_attack_period
property
Deprecated
- Component Method:
container:Open()
without parameters is deprecated- Use
container:Open(opener)
with the opener entity instead
- Use
Migration Guides
Migrating from pre-517850
If your mod was designed for versions before 517850, consider these changes:
- Replace all instances of
GetPlayer()
withThePlayer
- Update hunger rate calculations to use the new
hungerrate
property - Check for shard compatibility if your mod works across multiple shards
Migrating from pre-517600
If your mod was designed for versions before 517600, consider these changes:
- Update container opening code to include the opener entity
- Review combat cooldown logic for compatibility with the new calculation method
- Use the new minimap icon system if your mod adds custom map icons
Compatibility Tools
When dealing with API changes, these helper functions can assist with maintaining compatibility across game versions:
-- Check if a function exists before using it
function SafeCall(fn, ...)
if type(fn) == "function" then
return fn(...)
end
return nil
end
-- Get API version safely
function GetAPIVersion()
if TheSim and TheSim.GetGameVersion then
return TheSim:GetGameVersion()
end
return "Unknown"
end
-- Check if current version is at least the specified version
function IsVersionAtLeast(major, minor, revision)
local version = GetAPIVersion()
-- Parse version string and compare
-- Implementation depends on version format
return true -- Replace with actual comparison
end
Contributing
This changelog is maintained by the community. If you notice API changes that aren't documented here:
- Verify the change across multiple game versions
- Document the old and new behavior with code examples
- Note which game version introduced the change
- Submit a pull request to update this document
Your contributions help the entire modding community stay informed about API changes.