diff --git a/changelog/snippets/fix.6213.md b/changelog/snippets/fix.6213.md new file mode 100644 index 0000000000..1a98682f93 --- /dev/null +++ b/changelog/snippets/fix.6213.md @@ -0,0 +1 @@ +- (#6213) Fix the default teleport delay being set to 15 seconds instead of 0, which caused some modded units to teleport much slower. diff --git a/engine/Core/Blueprints/UnitBlueprint.lua b/engine/Core/Blueprints/UnitBlueprint.lua index 19d3b8c9c8..5da41bb219 100644 --- a/engine/Core/Blueprints/UnitBlueprint.lua +++ b/engine/Core/Blueprints/UnitBlueprint.lua @@ -755,8 +755,9 @@ ---@field TeleportMassMod? number --- Multiplied by the resulting total energy cost of the teleport to get its required time. --- Treated as `0.01` when absent. +---@see TeleportDelay For an additional flat delay that also delays teleport FX showing at the destination. ---@field TeleportTimeMod? number ---- Whether to use the new variable teleport cost calculation method, or revert to the old +--- Whether to use the new distance-based teleport cost calculation method, or revert to the old unit cost based method. ---@field UseVariableTeleportCosts? boolean ---@class UnitBlueprintExternalFactory @@ -947,7 +948,10 @@ ---@field TarmacGlowDecal? any unused --- defines the tech level used for display purposes ---@field TechLevel UnitTechLevel ---- if present, makes the "teleport" ability show up in the unit view with the delay of this value. Defaults to 15 seconds. +--- Extra time taken to teleport before other teleport time calculations. Defaults to 0 seconds. +--- If `UseVariableTeleportCosts` is false, then this also delays teleport FX appearing at the destination. +--- If `UseVariableTeleportCosts` is true, then destination FX appear after 0.4x the total teleport time. +---@see TeleportTimeMod For an energy-scaling teleport time that does not delay teleport FX at the destination. ---@field TeleportDelay? number --- if present, adds a flat energy cost to the "teleport" ability. Defaults to 150000 energy. Only applies when `UseVariableTeleportCosts` is true. ---@field TeleportFlatEnergyCost? number diff --git a/lua/shared/teleport.lua b/lua/shared/teleport.lua index 8f84da38c8..05a07fac83 100644 --- a/lua/shared/teleport.lua +++ b/lua/shared/teleport.lua @@ -58,7 +58,7 @@ TeleportCostFunction = function(unit, location) end local dist = VDist3(pos, location) - local teleDelay = bp.General.TeleportDelay or 15 + local teleDelay = bp.General.TeleportDelay or 0 local teleportFlatEnergyCost = bp.General.TeleportFlatEnergyCost or 75000 local teleportMaximumEnergyCost = bp.General.TeleportMaximumEnergyCost or 2500000 local teleportMaximumDuration = bp.General.TeleportMaximumDuration or 50