Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sight and special range corrections #149

Open
SavagingSky opened this issue Apr 9, 2023 · 2 comments
Open

Sight and special range corrections #149

SavagingSky opened this issue Apr 9, 2023 · 2 comments

Comments

@SavagingSky
Copy link

SavagingSky commented Apr 9, 2023

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.

@soundmud
Copy link
Owner

soundmud commented Apr 9, 2023

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.

@soundmud
Copy link
Owner

soundmud commented Apr 9, 2023

The load order of the map and the rules could change though, if it doesn't break the game. I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants