You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that sight_range 1 and special_range 1 should be replaced not with default square length 12 parameters, but rather by default map square length.
So instead of
if "sight_range" in d and d["sight_range"] == 1 * PRECISION:
d["sight_range"] = 12 * PRECISION
d["bonus_height"] = 1
info(
"in %s: replacing sight_range 1 with sight_range 12 and bonus_height 1",
name,
)
if "special_range" in d:
del d["special_range"]
d["range"] = 12 * PRECISION
d["minimal_range"] = 4 * PRECISION
d["is_ballistic"] = 1
info(
"in %s: replacing special_range 1 with range 12, minimal_range 4 and is_ballistic 1",
name,
)
there should be
if "sight_range" in d and d["sight_range"] == 1 * PRECISION:
d["sight_range"] = SquareLength+1 * PRECISION
info(
"in %s: replacing sight_range 1 with sight_range 12 and bonus_height 1",
name,
)
if "special_range" in d:
del d["special_range"]
d["range"] = SquareLength+1 * PRECISION
d["minimal_range"] = SquareLength//3 * PRECISION
info(
"in %s: replacing special_range 1 with range 12, minimal_range 4 and is_ballistic 1",
name,
)
return d
It would solve those defs working not as intended on non standard maps, where square length is less or more than 12.
The text was updated successfully, but these errors were encountered:
A problem is that the map is not known yet when the rules are loaded, so the game would need to remember that some values are to be replaced only when building the map.
Those corrections were trying to fix automatically some mods instead of fixing the mod manually. I'm not sure about what exactly the game is supposed to do anyway. Maybe try to turn the non standard map into a "folder map with custom rules" to check if the newly corrected rules would be better.
I think that sight_range 1 and special_range 1 should be replaced not with default square length 12 parameters, but rather by default map square length.
So instead of
if "sight_range" in d and d["sight_range"] == 1 * PRECISION:
d["sight_range"] = 12 * PRECISION
d["bonus_height"] = 1
info(
"in %s: replacing sight_range 1 with sight_range 12 and bonus_height 1",
name,
)
if "special_range" in d:
del d["special_range"]
d["range"] = 12 * PRECISION
d["minimal_range"] = 4 * PRECISION
d["is_ballistic"] = 1
info(
"in %s: replacing special_range 1 with range 12, minimal_range 4 and is_ballistic 1",
name,
)
there should be
if "sight_range" in d and d["sight_range"] == 1 * PRECISION:
d["sight_range"] = SquareLength+1 * PRECISION
info(
"in %s: replacing sight_range 1 with sight_range 12 and bonus_height 1",
name,
)
if "special_range" in d:
del d["special_range"]
d["range"] = SquareLength+1 * PRECISION
d["minimal_range"] = SquareLength//3 * PRECISION
info(
"in %s: replacing special_range 1 with range 12, minimal_range 4 and is_ballistic 1",
name,
)
return d
It would solve those defs working not as intended on non standard maps, where square length is less or more than 12.
The text was updated successfully, but these errors were encountered: