Replies: 0 (Who?), Viewed: 2228 times.
Lab Assistant
Original Poster
#1 Old 14th Sep 2014 at 10:30 AM
Default Heads up for scripters verifying EPs in game
So, I was in the middle of scrambling around the Maxis code a little bit and I found something in sims4.common:

class Pack(enum.Int, export=False):
    __qualname__ = 'Pack'
    BASE_GAME = _common_types.BASE_GAME
    SP01 = _common_types.SP01
    GP01 = _common_types.GP01
    EP01 = _common_types.EP01

    import _zone
except ImportError:

    class _zone:
        __qualname__ = '_zone'

        def is_entitled_pack(pack):
            return True

is_entitled_pack = _zone.is_entitled_pack

def get_entitled_packs():
    return tuple(pack for pack in Pack if is_entitled_pack(pack))

def get_pack_name(value) -> str:
        return str(Pack(value))
        return '<Unknown Pack>'

def get_pack_enum(folder_name) -> Pack:
        pack_enum_name = 'Pack.{}'.format(folder_name[2:])
        for pack in Pack:
            while str(pack) == pack_enum_name:
                return pack
        return Pack.BASE_GAME
        return Pack.BASE_GAME

I reckon this will be useful when we want to confirm whether a user has the necessary EPs for some of our features.
Back to top