Sim Utilities

Fundamentals

Names

class CommonSimNameUtils

Bases: object

Utilities for manipulating the name of Sims.

static get_first_name(sim_info)

Retrieve the First Name of a Sim.

Parameters:sim_info (SimInfo) – The Sim to retrieve the first name of.
Returns:The first name of the specified Sim.
Return type:str
static get_full_name(sim_info)

Retrieve the full name of a Sim.

Note

Resulting Full Name: ‘{First} {Last}’

Parameters:sim_info (SimInfo) – The Sim to retrieve the full name of.
Returns:The full name of the specified Sim.
Return type:str
static get_full_names(sim_info_list)

Retrieve a collection of full names for the specified Sims.

Note

Resulting Full Names: (‘{First} {Last}’, ‘{First} {Last}’, ‘{First} {Last}’, …)

Parameters:sim_info_list (Tuple[SimInfo]) – A collection of Sims
Returns:A collection of full names of the specified Sims.
Return type:Tuple[str]
static get_last_name(sim_info)

Retrieve the Last Name of a Sim.

Parameters:sim_info (SimInfo) – The Sim to retrieve the last name of.
Returns:The last name of the specified Sim.
Return type:str

Age

class CommonAgeUtils

Bases: object

Utilities for manipulating Ages of Sims.

static are_same_age(sim_info, other_sim_info)

Determine if two Sims are the same Age.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • other_sim_info (SimInfo) – The other Sim to compare to.
Returns:

True, if both Sims are the same Age.

Return type:

bool

static get_age(sim_info)

Retrieve the Age of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the Age of.
Returns:The Age of the Sim or None if a problem occurs.
Return type:Union[Age, None]
static is_adult(sim_info)

Determine if a sim is either a Young Adult or an Adult.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_adult_age(age)

Determine if an Age is a Young Adult or an Adult.

Parameters:age (Union[Age, int]) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_adult_or_elder(sim_info)

Determine if a sim is a Young Adult, an Adult, or an Elder.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_adult_or_elder_age(age)

Determine if an age is Young Adult, Adult, or Elder.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_baby(sim_info)

Determine if a sim is a Baby.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_baby_age(age)

Determine if an Age is a Baby.

Parameters:age (Union[Age, int]) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_baby_child_or_toddler(sim_info)

Warning

Obsolete: Don’t use this function. Use the :func:’~is_baby_toddler_or_child’ function instead.

static is_baby_or_toddler(sim_info)

Determine if a sim is a Baby or a Toddler.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_baby_or_toddler_age(age)

Determine if an age is Baby or Toddler.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_baby_toddler_or_child(sim_info)

Determine if a sim is a Baby, a Toddler, or a Child.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_baby_toddler_or_child_age(age)

Determine if an age is Baby, Toddler, or Child.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_child(sim_info)

Determine if a sim is a Child.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_child_age(age)

Determine if an Age is a Child.

Parameters:age (Union[Age, int]) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_child_or_teen(sim_info)

Determine if a sim is a Child or a Teen.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_child_or_teen_age(age)

Determine if an age is Child or Teen.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_elder(sim_info)

Determine if a sim is an Elder.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_elder_age(age)

Determine if an Age is an Elder.

Parameters:age (Union[Age, int]) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_mature_adult(sim_info)

Determine if a sim is an Adult.

Note

This function does not determine whether they are a Young Adult or not. Use ‘is_adult’ to check for both.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_mature_adult_age(age)

Determine if an Age is an Adult.

Parameters:age (Union[Age, int]) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_mature_adult_or_elder(sim_info)

Determine if a sim is an Adult or an Elder.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_mature_adult_or_elder_age(age)

Determine if an age is Adult or Elder.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_older_than(sim_info, age, or_equal=False)

Determine if a Sim is older than the specified Age.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • age (Union[Age, int]) – The age to check with.
  • or_equal (bool) – If True, the age check will be older than or equal to. If False, the Age check will be older than.
Returns:

True, if the Sim is older than the specified Age or equal to the specified Age if or_equal is True. False, if not.

Return type:

bool

static is_teen(sim_info)

Determine if a sim is a Teen.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_teen_adult_or_elder(sim_info)

Determine if a sim is a Teen, a Young Adult, an Adult, or an Elder.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_teen_adult_or_elder_age(age)

Determine if an age is Teen, Young Adult, Adult, or Elder.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_teen_age(age)

Determine if an Age is a Teen.

Parameters:age (Union[Age, int]) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_teen_or_adult(sim_info)

Determine if a sim is a Teen, a Young Adult, or an Adult.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_teen_or_adult_age(age)

Determine if an age is Teen, Young Adult, or Adult.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_teen_or_young_adult(sim_info)

Determine if a sim is a Teen or a Young Adult.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_teen_or_young_adult_age(age)

Determine if an age is Teen or Young Adult.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_toddler(sim_info)

Determine if a sim is a Toddler.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_toddler_age(age)

Determine if an Age is a Toddler.

Parameters:age (Union[Age, int]) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_toddler_or_child(sim_info)

Determine if a sim is a Toddler or a Child.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_toddler_or_child_age(age)

Determine if an age is Toddler or Child.

Parameters:age (Age) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_young_adult(sim_info)

Determine if a sim is an Young Adult.

Note

This function does not determine whether they are an Adult or not. Use “is_adult” to check for both.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is. False, if the Sim is not.
Return type:bool
static is_young_adult_age(age)

Determine if an Age is a Young Adult.

Parameters:age (Union[Age, int]) – The age to check.
Returns:True, if it is. False, if it is not.
Return type:bool
static is_younger_than(sim_info, age, or_equal=False)

Determine if a Sim is younger than the specified Age.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • age (Union[Age, int]) – The age to check with.
  • or_equal (bool) – If True, the age check will be younger than or equal to. If False, the age check will be younger than.
Returns:

True, if the Sim is younger than the specified Age or equal to the specified age if or_equal is True. False, if not.

Return type:

bool

static set_age(sim_info, age)

Set the Age of a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to set the Age of.
  • age (Union[Age, int]) – The Age to set the Sim to.
Returns:

True, if the Age was set successfully. False, if not.

Return type:

bool

Species

class CommonSpeciesUtils

Bases: object

Utilities for manipulating and checking the Species of Sims.

static are_same_species(sim_info, other_sim_info)

Determine if two sims are of the same species.

Note

Extended Species are also compared (Large Dog, Small Dog, etc.)

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • other_sim_info (SimInfo) – The Sim to compare to.
Returns:

True, if both Sims are the same species. False, if not.

Return type:

bool

static get_species(sim_info)

Retrieve the Species of a sim.

Parameters:sim_info (SimInfo) – The Sim to get the Species of.
Returns:The Species of the Sim or None if the Sim does not have a Species.
Return type:Union[Species, None]
static is_cat(sim_info)

Determine if a sim is a Cat.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Cat. False, if not.
Return type:bool
static is_cat_species(species)

Determine if a Species is a Cat.

Parameters:species (Union[Species, int]) – The Species to check.
Returns:True, if the Species is a Cat Species. False, if not.
Return type:bool
static is_dog(sim_info)

Determine if a sim is a Dog.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Dog (Large Dog, Small Dog). False, if not.
Return type:bool
static is_dog_species(species)

Determine if a Species is a Dog.

Parameters:species (Union[Species, int]) – The Species to check.
Returns:True, if the Species is a Dog Species (Large Dog, Small Dog). False, if not.
Return type:bool
static is_human(sim_info)

Determine if a sim is a Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Human. False, if not.
Return type:bool
static is_human_species(species)

Determine if a Species is a Human.

Parameters:species (Union[Species, int]) – The Species to check.
Returns:True, if the Species is Human. False, if not.
Return type:bool
static is_large_dog(sim_info)

Determine if a sim is a Large Dog.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Large Dog. False, if not.
Return type:bool
static is_pet(sim_info)

Determine if a sim is a Pet.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Pet (Large Dog, Small Dog, Cat). False, if not.
Return type:bool
static is_pet_species(species)

Determine if a Species is a Pet.

Parameters:species (Union[Species, int]) – The Species to check.
Returns:True, if the Species is a Pet Species (Large Dog, Small Dog, Cat). False, if not.
Return type:bool
static is_small_dog(sim_info)

Determine if a sim is a Small Dog.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Small Dog. False, if not.
Return type:bool
static set_species(sim_info, species)

Set the Species of a sim.

Parameters:
  • sim_info (SimInfo) – The Sim to set the Species of.
  • species (Union[Species, int]) – The Species to set the Sim to.
Returns:

True, if successful. False, if not.

Return type:

bool

Age and Species

class CommonAgeSpeciesUtils

Bases: object

Utilities for checking the Age and Species of Sims.

static are_same_age_and_species(sim_info, other_sim_info)

Determine if two Sims are the same Age and the same Species.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • other_sim_info (SimInfo) – The other Sim to compare to.
Returns:

True, if both Sims are the same Age and Species. False, if they are not.

Return type:

bool

static is_adult_human(sim_info)

Determine if a sim is a Young Adult or Adult Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Young Adult or Adult Human. False, if the Sim is not.
Return type:bool
static is_adult_human_or_pet(sim_info)

Determine if a sim is a Young Adult, Adult, or Elder Human or an Adult Pet (Cat, Small Dog, Large Dog).

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Young Adult, Adult, or Elder Human or an Adult Pet (Cat, Small Dog, Large Dog). False, if the Sim is not.
Return type:bool
static is_adult_pet(sim_info)

Determine if a sim is an Adult Pet (Cat, Small Dog, Large Dog).

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is an Adult Pet (Cat, Small Dog, Large Dog). False, if the Sim is not.
Return type:bool
static is_baby_human(sim_info)

Determine if a sim is a Baby Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Baby Human. False, if the Sim is not.
Return type:bool
static is_baby_or_toddler_human(sim_info)

Determine if a sim is a Baby or Toddler Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Baby or Toddler Human. False, if the Sim is not.
Return type:bool
static is_baby_toddler_or_child_human(sim_info)

Determine if a sim is a Baby, Toddler, or Child Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Baby, Toddler, or Child Human. False, if the Sim is not.
Return type:bool
static is_child_human(sim_info)

Determine if a sim is a Child Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Child Human. False, if the Sim is not.
Return type:bool
static is_child_or_teen_human(sim_info)

Determine if a sim is a Child or Teen Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Child or Teen Human. False, if the Sim is not.
Return type:bool
static is_child_pet(sim_info)

Determine if a sim is a Child Pet (Cat, Small Dog, Large Dog).

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Child Pet (Cat, Small Dog, Large Dog). False, if the Sim is not.
Return type:bool
static is_elder_human(sim_info)

Determine if a sim is an Elder Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is an Elder Human. False, if the Sim is not.
Return type:bool
static is_elder_human_or_pet(sim_info)

Determine if a sim is an Elder Human or Pet (Cat, Small Dog, Large Dog).

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is an Elder Human or Pet (Cat, Small Dog, Large Dog). False, if the Sim is not.
Return type:bool
static is_elder_pet(sim_info)

Determine if a sim is an Elder Pet (Cat, Small Dog, Large Dog).

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is an Elder Pet (Cat, Small Dog, Large Dog). False, if the Sim is not.
Return type:bool
static is_mature_adult_human(sim_info)

Determine if a sim is an Adult Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is an Adult Human. False, if the Sim is not.
Return type:bool
static is_mature_adult_or_elder_human(sim_info)

Determine if a sim is a Adult or Elder Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Adult or Elder Human. False, if the Sim is not.
Return type:bool
static is_old_human_or_pet(sim_info)

Determine if a sim is a Teen, Young Adult, Adult, or Elder Human or an Adult or Elder Pet (Cat, Small Dog, Large Dog).

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Teen, Young Adult, Adult, or Elder Human or an Adult or Elder Pet (Cat, Small Dog, Large Dog). False, if the Sim is not.
Return type:bool
static is_old_pet(sim_info)

Determine if a sim is an Adult or Elder Pet (Cat, Small Dog, Large Dog).

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is an Adult or Elder Pet (Cat, Small Dog, Large Dog). False, if the Sim is not.
Return type:bool
static is_teen_adult_or_elder_human(sim_info)

Determine if a sim is a Teen, Young Adult, Adult, or Elder Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Teen, Young Adult, Adult, or Elder Human. False, if the Sim is not.
Return type:bool
static is_teen_human(sim_info)

Determine if a sim is a Teen Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Teen Human. False, if the Sim is not.
Return type:bool
static is_teen_or_adult_human(sim_info)

Determine if a sim is a Teen, Young Adult, or Adult Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Teen, Young Adult, or Adult Human. False, if the Sim is not.
Return type:bool
static is_teen_or_young_adult_human(sim_info)

Determine if a sim is a Teen or Young Adult Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Teen or Young Adult Human. False, if the Sim is not.
Return type:bool
static is_toddler_human(sim_info)

Determine if a sim is a Toddler Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Toddler Human. False, if the Sim is not.
Return type:bool
static is_toddler_or_child_human(sim_info)

Determine if a sim is a Toddler or Child Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Toddler or Child Human. False, if the Sim is not.
Return type:bool
static is_young_adult_human(sim_info)

Determine if a sim is a Young Adult Human.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Young Adult Human. False, if the Sim is not.
Return type:bool
static is_young_human_or_pet(sim_info)

Determine if a sim is a Baby, Toddler, or Child Human or a Child Pet (Cat, Small Dog, Large Dog).

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Baby, Toddler, or Child Human or a Child Pet (Cat, Small Dog, Large Dog). False, if the Sim is not.
Return type:bool

Gender

class CommonGenderUtils

Bases: object

Utilities for manipulating Genders of Sims.

static are_same_gender(sim_info, other_sim_info)

Determine if two Sims are the same Gender.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • other_sim_info (SimInfo) – The Sim to compare to.
Returns:

True, if both Sims are the same Gender. False, if not.

Return type:

bool

static get_gender(sim_info)

Retrieve the Gender of a Sim.

Parameters:sim_info (SimInfo) – The Sim to retrieve the gender of.
Returns:The Gender of the Sim or None if a problem occurs.
Return type:Union[Gender, None]
static is_female(sim_info)

Determine if a Sim is Female.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is female. False, if the Sim is not female.
Return type:bool
static is_female_gender(gender)

Determine if a Gender is Female.

Parameters:gender (Gender) – The gender to check.
Returns:True, if the gender is female. False, if the gender is not female.
Return type:bool
static is_male(sim_info)

Determine if a Sim is Male.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is male. False, if the Sim is not male.
Return type:bool
static is_male_gender(gender)

Determine if a Gender is Male.

Parameters:gender (Gender) – The gender to check.
Returns:True, if the gender is male. False, if the gender is not male.
Return type:bool
static set_gender(sim_info, gender)

Set the Gender of a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to set the Gender of.
  • gender (Union[int, Gender]) – The Gender to set the Sim to.
Returns:

True, if the Gender of the Sim was set successfully. False, if not.

Return type:

bool

static swap_gender(sim_info, update_gender_options=True)

Swap the Gender of a Sim to it’s opposite. i.e. Change a Sim from Male to Female or from Female to Male.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • update_gender_options (bool, optional) – If True, gender option traits such as Toilet Usage, Clothing Preference, Pregnancy, and Body Frame will be updated to reflect the vanilla settings for each gender For example, if a Human Sim is swapping from Female to Male, their gender options will be updated to Toilet Standing, Cannot Be Impregnated, Can Impregnate, Mens Wear clothing preference, and Masculine Frame. If False, gender option traits will not be updated. Default is True.
Returns:

True, if the Gender of the Sim was swapped successfully. False, if not.

Return type:

bool

Occults

class CommonOccultUtils

Bases: object

Utilities for manipulating the Occults of Sims.

static get_sim_info_for_all_occults_gen(sim_info, exclude_occult_types)

Retrieve a generator of SimInfo objects for all Occults of a sim.

Note

Results include the occult type of the sim_info specified. If they are Human by default, the Human occult Sim info will be included.

Parameters:
  • sim_info (SimInfo) – The Sim to locate the Occults of.
  • exclude_occult_types (Iterator[OccultType]) – A collection of OccultTypes to exclude from the resulting SimInfo list.
Returns:

An iterable of Sims for all occult types of the Sim.

Return type:

Iterator[SimInfo]

static get_sim_info_of_all_occults_gen(sim_info, *exclude_occult_types)

Retrieve a generator of SimInfo objects for all Occults of a sim.

Warning

Obsolete, please use get_sim_info_for_all_occults_gen() instead.

Parameters:
  • sim_info (SimInfo) – The Sim to locate the Occults of.
  • exclude_occult_types (OccultType) – A collection of OccultTypes to exclude from the resulting SimInfo list.
Returns:

An iterable of Sims for all occult types of the Sim.

Return type:

Iterator[SimInfo]

static is_alien(sim_info)

Determine if a Sim is an Alien.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is an Alien. False, if not.
Return type:bool
static is_currently_a_mermaid(sim_info)

Determine if a Sim is currently in their Mermaid form. (Not disguised)

Note

This only checks their current occult status, it does not check for a visible Tail. Use is_in_mermaid_form() to check for a visible Tail.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is currently in their Mermaid form. False, if not.
Return type:bool
static is_currently_a_vampire(sim_info)

Determine if a Sim is currently in their Vampire form. (Not disguised)

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is currently in their Vampire form. False, if not.
Return type:bool
static is_currently_a_witch(sim_info)

Determine if a Sim is currently in their Witch form. (Not disguised)

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is currently in their Witch form. False, if not.
Return type:bool
static is_currently_an_alien(sim_info)

Determine if a Sim is currently in their Alien form. (Not disguised)

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is currently in their Alien form. False, if not.
Return type:bool
static is_currently_human(sim_info)

Determine if a Sim is currently in their Human form (regardless of their Occult type).

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is currently a Human. False, if not.
Return type:bool
static is_ghost(sim_info)

Determine if a Sim is a Ghost.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is a Ghost. False, if not.
Return type:bool
static is_in_mermaid_form(sim_info)

Determine if a Sim is in Mermaid Form (The Sim has a visible Tail).

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim has their Mermaid tail out. False, if not.
Return type:bool
static is_mermaid(sim_info)

Determine if a Sim is a Mermaid

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is a Mermaid. False, if not.
Return type:bool
static is_mermaid_in_mermaid_form(sim_info)

Determine if a Sim is a Mermaid and is in Mermaid Form (Their Tail is visible).

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is a Mermaid with their tail out. False, if not.
Return type:bool
static is_plant_sim(sim_info)

Determine if a Sim is a Plant Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is a Plant Sim. False, if not.
Return type:bool
static is_robot(sim_info)

Determine if a Sim is a Robot.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is a Robot. False, if not.
Return type:bool
static is_skeleton(sim_info)

Determine if a Sim is a Skeleton.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is the a Skeleton. False, if not.
Return type:bool
static is_vampire(sim_info)

Determine if a Sim is a Vampire.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is a Vampire. False, if not.
Return type:bool
static is_witch(sim_info)

Determine if a Sim is a Witch

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is a Witch. False, if not.
Return type:bool

Body

class CommonSimBodyUtils

Bases: object

Utilities for manipulating the body of Sims.

static get_wading_size(sim_info)

Retrieve the size of a Sim if they were to wade in a pool of water.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:A tuple indicating the x and y wading size of a Sim from their origin point.
Return type:Tuple[int, int]

Outfits

CAS

class CommonCASUtils

Bases: object

Utilities for manipulating the CAS parts of Sims.

static attach_cas_part_to_sim(sim_info, cas_part_id, body_type=BodyType.NONE, outfit_category_and_index=None)

Add a CAS part at the specified BodyType to the Sims outfit.

Parameters:
  • sim_info (SimInfo) – The SimInfo of a Sim to add the CAS part to.
  • cas_part_id (int) – The decimal identifier of a CAS part to attach to the Sim.
  • body_type (Union[BodyType, int], optional) – The BodyType the CAS part will be attached to. If no value is provided or it is None, the BodyType of the CAS part itself will be used.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The outfit category and index of the Sims outfit to modify. If no value is provided, the Sims current outfit will be used.
Returns:

True if the CAS part was successfully attached to the Sim. False if the CAS part was not successfully attached to the Sim.

Return type:

bool

static detach_cas_part_from_sim(sim_info, cas_part_id, body_type=BodyType.NONE, outfit_category_and_index=None)

Remove a CAS part at the specified BodyType from the Sims outfit.

Parameters:
  • sim_info (SimInfo) – The SimInfo of a Sim to remove the CAS part from.
  • cas_part_id (int) – The decimal identifier of a CAS part to detach from the Sim.
  • body_type (Union[BodyType, int, None], optional) – The BodyType the CAS part will be detached from. If no value is provided, the BodyType of the CAS part itself will be used. If set to None, the CAS part will be removed from all BodyTypes.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The outfit category and index of the Sims outfit to modify. If no value is provided, the Sims current outfit will be used.
Returns:

True if the CAS part was successfully detached from the Sim. False if the CAS part was not successfully detached from the Sim.

Return type:

bool

static get_body_type_cas_part_is_attached_to(sim_info, cas_part_id, outfit_category_and_index=None)

Retrieve the BodyType that a CAS part is attached to within a Sims outfit.

Parameters:
  • sim_info (SimInfo) – The SimInfo of the Sim to check.
  • cas_part_id (int) – A decimal identifier of the CAS part to locate.
  • outfit_category_and_index (Tuple[OutfitCategory, int], optional) – The outfit category and index of the Sims outfit to check. If None, the current outfit of the Sim will be used.
Returns:

The BodyType the specified CAS part id is attached to or BodyType.NONE if the CAS part is not found or the Sim does not have body parts for their outfit.

Return type:

Union[BodyType, int]

static get_body_type_of_cas_part(cas_part_id)

Retrieve the BodyType of a CAS part.

Note

Some Body Types don’t appear in the BodyType enum.

Parameters:cas_part_id (int) – The decimal identifier of a CAS part.
Returns:The default BodyType of the CAS part or an int if the Body Type is not within the BodyType enum.
Return type:Union[BodyType, int]
static get_cas_part_id_at_body_type(sim_info, body_type, outfit_category_and_index=None)

Retrieve the CAS part identifier attached to the specified BodyType within a Sims outfit.

Parameters:
  • sim_info (SimInfo) – The SimInfo of the Sim to check.
  • body_type (Union[BodyType, int]) – The BodyType to check.
  • outfit_category_and_index (Tuple[OutfitCategory, int], optional) – The outfit category and index of the Sims outfit to check. Default is the Sims current outfit.
Returns:

The CAS part identifier attached to the specified BodyType or -1 if the BodyType is not found.

Return type:

int

static has_any_cas_part_attached_to_body_type(sim_info, body_type, outfit_category_and_index=None)

Determine if a Sim has a CAS Part attached to a BodyType.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • body_type (Union[BodyType, int]) – A BodyType to check.
  • outfit_category_and_index (Tuple[OutfitCategory, int], optional) – An outfit category and index of the outfit. Default is None, which is whatever outfit a Sim is currently wearing.
Returns:

True, if the Sim has any CAS Part attached to the specified BodyType for the specified outfit. False, it not.

Return type:

bool

static has_cas_part_attached(sim_info, cas_part_id, body_type=BodyType.NONE, outfit_category_and_index=None)

Determine if a Sim has the specified CAS part attached to their outfit.

Parameters:
  • sim_info (SimInfo) – The SimInfo of the Sim to check.
  • cas_part_id (int) – A decimal identifier of the CAS part to locate.
  • body_type (Union[BodyType, int, None], optional) – The BodyType the CAS part will be located at. If no value is provided, it defaults to the BodyType of the CAS part itself. If set to None, the CAS part will be located within any BodyType.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The outfit category and index of the Sims outfit to check. Default is the Sims current outfit.
Returns:

True, if the Sims outfit contain the specified CAS part. False, if the Sims outfit does not contain the specified CAS part.

Return type:

bool

static is_cas_part_loaded(cas_part_id)

Determine if a CAS part is loaded within the game.

Note

If the CAS part is part of a package that is not installed, it will be considered as not loaded.

Note

A CAS part is considered as “loaded” when the BodyType it has can be found within the sims.outfits.outfit_enums.BodyType enum.

Parameters:cas_part_id (int) – The Decimal identifier of a CAS part.
Returns:True if the CAS part is loaded within the game, False if not.
Return type:bool

Outfit

class CommonOutfitUtils

Bases: object

Utilities for handling Sim outfits.

static generate_outfit(sim_info, outfit_category_and_index)

Generate an outfit for a Sim for the specified OutfitCategory and Index.

Note

If an outfit exists in the specified OutfitCategory and Index, already, it will be overridden.

Parameters:
  • sim_info (SimInfo) – The Sim to generate an outfit for.
  • outfit_category_and_index (Tuple[OutfitCategory, int]) – The OutfitCategory and Index of the outfit to generate.
Returns:

True, if an outfit was generated successfully. False, if not.

Return type:

bool

static get_all_outfit_categories()

Retrieve a collection of all OutfitCategory types.

Returns:A collection of all OutfitCategories.
Return type:Tuple[OutfitCategory]
static get_all_outfit_tags(sim_info, outfit_category_and_index=None)

Retrieve a collection of game tags that apply to the outfit of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to retrieve data from. Default is the current outfit.
Returns:

A collection of Game Tags that apply to the outfit of a Sim.

Return type:

Tuple[CommonGameTag]

static get_appearance_modifiers_gen(sim_info, appearance_modifier_type, include_appearance_modifier_callback=None)

Retrieve the appearance modifiers of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • appearance_modifier_type (AppearanceModifierType) – The type of appearance modifiers to retrieve.
  • include_appearance_modifier_callback (Callable[[ModifierInfo], bool], optional) – If an appearance modifier matches this callback, then it will be returned. Default is None.
Returns:

A collection of appearance modifiers.

Return type:

Iterator[AppearanceModifier]

static get_current_outfit(sim_info)

Retrieve the current OutfitCategory and Index of the current sim.

Note

If a Sim has two Athletic outfits and they are wearing the second outfit, the index would be 1.

Parameters:sim_info (SimInfo) – The Sim to get the current outfit of.
Returns:The OutfitCategory and index of the current outfit a Sim is wearing.
Return type:Tuple[OutfitCategory, int]
static get_current_outfit_category(sim_info)

Retrieve the current OutfitCategory and Index of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the outfit category of.
Returns:The OutfitCategory of the current outfit a Sim is wearing.
Return type:OutfitCategory
static get_current_outfit_index(sim_info)

Retrieve the current OutfitCategory and Index of a Sim.

Note

If a Sim has two Athletic outfits and they are wearing the second outfit, the index would be 1.

Parameters:sim_info (SimInfo) – The Sim to get the outfit index of.
Returns:The index of their current outfit relative to the outfits a Sim has in the current OutfitCategory.
Return type:int
static get_outfit_category_by_name(name)

Retrieve an OutfitCategory by its a name.

Parameters:name (str) – The name of an outfit category.
Returns:The OutfitCategory with the specified name or OutfitCategory.CURRENT_OUTFIT if no outfit category was found using the specified name.
Return type:OutfitCategory
static get_outfit_data(sim_info, outfit_category_and_index=None)

Retrieve OutfitData for the specified OutfitCategory and Index of a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to retrieve outfit data of.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to retrieve data from. Default is the current outfit.
Returns:

Outfit Data for the specified outfit.

Return type:

OutfitData

static get_outfit_parts(sim_info, outfit_category_and_index=None)

Retrieve Outfit Parts for the specified OutfitCategory and Index of a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to retrieve outfit parts of.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to retrieve data from. Default is the current outfit.
Returns:

A dictionary of body types and cas parts in those body types for the outfit of a Sim.

Return type:

Dict[BodyType, int]

static get_outfit_tags_by_cas_part_id(sim_info, outfit_category_and_index=None)

Retrieve the game tags of the outfit of a Sim grouped by CAS Part Id.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to retrieve data from. Default is the current outfit.
Returns:

A library of Game Tags grouped by CAS Part Id.

Return type:

Dict[int, Tuple[CommonGameTag]]

static get_previous_outfit(sim_info, default_outfit_category_and_index=(OutfitCategory.EVERYDAY, 0))

Retrieve the previous outfit a Sim was wearing before their current outfit.

Parameters:
  • sim_info (SimInfo) – The Sim to get the previous outfit of.
  • default_outfit_category_and_index (Tuple[OutfitCategory, int], optional) – A default OutfitCategory and index if no previous outfit was found.
Returns:

The OutfitCategory and Index of the outfit a Sim was wearing before their current outfit or the default if none was found.

Return type:

Tuple[OutfitCategory, int]

static has_all_tags_on_outfit(sim_info, tags, outfit_category_and_index=None)

Determine if the Outfit of a Sim has all of the specified tags.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • tags (Iterator[Union[int, CommonGameTag]]) – A collection of tags to locate.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to retrieve data from. Default is the current outfit.
Returns:

True, if the Outfit of the Sim has all of the specified tags. False, if not.

Return type:

bool

static has_any_cas_parts_attached(sim_info, cas_part_ids, outfit_category_and_index=None)

Determine if any of the specified CAS Parts are attached to the Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • cas_part_ids (Tuple[int]) – A collection of CAS Part identifiers.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to check. Default is the current outfit.
Returns:

True, if the Sim has any of the specified CAS Parts attached to the specified outfit. False, if not.

Return type:

bool

static has_any_tags_on_outfit(sim_info, tags, outfit_category_and_index=None)

Determine if the Outfit of a Sim has any of the specified tags.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • tags (Iterator[Union[int, CommonGameTag]]) – A collection of tags to locate.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to retrieve data from. Default is the current outfit.
Returns:

True, if the Outfit of the Sim has any of the specified tags. False, if not.

Return type:

bool

static has_cas_part_attached(sim_info: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe47f051150>, cas_part_id: int, outfit_category_and_index: Tuple[<sphinx.ext.autodoc.importer._MockObject object at 0x7fe47f1c4490>, int] = None) → bool

has_any_cas_parts_attached(sim_info, cas_part_id, outfit_category_and_index=None)

Determine if any of the specified CAS Parts are attached to the Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • cas_part_id (int) – A CAS Part identifier.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to check. Default is the current outfit.
Returns:

True, if the Sim has the specified CAS Parts attached to the specified outfit. False, if not.

Return type:

bool

static has_outfit(sim_info, outfit_category_and_index)

Determine if a Sim has an existing outfit in the specified OutfitCategory and Index.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • outfit_category_and_index (Tuple[OutfitCategory, int], optional) – The OutfitCategory and index to locate.
Returns:

True, if the Sim has the specified OutfitCategory and Index. False, if not.

Return type:

bool

static has_tag_on_outfit(sim_info, tag, outfit_category_and_index=None)

Determine if the Outfit of a Sim has the specified tag.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • tag (Union[int, CommonGameTag]) – A tag to locate.
  • outfit_category_and_index (Union[Tuple[OutfitCategory, int], None], optional) – The OutfitCategory and Index of the outfit to retrieve data from. Default is the current outfit.
Returns:

True, if the Outfit of the Sim has the specified tag. False, if not.

Return type:

bool

static is_athletic_category(outfit_category)

Determine if an OutfitCategory is ATHLETIC

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.ATHLETIC. False, if it is not.
Return type:bool
static is_bathing_category(outfit_category)

Determine if an OutfitCategory is BATHING

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.BATHING. False, if it is not.
Return type:bool
static is_batuu_category(outfit_category)

Determine if an OutfitCategory is BATUU

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.BATUU. False, if it is not.
Return type:bool
static is_career_category(outfit_category)

Determine if an OutfitCategory is CAREER

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.CAREER. False, if it is not.
Return type:bool
static is_cold_weather_category(outfit_category)

Determine if an OutfitCategory is COLDWEATHER

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.COLDWEATHER. False, if it is not.
Return type:bool
static is_every_day_category(outfit_category)

Determine if an OutfitCategory is EVERYDAY

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.EVERYDAY. False, if it is not.
Return type:bool
static is_formal_category(outfit_category)

Determine if an OutfitCategory is FORMAL

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.FORMAL. False, if it is not.
Return type:bool
static is_hot_weather_category(outfit_category)

Determine if an OutfitCategory is HOTWEATHER

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.HOTWEATHER. False, if it is not.
Return type:bool
static is_party_category(outfit_category)

Determine if an OutfitCategory is PARTY

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.PARTY. False, if it is not.
Return type:bool
static is_situation_category(outfit_category)

Determine if an OutfitCategory is SITUATION

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.SITUATION. False, if it is not.
Return type:bool
static is_sleep_category(outfit_category)

Determine if an OutfitCategory is SLEEP

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.SLEEP. False, if it is not.
Return type:bool
static is_special_category(outfit_category)

Determine if an OutfitCategory is SPECIAL

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.SPECIAL. False, if it is not.
Return type:bool
static is_swimwear_category(outfit_category)

Determine if an OutfitCategory is SWIMWEAR

Parameters:outfit_category (OutfitCategory) – The OutfitCategory to check.
Returns:True, if the OutfitCategory is OutfitCategory.SWIMWEAR. False, if it is not.
Return type:bool
static is_wearing_athletic_outfit(sim_info)

Determine if a Sim is wearing an Athletic outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing an athletic outfit. False, if not.
Return type:bool
static is_wearing_bathing_outfit(sim_info)

Determine if a Sim is wearing a Bathing outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing their bathing/nude outfit. False, if not.
Return type:bool
static is_wearing_batuu_outfit(sim_info)

Determine if a Sim is wearing a Batuu outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a batuu outfit. False, if not.
Return type:bool
static is_wearing_career_outfit(sim_info)

Determine if a Sim is wearing a Career outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a career outfit. False, if not.
Return type:bool
static is_wearing_cold_weather_outfit(sim_info)

Determine if a Sim is wearing a Cold Weather outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a cold weather outfit. False, if not.
Return type:bool
static is_wearing_everyday_outfit(sim_info)

Determine if a Sim is wearing an Everyday outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing an everyday outfit. False, if not.
Return type:bool
static is_wearing_formal_outfit(sim_info)

Determine if a Sim is wearing a Formal outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a formal outfit. False, if not.
Return type:bool
static is_wearing_hot_weather_outfit(sim_info)

Determine if a Sim is wearing a Hot Weather outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a hot weather outfit. False, if not.
Return type:bool
static is_wearing_party_outfit(sim_info)

Determine if a Sim is wearing a Party outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a party outfit. False, if not.
Return type:bool
static is_wearing_situation_outfit(sim_info)

Determine if a Sim is wearing a Situation outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a situation outfit. False, if not.
Return type:bool
static is_wearing_sleep_outfit(sim_info)

Determine if a Sim is wearing a Sleep outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a sleep outfit. False, if not.
Return type:bool
static is_wearing_special_outfit(sim_info)

Determine if a Sim is wearing a Special outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a special outfit. False, if not.
Return type:bool
static is_wearing_swimwear_outfit(sim_info)

Determine if a Sim is wearing a Swimwear outfit.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a swimwear outfit. False, if not.
Return type:bool
static is_wearing_towel(sim_info)

Determine if a Sim is currently wearing a towel.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the sim is wearing a towel. False, if not.
Return type:bool
static remove_previous_outfit(sim_info)

Remove the outfit a Sim was wearing before their current outfit, from the cache.

Parameters:sim_info (SimInfo) – The Sim to remove the outfit from.
static resend_outfits(sim_info)

Resend outfit data to a Sim to refresh their outfits.

Parameters:sim_info (SimInfo) – The Sim to resend the outfit for.
Returns:True, if outfits were resent successfully. False, if not.
Return type:bool
static set_current_outfit(sim_info, outfit_category_and_index)

Set the current outfit of a Sim to the specified OutfitCategory and Index.

Parameters:
  • sim_info (SimInfo) – The Sim to change the outfit of.
  • outfit_category_and_index (Tuple[OutfitCategory, int]) – The OutfitCategory and index to change to.
static set_outfit_clean(sim_info, outfit_category)

Flag the specified OutfitCategory of a Sim as clean.

Parameters:
  • sim_info (SimInfo) – The Sim to flag the OutfitCategory for.
  • outfit_category (OutfitCategory) – The OutfitCategory being flagged.
static set_outfit_dirty(sim_info, outfit_category)

Flag the specified OutfitCategory of a Sim as dirty. This will tell the game that it needs to be updated.

Parameters:
  • sim_info (SimInfo) – The Sim to flag the OutfitCategory for.
  • outfit_category (OutfitCategory) – The OutfitCategory being flagged.
static update_outfits(sim_info)

Update all outfits of a Sim.

Parameters:sim_info (SimInfo) – The Sim to update outfits for.
Returns:True, if the outfits were updated successfully. False, if not.
Return type:bool

Stats

Buffs

class CommonBuffUtils

Bases: object

Utilities for manipulating Buffs on Sims.

static add_buff(sim_info, *buff_ids, buff_reason=None)

Add the specified buffs to a sim.

Parameters:
  • sim_info (SimInfo) – The sim to add the specified buffs to.
  • buff_ids (int) – The decimal identifiers of buffs to add.
  • buff_reason (Union[int, str, LocalizedString, CommonStringId], optional) – The text that will display when the player hovers over the buffs. What caused the buffs to be added.
Returns:

True, if all of the specified buffs were successfully added. False, if not.

Return type:

bool

static get_buff_id(buff_identifier)

Retrieve the decimal identifier of a Buff.

Parameters:buff_identifier (Union[int, Buff]) – The identifier or instance of a Buff.
Returns:The decimal identifier of the Buff or None if the Buff does not have an id.
Return type:Union[int, None]
static get_buff_name(buff)

Retrieve the Name of a Buff.

Parameters:buff (Buff) – An instance of a Buff.
Returns:The name of a Buff or None if a problem occurs.
Return type:Union[str, None]
static get_buff_names(buffs)

Retrieve the Names of a collection of Buffs.

Parameters:buffs (Iterator[Buff]) – A collection of Buff instances.
Returns:A collection of names for all specified Buffs.
Return type:Tuple[str]
static get_buffs(sim_info)

Retrieve all buffs currently active on a Sim.

Parameters:sim_info (SimInfo) – The Sim to retrieve the buffs of.
Returns:A collection of currently active buffs on the Sim.
Return type:Tuple[Buff]
static has_buff(sim_info, *buff_ids)

Determine if any of the specified buffs are currently active on a sim.

Parameters:
  • sim_info (SimInfo) – The sim being checked.
  • buff_ids (int) – The decimal identifiers of Buffs.
Returns:

True if the sim has any of the specified buffs.

Return type:

int

static has_fertility_boosting_buff(sim_info)

Determine if any fertility boosting buffs are currently active on a sim.

Note

Fertility Boosting Buffs:

  • Fertility Potion
  • Fertility Potion Masterwork
  • Fertility Potion Normal
  • Fertility Potion Outstanding
  • Massage Table Fertility Boost
  • Massage Table Fertility Boost Incense
Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if they have any fertility boosting buffs. False, if not.
Return type:bool
static has_morning_person_buff(sim_info)

Determine if any Morning Person Trait buffs are currently active on a Sim.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if they have any morning person buffs. False, if not.
Return type:bool
static has_night_owl_buff(sim_info)

Determine if any Night Owl Trait buffs are currently active on a sim.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if they have any night owl buffs. False, if not.
Return type:bool
static load_buff_by_id(buff_id)

Load an instance of a Buff by its decimal identifier.

Parameters:buff_id (Union[int, CommonBuffId]) – The decimal identifier of a Buff.
Returns:An instance of a Buff matching the decimal identifier or None if not found.
Return type:Union[Buff, None]
static remove_buff(sim_info, *buff_ids)

Remove the specified buffs from a sim.

Parameters:
  • sim_info (SimInfo) – The sim to remove the specified buffs from.
  • buff_ids (int) – The decimal identifiers of Buffs to remove.
Returns:

True, if all of the specified buffs were successfully removed. False, if not.

Return type:

bool

Mood

class CommonMoodUtils

Bases: object

Utilities for manipulating Sim moods.

static get_current_mood(sim_info)

Retrieve the current mood for the specified Sim.

Parameters:sim_info (SimInfo) – The Sim to retrieve the mood of.
Returns:The current Mood of the Sim.
Return type:Mood
static get_current_mood_id(sim_info)

Retrieve an identifier of the current mood for the specified Sim.

Parameters:sim_info (SimInfo) – The Sim to retrieve the mood identifier of.
Returns:The identifier of the current Mood of the Sim.
Return type:int
static has_mood(sim_info, mood_id)

Determine if a Sim has the specified mood.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • mood_id (CommonMoodId) – The identifier of the Mood to check for.
Returns:

True, if the Sim has the specified Mood. False, if the Sim does not.

Return type:

bool

static is_angry(sim_info)

Determine if a Sim is angry.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_bored(sim_info)

Determine if a Sim is bored.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_confident(sim_info)

Determine if a Sim is confident.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_dazed(sim_info)

Determine if a Sim is dazed.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_embarrassed(sim_info)

Determine if a Sim is embarrassed.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_energized(sim_info)

Determine if a Sim is energized.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_fine(sim_info)

Determine if a Sim is fine.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_flirty(sim_info)

Determine if a Sim is flirty.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_focused(sim_info)

Determine if a Sim is focused.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_happy(sim_info)

Determine if a Sim is happy.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_inspired(sim_info)

Determine if a Sim is inspired.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_playful(sim_info)

Determine if a Sim is playful.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_possessed(sim_info)

Determine if a Sim is possessed.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_sad(sim_info)

Determine if a Sim is sad.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_sleeping(sim_info)

Determine if a Sim is sleeping.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_stressed(sim_info)

Determine if a Sim is stressed.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool
static is_uncomfortable(sim_info)

Determine if a Sim is uncomfortable.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is the Mood. False, if the Sim is not.
Return type:bool

Motives

class CommonSimMotiveUtils

Bases: object

Utilities for Sim motives.

Note

Motives are just another name for Sim Needs (Bladder, Hunger, Energy, etc.)

static decrease_motive_level(sim_info, motive_id, amount)

Decrease the current level of a Motive of a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • motive_id (CommonMotiveId) – The identifier of the Motive to change.
  • amount (float) – The amount to decrease the motive by.
Returns:

True, if the specified Motive was changed successfully. False, if not.

Return type:

bool

static get_bladder_level(sim_info)

Retrieve the bladder level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim.
Return type:float
static get_bowels_level(sim_info)

Retrieve the bowel level of a Sim.

Note

Human Sims do not have Bowels. (As hard as that is to believe)

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim.
Return type:float
static get_energy_level(sim_info)

Retrieve the energy level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim.
Return type:float
static get_fun_level(sim_info)

Retrieve the fun level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim.
Return type:float
static get_hunger_level(sim_info)

Retrieve the hunger level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim.
Return type:float
static get_hygiene_level(sim_info)

Retrieve the hygiene level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim.
Return type:float
static get_plant_sim_water_level(sim_info)

Retrieve the plant sim water level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim or -1.0 if the Sim is not a Plant Sim.
Return type:float
static get_social_level(sim_info)

Retrieve the social level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim.
Return type:float
static get_vampire_power_level(sim_info)

Retrieve the vampire power level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim or -1.0 if the Sim is not a Vampire.
Return type:float
static get_vampire_thirst_level(sim_info)

Retrieve the vampire thirst level of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the level of.
Returns:The current level of the Motive of the Sim or -1.0 if the Sim is not a Vampire.
Return type:float
static has_bowels(sim_info)

Determine if a Sim has bowels.

Note

Human Sims do not have Bowels.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim has bowels. False, if not.
Return type:bool
static has_motive(sim_info, motive_id)

Determine if a Sim has the specified Motive.

Note

For example, you could use this to determine if a Sim has a vampire power level.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • motive_id (int) – The identifier of the Motive to look for.
Returns:

True, if the Sim has the specified Motive. False, if not.

Return type:

bool

static increase_motive_level(sim_info, motive_id, amount)

Increase the current level of a Motive of a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • motive_id (CommonMotiveId) – The identifier of the Motive to change.
  • amount (float) – The amount to increase the motive by.
Returns:

True, if the specified Motive was changed successfully. False, if not.

Return type:

bool

static set_motive_level(sim_info, motive_id, amount)

Set the current level of a Motive of a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • motive_id (CommonMotiveId) – The identifier of the Motive to change.
  • amount (float) – The amount to set the motive level to.
Returns:

True, if the specified Motive was changed successfully. False, if not.

Return type:

bool

Skills

class CommonSimSkillUtils

Bases: object

Utilities for manipulating the Skills of Sims.

static change_progress_toward_max_skill_level(sim_info, skill_id, value, add=True)

Modify the amount of progress a Sim has made toward the max level of a Skill.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to modify.
  • value (Union[int, CommonSkillId]) – The level to add or subtract to/from the skill.
  • add (bool, optional) – If True, the skill will be added to the Sim before it is modified.
Returns:

True, if successful. False, if not.

Return type:

bool

static change_progress_toward_next_skill_level(sim_info, skill_id, value, add=True)

Modify the amount of progress a Sim has made toward the next level of a Skill.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to modify.
  • value (Union[int, CommonSkillId]) – The level to add or subtract to/from the skill.
  • add (bool, optional) – If True, the skill will be added to the Sim before it is modified.
Returns:

True, if successful. False, if not.

Return type:

bool

static get_current_skill_level(sim_info, skill_id)

Retrieve the Skill Level of a sim.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to use.
Returns:

The current skill level of the specified Skill or -1.0 if a problem occurs.

Return type:

float

static get_progress_toward_max_skill_level(sim_info, skill_id, add=True)

Retrieve the amount of progress a Sim has made toward the max level of a Skill.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to modify.
  • add (bool, optional) – If True, the skill will be added to the Sim before it is modified.
Returns:

True, if successful. False, if not.

Return type:

bool

static get_progress_toward_next_skill_level(sim_info, skill_id, add=False)

Retrieve the amount of progress a Sim has made toward the next level of a Skill.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to use.
  • add (bool, optional) – If True, the skill will be added to the Sim before it is checked.
Returns:

The progress to the next level of the specified Skill or -1.0 if a problem occurs.

Return type:

float

static get_skill(sim_info, skill_id, add=True)

Retrieve a Skill for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to use.
  • add (bool, optional) – If True, the skill will be added to the Sim before it is checked.
Returns:

An instance of a Skill of the Sim or None if the Skill does not exist.

Return type:

Union[Skill, None]

static has_skill(sim_info, skill_id)

Determine if a Sim has a Skill.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to check.
Returns:

True, if the Sim has the skill. False, if the Sim does not.

Return type:

bool

static is_at_max_skill_level(sim_info, skill_id)

Determine if a Sim has reached the Maximum Level of a Skill.

Note

Max level depends on the skill itself. Each skill can have a different max level.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to check.
Returns:

True, if the Sim has the skill at the maximum level. False, if the Sim does not.

