Created
August 28, 2021 00:50
-
-
Save apple1417/723849d0f68548ac523a0bf9b91f9616 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unrealsdk | |
import csv | |
from typing import Dict, Set | |
INVBAL_CLS_BLACKLIST = ( | |
"CustomizationInventoryBalanceData", | |
"InventoryBalanceData_Generated", | |
"VaultCardRewardBalanceData", | |
) | |
INVDATA_CLS_BLACKLIST = ( | |
"BPInv_Ammo_C", | |
"BPInv_Eridian_Fabricator_C", | |
"BPInv_LootOGramData_C", | |
"BPInv_Money_C", | |
"InventoryData", | |
) | |
all_anoints: Set[str] = set() | |
balance_map: Dict[str, Set[str]] = {} | |
for obj in unrealsdk.FindAll("InventoryBalanceData"): | |
if obj.Class.Name in INVBAL_CLS_BLACKLIST: | |
continue | |
if obj.InventoryData is None or obj.InventoryData.Class.Name in INVDATA_CLS_BLACKLIST: | |
continue | |
local_anoints = set() | |
if obj.RuntimeGenericPartList.bEnabled: | |
for entry in obj.RuntimeGenericPartList.PartList: | |
if entry.PartData is None: | |
continue | |
name = entry.PartData.Name | |
all_anoints.add(name) | |
local_anoints.add(name) | |
obj_name = obj.Name | |
if obj_name in balance_map: | |
obj_name = str(obj).split(" ")[-1] | |
balance_map[obj_name] = local_anoints | |
ordered_anoints = sorted(all_anoints) | |
with open("anoints.csv", "w", newline="") as file: | |
writer = csv.writer(file) | |
writer.writerow(["Balance"] + ordered_anoints) | |
for balance in sorted(balance_map): | |
row = [balance] | |
for anoint in ordered_anoints: | |
row.append("Y" if anoint in balance_map[balance] else "") | |
writer.writerow(row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment