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

Make the walking speed modifiers generic #2

Open
felixbade opened this issue Nov 25, 2021 · 1 comment
Open

Make the walking speed modifiers generic #2

felixbade opened this issue Nov 25, 2021 · 1 comment

Comments

@felixbade
Copy link
Owner

The mod could iterate through all tiles in data.json and set their new speed according to their previous speed instead of their tile name. This way the mod would be compatible with all mods that introduce new tiles, and it would be easier to make the speed changes consistent. This feature might be able to reduce the total amount of code as well.

The downside of course would be that if there is some other mod that changes the walking speeds, the two mods together would modify the speeds twice. That’s probably not a big deal though.

@felixbade
Copy link
Owner Author

In the simplest possible implementation this doesn’t calculate the new speeds with any fancy formula, but simply looks for specific values and replaces them with specific other values (e.g. 1.3 → 1.8).

It just has to make sure the loop doesn’t modify the same values twice (e.g. if 1.8 → 3.0 then 1.3 shouldn’t become 3.0).

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

1 participant