Return type:

bool

static remove_skill(sim_info, skill_id)

Remove a Skill from the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to remove.
Returns:

True, if the skill was removed successfully. False, if not.

Return type:

bool

static set_current_skill_level(sim_info, skill_id, level, add=True)

Set the Skill Level of the Skill for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to set.
  • level (Union[int, CommonSkillId]) – The level to set the skill to.
  • add (bool, optional) – If True, the skill will be added to the Sim before it is modified.
Returns:

True, if successful. False, if not.

Return type:

bool

static set_progress_toward_max_skill_level(sim_info, skill_id, value, add=True)

Set the amount of progress a Sim has made toward the max level of a Skill.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • skill_id (Union[int, CommonSkillId]) – The identifier of the Skill to set.
  • value (Union[int, CommonSkillId]) – The amount to add.
  • add (bool, optional) – If True, the skill will be added to the Sim before it is modified.
Returns:

True, if successful. False, if not.

Return type:

bool

static translate_skill_progress(sim_info, skill_id_from, skill_id_to, add=True)

Translate the total progress of one Skill to the total progress of another Skill for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • skill_id_from (Union[int, CommonSkillId]) – The identifier of the Skill being changed.
  • skill_id_to (Union[int, CommonSkillId]) – The identifier of the Skill being translated to.
  • add (bool, optional) – If True, the skill will be added to the Sim before it is modified.
Returns:

True, if successful. False, if not.

Return type:

bool

Traits

class CommonTraitUtils

Bases: object

Utilities for manipulating Traits on Sims.

static add_trait(sim_info, *trait_ids)

Add the specified traits to a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to add the specified traits to.
  • trait_ids (Union[int, CommonTraitId]) – An iterable of Trait identifiers of traits being added.
Returns:

True, if all specified traits were successfully added to the Sim. False, if not.

Return type:

bool

static add_trait_to_all_sims(trait_id, include_sim_callback=None)

Add a trait to all Sims that match the specified include filter.

Parameters:
  • trait_id (Union[int, CommonTraitId]) – The identifier of the Trait to add to all Sims.
  • include_sim_callback (Callback[[SimInfo], bool], optional) – Only Sims that match this filter will have the Trait added.
static can_be_impregnated(sim_info)

Determine if a sim Can Be Impregnated.

Note

Use can_reproduce() for Pet Sims.

Note

Will return False if the sim has the GENDER_OPTIONS_PREGNANCY_CAN_NOT_BE_IMPREGNATED trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can be impregnated. False, if the Sim can not be impregnated.
Return type:bool
static can_create_pregnancy(sim_info)

Determine if a Sim can either impregnate, be impregnated, or can reproduce.

Note

Will return False if the Sim can both impregnate and not impregnate, if the Sim can both be impregnated and not be impregnated or if the Sim can both reproduce and not reproduce.

Note

A Sim can impregnate when they can either impregnate other Sims, can be impregnated by other Sims, or if they are a Pet, can reproduce.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can create pregnancies. False, if the Sim can not create pregnancies.
Return type:bool
static can_impregnate(sim_info)

Determine if a sim Can Impregnate.

Note

Use can_reproduce() for Pet Sims.

Note

This will check for a sim to not also have the GENDER_OPTIONS_PREGNANCY_CAN_NOT_IMPREGNATE trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can impregnate other Sims. False, if the Sim can not impregnate other Sims.
Return type:bool
static can_not_be_impregnated(sim_info)

Determine if a sim Can Not Be Impregnated.

Note

Use can_not_reproduce() for Pet Sims.

Note

Will return False if the sim has the GENDER_OPTIONS_PREGNANCY_CAN_BE_IMPREGNATED trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can not be impregnated. False, if the Sim can be impregnated.
Return type:bool
static can_not_impregnate(sim_info)

Determine if a sim Can Not Impregnate.

Note

Use can_not_reproduce() for Pet Sims.

Note

This will check for a sim to not also have the GENDER_OPTIONS_PREGNANCY_CAN_IMPREGNATE trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can not impregnate other Sims. False, if the Sim can impregnate other Sims.
Return type:bool
static can_not_reproduce(sim_info)

Determine if a pet sim can reproduce.

..note:: Use can_not_impregnate() and can_not_be_impregnated() for Human Sims. .. note:: Will return False if the pet sim has the PREGNANCY_OPTIONS_PET_CAN_REPRODUCE trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can not reproduce. False, if the Sim can reproduce.
Return type:bool
static can_reproduce(sim_info)

Determine if a pet sim can reproduce.

Note

Use can_impregnate() and can_be_impregnated() for Human Sims.

Note

Will return False if the pet sim has the PREGNANCY_OPTIONS_PET_CAN_NOT_REPRODUCE trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can reproduce. False, if the Sim can not reproduce.
Return type:bool
static get_equipped_traits(sim_info)

Retrieve Sims currently equipped traits.

Note

The main use of this function is to check Occult Types.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:A collection of equipped Traits on a Sim.
Return type:List[int]
static get_trait_id(trait_identifier)

Retrieve the decimal identifier of a Trait.

Parameters:trait_identifier (Union[int, Trait]) – The identifier or instance of a Trait.
Returns:The decimal identifier of the Trait or None if the Trait does not have an id.
Return type:Union[int, None]
static get_trait_ids(sim_info)

Retrieve decimal identifiers for all Traits of a sim.

Parameters:sim_info (SimInfo) – The sim to check.
Returns:A collection of Trait identifiers on a Sim.
Return type:List[int]
static get_trait_name(trait)

Retrieve the Name of a Trait.

Parameters:trait (Trait) – An instance of a Trait.
Returns:The name of a Trait or None if a problem occurs.
Return type:Union[str, None]
static get_trait_names(traits)

Retrieve the Names of a collection of Trait.

Parameters:traits (Iterator[Trait]) – A collection of Trait instances.
Returns:A collection of names for all specified Traits.
Return type:Tuple[str]
static get_traits(sim_info)

Retrieve all Traits of a sim.

Parameters:sim_info (SimInfo) – The sim to check.
Returns:A collection of Traits on a Sim.
Return type:List[int]
static has_animal_attraction(sim_info)

Determine if a sim has an Animal Attraction.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static has_animal_whisperer(sim_info)

Determine if a sim is an Animal Whisperer.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static has_challenge_kindness_ambassador(sim_info)

Determine if a sim has Challenged the Kindness Ambassador.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static has_commitment_issues(sim_info)

Determine if a sim has Commitment Issues.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static has_feminine_frame(sim_info)

Determine if a sim has a Feminine Body Frame.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static has_masculine_frame(sim_info)

Determine if a sim has a Masculine Body Frame.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static has_trait(sim_info, *trait_ids)

Determine if a sim has any of the specified traits.

Parameters:
  • sim_info (SimInfo) – The sim to check.
  • trait_ids (Union[int, CommonTraitId]) – An iterable of identifiers of Traits.
Returns:

True, if the sim has any of the specified traits. False, if not.

Return type:

bool

static hates_children(sim_info)

Determine if a sim Hates Children.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static is_active(sim_info)

Determine if a Sim is active.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_aggressive_pet(sim_info)

Determine if a pet sim is Aggressive.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_alluring(sim_info)

Determine if a sim is Alluring.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_antiseptic(sim_info)

Determine if a sim is Antiseptic.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_bro(sim_info)

Determine if a sim is a Bro.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_carefree(sim_info)

Determine if a sim is Care Free.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_cat_lover(sim_info)

Determine if a sim is a Cat Lover.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_clumsy(sim_info)

Determine if a sim is Clumsy.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_criminal(sim_info)

Determine if a sim is a Criminal.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_dastardly(sim_info)

Determine if a sim is Dastardly.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_dog_lover(sim_info)

Determine if a sim is a Dog Lover.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_evil(sim_info)

Determine if a sim is Evil.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_fertile(sim_info)

Determine if a sim is Fertile.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_friendly_pet(sim_info)

Determine if a pet sim is Friendly.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_geek(sim_info)

Determine if a Sim is a geek.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_genius(sim_info)

Determine if a sim is a Genius.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_glutton(sim_info)

Determine if a sim is a Glutton.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_glutton_human(sim_info)

Determine if a non pet sim is a Glutton

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_glutton_pet(sim_info)

Determine if a pet sim is a Glutton.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_good(sim_info)

Determine if a sim is Good.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_gregarious(sim_info)

Determine if a sim is Gregarious.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_hot_headed(sim_info)

Determine if a sim is Hot Headed.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_hunter_pet(sim_info)

Determine if a pet sim is a Hunter.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_incredibly_friendly(sim_info)

Determine if a sim is Incredibly Friendly.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_insane(sim_info)

Determine if a sim is Insane.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_insider(sim_info)

Determine if a sim is an Insider.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_lazy(sim_info)

Determine if a sim is Lazy.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_loner(sim_info)

Determine if a sim is a Loner.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_love_guru(sim_info)

Determine if a sim is a Love Guru.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_loyal_pet(sim_info)

Determine if a pet sim is Loyal.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_mean(sim_info)

Determine if a sim is Mean.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_mentor(sim_info)

Determine if a sim is a Mentor.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_morning_person(sim_info)

Determine if a sim is a Morning Person.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_naughty_pet(sim_info)

Determine if a pet sim is Naughty.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_neat(sim_info)

Determine if a Sim is neat.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_night_owl(sim_info)

Determine if a sim is a Night Owl.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_self_absorbed(sim_info)

Determine if a sim is Self Absorbed.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_self_assured(sim_info)

Determine if a sim is Self Assured.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_service_sim(sim_info)

Determine if a sim is a service sim.

..warning:: Obsolete: Use is_service_sim() in CommonSimTypeUtils instead.

static is_shameless(sim_info)

Determine if a sim is Shameless.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_sincere(sim_info)

Determine if a sim is Sincere.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_skittish_pet(sim_info)

Determine if a pet sim is Skittish.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_slob(sim_info)

Determine if a sim is a Slob.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_snob(sim_info)

Determine if a sim is a Snob.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_special_npc(sim_info)

Determine if a sim is a Special NPC.

Note

Special NPCs:

  • Hidden Event NPC
  • Grim Reaper
  • Scarecrow
  • Flower Bunny
Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_squeamish(sim_info)

Determine if a sim is Squeamish.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_survivalist(sim_info)

Determine if a sim is a Survivalist.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static is_unflirty(sim_info)

Determine if a sim is Unflirty.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim has the Trait. False, if the Sim does not have the Trait.
Return type:bool
static load_trait_by_id(trait_id)

Load an instance of a Trait by its decimal identifier.

Parameters:trait_id (Union[int, CommonTraitId]) – The decimal identifier of a Trait.
Returns:An instance of a Trait matching the decimal identifier or None if not found.
Return type:Union[Trait, None]
static prefers_menswear(sim_info)

Determine if a sim prefers Mens Clothing.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static prefers_womenswear(sim_info)

Determine if a sim prefers Womens Clothing.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static remove_trait(sim_info, *trait_ids)

Remove the specified traits from a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to remove the specified traits from.
  • trait_ids (Union[int, CommonTraitId]) – The decimal identifier of the trait being removed.
Returns:

True, if all specified traits were successfully removed from the Sim. False, if not.

Return type:

bool

static remove_trait_from_all_sims(trait_id, include_sim_callback=None)

Remove a trait from all Sims that match the specified include filter.

Parameters:
  • trait_id (Union[int, CommonTraitId]) – The identifier of the Trait to remove from all Sims.
  • include_sim_callback (Callback[[SimInfo], bool], optional) – Only Sims that match this filter will have the Trait removed.
static swap_traits(sim_info, trait_id_one, trait_id_two)

Remove one trait and add another to a Sim.

Note

If trait_id_one exists on the Sim, it will be removed and trait_id_two will be added.

Note

If trait_id_two exists on the Sim, it will be removed and trait_id_one will be added.

Parameters:
  • sim_info (SimInfo) – The Sim to remove the specified traits from.
  • trait_id_one (Union[int, CommonTraitId]) – The first trait to remove/add
  • trait_id_two (Union[int, CommonTraitId]) – The second trait to remove/add
Returns:

True, if the Traits were swapped successfully. False, if neither Trait exists on a Sim or the traits were not swapped successfully.

Return type:

bool

static uses_toilet_sitting(sim_info)

Determine if a sim uses the toilet while sitting.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim uses toilets while sitting. False, if the Sim does not use toilets while sitting.
Return type:bool
static uses_toilet_standing(sim_info)

Determine if a sim uses the toilet while standing.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim uses toilets while standing. False, if the Sim does not use toilets while standing.
Return type:bool

Statistics

class CommonSimStatisticUtils

Bases: object

Utilities for manipulating the Statistics of Sims.

static add_statistic_modifier(sim_info, statistic_id, value, add_dynamic=True, add=True)

Add a Modifier to the specified Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic containing the modifier.
  • value (float) – The modifier to add.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

True, if successful. False, if not successful.

Return type:

bool

static add_statistic_value(sim_info, statistic_id, value, add_dynamic=True, add=True)

Change the Value of a Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to add a value to.
  • value (float) – The amount to add.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

True, if successful. False, if not successful.

Return type:

bool

static get_statistic(sim_info, statistic_id, add_dynamic=True, add=False)

Retrieve a Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to retrieve of.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

An instance of the statistic or None if a problem occurs.

Return type:

Union[BaseStatistic, None]

static get_statistic_level(sim_info, statistic_id)

Retrieve the User Value of a Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to retrieve the user value of.
Returns:

The value of the statistic, -1.0 if the statistic is not found, or 0.0 if a problem occurs.

Return type:

float

static get_statistic_value(sim_info, statistic_id, add_dynamic=True, add=False)

Retrieve the Value of a Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to retrieve the value of.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

The value of the statistic, -1.0 if the statistic is not found, or 0.0 if a problem occurs.

Return type:

float

static has_statistic(sim_info: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe48123d5d0>, statistic_id: Union[int, sims4communitylib.enums.statistics_enum.CommonStatisticId]) → bool

Determine if a sim has any of the specified Statistics.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to check.
Returns:

True, if the Sim has any of the statistics. False, if not.

Return type:

bool

static has_statistics(sim_info, statistic_ids)

Determine if a sim has any of the specified Statistics.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • statistic_ids (Iterator[Union[int, CommonStatisticId]]) – An iterator of identifiers for statistics to check.
Returns:

True, if the Sim has any of the statistics. False, if not.

Return type:

bool

static is_statistic_locked(sim_info, statistic_id, add_dynamic=True, add=False)

Determine if a statistic is locked for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to check.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

True, if the statistic is locked. False, if not.

Return type:

bool

static remove_all_statistic_modifiers_for_statistic(sim_info, statistic_id, add_dynamic=True, add=True)

Remove all Modifiers from the specified Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to remove modifiers from.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

True, if successful. False, if not successful.

Return type:

bool

static remove_statistic(sim_info, statistic_id)

Remove a Statistic from the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to remove.
Returns:

True, if successful. False, if not successful.

Return type:

bool

static remove_statistic_modifier(sim_info, statistic_id, value, add_dynamic=True, add=True)

Remove a Modifier from the specified Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to remove the modifier from.
  • value (float) – The modifier to remove.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

True, if successful. False, if not successful.

Return type:

bool

static set_statistic_user_value(sim_info, statistic_id, value, add_dynamic=True, add=True)

Set the User Value of a Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to add a user value to.
  • value (float) – The amount to add.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

True, if successful. False, if not successful.

Return type:

bool

static set_statistic_value(sim_info, statistic_id, value, add_dynamic=True, add=True)

Set the Value of a Statistic for the specified Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to modify.
  • statistic_id (Union[int, CommonStatisticId]) – The identifier of the statistic to add a value to.
  • value (float) – The amount to add.
  • add_dynamic (bool, optional) – Add the statistic components to the Sim.
  • add (bool, optional) – Add the statistic to the Sim.
