{"record":{"id":"73822705d00d8b49","repo":"OpenRA/OpenRA","slug":"hovers-ticks-must-be-higher-than-zero","errorCode":null,"errorMessage":"Hovers.Ticks must be higher than zero.","messagePattern":"Hovers\\.Ticks must be higher than zero\\.","errorType":"validation","errorClass":"YamlException","httpStatus":null,"severity":"error","filePath":"OpenRA.Mods.Common/Traits/Render/Hovers.cs","lineNumber":50,"sourceCode":"\n\t\t[Desc(\"Amount of ticks it takes to fall to the ground from the highest point when disabled.\")]\n\t\tpublic readonly int FallTicks = 10;\n\n\t\t[Desc(\"Amount of ticks it takes to rise from the ground to InitialHeight.\")]\n\t\tpublic readonly int RiseTicks = 20;\n\n\t\t[Desc(\"Initial Z axis modifier relative to actual position.\")]\n\t\tpublic readonly WDist InitialHeight = new(43);\n\n\t\tpublic override object Create(ActorInitializer init) { return new Hovers(this); }\n\n\t\tpublic override void RulesetLoaded(Ruleset rules, ActorInfo ai)\n\t\t{\n\t\t\tif (BobDistance.Length > -1)\n\t\t\t\tthrow new YamlException(\"Hovers.BobDistance must be a negative value.\");\n\n\t\t\tif (Ticks < 1)\n\t\t\t\tthrow new YamlException(\"Hovers.Ticks must be higher than zero.\");\n\n\t\t\tif (FallTicks < 1)\n\t\t\t\tthrow new YamlException(\"Hovers.FallTicks must be higher than zero.\");\n\n\t\t\tif (RiseTicks < 1)\n\t\t\t\tthrow new YamlException(\"Hovers.RiseTicks must be higher than zero.\");\n\n\t\t\tif (InitialHeight.Length < RiseTicks)\n\t\t\t\tthrow new YamlException(\"Hovers.InitialHeight must be at least as high as RiseTicks.\");\n\n\t\t\tbase.RulesetLoaded(rules, ai);\n\t\t}\n\t}\n\n\tpublic class Hovers : ConditionalTrait<HoversInfo>, IRenderModifier, ITick, ISync\n\t{\n\t\treadonly HoversInfo info;\n\t\treadonly int stepPercentage;","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/OpenRA/OpenRA/blob/a520984d91eda9de48a62b1d15c1e3bad0d4fb1a/OpenRA.Mods.Common/Traits/Render/Hovers.cs#L32-L68","documentation":"Thrown in HoversInfo.RulesetLoaded when Ticks is less than 1. Ticks defines the number of game ticks for the hovering bob animation cycle; it must be at least 1 to produce any animation. A value of 0 or negative would cause division-by-zero or undefined oscillation behavior.","triggerScenarios":"A mod sets Ticks to 0 or a negative value on a Hovers trait. The check 'Ticks < 1' catches both zero and negatives.","commonSituations":"Explicitly setting 'Ticks: 0' to try to disable bobbing; copy-pasting a trait and not filling in valid values; misunderstanding the field semantics.","solutions":["Set Ticks to a positive integer representing the bob cycle length in game ticks, e.g. 'Ticks: 20'.","If you want to disable hovering entirely, remove the Hovers trait rather than setting Ticks to 0."],"exampleFix":"// before\nHovers:\n  Ticks: 0\n\n// after\nHovers:\n  Ticks: 20","handlingStrategy":"validation","validationCode":"if (hoversInfo.Ticks < 1)\n    Log.Error($\"Hovers.Ticks must be >= 1, got {hoversInfo.Ticks}\");\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never set animation tick counts to 0; use a small positive value or remove the trait.","Validate all Hovers fields together since multiple checks run sequentially."],"tags":["openra","yaml-config","hover","render","trait-validation"],"backgroundTag":null,"analyzedSha":"a520984d91eda9de48a62b1d15c1e3bad0d4fb1a","analyzedAt":"2026-08-13T15:30:14.787Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}