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

chore!: migrate legacy unit #3312

Merged
merged 15 commits into from
Dec 2, 2023

Conversation

scarf005
Copy link
Member

@scarf005 scarf005 commented Sep 29, 2023

Purpose of change

Describe the solution

Wrote a migration script. It preserves object field order, making it idempotent. It will convert:

for convenience, deno task migrate-unit will

  1. find and replace all occurances of legacy units in data/json and data/mods.
  2. format them accordingly

Describe alternatives you've considered

Testing

Was able to load previous save without errors

@github-actions github-actions bot added JSON related to game datas in JSON format. scripts related to game management scripts labels Sep 29, 2023
@github-actions github-actions bot added mods PR changes related to mods. and removed scripts related to game management scripts labels Sep 30, 2023
@olanti-p
Copy link
Contributor

olanti-p commented Oct 7, 2023

Tests failed, it's related.

@scarf005
Copy link
Member Author

scarf005 commented Nov 28, 2023

Tests failed, it's related.

I've found out many fields have different meanings depending on its types, for example tests fail due to the script converting "capacity" field in ammo to KJ. I'll adjust the script.

@github-actions github-actions bot added the scripts related to game management scripts label Nov 29, 2023
@scarf005 scarf005 force-pushed the migrate-legacy-unit branch 3 times, most recently from 1b5ef6d to 3e01158 Compare November 29, 2023 11:20
@scarf005 scarf005 marked this pull request as ready for review November 29, 2023 11:20
@scarf005 scarf005 changed the title chore: migrate legacy unit chore!: migrate legacy unit Nov 29, 2023
@scarf005
Copy link
Member Author

scarf005 commented Dec 2, 2023

image

failures are unrelated (wearing power armor)

@chaosvolt
Copy link
Member

The power armor test fail is weird since it seems to be complaining about an item combo the player can spawn in and wear just fine...

@scarf005 scarf005 added this pull request to the merge queue Dec 2, 2023
Merged via the queue into cataclysmbnteam:upload with commit 2703a29 Dec 2, 2023
11 of 12 checks passed
@scarf005 scarf005 deleted the migrate-legacy-unit branch December 2, 2023 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format. mods PR changes related to mods. scripts related to game management scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modernize JSON parser to accept type strings over raw integers
4 participants