Returns:

True, if successful. False, if not successful.

Return type:

bool

Whims

class CommonWhimUtils

Bases: object

Utilities for manipulating the Whims of Sims.

static get_current_whims(sim_info)

Retrieve the current Whims of the specified Sim.

Parameters:sim_info (SimInfo) – The Sim to get the Whim Sets of.
Returns:A collection of Whims Sets for the specified Sim.
Return type:Tuple[WhimSetBaseMixin]

Locational

Location

class CommonSimLocationUtils

Bases: object

Utilities for manipulating the locations of Sims.

static can_route_to_location(sim_info, location)

Determine if a Sim can route to a Location.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • location (CommonLocation) – The location to route to.
Returns:

True, if the Sim can route to the specified Location. False, if not.

Return type:

bool

static can_route_to_position(sim_info, position, routing_surface)

Determine if a Sim can route to a Location.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • position (CommonVector3) – The position to route to.
  • routing_surface (CommonSurfaceIdentifier) – The routing surface of the target.
  • orientation (CommonQuaternion, optional) – The orientation of the position. Default is CommonQuaternion.empty().
Returns:

True, if the Sim can route to the specified Position. False, if not.

Return type:

bool

static can_swim_at_current_location(sim_info)

Determine if a Sim can swim at their current location.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can swim at their current location. False, if not.
Return type:bool
static can_swim_at_location(sim_info, location)

Determine if a Sim can swim at the specified location.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • location (CommonLocation) – The Location to check.
Returns:

True, if the Sim can swim at the specified location. False, if not.

Return type:

bool

static get_forward_vector(sim_info)

Retrieve the forward vector of a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The forward vector of the Sim.
Return type:CommonVector3
static get_location(sim_info)

Retrieve the current location of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the location of.
Returns:The current location of the Sim or None if the Sim does not have a location.
Return type:Union[CommonLocation, None]
static get_orientation(sim_info)

Retrieve the orientation of a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The orientation of the Sim.
Return type:CommonQuaternion
static get_orientation_degrees(sim_info)

Retrieve the orientation of a Sim represented in degrees.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The orientation of the Sim represented in degrees.
Return type:float
static get_position(sim_info)

Retrieve the current position of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the position of.
Returns:The current position of the Sim or None if the Sim does not have a position.
Return type:Union[CommonVector3, None]
static get_routing_context(sim_info)

Retrieve the routing context of a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The routing context of the specified Sim or None if an error occurs.
Return type:Union[RoutingContext, None]
static get_routing_location(sim_info)

Retrieve a routing location for the current location of a Sim.

Parameters:sim_info (SimInfo) – The Sim to get the location of.
Returns:The routing location for the current location of the Sim or None if the Sim does not have a location.
Return type:Union[CommonRoutingLocation, None]
static get_routing_surface(sim_info)

Retrieve the Routing Surface Identifier of a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The Routing Surface Identifier of the specified Sim or None if a problem occurs.
Return type:Union[CommonSurfaceIdentifier, None]
static get_surface_level(sim_info)

Retrieve the Surface Level of a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The Surface Level of the specified Sim or 0 if a problem occurs.
Return type:int
static is_allowed_on_current_lot(sim_info)

Determine if a Sim is allowed on the current lot.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is allowed on the current lot. False, if not.
Return type:bool
static is_at_home(sim_info)

Determine if a Sim is on their home Lot.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is on their home Lot. False, if not.
Return type:bool
static is_on_current_lot(sim_info)

Determine if a Sim is on the active Lot.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is on the active Lot. False, if not.
Return type:bool
static is_on_lot(sim_info, lot)

Determine if a Sim is on a Lot.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • lot (Lot) – An instance of a Lot.
Returns:

True, if the Sim is on the specified Lot. False, if not.

Return type:

bool

static is_renting_current_lot(sim_info)

Determine if a Sim is renting the current lot.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is renting the active lot. False, if not.
Return type:bool
static send_to_position(sim_info, position, level)

Send a Sim to the specified location.

Parameters:
  • sim_info (SimInfo) – The Sim to send.
  • position (CommonVector3) – The position to send the sim to.
  • level (int) – The level at which the position is located.
Returns:

The result of sending the Sim to the specified location or None if they could not go there.

Return type:

EnqueueResult

static set_location(sim_info, location)

Set the location of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • location (CommonLocation) – The location to put the Sim.
Returns:

True, if the location of the Sim is successfully set. False, if not.

Return type:

bool

Household

class CommonHouseholdUtils

Bases: object

Utilities for manipulating households.

static add_sim_to_active_household(sim_info, destroy_if_empty_household=True)

Add a Sim to the Active Sims household.

Parameters:
  • sim_info (SimInfo) – The Sim to add.
  • destroy_if_empty_household (bool, optional) – If True, if the Sim comes from a household containing only them, then it will be destroyed after they are moved.
Returns:

True, if the Sim was added to the active household successfully. False, if not.

Return type:

bool

static add_sim_to_target_household(sim_info: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe47f044c50>, target_sim_info: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe47f044c50>, destroy_if_empty_household: bool = True) → bool

add_sim_to_active_household(sim_info, destroy_if_empty_household=True)

Add a Sim to the Household of the Target Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to add.
  • target_sim_info (SimInfo) – This Sim will receive the Sim to their Household.
  • destroy_if_empty_household (bool, optional) – If True, if the Sim comes from a household containing only them, then it will be destroyed after they are moved.
Returns:

True, if the Sim was added to the household of the target successfully. False, if not.

Return type:

bool

static create_empty_household(starting_funds=0, as_hidden_household=False)

Create an empty household.

Parameters:
  • starting_funds (int, optional) – The funds the Household will start with.
  • as_hidden_household (bool, optional) – If True, the created household will be hidden.
Returns:

The created Household

Return type:

Household

static delete_household(household)

Delete the specified household from the game.

Parameters:household (Household) – The Household to delete
Returns:True, if the Household was deleted successfully. False, if not.
Return type:bool
static delete_households_with_name(name, allow_partial_match=False)

Delete all households with the specified name.

Parameters:
  • name (str) – The name of the households to delete.
  • allow_partial_match (bool) – If True, households only need to contain the name to match.
Returns:

True, if Households were deleted successfully. False, if not.

Return type:

bool

static get_active_household()

Retrieve the Household of the Active Sim.

Returns:The Household of the Active Sim or None if no household is found.
Return type:Union[Household, None]
static get_active_household_id()

Retrieve an identifier for the Household of the Active Sim.

Returns:The identifier of the Household of the Active Sim.
Return type:int
static get_all_households_generator()

Retrieve a collection of all households.

Returns:An iterable of all Households.
Return type:Iterator[Household]
static get_free_household_slots(sim_info)

Retrieve the number of free household slots in the Household of the specified Sim.

Note

Max household slots in vanilla Sims 4 is 8 sims.

Parameters:sim_info (SimInfo) – The Sim whose household will be checked.
Returns:The number of free household slots or -1 if no Household is found for the specified Sim.
Return type:int
static get_household(sim_info)

Retrieve the household of a Sim.

Parameters:sim_info (SimInfo) – The Sim whose household will be retrieved.
Returns:The Household of the specified Sim or None if no household is found.
Return type:Union[Household, None]
static get_household_home_lot_id(household)

Retrieve the decimal identifier of the home Lot for a Household.

Parameters:household (Household) – An instance of a Household.
Returns:The home zone identifier of the specified Household or -1 if a problem occurs.
Return type:int
static get_household_home_zone_id(household)

Retrieve the home zone identifier for a Household.

Parameters:household (Household) – An instance of a Household.
Returns:The home zone identifier of the specified Household or -1 if a problem occurs..
Return type:int
static get_household_id(sim_info)

Retrieve an identifier for the Household a Sim is a part of.

Parameters:sim_info (SimInfo) – The Sim whose household will be retrieved.
Returns:The identifier of the Household of the specified Sim or 0 if no household is found.
Return type:int
static get_household_id_owning_current_lot()

Retrieve the decimal identifier of the Household that owns the current Lot.

Returns:A decimal identifier of the Household that owns the current Lot or -1 if a problem occurs.
Return type:int
static get_household_id_owning_lot(lot)

Retrieve the decimal identifier of the Household that owns a Lot.

Parameters:lot (Lot) – An instance of a Lot.
Returns:A decimal identifier of the Household that owns the specified Lot or -1 if a problem occurs.
Return type:int
static get_household_lot_id(sim_info)

Retrieve an identifier for the home Lot of a Sim.

Parameters:sim_info (SimInfo) – The Sim to retrieve the household Lot id of.
Returns:The identifier of the Household Lot for the Sim.
Return type:int
static get_household_owning_current_lot()

Retrieve the Household that owns the current Lot.

Returns:A decimal identifier of the Household that owns the current Lot or None if no Household owns the current Lot.
Return type:Union[Household, None]
static get_household_owning_lot(lot)

Retrieve the Household that owns a Lot.

Parameters:lot (Lot) – An instance of a Lot.
Returns:A decimal identifier of the Household that owns the specified Lot or None if no Household owns the specified Lot.
Return type:Union[Household, None]
static get_household_zone_id(sim_info)

Retrieve an zone identifier for the home Lot of the specified Sim.

Parameters:sim_info (SimInfo) – The Sim to retrieve the household Lot id of.
Returns:The zone identifier of the Household the Sim belongs to.
Return type:int
static get_id(household)

Retrieve the decimal identifier of a Household.

Parameters:household – An instance of a Household.
Type:Household
Returns:The identifier of the Household or 0 if an error occurs.
Return type:int
static get_number_of_sims_in_household(household)

Determine the number of Sims in the specified Household.

Parameters:household (Household) – An instance of a Household.
Returns:The number of Sims in the specified Household.
Return type:int
static get_number_of_sims_in_household_of_sim(sim_info)

Determine the number of Sims in the household of the specified Sim.

Parameters:sim_info – An instance of a Sim.
Type:sim_info: SimInfo
Returns:The number of Sims in the household of the specified Sim.
Return type:int
static get_sim_info_of_all_sims_in_active_household_generator()

Retrieve a collection of Sims that are a part of the active household.

Returns:An iterable of Sims in the active household.
Return type:Iterator[SimInfo]
static get_sim_info_of_all_sims_in_household_generator(household)

Retrieve a collection of Sims that are a part of the active household.

Parameters:household (Household) – The Household to retrieve Sims from.
Returns:An iterable of Sims in the specified Household.
Return type:Iterator[SimInfo]
static has_free_household_slots(sim_info)

Determine if the Household of the specified Sim has any free Sim slots.

Note

Max household slots in vanilla Sims 4 is 8 sims.

Parameters:sim_info (SimInfo) – The Sim whose household will be checked.
Returns:True, if there are free slots for new Sims in the Household of the specified Sim. False, if not.
Return type:bool
static has_household(sim_info)

Determine if the Sim is part of a Household.

Parameters:sim_info (SimInfo) – The Sim whose household will be checked.
Returns:True, if the Sim is part of a Household. False, if not.
Return type:bool
static is_alone_on_home_lot(sim_info)

Determine if a Sim is alone on their home lot.

Parameters:sim_info – An instance of a Sim.
Type:sim_info: SimInfo
Returns:True, if the Sim is on their home lot and alone. False, if not.
Return type:bool
static is_in_same_household(sim_info, target_sim_info)

Determine if two Sims are in the same household.

Parameters:
  • sim_info (SimInfo) – The Sim whose household will be checked.
  • target_sim_info (SimInfo) – The Target whose household will be checked.
Returns:

True, if the Sim is part of same Household as the Target Sim. False, if not.

Return type:

bool

static is_part_of_a_single_sim_household(sim_info)

Determine if a Sim is the only Sim in their Household (Single Sim Household).

Parameters:sim_info – An instance of a Sim.
Type:sim_info: SimInfo
Returns:True, if specified Sim is the only Sim in their Household (Single Sim Household). False, if not.
Return type:bool
static is_part_of_active_household(sim_info)

Determine if a Sim is part of the active household.

Returns:True, if the Sim is part of the Active Household. False, if not.
Return type:bool
static locate_household_by_id(household_id)

Locate a household with the specified id.

Parameters:household_id (int) – The decimal identifier of a Household.
Returns:The Household with an identifier matching the specified identifier or None if no Household was found.
Return type:Union[Household, None]
static locate_household_by_name(name, allow_partial_match=False, create_on_missing=False, starting_funds=0, as_hidden_household=False)

Locate a household with the specified name.

Parameters:
  • name (str) – The name of a household to locate.
  • allow_partial_match (bool, optional) – If True, households only need to contain the name to match.
  • create_on_missing (bool, optional) – If True, a household will be created if one isn’t found with the specified name.
  • starting_funds (int, optional) – If a household is created, this will be the starting funds of that household.
  • as_hidden_household (bool, optional) – If True, the created household will be hidden.
Returns:

A Household with the specified name or None if no household is found.

Return type:

Union[Household, None]

static locate_households_by_name_generator(name, allow_partial_match=False)

Locate all households with the specified name.

Parameters:
  • name (str) – The name of the households to locate.
  • allow_partial_match (bool, optional) – If True, households only need to contain the name to match.
Returns:

An iterable of Households with the specified name.

Return type:

Iterator[Household]

static move_sim_to_household(sim_info, household_id=None, destroy_if_empty_household=True)

Move a Sim to the specified household or a new household if no Household is specified.

Parameters:
  • sim_info (SimInfo) – The Sim to add.
  • household_id (int) – The identifier of the Household to add the Sim to.
  • destroy_if_empty_household (bool, optional) – If True, if the Sim comes from a household containing only them, then it will be destroyed after they are moved.
Returns:

True, if the Sim was added to the Household successfully. False, if not.

Return type:

bool

Creation

Spawn, Despawn, Destroy

class CommonSimSpawnUtils

Bases: object

Utilities for creating, spawning, despawning, and resetting Sims.

static create_human_sim_info(gender=None, age=None, species=None, first_name='', last_name='', trait_ids=(), household=None, source='testing')

Create SimInfo for a Human Sim.

Parameters:
  • gender (Gender, optional) – The Gender of the created Sim. Default is None.
  • age (Age, optional) – The Age of the created Sim. Default is None.
  • first_name (str, optional) – The First Name of the created Sim. Default is an empty string.
  • last_name (str, optional) – The Last Name of the created Sim. Default is an empty string.
  • trait_ids (Tuple[int], optional) – The decimal identifiers of the Traits to add to the created Sim. Default is an empty collection.
  • household (Household, optional) – The household to place the created Sim in. If None, the Sim will be placed in a hidden household. Default is None.
  • source (str, optional) – The reason for the Sims creation. Default is ‘testing’.
Returns:

The SimInfo of the created Sim or None if the Sim failed to be created.

Return type:

SimInfo

static delete_sim(sim_info, source=None, cause=None, **kwargs)

Delete a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to delete.
  • source (str, optional) – The source of the destruction. Default is None.
  • cause (str, optional) – The cause of the destruction. Default is None.
Returns:

True, if the Sim was deleted successfully. False, if not.

Return type:

bool

static despawn_sim(sim_info, source=None, cause=None, **kwargs)

Despawn a Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to despawn.
  • source (str, optional) – The source of the destruction. Default is None.
  • cause (str, optional) – The cause of the destruction. Default is None.
Returns:

True, if the Sim was despawn successfully. False, if not.

Return type:

bool

static fade_in(sim_info, fade_duration=1.0)

