Skip to content

Commit b561858

Browse files
feat: use only local game files
1 parent d6db0fe commit b561858

File tree

5 files changed

+25
-20
lines changed

5 files changed

+25
-20
lines changed

scripts/Makefile

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,59 @@
1-
.PHONY: clean install-deps all mapping.json rewards translations.json item_to_name_mappings.json season_rewards.json twitch_rewards.json platform_rewards.json
1+
.PHONY: clean install-deps all mapping.json rewards translations.json item_to_name_mappings.json season_rewards.json twitch_rewards.json platform_rewards.json extract_pcbank_metadataetc extract_pcbank_precache
22

3-
VERSION := 6.12-BREACH-28.October.2025
3+
MBIN_COMPILER_VERSION := v6.13.0-pre1
44

55
all: clean install-deps mapping.json rewards
66

77
clean:
8-
rm -f ./season_rewards.json ./twitch_rewards.json ./item_to_name_mappings.json ./translations.json ./mapping.json
8+
rm -f ./season_rewards.json ./twitch_rewards.json ./item_to_name_mappings.json ./translations.json ./mapping.json ./platform_rewards.json
99
rm -rf ./EXTRACTED
1010
rm -f ./MBINCompiler-linux
1111
rm -rf ./HGPAKtool
1212
rm -f ./*.log
1313
rm -f ./*.MXML
1414

1515
install-deps:
16-
curl -sSL https://github.com/monkeyman192/MBINCompiler/releases/download/v6.13.0-pre1/MBINCompiler-linux-dotnet6 -o ./MBINCompiler-linux
16+
curl -sSL https://github.com/monkeyman192/MBINCompiler/releases/download/$(MBIN_COMPILER_VERSION)/MBINCompiler-linux-dotnet6 -o ./MBINCompiler-linux
1717
git clone https://github.com/monkeyman192/HGPAKtool.git ./HGPAKtool
1818
chmod +x ./MBINCompiler-linux
1919

2020
mapping.json:
21-
curl -sSL https://github.com/monkeyman192/MBINCompiler/releases/latest/download/mapping.json -o ./mapping.json
21+
curl -sSL https://github.com/monkeyman192/MBINCompiler/releases/download/$(MBIN_COMPILER_VERSION)/mapping.json -o ./mapping.json
2222
jq '.Mapping | map({(.Key): .Value}) | add' ./mapping.json > ../src/data/mapping.json
2323
npx prettier --write ../src/data/mapping.json --config ../.prettierrc
2424

25-
translations.json:
25+
extract_pcbank_metadataetc:
2626
python ./HGPAKtool/HGPAKTool/hgpaktool.py ./PCBANKS/NMSARC.MetadataEtc.pak
27+
28+
extract_pcbank_precache:
29+
python ./HGPAKtool/HGPAKTool/hgpaktool.py ./PCBANKS/NMSARC.Precache.pak
30+
31+
translations.json: extract_pcbank_metadataetc
2732
for f in EXTRACTED/language/*_usenglish.mbin; do \
2833
echo "Decoding $$f"; \
2934
./MBINCompiler-linux -y -d ./EXTRACTED/language/ "$$f"; \
3035
done
3136
python ./extract_translations.py
3237

33-
item_to_name_mappings.json: translations.json
34-
curl -sSL "https://github.com/NMSCD/nms-archive/raw/refs/heads/main/$(VERSION)/METADATA/REALITY/TABLES/NMS_REALITY_GCPRODUCTTABLE.MXML" -o ./NMS_REALITY_GCPRODUCTTABLE.MXML
35-
curl -sSL "https://github.com/NMSCD/nms-archive/raw/refs/heads/main/$(VERSION)/METADATA/REALITY/TABLES/NMS_BASEPARTPRODUCTS.MXML" -o ./NMS_BASEPARTPRODUCTS.MXML
38+
item_to_name_mappings.json: translations.json extract_pcbank_precache
39+
./MBINCompiler-linux -y -d ./ ./EXTRACTED/metadata/reality/tables/nms_reality_gcproducttable.mbin
40+
./MBINCompiler-linux -y -d ./ ./EXTRACTED/metadata/reality/tables/nms_basepartproducts.mbin
3641
python ./extract_item_names.py
3742

38-
season_rewards.json: item_to_name_mappings.json
39-
curl -sSL "https://github.com/NMSCD/nms-archive/raw/refs/heads/main/$(VERSION)/METADATA/REALITY/TABLES/UNLOCKABLESEASONREWARDS.MXML" -o ./UNLOCKABLESEASONREWARDS.MXML
43+
season_rewards.json: item_to_name_mappings.json extract_pcbank_precache
44+
./MBINCompiler-linux -y -d ./ ./EXTRACTED/metadata/reality/tables/unlockableseasonrewards.mbin
4045
python ./extract_season_rewards.py
4146
cp ./season_rewards.json ../src/data/rewards/season.json
4247
npx prettier --write ../src/data/rewards/season.json --config ../.prettierrc
4348

44-
twitch_rewards.json: item_to_name_mappings.json
45-
curl -sSL "https://github.com/NMSCD/nms-archive/raw/refs/heads/main/$(VERSION)/METADATA/REALITY/TABLES/UNLOCKABLETWITCHREWARDS.MXML" -o ./UNLOCKABLETWITCHREWARDS.MXML
49+
twitch_rewards.json: item_to_name_mappings.json extract_pcbank_precache
50+
./MBINCompiler-linux -y -d ./ ./EXTRACTED/metadata/reality/tables/unlockabletwitchrewards.mbin
4651
python ./extract_twitch_rewards.py
4752
cp ./twitch_rewards.json ../src/data/rewards/twitch.json
4853
npx prettier --write ../src/data/rewards/twitch.json --config ../.prettierrc
4954

50-
platform_rewards.json: item_to_name_mappings.json
51-
curl -sSL "https://github.com/NMSCD/nms-archive/raw/refs/heads/main/$(VERSION)/METADATA/REALITY/TABLES/UNLOCKABLEPLATFORMREWARDS.MXML" -o ./UNLOCKABLEPLATFORMREWARDS.MXML
55+
platform_rewards.json: item_to_name_mappings.json extract_pcbank_precache
56+
./MBINCompiler-linux -y -d ./ ./EXTRACTED/metadata/reality/tables/unlockableplatformrewards.mbin
5257
python ./extract_platform_rewards.py
5358
cp ./platform_rewards.json ../src/data/rewards/platform.json
5459
npx prettier --write ../src/data/rewards/platform.json --config ../.prettierrc

scripts/extract_item_names.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import json
33

44
xml_paths = [
5-
"./NMS_REALITY_GCPRODUCTTABLE.MXML",
6-
"./NMS_BASEPARTPRODUCTS.MXML"
5+
"./nms_reality_gcproducttable.MXML",
6+
"./nms_basepartproducts.MXML"
77
]
88
translations_path = "./translations.json"
99
output_json = "item_to_name_mappings.json"

scripts/extract_platform_rewards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import xml.etree.ElementTree as ET
22
import json
33

4-
platform_rewards_xml = "./UNLOCKABLEPLATFORMREWARDS.MXML"
4+
platform_rewards_xml = "./unlockableplatformrewards.MXML"
55
product_mapping_json = "./item_to_name_mappings.json"
66
output_json = "./platform_rewards.json"
77

scripts/extract_season_rewards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import json
33
import re
44

5-
xml_path = "./UNLOCKABLESEASONREWARDS.MXML"
5+
xml_path = "./unlockableseasonrewards.MXML"
66
mapping_path = "./item_to_name_mappings.json"
77
output_path = "./season_rewards.json"
88

scripts/extract_twitch_rewards.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import xml.etree.ElementTree as ET
22
import json
33

4-
xml_path = "./UNLOCKABLETWITCHREWARDS.MXML"
4+
xml_path = "./unlockabletwitchrewards.MXML"
55
mapping_path = "./item_to_name_mappings.json"
66
output_path = "twitch_rewards.json"
77

0 commit comments

Comments
 (0)