[Python] Convert Ark ID to Ingame ID in Python

Discussão em 'Python' iniciado por Stack, Janeiro 31, 2025.

  1. Stack

    Stack Membro Participativo

    I was analysing the Ark stats extractor and wanted to include database in my application

    https://github.com/cadon/ARKStatsExtractor/blob/dev/ARKBreedingStats/Utils.cs#L581

    If I'm not mistaken this function is used to convert the IDs to Ingame IDs I took "ArkId": 1294819557881357000 and wrote following python code

    def convert_imported_ark_id_to_ingame_visualization(imported_ark_id: int) -> str:
    """
    Converts a 64-bit Ark ID into an in-game visualization string.

    :param imported_ark_id: The 64-bit Ark ID.
    :return: A string representation used in-game.
    """

    part1 = int(imported_ark_id >> 32)
    part2 = int(imported_ark_id & 0xFFFFFFFF)

    return f"{part1}{part2}"

    if __name__ == "__main__":
    ingame = convert_imported_ark_id_to_ingame_visualization(1294819557881357000)
    print(f"Ingame should be 301473671331293553 but is {ingame}")


    the breeder is showing me ID: 301473671331293553 my one is: 301473671331293384

    I have no idea why there is a difference.

    Continue reading...

Compartilhe esta Página