Fade a Sim to become visible.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • fade_duration (float, optional) – The number of milliseconds the fade effect should take to complete. Default is 1.0.
  • immediate (bool, optional) – If set to True, fade in will occur immediately. Default is False.
  • additional_channels (Iterator[Tuple[int, int, int]], optional) – A collection of additional channels. The order of the inner tuple is Manager Id, Sim Id, and Mask. Default is None.
static fade_out(sim_info, fade_duration=1.0, immediate=False, additional_channels=None)

Fade a Sim to become invisible.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • fade_duration (float, optional) – The number of milliseconds the fade effect should take to complete. Default is 1.0.
  • immediate (bool, optional) – If set to True, fade out will occur immediately. Default is False.
  • additional_channels (Iterator[Tuple[int, int, int]], optional) – A collection of additional channels. The order of the inner tuple is Manager Id, Sim Id, and Mask. Default is None.
static hard_reset(sim_info, reset_reason=ResetReason.RESET_EXPECTED, source=None, cause=None)

Perform a hard reset on a SimInfo.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • reset_reason (ResetReason, optional) – The reason for the reset. Default is ResetReason.RESET_EXPECTED.
  • source (Any, optional) – The source of the reset. Default is the SimInfo.
  • cause (Any, optional) – The cause of the reset. Default is ‘S4CL Hard Reset’.
Returns:

True, if the reset was successful. False, if not.

Return type:

bool

static schedule_sim_for_despawn(sim_info, source=None, cause=None, on_despawn=None, **kwargs)

Schedule a Sim to be despawned.

Parameters:
  • sim_info (SimInfo) – The Sim to despawn.
  • source (str, optional) – The source of the destruction. Default is None.
  • cause (str, optional) – The cause of the destruction. Default is None.
  • on_despawn (Callable[[], None], optional) – A callback that occurs after the Sim is despawned. Default is None.
Returns:

True, if the Object was successfully scheduled for destruction. False, if not.

Return type:

bool

static soft_reset(sim_info, reset_reason=ResetReason.RESET_EXPECTED, hard_reset_on_exception=False, source=None, cause=None)

Perform a soft reset on a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of an Sim.
  • reset_reason (ResetReason, optional) – The reason for the reset. Default is ResetReason.RESET_EXPECTED.
  • hard_reset_on_exception (bool, optional) – If set to True, a hard reset of the Object will be attempted upon an error occurring. If set to False, nothing will occur if the reset failed. Default is False.
  • source (Any, optional) – The source of the reset. Default is the GameObject.
  • cause (Any, optional) – The cause of the reset. Default is ‘S4CL Soft Reset’.
Returns:

True, if the reset was successful. False, if not.

Return type:

bool

static spawn_sim(sim_info, location=None, position=None, **kwargs)

Spawn a Sim.

..note:: Do not provide sim_position or sim_location in kwargs as they are already specified as location and position.

Parameters:
  • sim_info (SimInfo) – The Sim to Spawn.
  • location (CommonLocation, optional) – The location to spawn the Sim at. Default is None.
  • position (CommonVector3, optional) – The position to spawn the Sim at. Default is None.
Returns:

True, if the Sim was spawned successfully. False, if not.

Return type:

bool

static spawn_sim_at_active_sim_location(sim_info, **kwargs)

Spawn a Sim at the location of the Active Sim.

Parameters:sim_info (SimInfo) – The Sim to Spawn.
Returns:True, if the Sim was spawned successfully. False, if not.
Return type:bool

Misc

Sim

class CommonSimUtils

Bases: object

Utilities for retrieving sims in different ways.

Note

Available commands:

  • s4clib_testing.display_name_of_currently_active_sim
  • s4clib_testing.display_names_of_all_sims
static get_active_sim()

Retrieve a Sim object of the Currently Active Sim.

Note

The Active Sim is the Sim with the Plumbob above their head.

Returns:An instance of the Active Sim.
Return type:Sim
static get_active_sim_info()

Retrieve a SimInfo object of the Currently Active Sim.

Returns:The SimInfo of the Active Sim.
Return type:SimInfo
static get_all_sims_generator(include_sim_callback=None)

Retrieve a Sim object for each and every Sim (including hidden Sims).

Parameters:include_sim_callback (Callable[[SimInfo], bool], optional) – If the result of this callback is True, the sim will be included in the results. If set to None, All sims will be included.
Returns:An iterable of all Sims matching the include_sim_callback filter.
Return type:Iterator[Sim]
static get_instanced_sim_info_for_all_sims_generator(include_sim_callback=None)

Retrieve a SimInfo object for each and every sim.

Note

Only SimInfo with a Sim instance (get_sim_instance()) will be returned.

Parameters:include_sim_callback (Callable[[SimInfo], bool], optional) – If the result of this callback is True, the sim will be included in the results. If set to None, All sims will be included.
Returns:An iterable of all Sims matching the include_sim_callback filter.
Return type:Iterator[SimInfo]
static get_sim_id(sim_identifier)

Retrieve a SimId (int) from a Sim identifier.

Parameters:sim_identifier (Union[int, Sim, SimInfo]) – The identifier or instance of a Sim.
Returns:An identifier for the Sim instance.
Return type:int
static get_sim_info(sim_identifier)

Retrieve a SimInfo instance from a sim identifier.

Parameters:sim_identifier (Union[int, Sim, SimInfo]) – The identifier or instance of a Sim to use.
Returns:The SimInfo of the specified Sim instance or None if SimInfo is not found.
Return type:Union[SimInfo, None]
static get_sim_info_for_all_sims_generator(include_sim_callback=None)

Retrieve a SimInfo object for each and every sim.

Parameters:include_sim_callback (Callable[[SimInfo], bool], optional) – If the result of this callback is True, the sim will be included in the results. If set to None, All sims will be included.
Returns:An iterable of all Sims matching the include_sim_callback filter.
Return type:Iterator[SimInfo]
static get_sim_info_for_all_sims_with_name_generator(first_name, last_name)

Retrieve a SimInfo object for each and every Sim with the specified First and Last Name.

Parameters:
  • first_name (str) – A first name to look for.
  • last_name (str) – A last name to look for.
Returns:

An iterable of Sims found with the specified first and last name.

Return type:

Iterator[SimInfo]

static get_sim_info_of_sim_with_name(first_name, last_name)

Retrieve a SimInfo object for the first Sim with the specified First and Last Name.

Parameters:
  • first_name (str) – A first name to look for.
  • last_name (str) – A last name to look for.
Returns:

The first Sim found with the specified first and last name or None if no Sim is found.

Return type:

Union[SimInfo, None]

static get_sim_instance(sim_identifier)

Retrieve a Sim instance from a sim identifier.

Parameters:sim_identifier (Union[int, Sim, SimInfo]) – The identifier or instance of a Sim to use.
Returns:The instance of the specified Sim or None if no instance was found.
Return type:Union[Sim, None]

Autonomy

class CommonSimAutonomyUtils

Bases: object

Utilities for manipulating the autonomy of Sims.

static get_autonomy_state(sim_info: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe4805c4b10>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fe48063b310>

get_autonomy_state_setting(sim_info)

Retrieve the current autonomy state of a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
static has_autonomy_state(sim_info, autonomy_state)

Determine if the autonomy state of a Sim matches an autonomy state.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • autonomy_state (AutonomyState) – An autonomy state.
Returns:

True, if the autonomy state of the Sim matches the specified autonomy state. False, if not.

Return type:

bool

static has_disabled_autonomy(sim_info)

Determine if the autonomy state of a Sim is set to Disabled.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the autonomy state of the Sim is set to Disabled. False, if not.
Return type:bool
static has_full_autonomy(sim_info)

Determine if the autonomy state of a Sim is set to Full.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the autonomy state of the Sim is set to Full. False, if not.
Return type:bool
static has_limited_autonomy(sim_info)

Determine if the autonomy state of a Sim is set to Limited Only.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the autonomy state of the Sim is set to Limited Only. False, if not.
Return type:bool
static has_medium_autonomy(sim_info)

Determine if the autonomy state of a Sim is set to Medium.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the autonomy state of the Sim is set to Medium. False, if not.
Return type:bool
static has_scoring_preference_for_object(sim_info, preference_tag, game_object)

Determine if a Sim will have a scoring preference for an Object when searching for Objects to use with a Tag.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • preference_tag (CommonObjectPreferenceTag) – The tag to look for preference with.
  • game_object (GameObject) – An instance of an Object.
Returns:

True, if the Sim will have a scoring preference to use the specified Object when searching for Objects to use with the specified Tag. False, if not.

Return type:

bool

static has_use_preference_for_object(sim_info, preference_tag, game_object)

Determine if a Sim will have a preference for an Object when searching for Objects to use with a Tag.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • preference_tag (CommonObjectPreferenceTag) – The tag to look for preference with.
  • game_object (GameObject) – An instance of an Object.
Returns:

True, if the Sim will prefer to use the specified Object when searching for Objects to use with the specified Tag. False, if not.

Return type:

bool

Situations

class CommonSimSituationUtils

Bases: object

Utilities for manipulating the Situations of Sims.

static get_situations(sim_info, include_situation_callback=None)

Retrieve all Situations that a Sim is currently involved in.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim
  • include_situation_callback (Callable[[Situation], bool], optional) – If the result of this callback is True, the Situation will be included in the results. If set to None, All situations will be included. Default is None.
Returns:

An iterable of Situations that pass the include callback filter.

Return type:

Iterator[Situation]

static has_situations(sim_info, situation_ids)

Determine if a Sim is involved in any of the specified Situations.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • situation_ids (Iterator[Union[int, CommonSituationId]]) – The decimal identifiers of Situations.
Returns:

True, if the Sim has any of the specified buffs. False, if not.

Return type:

bool

Relationships

class CommonRelationshipUtils

Bases: object

Utilities for manipulating relationship bits, tracks, etc.

static add_relationship_bit(sim_info, target_sim_info, relationship_bit_id)

Add a relationship bit between two sims.

Note

If the relationship bit is UNIDIRECTIONAL, it will only be added to sim_info in the direction of the Target. i.e. Sim will have relationship bit towards Target, but Target will not have relationship bit towards Sim.

One example is the Caregiver relationship:

  • Sim is caregiver of Target.
  • Target is being cared for by Sim.
Parameters:
  • sim_info (SimInfo) – The source Sim of the Relationship Bit.
  • target_sim_info (SimInfo) – The target Sim of the Relationship Bit.
  • relationship_bit_id (Union[int, CommonRelationshipBitId]) – The identifier of the Relationship Bit to add.
Returns:

True, if the relationship bit was added successfully. False, if not.

Return type:

bool

static calculate_average_relationship_level(sim_info, target_sim_info)

Calculate an average level for Friendship and Romance between two Sims.

Note

Math: (Friendship Level + Romance Level)/2

Note

Example Levels:
Friendship Level: 10 Romance Level: 20 Average: 15
Parameters:
  • sim_info (SimInfo) – The Sim to use.
  • target_sim_info (SimInfo) – The Target Sim to use.
Returns:

The average level of friendship and romance between two Sims.

Return type:

float

static change_relationship_level_of_sims(sim_info, target_sim_info, relationship_track_id, level)

Change the level of a relationship track between two Sims.

Parameters:
  • sim_info (SimInfo) – The sim that owns the relationship track.
  • target_sim_info (SimInfo) – The target of the relationship track.
  • relationship_track_id (: Union[int, CommonRelationshipTrackId]) – The identifier of the Relationship Track to change.
  • level (float) – The amount to add to the relationship track (Can be positive or negative).
Returns:

True, if the relationship track was changed successfully. False, if not.

Return type:

bool

static get_friendship_level(sim_info, target_sim_info)

Retrieve the level of Friendship between two Sims.

Parameters:
  • sim_info (SimInfo) – The Sim to use.
  • target_sim_info (SimInfo) – The Target Sim to use.
Returns:

The current level of friendship between two Sims.

Return type:

float

static get_relationship_level_of_sims(sim_info, target_sim_info, relationship_track_id)

Retrieve the level of a relationship track between two sims.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • target_sim_info (SimInfo) – The Target Sim of the relationship track.
  • relationship_track_id (Union[int, CommonRelationshipTrackId]) – An identifier for a Relationship Track to retrieve.
Returns:

The current level between two Sims for the specified Relationship Track.

Return type:

float

static get_romance_level(sim_info, target_sim_info)

Retrieve the level of Romance between two Sims.

Parameters:
  • sim_info (SimInfo) – The Sim to use.
  • target_sim_info (SimInfo) – The Target Sim to use.
Returns:

The current level of romance between two Sims.

Return type:

float

static get_sim_info_of_all_sims_romantically_committed_to_generator(sim_info, instanced_only=True)

Retrieve a SimInfo object for all Sims romantically committed with the specified Sim.

Note

Romantic Commitments:

  • Married
  • Getting Married
  • Engaged
  • Significant Other
Parameters:
  • sim_info (SimInfo) – The Sim to locate romantically involved Sims with.
  • instanced_only (bool, optional) – If True, only Sims that are currently loaded will be returned.
Returns:

An iterable of Sims the specified Sim is romantically committed to.

Return type:

Iterator[SimInfo]

static get_sim_info_of_all_sims_with_relationship_bit_generator(sim_info, relationship_bit_id, instanced_only=True)

Retrieve an Iterator of SimInfo for all Sims that have the specified relationship bit with the specified Sim.

Note

For UNIDIRECTIONAL relationship bits, the direction is sim_info has relationship bit with target_sim_info

Caregiver example:

  • The Caregiver has a relationship bit pointed at Toddler (The Caregiver would show “caregiving ward” when hovering over the Toddler in the relationships panel)
  • The Toddler would NOT have the relationship bit.
  • Sim is Caregiver of Toddler.
Parameters:
  • sim_info (SimInfo) – The Sim to locate the relationship bit on.
  • relationship_bit_id (Union[int, CommonRelationshipBitId]) – The identifier of the relationship bit to locate connections with.
  • instanced_only (bool, optional) – If True, only Sims that are currently loaded will be returned.
Returns:

An iterable of Sims that have the specified relationship bit with the specified Sim.

Return type:

Iterator[SimInfo]

static get_sim_info_of_all_sims_with_relationship_bits_generator(sim_info, relationship_bit_ids, instanced_only=True)

Retrieve an Iterator of SimInfo for all Sims that have the specified relationship bits with the specified Sim.

Note

For UNIDIRECTIONAL relationship bits, the direction is sim_info has relationship bit with target_sim_info Caregiver example:

  • The Caregiver has a relationship bit pointed at Toddler (The Caregiver would show “caregiving ward” when hovering over the toddler in the relationships panel)
  • The toddler would NOT have the relationship bit.
  • Sim is Caregiver of Toddler.
Parameters:
  • sim_info (SimInfo) – The Sim to locate relationship bits on.
  • relationship_bit_ids (Iterator[Union[int, CommonRelationshipBitId]]) – A collection of identifiers for relationship bits to locate connections with.
  • instanced_only (bool, optional) – If True, only Sims that are currently loaded will be returned.
Returns:

An iterable of Sims that have any of the specified relationship bits with the specified Sim.

Return type:

Iterator[SimInfo]

static has_met(sim_info, target_sim_info)

Determine if a Sim has met the Target Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • target_sim_info (SimInfo) – The Target Sim to check.
Returns:

True, if both Sims have met each other. False, if not.

Return type:

bool

static has_positive_romantic_combo_relationship_bit_with(sim_info, target_sim_info)

Determine if a Sim has a positive romantic combo with the Target Sim.

Note

Positive Romantic Combo Relationship Bits:

  • Soul Mates
  • Lovers
  • Sweethearts
  • Love Birds
Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • target_sim_info (SimInfo) – The Target Sim to check.
Returns:

True, if the Sims have positive romantic combo relationship bits with each other. False, if not.

Return type:

bool

static has_relationship_bit_with_any_sims(sim_info, relationship_bit_id, instance_only=True)

Determine if a Sim has the specified relationship bit with any Sims.

Parameters:
  • sim_info (SimInfo) – The Sim to use.
  • relationship_bit_id (Union[int, CommonRelationshipBitId]) – The identifier of the Relationship Bit to check for.
  • instanced_only (bool, optional) – If True, only Sims that are currently loaded will be valid.
Returns:

True, if the Sim has the specified Relationship Bit with any Sims. False, if not.

Return type:

bool

static has_relationship_bit_with_sim(sim_info, target_sim_info, relationship_bit_id)

Determine if two Sims have the specified relationship bit with each other.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • target_sim_info (SimInfo) – The Target Sim of the relationship bit (The target is especially important for Unidirectional/One Way Relationship Bits).
  • relationship_bit_id (Union[int, CommonRelationshipBitId]) – The identifier of the Relationship Bit to check for.
Returns:

True, if the Sim has the specified Relationship Bit with the Target Sim. False, if not.

Return type:

bool

static has_relationship_bits_with_any_sims(sim_info, relationship_bit_ids, instanced_only=True)

Determine if a Sim has the specified relationship bits with any Sims.

Parameters:
  • sim_info (SimInfo) – The Sim to use.
  • relationship_bit_ids (int) – A collection of identifier of Relationship Bits to check for.
  • instanced_only (bool, optional) – If True, only Sims that are currently loaded will be valid.
Returns:

True, if the Sim has any of the specified Relationship Bits with any Sims. False, if not.

Return type:

bool

static has_relationship_bits_with_sim(sim_info, target_sim_info, relationship_bit_ids)

Determine if two sims have any of the specified relationship bits with each other.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • target_sim_info (SimInfo) – The Target Sim of the relationship bit (The target is especially important for Unidirectional/One Way Relationship Bits).
  • relationship_bit_ids (Iterator[Union[int, CommonRelationshipBitId]]) – A collection of identifier of Relationship Bits to check for.
Returns:

True, if the Sim has any of the specified Relationship Bits with the Target Sim. False, if not.

Return type:

bool

static is_romantically_committed_to(sim_info, target_sim_info)

Determine if a Sim is romantically committed to the Target Sim.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • target_sim_info (SimInfo) – The Target Sim to check.
Returns:

True, if the Sim is romantically committed to the Target Sim. False, if not.

Return type:

bool

static is_romantically_committed_to_any_sims(sim_info)

Determine if the Sim is romantically committed to any Sims.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is romantically committed to any Sims. False, if not.
Return type:bool
static remove_relationship_bit(sim_info, target_sim_info, relationship_bit_id)

Remove a relationship bit between two sims.

Note

If the relationship bit is UNIDIRECTIONAL, it will only be removed from sim_info in the direction of the Target. i.e. Sim will have no longer have relationship bit towards Target, but Target will still have relationship bit towards Sim.

One example is the Caregiver relationship:

  • Sim is caregiver of Target.
  • Target is being cared for by Sim.
Parameters:
  • sim_info (SimInfo) – The source Sim of the Relationship Bit.
  • target_sim_info (SimInfo) – The target Sim of the Relationship Bit.
  • relationship_bit_id (Union[int, CommonRelationshipBitId]) – The identifier of the Relationship Bit to remove.
Returns:

True, if the relationship bit was removed successfully. False, if not.

Return type:

bool

Interactions

class CommonSimInteractionUtils

Bases: object

Utilities for manipulating the interactions of Sims.

static cancel_all_queued_interactions(sim_info, cancel_reason, finishing_type=FinishingType.USER_CANCEL, include_interaction_callback=None, **kwargs)

Cancel all interactions that a Sim currently has queued.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim
  • cancel_reason (str) – The reason for the cancellation.
  • finishing_type (FinishingType, optional) – The type of finish to finish the interaction with. Default is FinishingType.USER_CANCEL.
  • include_interaction_callback (Callable[[Interaction], bool], optional) – If the result of this callback is True, the Interaction will be cancelled. If set to None, All interactions will be cancelled. Default is None.
Returns:

True, if all queued interactions were successfully cancelled. False, if not.

Return type:

bool

static cancel_all_queued_or_running_interactions(sim_info, cancel_reason, finishing_type=FinishingType.USER_CANCEL, include_interaction_callback=None, **kwargs)

Cancel all interactions that a Sim currently has queued or is currently running.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim
  • cancel_reason (str) – The reason for the cancellation.
  • finishing_type (FinishingType, optional) – The type of finish to finish the interaction with. Default is FinishingType.USER_CANCEL.
  • include_interaction_callback (Callable[[Interaction], bool], optional) – If the result of this callback is True, the Interaction will be cancelled. If set to None, All interactions will be cancelled. Default is None.
Returns:

True, if all queued and running interactions were successfully cancelled. False, if not.

Return type:

bool

static cancel_all_running_interactions(sim_info, cancel_reason, finishing_type=FinishingType.USER_CANCEL, include_interaction_callback=None, **kwargs)

Cancel all interactions that a Sim is currently running.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim
  • cancel_reason (str) – The reason for the cancellation.
  • finishing_type (FinishingType, optional) – The type of finish to finish the interaction with. Default is FinishingType.USER_CANCEL.
  • include_interaction_callback (Callable[[Interaction], bool], optional) – If the result of this callback is True, the Interaction will be cancelled. If set to None, All interactions will be cancelled. Default is None.
Returns:

True, if all running interactions were successfully cancelled. False, if not.

Return type:

bool

static create_interaction_context(sim_info, interaction_source=InteractionContext.SOURCE_SCRIPT_WITH_USER_INTENT, priority=Priority.High, run_priority=Priority.High, insert_strategy=QueueInsertStrategy.NEXT, must_run_next=False, **kwargs)

Create an InteractionContext.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • interaction_source (InteractionSource, optional) – The source of the interaction. Default is InteractionContext.SOURCE_SCRIPT_WITH_USER_INTENT.
  • priority (Priority, optional) – The priority of the interaction. Default is Priority.High.
  • run_priority (Union[Priority, None], optional) – The priority of running the interaction. Default is Priority.High.
  • insert_strategy (QueueInsertStrategy, optional) – The insert strategy for the interaction. Default is QueueInsertStrategy.NEXT.
  • must_run_next (bool, optional) – If True, the interaction will run next. Default is False.
Returns:

An interaction context for use with interactions or None if a problem occurs.

Return type:

Union[InteractionContext, None]

static get_queued_interactions_gen(sim_info, include_interaction_callback=None)

Retrieve all interactions that a Sim currently has queued.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim
  • include_interaction_callback (Callable[[Interaction], bool], optional) – If the result of this callback is True, the Interaction will be included in the results. If set to None, All interactions will be included. Default is None.
Returns:

An iterable of Interactions that pass the include callback filter.

Return type:

Iterator[Interaction]

static get_running_interactions_gen(sim_info, include_interaction_callback=None)

Retrieve all interactions that a Sim is currently running.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim
  • include_interaction_callback (Callable[[Interaction], bool], optional) – If the result of this callback is True, the Interaction will be included in the results. If set to None, All interactions will be included. Default is None.
Returns:

An iterable of Interactions that pass the include callback filter.

Return type:

Iterator[Interaction]

static get_stand_interaction(sim_info)

Retrieve a Stand interaction appropriate for a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The decimal identifier of a Stand interaction appropriate for the Sim or -1 if no Stand interaction was found to be appropriate.
Return type:Union[int, CommonInteractionId]
static get_swim_interaction(sim_info)

Retrieve a Swim interaction appropriate for a Sim.

Note

Cats do not have an appropriate Swim interaction.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The decimal identifier of an interaction appropriate for the Sim or -1 if no interaction was found to be appropriate.
Return type:Union[int, CommonInteractionId]
static has_interaction_queued(sim_info, interaction_id)

Determine if a Sim is running the specified interaction.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • interaction_id (Union[int, CommonInteractionId]) – The identifier of the interaction to check for.
Returns:

True, if the Sim has the specified interaction queued. False, if not.

Return type:

bool

static has_interaction_running(sim_info, interaction_id)

Determine if a Sim is running the specified interaction.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • interaction_id (Union[int, CommonInteractionId]) – The identifier of the interaction to check for.
Returns:

True, if the Sim has the specified interaction running. False, if not.

Return type:

bool

static has_interaction_running_or_queued(sim_info, interaction_id)

Determine if a Sim has the specified interaction running or in their interaction queue.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • interaction_id (Union[int, CommonInteractionId]) – The identifier of the interaction to check for.
Returns:

True, if the Sim has the specified interaction running or queued. False, if not.

Return type:

bool

static has_interactions_queued(sim_info, interaction_ids)

Determine if a Sim has any of the specified interactions in their interaction queue.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • interaction_ids (Union[int, CommonInteractionId]) – An iterable of identifiers of the interactions to check for.
Returns:

True, if the Sim has any of the specified interactions queued. False, if not.

Return type:

bool

static has_interactions_running(sim_info, interaction_ids)

Determine if a Sim is running any of the specified interactions.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • interaction_ids (Union[int, CommonInteractionId]) – An iterable of identifiers of the interactions to check for.
Returns:

True, if the Sim has any of the specified interactions running. False, if not.

Return type:

bool

static has_interactions_running_or_queued(sim_info, interaction_ids)

Determine if a Sim has any of the specified interactions running or in their interaction queue.

Parameters:
  • sim_info (SimInfo) – The Sim to check.
  • interaction_ids (Union[int, CommonInteractionId]) – An iterable of identifiers of the interactions to check for.
Returns:

True, if the Sim has any of the specified interactions running or queued. False, if not.

Return type:

bool

static is_sitting(sim_info)

Determine if a Sim is currently sitting.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is sitting. False, if not.
Return type:bool
static is_standing(sim_info)

Determine if a Sim is standing.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is standing. False, if not.
Return type:bool
static is_swimming(sim_info)

Determine if a Sim is swimming.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is swimming. False, if not.
Return type:bool
static lock_interaction_queue(sim_info)

Lock the interaction queue of a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.
static queue_interaction(sim_info, interaction_id, social_super_interaction_id=None, target=None, interaction_context, skip_if_running=False, **kwargs)

Push an Interaction into the queue of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of an interaction.
  • social_super_interaction_id (Union[int, CommonInteractionId], optional) – The decimal identifier of a social super interaction to queue the interaction under. Default is None
  • target (Any, optional) – The target of the interaction. Default is None.
  • interaction_context (InteractionContext, optional) – The context to queue the interaction with. See also create_interaction_context(). Default is None.
  • skip_if_running – If True, the interaction will not be queued, if it is already queued or running. If False, the interaction will be queued, even if it is already queued or running.
Returns:

The result of pushing the interaction to the queue of a Sim.

Return type:

EnqueueResult

static queue_mixer_interaction(sim_info, mixer_interaction_id, target=None, interaction_context=None, **kwargs)

Push a Mixer Interaction into the Queue of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • mixer_interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of a mixer interaction.
  • target (Any, optional) – The target of the interaction. Default is None.
  • interaction_context (InteractionContext, optional) – The context to queue the interaction with. See also create_interaction_context(). Default is None.
Returns:

The result of pushing the interaction to the queue of a Sim.

Return type:

EnqueueResult

static queue_social_mixer_interaction(sim_info, social_mixer_interaction_id, social_super_interaction_id, target=None, interaction_context=None, **kwargs)

Push a Social Mixer Interaction into the queue of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • social_mixer_interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of a social mixer interaction.
  • social_super_interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of a social super interaction to queue the social mixer interaction under.
  • target (Any, optional) – The target of the interaction. Default is None.
  • interaction_context (InteractionContext, optional) – The context to queue the interaction with. See also create_interaction_context(). Default is None.
Returns:

The result of pushing the interaction to the queue of a Sim.

Return type:

EnqueueResult

static queue_super_interaction(sim_info, super_interaction_id, target=None, interaction_context=None, **kwargs)

Push a Super Interaction into the queue of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • super_interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of a super interaction.
  • target (Any, optional) – The target of the interaction. Default is None.
  • interaction_context (InteractionContext, optional) – The context to queue the interaction with. See also create_interaction_context(). Default is None.
Returns:

The result of pushing the interaction to the queue of a Sim.

Return type:

EnqueueResult

static test_interaction(sim_info, interaction_id, social_super_interaction_id=None, target=None, interaction_context, skip_if_running=False, **kwargs)

Test to see if an Interaction can be pushed into the queue of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of an interaction.
  • social_super_interaction_id (Union[int, CommonInteractionId], optional) – The decimal identifier of a social super interaction to queue the interaction under. Default is None
  • target (Any, optional) – The target of the interaction. Default is None.
  • interaction_context (InteractionContext, optional) – The context to queue the interaction with. See also create_interaction_context(). Default is None.
Returns:

The result of testing a push of the interaction to the queue of a Sim.

Return type:

TestResult

static test_mixer_interaction(sim_info, mixer_interaction_id, target=None, interaction_context=None, **kwargs)

Test to see if a Mixer Interaction can be pushed into the Queue of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • mixer_interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of a mixer interaction.
  • target (Any, optional) – The target of the interaction. Default is None.
  • interaction_context (InteractionContext, optional) – The context to queue the interaction with. See also create_interaction_context(). Default is None.
Returns:

The result of testing a push of the interaction to the queue of a Sim.

Return type:

TestResult

static test_social_mixer_interaction(sim_info, social_mixer_interaction_id, social_super_interaction_id, target=None, interaction_context=None, **kwargs)

Test to see if a Social Mixer Interaction can be pushed into the queue of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • social_mixer_interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of a social mixer interaction.
  • social_super_interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of a social super interaction to queue the social mixer interaction under.
  • target (Any, optional) – The target of the interaction. Default is None.
  • interaction_context (InteractionContext, optional) – The context to queue the interaction with. See also create_interaction_context(). Default is None.
Returns:

The result of testing a push of the interaction to the queue of a Sim.

Return type:

TestResult

static test_super_interaction(sim_info, super_interaction_id, target=None, interaction_context=None, **kwargs)

Test to see if a Super Interaction can be pushed into the queue of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • super_interaction_id (Union[int, CommonInteractionId]) – The decimal identifier of a super interaction.
  • target (Any, optional) – The target of the interaction. Default is None.
  • interaction_context (InteractionContext, optional) – The context to queue the interaction with. See also create_interaction_context(). Default is None.
Returns:

The result of testing a push of the interaction to the queue of a Sim.

Return type:

TestResult

static unlock_interaction_queue(sim_info)

Unlock the interaction queue of a Sim.

Parameters:sim_info (SimInfo) – An instance of a Sim.

Pregnancy

class CommonSimPregnancyUtils

Bases: object

Utilities for manipulating the pregnancy status of Sims.

static can_be_impregnated(sim_info)

Determine if a Sim can be impregnated.

Parameters:sim_info (SimInfo) – The Sim being checked.
Returns:True, if they can. False, if they cannot.
Return type:bool
static can_impregnate(sim_info)

Determine if a Sim can impregnate other sims.

Parameters:sim_info (SimInfo) – The Sim being checked.
Returns:True, if they can. False, if they cannot.
Return type:bool
static clear_pregnancy(sim_info)

Clear the pregnancy status of a Sim.

Parameters:sim_info (SimInfo) – The Sim being cleared.
Returns:True, if successful. False, if not.
Return type:bool
static get_in_labor_buff(sim_info)

Retrieve an In Labor buff appropriate for causing the Sim to go into labor (Give Birth).

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:The decimal identifier of a Buff that will cause the specified Sim to go into labor. If no appropriate Buff is found, -1 will be returned.
Return type:Union[int, CommonBuffId]
static get_partner_of_pregnant_sim(sim_info)

Retrieve a SimInfo object of the Sim that impregnated the specified Sim.

Parameters:sim_info (SimInfo) – The Sim being checked.
Returns:The Sim that has impregnated the specified Sim or None if the Sim does not have a partner.
Return type:Union[SimInfo, None]
static get_pregnancy_progress(sim_info)

Retrieve the pregnancy progress of a Sim.

Parameters:sim_info (SimInfo) – The Sim being checked.
Returns:The current progress of the pregnancy of a Sim.
Return type:float
static get_pregnancy_rate(sim_info)

Retrieve the rate at which pregnancy progresses.

Parameters:sim_info (SimInfo) – The Sim being checked.
Returns:The rate at which the pregnancy state of a Sim is progressing.
Return type:float
static is_pregnant(sim_info)

Determine if the specified Sim is pregnant.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is pregnant. False, if not.
Return type:bool
static start_pregnancy(sim_info, partner_sim_info, pregnancy_origin=PregnancyOrigin.DEFAULT)

Start a pregnancy between a Sim and a Partner Sim.

Parameters:
  • sim_info (SimInfo) – The Sim getting pregnant.
  • partner_sim_info (SimInfo) – The Sim that is getting the other Sim pregnant.
  • pregnancy_origin (PregnancyOrigin, optional) – The origin of the pregnancy. Default is PregnancyOrigin.DEFAULT.
Returns:

True, if the Sim is successfully impregnated by the Partner Sim. False, if not.

Return type:

bool

State

class CommonSimStateUtils

Bases: object

Utilities for checking the state of a sim.

static is_dying(sim_info)

Determine if a Sim is currently dying.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is dying. False, if the Sim is not dying.
Return type:bool
static is_hidden(sim_info)

Determine if a Sim is hidden.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is hidden. False, if the Sim is not hidden.
Return type:bool
static is_in_sunlight(sim_info)

Determine if a Sim is in sunlight.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is in sunlight. False, if the Sim is not in sunlight.
Return type:bool
static is_leaving_zone(sim_info)

Determine if a Sim is currently leaving the zone.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is leaving the zone. False, if the Sim is not leaving the zone.
Return type:bool
static is_visible(sim_info)

Determine if a Sim is visible.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is visible. False, if the Sim is not visible.
Return type:bool
static is_wearing_towel(sim_info)

Determine if a Sim is wearing a towel.

..warning:: Obsolete: Use is_wearing_towel() in CommonOutfitUtils instead.

Types

class CommonSimTypeUtils

Bases: object

Utilities for determining the type of a Sim. i.e. Player, NPC, Service, etc.

static is_non_player_sim(sim_info)

Determine if a Sim is a Non Player Sim.

Note

An NPC Sim is a sim that is not a part of the active household.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is an NPC. False, if not.
Return type:bool
static is_played_sim(sim_info)

Determine if a Sim is a Played Sim.

Note

This does not indicate whether or not a Sim is a Player Sim or Non Player Sim.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Played Sim. False, if not.
Return type:bool
static is_player_sim(sim_info)

Determine if a Sim is a Player Sim.

Note

A Player Sim is a Sim that is a part of the active household.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Player Sim. False, if not.
Return type:bool
static is_service_sim(sim_info: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe488498d90>) → bool

Determine if a Sim is a Service Sim.

Note

Service Sims:

  • Butler
  • Chalet
  • City Repair
  • Forest Ranger
  • Gardener
  • Grim Reaper
  • Maid
  • Mailman
  • Massage Therapist
  • Master Fisherman
  • Master Gardener
  • Master Herbalist
  • Nanny
  • Pizza Delivery
  • Repairman
  • Restaurant Critic
  • Statue Busker
Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim is a Service Sim. False, if not.
Return type:bool

Phone

class CommonPhoneUtils

Bases: object

Utilities for manipulating the Phone.

static phone_is_silenced()

Determine if the phone is silenced.

Returns:True, if the Phone is silenced. False, if not.
Return type:bool
static silence_phone()

Silence the phone.

static unsilence_phone()

Unsilence the phone.

Club

class CommonSimClubUtils

Bases: object

Utilities for manipulating the Clubs of Sims.

static is_engaged_in_club_gathering(sim_info)

Determine if a Sim is engaged in a Club Gathering.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if the Sim is engaged in a Club Gathering. False, if not.
Return type:bool

Gender Preferences

class CommonSimGenderPreferenceUtils

Bases: object

Utilities for Sim gender preferences.

HIGH_PREFERENCE_THRESHOLD = 20
LOW_PREFERENCE_THRESHOLD = 5
classmethod determine_preferred_genders(sim_info, like_threshold=None, love_threshold=None)

Determine which genders a Sim prefers.

Note

The math is as follows (The first match will return):

  • Default Gender Preferences = MALE_PREF < like_threshold and FEMALE_PREF < like_threshold
  • Prefers both Genders = absolute(MALE_PREF - FEMALE_PREF) <= love_threshold
  • Prefers Male = MALE_PREF > FEMALE_PREF
  • Prefers Female = FEMALE_PREF > MALE_PREF
Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • like_threshold (int, optional) – A value indicating a low amount of preference. Default is cls.LOW_PREFERENCE_THRESHOLD.
  • love_threshold (int, optional) – A value indicating a high amount of preference. Default is cls.HIGH_PREFERENCE_THRESHOLD.
Returns:

A collection of Genders the specified Sim prefers.

Return type:

Tuple[Gender]

static get_default_preferred_genders(sim_info)

Retrieve a collection of default gender preferences.

Note

By default Male Sims prefer Female Sims and Female Sims prefer Male Sims.

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:A collection of preferred Genders.
Return type:Tuple[Gender]
static get_gender_preference_amount(sim_info: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe47f892950>, gender: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe47f892f90>) → int

get_gender_preference_value(sim_info, gender)

Retrieve the amount a Sim prefers the specified gender.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • gender (Gender) – A Gender.
Returns:

The amount the Sim prefers the specified Gender.

Return type:

int

static has_preference_for(sim_info, target_sim_info, like_threshold=None, love_threshold=None)

Determine if a Sim has a preference for another Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • target_sim_info (SimInfo) – An instance of a Sim.
  • like_threshold (int, optional) – A value indicating a low amount of preference. Default is CommonSimGenderPreferenceUtils.LOW_PREFERENCE_THRESHOLD.
  • love_threshold (int, optional) – A value indicating a high amount of preference. Default is CommonSimGenderPreferenceUtils.HIGH_PREFERENCE_THRESHOLD.
Returns:

True, if the Sim has a preference for the Gender. False, if not.

Return type:

bool

static has_preference_for_gender(sim_info, gender, like_threshold=None, love_threshold=None)

Determine if a Sim has a preference for the specified Gender.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • gender (Gender) – A Gender.
  • like_threshold (int, optional) – A value indicating a low amount of preference. Default is CommonSimGenderPreferenceUtils.LOW_PREFERENCE_THRESHOLD.
  • love_threshold (int, optional) – A value indicating a high amount of preference. Default is CommonSimGenderPreferenceUtils.HIGH_PREFERENCE_THRESHOLD.
Returns:

True, if the Sim has a preference for the Gender. False, if not.

Return type:

bool

static set_gender_preference_amount(sim_info, gender, amount)

Set the amount a Sim prefers the specified Gender.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • gender (Gender) – A Gender.
  • amount (int) – The amount the Sim prefers the specified Gender.
Returns:

True, if successfully set. False, it not.

Return type:

bool

Gender Options

class CommonSimGenderOptionUtils

Bases: object

Utilities for manipulating the Gender Options of Sims.

static can_be_impregnated(sim_info)

Determine if a sim Can Be Impregnated.

Note

Use can_reproduce() for Pet Sims.

Note

Will return False if the sim has the GENDER_OPTIONS_PREGNANCY_CAN_NOT_BE_IMPREGNATED trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can be impregnated. False, if the Sim can not be impregnated.
Return type:bool
static can_create_pregnancy(sim_info)

Determine if a Sim can either impregnate, be impregnated, or can reproduce.

Note

Will return False if the Sim can both impregnate and not impregnate, if the Sim can both be impregnated and not be impregnated or if the Sim can both reproduce and not reproduce.

Note

A Sim can impregnate when they can either impregnate other Sims, can be impregnated by other Sims, or if they are a Pet, can reproduce.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can create pregnancies. False, if the Sim can not create pregnancies.
Return type:bool
static can_impregnate(sim_info)

Determine if a sim Can Impregnate.

Note

Use can_reproduce() for Pet Sims.

Note

This will check for a sim to not also have the GENDER_OPTIONS_PREGNANCY_CAN_NOT_IMPREGNATE trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can impregnate other Sims. False, if the Sim can not impregnate other Sims.
Return type:bool
static can_not_be_impregnated(sim_info)

Determine if a sim Can Not Be Impregnated.

Note

Use can_not_reproduce() for Pet Sims.

Note

Will return False if the sim has the GENDER_OPTIONS_PREGNANCY_CAN_BE_IMPREGNATED trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can not be impregnated. False, if the Sim can be impregnated.
Return type:bool
static can_not_impregnate(sim_info)

Determine if a sim Can Not Impregnate.

Note

Use can_not_reproduce() for Pet Sims.

Note

This will check for a sim to not also have the GENDER_OPTIONS_PREGNANCY_CAN_IMPREGNATE trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can not impregnate other Sims. False, if the Sim can impregnate other Sims.
Return type:bool
static can_not_reproduce(sim_info)

Determine if a pet sim can reproduce.

..note:: Use can_not_impregnate() and can_not_be_impregnated() for Human Sims. .. note:: Will return False if the pet sim has the PREGNANCY_OPTIONS_PET_CAN_REPRODUCE trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can not reproduce. False, if the Sim can reproduce.
Return type:bool
static can_reproduce(sim_info)

Determine if a Pet Sim can reproduce.

Note

Use can_impregnate() and can_be_impregnated() for Human Sims.

Note

Will return False if the Pet Sim has the PREGNANCY_OPTIONS_PET_CAN_NOT_REPRODUCE trait.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim can reproduce. False, if the Sim can not reproduce.
Return type:bool
static has_feminine_frame(sim_info)

Determine if a sim has a Feminine Body Frame.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static has_masculine_frame(sim_info)

Determine if a sim has a Masculine Body Frame.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static prefers_menswear(sim_info)

Determine if a sim prefers Mens Clothing.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static prefers_womenswear(sim_info)

Determine if a sim prefers Womens Clothing.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim does. False, if the Sim does not.
Return type:bool
static update_body_frame(sim_info, masculine)

Update the Body Frame of a Sim.

Note

Will only update Human Sims.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • masculine (bool) – If True, the Sim will get a Masculine frame. If False, the Sim will get a Feminine frame.
Returns:

True, if successful. False, if not.

Return type:

bool

static update_can_be_impregnated(sim_info, can_be_impregnated)

Update a Sims ability to be impregnated by other Sims.

Note

Will only update Human Sims.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • can_be_impregnated (bool) – If True, the Sim will have the ability to be impregnated. If False, the Sim will not have the ability to be impregnated.
Returns:

True, if successful. False, if not.

Return type:

bool

static update_can_impregnate(sim_info, can_impregnate)

Update a Sims ability to impregnate other Sims.

Note

Will only update Human Sims.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • can_impregnate (bool) – If True, the Sim will have the ability to impregnate other Sims. If False, the Sim will not have the ability to impregnate other Sims.
Returns:

True, if successful. False, if not.

Return type:

bool

static update_can_reproduce(sim_info, can_reproduce)

Update a Sims ability to reproduce.

Note

Will only update Pet Sims.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • can_reproduce (bool) – If True, the Sim will have the ability to reproduce. If False, the Sim will not have the ability to reproduce.
Returns:

True, if successful. False, if not.

Return type:

bool

static update_clothing_preference(sim_info, prefer_menswear)

Update the Clothing Preference of a Sim.

Note

Will only update Human Sims.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • prefer_menswear (bool) – If True, the Sim will prefer Menswear. If False, the Sim will prefer Womenswear.
Returns:

True, if successful. False, if not.

Return type:

bool

static update_gender_options_to_vanilla_female(sim_info)

Update a Sim to the vanilla Sims 4 default gender options for Female Sims. (Feminine, Womenswear Preference, etc.)

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if successful. False, if not.
Return type:bool
static update_gender_options_to_vanilla_male(sim_info)

Update a Sim to the vanilla Sims 4 default gender options for Male Sims. (Masculine, Menswear Preference, etc.)

Parameters:sim_info (SimInfo) – An instance of a Sim.
Returns:True, if successful. False, if not.
Return type:bool
static update_toilet_usage(sim_info, uses_toilet_standing)

Update how a Sim uses the toilet. i.e. Toilet Standing or Toilet Sitting.

Note

Will only update Human Sims.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • uses_toilet_standing (bool) – If True, the Sim will use toilets while standing. If False, the Sim will use toilets while sitting.
Returns:

True, if successful. False, if not.

Return type:

bool

static uses_toilet_sitting(sim_info)

Determine if a sim uses the toilet while sitting.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim uses toilets while sitting. False, if the Sim does not use toilets while sitting.
Return type:bool
static uses_toilet_standing(sim_info)

Determine if a sim uses the toilet while standing.

Parameters:sim_info (SimInfo) – The Sim to check.
Returns:True, if the Sim uses toilets while standing. False, if the Sim does not use toilets while standing.
Return type:bool

Inventory

class CommonSimInventoryUtils

Bases: object

Utilities for manipulating the inventory of Sims.

static add_to_inventory(sim_info, object_definition_id, count=1)

Add a number of Newly Created Objects to the Inventory of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • object_id (int) – The decimal identifier of an Object.
  • count (int, optional) – The number of the specified Object to add. Default is 1.
Returns:

True, if the count of the specified Object were added successfully. False, it not.

Return type:

bool

static get_all_objects_in_inventory_gen(sim_info, include_object_callback=None)

Retrieve all Objects in the inventory of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • include_object_callback (Callable[[int], bool], optional) – If the result of this callback is True, the object will be included in the results. If set to None, All objects in the inventory will be included.
Returns:

An iterator containing the decimal identifiers for the objects in the inventory of a Sim.

Return type:

Iterator[GameObject]

static get_count_of_object_in_inventory(sim_info, object_id)

Count the number of an Object in the inventory of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • object_id (int) – The decimal identifier of an object.
Returns:

The number of the specified Object in the inventory of the specified Sim.

Type:

int

static move_object_to_inventory(sim_info, game_object)

Move an Object to the inventory of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • game_object (GameObject) – An instance of an Object.
Returns:

True, if the object was successfully moved to the inventory of the specified Sim. False, if not.

Return type:

bool

static move_objects_to_inventory(sim_info, game_objects)

Move Objects to the inventory of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • game_objects (GameObject) – A collection of Object instances.
Returns:

True, if all objects were successfully moved to the inventory of the specified Sim. False, if not.

Return type:

bool

static remove_from_inventory(sim_info, object_id, count=1)

Remove a number of Objects from the inventory of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • object_id (int) – The decimal identifier of an Object.
  • count (int, optional) – The amount of the Object to remove. Default is 1.
Returns:

True, if the count of the specified Object were removed successfully. False, if not.

static remove_from_inventory_by_definition(sim_info: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe47f5742d0>, object_definition: <sphinx.ext.autodoc.importer._MockObject object at 0x7fe47f66e190>, count: int = 1) → bool

remove_from_inventory(sim_info, object_id, count=1)

Remove a number of Objects from the inventory of a Sim.

Parameters:
  • sim_info (SimInfo) – An instance of a Sim.
  • object_definition (ObjectDefinition) – The definition of an Object.
  • count (int, optional) – The amount of the Object to remove. Default is 1.
Returns:

True, if the count of the specified Object were removed successfully. False, if not.