Sim Utilities¶
Fundamentals¶
Names¶
- class CommonSimNameUtils¶
Bases:
objectUtilities for manipulating the name of Sims.
- static create_random_first_name(gender, species=sims4communitylib.enums.common_species.CommonSpecies.HUMAN, sim_name_type=sims4communitylib.enums.common_sim_name_type.CommonSimNameType.DEFAULT)¶
Create a random first name.
- Parameters:
gender (CommonGender) – A gender.
species (CommonSpecies, optional) – A species. Default is HUMAN.
sim_name_type (CommonSimNameType, optional) – The Sim Name Type determines from which list of names to randomize the name from. Default is CommonSimNameType.DEFAULT.
- Returns:
A random first name.
- Return type:
str
- static create_random_last_name(gender, species=sims4communitylib.enums.common_species.CommonSpecies.HUMAN, sim_name_type=sims4communitylib.enums.common_sim_name_type.CommonSimNameType.DEFAULT)¶
Create a random last name.
- Parameters:
gender (CommonGender) – A gender.
species (CommonSpecies, optional) – A species. Default is HUMAN.
sim_name_type (CommonSimNameType, optional) – The Sim Name Type determines from which list of names to randomize the name from. Default is CommonSimNameType.DEFAULT.
- Returns:
A random last name.
- Return type:
str
- 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
- static has_name(sim_info)¶
Determine if a Sim has a name.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the specified Sim has a name. False, if not.
- Return type:
bool
- static set_first_name(sim_info, first_name)¶
Retrieve the First Name of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to set the first name of.
first_name (str) – The first name you want the Sim to have.
- static set_last_name(sim_info, last_name)¶
Retrieve the Last Name of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to set the last name of.
last_name (str) – The last name you want the Sim to have.
Age¶
- class CommonAgeUtils¶
Bases:
objectUtilities for manipulating Ages of Sims.
- classmethod 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
- classmethod convert_to_approximate_age(age)¶
Convert an age to an approximate Age value.
- Parameters:
age (Union[CommonAge, Age, int]) – An Age.
- Returns:
The specified Age converted into an approximate Age value.
- Return type:
Age
- classmethod get_age(sim_info, exact_age=False)¶
Retrieve the Age of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to get the Age of.
exact_age (bool, optional) – If set to True, the exact age of the Sim will be returned (Age 24 will be returned as 24). If set to False, the age of the Sim rounded to the nearest Age value will be returned. (Age 24 will be returned as Age.YOUNGADULT). Default is False.
- Returns:
The Age of the Sim or None if a problem occurs.
- Return type:
Union[Age, None]
- classmethod get_birth_age(sim_info)¶
Retrieve the Age that New Sims will be, if they are born from a specified Sim.
Note
Human Sims start at the BABY age. Pet Sims (Large Dog, Small Dog, Cat, Horse) start at the CHILD age. Fox Sims start at the ADULT age.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
The Age that New Sims will be, if they are born from the specified Sim.
- Return type:
Age
- classmethod get_birth_age_from_species(species)¶
Retrieve the Age that New Sims will be, if they are born with a specified Species.
Note
The HUMAN species starts at the BABY age. The Pet species (Large Dog, Small Dog, Cat, Horse) start at the CHILD age. The FOX species starts at the ADULT age.
- Parameters:
species (Union[Species, SpeciesExtended, int]) – The species to retrieve information for.
- Returns:
The Age that New Sims will be, if they are born with the specified Species or None if an Age is not found for the specified Species.
- Return type:
Union[Age, None]
- classmethod get_percentage_total_days_sim_has_been_in_their_current_age(sim_info)¶
Retrieve the percentage total days a Sim has been in their current age.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The percentage total days the specified Sim has been in their current age.
- Return type:
float
- classmethod get_total_days_sim_has_been_in_their_current_age(sim_info)¶
Retrieve the total number of days a Sim has been in their current Age.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
A total number of days the specified Sim has been in their current Age.
- Return type:
float
- classmethod get_total_days_to_age_up(sim_info)¶
Retrieve the total number of days required for the next age of a Sim to be required. (Not to be confused with the amount of days they have left)
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The total number of days required for the specified Sim to reach their next age.
- Return type:
float
- classmethod get_total_days_until_sim_ages_up(sim_info)¶
Retrieve the total number of days a Sim has left until they age up.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The total number of days the specified Sim has left until they age up.
- Return type:
int
- classmethod has_age(sim_info, age, exact_age=False)¶
Determine if a Sim has a matching Age.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
age (Union[CommonAge, Age, int]) – The age to check.
exact_age (bool, optional) – If True, the Sims exact age will be used. If False, the Sims approximate age will be used. In most cases, this should be False. Default is False.
- Returns:
True, if the age of the specified Sim matches the specified age. False, if not.
- Return type:
bool
- classmethod has_any_age(sim_info, ages, exact_age=False)¶
Determine if a Sim has an Age matching any of the specified Ages.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
ages (Iterator[Union[CommonAge, Age, int]]) – The ages to check.
exact_age (bool, optional) – If True, the Sims exact age will be used. If False, the Sims approximate age will be used. In most cases, this should be False. Default is False.
- Returns:
True, if the age of the specified Sim matches any of the specified ages. False, if not.
- Return type:
bool
- classmethod 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
- classmethod is_adult_age(age)¶
Determine if an Age is a Young Adult or an Adult.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_adult_or_elder_age(age)¶
Determine if an age is Young Adult, Adult, or Elder.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod is_age_available_for_sim(sim_info, age)¶
Determine if an Age is available for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
age (CommonAge) – The age to check.
- Returns:
True, if the specified Age is available for the specified Sim. False, if not.
- Return type:
bool
- classmethod 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
- classmethod is_baby_age(age)¶
Determine if an Age is a Baby.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod is_baby_child_or_toddler(sim_info)¶
Warning
Obsolete: Don’t use this function. Use the :func:’~is_baby_toddler_or_child’ function instead.
- Return type:
bool
- classmethod is_baby_infant_or_toddler(sim_info)¶
Determine if a Sim is a Baby, Infant, 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
- classmethod is_baby_infant_or_toddler_age(age)¶
Determine if an age is Baby or Toddler.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod is_baby_infant_toddler_or_child(sim_info)¶
Determine if a Sim is a Baby, Infant, 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
- classmethod is_baby_infant_toddler_or_child_age(age)¶
Determine if an age is Baby, Infant, Toddler, or Child.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_baby_or_toddler_age(age)¶
Determine if an age is Baby or Toddler.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_baby_toddler_or_child_age(age)¶
Determine if an age is Baby, Toddler, or Child.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_child_age(age)¶
Determine if an Age is a Child.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_child_or_teen_age(age)¶
Determine if an age is Child or Teen.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_elder_age(age)¶
Determine if an Age is an Elder.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod is_infant(sim_info)¶
Determine if a Sim is an Infant.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is. False, if the Sim is not.
- Return type:
bool
- classmethod is_infant_age(age)¶
Determine if an Age is an Infant.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_mature_adult_age(age)¶
Determine if an Age is an Adult.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_mature_adult_or_elder_age(age)¶
Determine if an age is Adult or Elder.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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[CommonAge, 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
- classmethod 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
- classmethod 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
- classmethod is_teen_adult_or_elder_age(age)¶
Determine if an age is Teen, Young Adult, Adult, or Elder.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod is_teen_age(age)¶
Determine if an Age is a Teen.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_teen_or_adult_age(age)¶
Determine if an age is Teen, Young Adult, or Adult.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_teen_or_young_adult_age(age)¶
Determine if an age is Teen or Young Adult.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_toddler_age(age)¶
Determine if an Age is a Toddler.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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
- classmethod is_toddler_or_child_age(age)¶
Determine if an age is Toddler or Child.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod is_young_adult(sim_info)¶
Determine if a Sim is a 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
- classmethod is_young_adult_age(age)¶
Determine if an Age is a Young Adult.
- Parameters:
age (Union[CommonAge, Age, int]) – The age to check.
- Returns:
True, if it is. False, if it is not.
- Return type:
bool
- classmethod 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[CommonAge, 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
- classmethod set_age(sim_info, age)¶
Set the Age of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to set the Age of.
age (Union[CommonAge, Age, int]) – The Age to set the Sim to.
- Returns:
True, if the Age was set successfully. False, if not.
- Return type:
bool
- classmethod set_percentage_total_days_sim_has_been_in_their_current_age(sim_info, percentage_progress)¶
Set the percentage total days a Sim has been in their current age.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
percentage_progress (int) – A percentage total days a Sim has been in their current age.
- Return type:
None
- classmethod set_total_days_sim_has_been_in_their_current_age(sim_info, days)¶
Set the total number of days of progress made towards the next age of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
days (float) – The total number of days the Sim has been in their current age.
- Return type:
None
Species¶
- class CommonSpeciesUtils¶
Bases:
objectUtilities for manipulating and checking the Species of Sims.
- classmethod 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
- classmethod 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, SpeciesExtended, None]
- classmethod is_animal(sim_info)¶
Determine if a Sim is an Animal.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is an Animal (Large Dog, Small Dog, Cat, Fox). False, if not.
- Return type:
bool
- classmethod is_animal_species(species)¶
Determine if a Species is an Animal.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to check.
- Returns:
True, if the Species is an Animal Species (Large Dog, Small Dog, Cat, or Fox). False, if not.
- Return type:
bool
- classmethod 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
- classmethod is_cat_species(species)¶
Determine if a Species is a Cat.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to check.
- Returns:
True, if the Species is a Cat Species. False, if not.
- Return type:
bool
- classmethod 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
- classmethod is_dog_species(species)¶
Determine if a Species is a Dog.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to check.
- Returns:
True, if the Species is a Dog Species (Large Dog, Small Dog). False, if not.
- Return type:
bool
- classmethod is_fox(sim_info)¶
Determine if a Sim is a Fox.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is a Fox. False, if not.
- Return type:
bool
- classmethod is_fox_species(species)¶
Determine if a Species is a Fox.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to check.
- Returns:
True, if the Species is a Fox Species. False, if not.
- Return type:
bool
- classmethod is_horse(sim_info)¶
Determine if a Sim is a Horse.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is a Horse. False, if not.
- Return type:
bool
- classmethod is_horse_species(species)¶
Determine if a Species is a Horse.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to check.
- Returns:
True, if the Species is a Horse Species. False, if not.
- Return type:
bool
- classmethod 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
- classmethod is_human_species(species)¶
Determine if a Species is a Human.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to check.
- Returns:
True, if the Species is Human. False, if not.
- Return type:
bool
- classmethod 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
- classmethod is_large_dog_species(species)¶
Determine if a Species is a Large Dog.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to check.
- Returns:
True, if the Species is a Large Dog Species. False, if not.
- Return type:
bool
- classmethod 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
- classmethod is_pet_species(species)¶
Determine if a Species is a Pet.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, 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
- classmethod 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
- classmethod is_small_dog_species(species)¶
Determine if a Species is a Small Dog.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to check.
- Returns:
True, if the Species is a Small Dog Species. False, if not.
- Return type:
bool
- classmethod set_species(sim_info, species)¶
Set the Species of a sim.
- Parameters:
sim_info (SimInfo) – The Sim to set the Species of.
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The Species to set the Sim to.
- Returns:
True, if successful. False, if not.
- Return type:
bool
Age and Species¶
- class CommonAgeSpeciesUtils¶
Bases:
objectUtilities 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_animal(sim_info)¶
Determine if a sim is an Adult Animal (Cat, Small Dog, Large Dog, Fox).
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is an Adult Pet (Cat, Small Dog, Large Dog, Fox). False, if the Sim is 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_animal(sim_info)¶
Determine if a sim is a Young Adult, Adult, or Elder Human or an Adult Animal (Cat, Small Dog, Large Dog, Fox).
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is a Young Adult, Adult, or Elder Human or an Adult Animal (Cat, Small Dog, Large Dog, Fox). 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_animal(sim_info)¶
Determine if a sim is a Child Animal (Cat, Small Dog, Large Dog, Fox).
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is a Child Animal (Cat, Small Dog, Large Dog, Fox). 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_animal(sim_info)¶
Determine if a sim is an Elder Pet (Cat, Small Dog, Large Dog, Fox).
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is an Elder Pet (Cat, Small Dog, Large Dog, Fox). 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_animal(sim_info)¶
Determine if a sim is an Elder Human or Animal (Cat, Small Dog, Large Dog, Fox).
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is an Elder Human or Animal (Cat, Small Dog, Large Dog, Fox). 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_animal(sim_info)¶
Determine if a Sim is an Adult or Elder Animal (Cat, Small Dog, Large Dog, Fox).
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is an Adult or Elder Animal (Cat, Small Dog, Large Dog, Fox). False, if the Sim is not.
- Return type:
bool
- static is_old_human_or_animal(sim_info)¶
Determine if a sim is a Teen, Young Adult, Adult, or Elder Human or an Adult or Elder Animal (Cat, Small Dog, Large Dog, Fox).
- 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 Animal (Cat, Small Dog, Large Dog, Fox). 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_animal(sim_info)¶
Determine if a sim is a Baby, Toddler, or Child Human or a Child Animal (Cat, Small Dog, Large Dog, Fox).
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
True, if the Sim is a Baby, Toddler, or Child Human or a Child Animal (Cat, Small Dog, Large Dog, Fox). 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
Demographic Types¶
- class CommonSimDemographicTypeUtils¶
Bases:
_HasS4CLClassLogUtilities for Sim Demographic types.
- classmethod convert_from_age(value)¶
Convert a value to a Sim demographic value.
- Return type:
CommonSimDemographicType
- classmethod convert_from_gender(value)¶
Convert a value to a Sim demographic value.
- Return type:
CommonSimDemographicType
- classmethod convert_from_occult_type(value)¶
Convert a value to a Sim demographic value.
- Return type:
CommonSimDemographicType
- classmethod convert_from_species(value)¶
Convert a value to a Sim demographic value.
- Return type:
CommonSimDemographicType
- classmethod convert_to_age(value)¶
Convert a value to an Age value.
- Return type:
CommonAge
- classmethod convert_to_gender(value)¶
Convert a value to a Gender value.
- Return type:
CommonGender
- classmethod convert_to_occult_type(value)¶
Convert a value to an Occult Type value.
- Return type:
CommonOccultType
- classmethod convert_to_species(value)¶
Convert a value to a Species value.
- Return type:
CommonSpecies
- classmethod determine_sim_demographic_flags(sim_info)¶
Determine the demographics of a Sim as flags.
- Return type:
CommonSimDemographicType
- classmethod determine_sim_demographics(sim_info)¶
Determine the demographics of a Sim as a collection.
- Return type:
Tuple[CommonSimDemographicType]
- classmethod get_all_sims_matching_demographic_flags(sim_demographic_flags, include_sim_callback=None, instanced_only=True)¶
Get all Sims matching Sim Demographics Flags.
- Parameters:
sim_demographic_flags (CommonSimDemographicType) – Flags of Sim Demographics to match on.
include_sim_callback (Callable[[SimInfo], bool], optional) – If the result of this callback is True, the Sim will be available in the results. If set to None, All Sims will be available in the results.
instanced_only (bool, optional) – If True, only Sims that are currently loaded will be available in the results. Default is True.
- Returns:
A generator of Sims matching the specified demographics.
- Return type:
Iterator[SimInfo]
- classmethod get_all_sims_matching_demographics(sim_demographics, include_sim_callback=None, instanced_only=True)¶
Get all Sims matching a collection of Sim Demographics.
- Parameters:
sim_demographics (Tuple[CommonSimDemographicType]) – A collection of Sim demographics to match on.
include_sim_callback (Callable[[SimInfo], bool], optional) – If the result of this callback is True, the Sim will be available in the results. If set to None, All Sims will be available in the results.
instanced_only (bool, optional) – If True, only Sims that are currently loaded will be available in the results. Default is True.
- Returns:
A generator of Sims matching the specified demographics.
- Return type:
Iterator[SimInfo]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod is_sim_contained_in_demographic_flags(sim_info, demographic_flags, match_all=True)¶
Determine if a Sim is contained in demographic flags.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
demographic_flags (CommonSimDemographicType) – The flags of Sim Demographics to match.
match_all (bool, optional) – If True, the Sim must be a match for all specified demographic flags. If False, the Sim can match any of the demographic flags. Default is True.
- Returns:
True, if the Sim matches all (or any) of the Demographic Flags. False, if not.
- Return type:
bool
- classmethod is_sim_contained_in_demographics(sim_info, demographics, match_all=True)¶
is_sim_contained_in_demographic_flags(sim_info, demographics, match_all=True)
Determine if a Sim is contained in a collection of Sim demographics.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
demographics (Tuple[CommonSimDemographicType]) – A collection of Sim Demographics to match.
match_all (bool, optional) – If True, the Sim must be a match for all specified demographics. If False, the Sim can match any of the demographics. Default is True.
- Returns:
True, if the Sim matches all (or any) of the Demographics. False, if not.
- Return type:
bool
- classmethod perform_action_on_sims_matching_demographic_flags(sim_demographic_flags, action, include_sim_callback=None, instanced_only=True)¶
Perform an action on all Sims matching Sim Demographics Flags.
- Parameters:
sim_demographic_flags (CommonSimDemographicType) – Flags of Sim Demographics to match on.
action (Callable[[SimInfo], None]) – A function invoked on each matching Sim.
include_sim_callback (Callable[[SimInfo], bool], optional) – If the result of this callback is True, the Sim will be available to have the action performed on them. If set to None, All Sims will be available to have the action performed on them.
instanced_only (bool, optional) – If True, only Sims that are currently loaded will be available to have the action performed on them. Default is True.
- classmethod perform_action_on_sims_matching_demographics(sim_demographics, action, include_sim_callback=None, instanced_only=True)¶
Perform an action on all Sims matching a collection of Sim Demographics.
- Parameters:
sim_demographics (Tuple[CommonSimDemographicType]) – A collection of Sim demographics to match on.
action (Callable[[SimInfo], None]) – A function invoked on each matching Sim.
include_sim_callback (Callable[[SimInfo], bool], optional) – If the result of this callback is True, the Sim will be available to have the action performed on them. If set to None, All Sims will be available to have the action performed on them.
instanced_only (bool, optional) – If True, only Sims that are currently loaded will be available. Default is True.
Gender¶
- class CommonGenderUtils¶
Bases:
objectUtilities 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 (Union[Gender, CommonGender, int]) – 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 (Union[Gender, CommonGender, int]) – 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[Gender, CommonGender, int]) – 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, update_voice=True, update_outfits=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.
update_voice (bool, optional) – If True, the voice of the Sim will be updated to a default voice for the gender being swapped to. If False, the voice of the Sim will remain unchanged. Default is True.
update_outfits (
bool) – If True, the outfits of the Sim will be regenerated to match the gender options of the Sim. If False, the outfits of the Sim will not be regenerated. Default is True.update_outfits – bool, optional
- Returns:
True, if the Gender of the Sim was swapped successfully. False, if not.
- Return type:
bool
Occults¶
- class CommonOccultUtils¶
Bases:
_HasS4CLClassLogUtilities for manipulating the Occults of Sims.
- classmethod add_alien_occult(sim_info)¶
Add the Alien Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the Alien occult. True, if the Sim has successfully become an Alien. False, if not.
- Return type:
- classmethod add_all_occults(sim_info)¶
Add all Occult Types to a Sim. i.e. Make them an Alien, a Vampire, a Witch, etc.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding all occult types. True, if all Occult Types were successfully added to the specified Sim. False, if not.
- Return type:
- classmethod add_fairy_occult(sim_info)¶
Add the Fairy Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the Fairy occult. True, if the Sim has successfully become a Fairy. False, if not.
- Return type:
- classmethod add_mermaid_occult(sim_info)¶
Add the Mermaid Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the mermaid occult. True, if the Sim has successfully become a Mermaid. False, if not.
- Return type:
- classmethod add_occult(sim_info, occult_type)¶
Add an Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
occult_type (CommonOccultType) – The occult type to add.
- Returns:
The result of adding the occult. True, if the specified Occult Type has been added to the Sim. False, if not.
- Return type:
- classmethod add_plant_sim_occult(sim_info)¶
Add the Plant Sim Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the Plant Sim occult. True, if the Sim has successfully become a Plant Sim. False, if not.
- Return type:
- classmethod add_robot_occult(sim_info)¶
Add the Robot Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the robot occult. True, if the Sim has successfully become a Robot. False, if not.
- Return type:
- classmethod add_scarecrow_occult(sim_info)¶
Add the Scarecrow Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the Scarecrow occult. True, if the Sim has successfully become a Scarecrow. False, if not.
- Return type:
- classmethod add_skeleton_occult(sim_info)¶
Add the Skeleton Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the Skeleton occult. True, if the Sim has successfully become a Skeleton. False, if not.
- Return type:
- classmethod add_vampire_occult(sim_info)¶
Add the Vampire Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the Vampire occult. True, if the Sim has successfully become a Vampire. False, if not.
- Return type:
- classmethod add_werewolf_occult(sim_info)¶
Add the Werewolf Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the Werewolf occult. True, if the Sim has successfully become a Werewolf. False, if not.
- Return type:
- classmethod add_witch_occult(sim_info)¶
Add the Witch Occult Type to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of adding the Witch occult. True, if the Sim has successfully become a Witch. False, if not.
- Return type:
- classmethod get_all_occult_types_for_sim_gen(sim_info)¶
Retrieve a generator of OccultType 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 type will be included.
- Parameters:
sim_info (SimInfo) – The Sim to locate the Occults of.
- Returns:
An iterator of OccultType for all occults of the Sim. (Results will not include Occult Types not within the OccultTypes enum, such as Skeleton, Robot, and Ghost! Use
CommonSimOccultTypeUtilsfor more accurate results.)- Return type:
Iterator[OccultType]
- classmethod get_current_occult_sim_info(sim_info)¶
Retrieve the SimInfo for the Occult the Sim is currently.
- Parameters:
sim_info (SimInfo) – The Sim to locate the Occults of.
- Returns:
The SimInfo of the Sim or the SimInfoBaseWrapper for the Occult they are (If they are currently an occult).
- Return type:
Union[SimInfo, SimInfoBaseWrapper, None]
- classmethod get_current_occult_type(sim_info)¶
Retrieve the current occult type of the Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The current occult type of the Sim or None if the Sim does not have a current occult type.
- Return type:
Union[OccultType, None]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_occult_sim_info(sim_info, occult_type)¶
Retrieve the SimInfo for an Occult of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to locate the Occults of.
occult_type (OccultType) – The Occult Type to retrieve the SimInfo of.
- Returns:
The SimInfo of the Sim or the SimInfoBaseWrapper for the specified Occult or the original Sim Info, if the Sim did not have the occult type.
- Return type:
Union[SimInfo, SimInfoBaseWrapper, None]
- classmethod 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 iterator of Sims for all occult types of the Sim.
- Return type:
Iterator[SimInfo]
- classmethod 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 iterator of Sims for all occult types of the Sim.
- Return type:
Iterator[SimInfo]
- classmethod has_any_occult(sim_info)¶
Determine if a Sim has any Occult Types.
- Parameters:
sim_info (SimInfo) – The Sim to locate the Occults of.
- Returns:
The result of testing. True, if the specified Sim has any Non-Human Occult Types. False, if not.
- Return type:
- classmethod has_full_body_cas_part_assigned_to_current_occult_of(sim_info)¶
has_full_body_cas_part_assigned_to_occult(sim_info)
Determine if the Sim is currently an occult that has a Full Body CAS Part associated with it. Such as a Skeleton (Skeleton Part) or Robot (Humanoid Bot Frame).
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the Sim is currently an occult with a full body outfit. False, if not.
- Return type:
- classmethod has_occult_sim_info(sim_info, occult_type)¶
Determine if a Sim has a SimInfo for an Occult.
- Parameters:
sim_info (SimInfo) – The Sim to locate the Occults of.
occult_type (OccultType) – The Occult Type to check.
- Returns:
The result of testing. True, if a SimInfo is available for the specified Occult for the Sim. False, if not.
- Return type:
- classmethod has_occult_type(sim_info, occult_type)¶
Determine if a Sim has an Occult Type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
occult_type (OccultType) – The Occult Type to check.
- Returns:
The result of testing. True, if the Sim has the specified Occult Type. False, if not.
- Return type:
- classmethod is_alien(sim_info)¶
Determine if a Sim is an Alien.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is an Alien. False, if not.
- Return type:
- classmethod is_alien_occult_available()¶
Determine if the Alien Occult is available.
- Returns:
The result of testing. True, if the Alien Occult is available. False, if not.
- Return type:
- classmethod is_currently_a_fairy(sim_info)¶
Determine if a Sim is currently in their Fairy form.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Fairy form. False, if not.
- Return type:
- classmethod is_currently_a_ghost(sim_info)¶
Determine if a Sim is currently in their Ghost form.
Note
In base game, if a Sim is a Ghost then they are automatically in their Ghost Form, since Ghosts do not have an alternative form.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Ghost form. False, if not.
- Return type:
- classmethod is_currently_a_mermaid(sim_info)¶
Determine if a Sim is currently in a Mermaid form. (Not disguised)
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Mermaid form. False, if not.
- Return type:
- classmethod is_currently_a_non_occult(sim_info)¶
Determine if a Sim is currently in a Non-Occult form (regardless of their Occult type).
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Non-Occult form. False, if not.
- Return type:
- classmethod is_currently_a_plant_sim(sim_info)¶
Determine if a Sim is currently in their Plant Sim form.
Note
In base game, if a Sim is a Plant Sim then they are automatically in their Plant Sim Form, since Plant Sims do not have an alternative form.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Plant Sim form. False, if not.
- Return type:
- classmethod is_currently_a_robot(sim_info)¶
Determine if a Sim is currently in their Robot form.
Note
In base game, if a Sim is a Robot then they are automatically in their Robot Form, since Robots do not have an alternative form.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Robot form. False, if not.
- Return type:
- classmethod is_currently_a_scarecrow(sim_info)¶
Determine if a Sim is currently in their Scarecrow form.
Note
In base game, if a Sim is a Scarecrow then they are automatically in their Scarecrow Form, since Scarecrows do not have an alternative form.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Scarecrow form. False, if not.
- Return type:
- classmethod is_currently_a_skeleton(sim_info)¶
Determine if a Sim is currently in their Skeleton form.
Note
In base game, if a Sim is a Skeleton then they are automatically in their Skeleton Form, since Skeletons do not have an alternative form.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Skeleton form. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim is currently in their Vampire form. False, if not.
- Return type:
- classmethod is_currently_a_werewolf(sim_info)¶
Determine if a Sim is currently in their Werewolf form.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently in their Werewolf form. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim is currently in their Witch form. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim is currently in their Alien form. False, if not.
- Return type:
- classmethod is_currently_human(sim_info)¶
Determine if a Sim is currently in their Human form (regardless of their Occult type).
Note
The Human Occult is not the same as the Human Species! This means that Pets can have a “Human” Occult as their Non-Occult.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is currently a Human. False, if not.
- Return type:
- classmethod is_fairy(sim_info)¶
Determine if a Sim is a Fairy.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Fairy. False, if not.
- Return type:
- classmethod is_fairy_occult_available()¶
Determine if the Fairy Occult is available.
- Returns:
The result of testing. True, if the Fairy Occult is available.. False, if not.
- Return type:
- classmethod is_ghost(sim_info)¶
Determine if a Sim is a Ghost.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Ghost. False, if not.
- Return type:
- classmethod is_ghost_occult_available()¶
Determine if the Ghost Occult is available.
- Returns:
The result of testing. True, if the Ghost Occult is available.. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim has their Mermaid tail out. False, if not.
- Return type:
- classmethod is_mermaid(sim_info)¶
Determine if a Sim is a Mermaid
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Mermaid. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim is a Mermaid with their tail out. False, if not.
- Return type:
- classmethod is_mermaid_occult_available()¶
Determine if the Mermaid Occult is available.
- Returns:
The result of testing. True, if the Mermaid Occult is available.. False, if not.
- Return type:
- classmethod is_occult_available(occult_type)¶
Determine if an Occult is available for us.
Note
An Occult is available for use usually when it exists in a persons game, such as the WITCH occult existing only when someone has the Realm Of Magic DLC, but does not exist otherwise.
- Parameters:
occult_type (CommonOccultType) – An occult type.
- Returns:
The result of testing. True, if the occult is available for use. False, if not.
- Return type:
- classmethod is_plant_sim(sim_info)¶
Determine if a Sim is a Plant Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Plant Sim. False, if not.
- Return type:
- classmethod is_plant_sim_occult_available()¶
Determine if the Plant Sim Occult is available.
- Returns:
The result of testing. True, if the Plant Sim Occult is available.. False, if not.
- Return type:
- classmethod is_robot(sim_info)¶
Determine if a Sim is a Robot.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Robot. False, if not.
- Return type:
- classmethod is_robot_occult_available()¶
Determine if the Robot Occult is available.
- Returns:
The result of testing. True, if the Robot Occult is available.. False, if not.
- Return type:
- classmethod is_scarecrow(sim_info)¶
Determine if a Sim is a Scarecrow.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Scarecrow. False, if not.
- Return type:
- classmethod is_scarecrow_occult_available()¶
Determine if the Scarecrow Occult is available.
- Returns:
The result of testing. True, if the Scarecrow Occult is available.. False, if not.
- Return type:
- classmethod is_skeleton(sim_info)¶
Determine if a Sim is a Skeleton.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is the a Skeleton. False, if not.
- Return type:
- classmethod is_skeleton_occult_available()¶
Determine if the Skeleton Occult is available.
- Returns:
The result of testing. True, if the Skeleton Occult is available.. False, if not.
- Return type:
- classmethod is_vampire(sim_info)¶
Determine if a Sim is a Vampire.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Vampire. False, if not.
- Return type:
- classmethod is_vampire_occult_available()¶
Determine if the Vampire Occult is available.
- Returns:
The result of testing. True, if the Vampire Occult is available.. False, if not.
- Return type:
- classmethod is_werewolf(sim_info)¶
Determine if a Sim is a Werewolf
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Werewolf. False, if not.
- Return type:
- classmethod is_werewolf_occult_available()¶
Determine if the Werewolf Occult is available.
- Returns:
The result of testing. True, if the Werewolf Occult is available.. False, if not.
- Return type:
- classmethod is_witch(sim_info)¶
Determine if a Sim is a Witch
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim is a Witch. False, if not.
- Return type:
- classmethod is_witch_occult_available()¶
Determine if the Witch Occult is available.
- Returns:
The result of testing. True, if the Witch Occult is available.. False, if not.
- Return type:
- classmethod occult_has_full_body_cas_part(occult_type)¶
Determine an occult type has a Full Body CAS Part associated with it. Such as a Skeleton (Skeleton Part) or Robot (Humanoid Bot Frame).
- Parameters:
occult_type (CommonOccultType) – The occult type to check.
- Returns:
The result of the test. True, if the occult type has a full body outfit associated with it. False, if not.
- Return type:
- classmethod remove_alien_occult(sim_info)¶
Remove the Alien Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the alien occult. True, if the Alien Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_all_occults(sim_info)¶
Remove all Occult Types from a Sim. i.e. Make them a Non-Occult only.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing all occult types. True, if all Occult Types were successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_fairy_occult(sim_info)¶
Remove the Fairy Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the Fairy occult. True, if the Fairy Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_mermaid_occult(sim_info)¶
Remove the Mermaid Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the mermaid occult. True, if the Mermaid Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_occult(sim_info, occult_type)¶
Remove an Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
occult_type (CommonOccultType) – The occult type to remove.
- Returns:
The result of removing the occult. True, if the specified Occult Type has been removed from the Sim. False, if not.
- Return type:
- classmethod remove_plant_sim_occult(sim_info)¶
Remove the Plant Sim Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the Plant Sim occult. True, if the Plant Sim Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_robot_occult(sim_info)¶
Remove the Robot Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the robot occult. True, if the Robot Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_scarecrow_occult(sim_info)¶
Remove the Scarecrow Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the Scarecrow occult. True, if the Scarecrow Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_skeleton_occult(sim_info)¶
Remove the Skeleton Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the Skeleton occult. True, if the Skeleton Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_vampire_occult(sim_info)¶
Remove the Vampire Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the Vampire occult. True, if the Vampire Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_werewolf_occult(sim_info)¶
Remove the Werewolf Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the Werewolf occult. True, if the Werewolf Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod remove_witch_occult(sim_info)¶
Remove the Witch Occult Type from a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of removing the Witch occult. True, if the Witch Occult Type has been successfully removed from the specified Sim. False, if not.
- Return type:
- classmethod switch_to_occult_form(sim_info, occult_type)¶
Switch a Sim to an Occult Form.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
occult_type (Union[OccultType, CommonOccultType]) – The type of Occult to switch to.
- Returns:
The result of switching a Sim to an occult form. True, if the Sim successfully switched to the specified Occult Type. False, if the Sim failed to switch to the specified Occult Type or if they do not have that Occult Type to switch to.
- Return type:
Body¶
- class CommonSimBodyUtils¶
Bases:
objectUtilities for manipulating the body of Sims.
- classmethod get_fat_level(sim_info)¶
Get the Fat level of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to modify.
- Returns:
The Fat level of the Sim.
- Return type:
float
- classmethod get_fit_level(sim_info)¶
Get the Fit level of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to modify.
- Returns:
The Fit level of the Sim.
- Return type:
float
- static get_ocean_wading_size(sim_info)¶
Retrieve the size of a Sim if they were to wade in an Ocean of water.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
A tuple indicating the x and y Ocean wading size of a Sim from their origin point.
- Return type:
Tuple[int, int]
- static get_pond_wading_size(sim_info)¶
get_wading_size(sim_info)
Retrieve the size of a Sim if they were to wade in a pond of water.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
A tuple indicating the x and y Pond wading size of a Sim from their origin point.
- Return type:
Tuple[int, int]
- static get_wading_size(sim_info)¶
Retrieve the size of a Sim if they were to wade in an Ocean of water.
Note
This function is obsolete. Please use
get_ocean_wading_size()instead.- 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]
- classmethod set_fat_level(sim_info, level)¶
Set the Fat level of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to modify.
level (float) – The Fat level to set the Sim to.
- classmethod set_fit_level(sim_info, level)¶
Set the Fit level of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to modify.
level (float) – The Fit level to set the Sim to.
Family Tree¶
- class CommonSimFamilyTreeUtils¶
Bases:
objectUtilities for managing and manipulating the Family Tree of Sims.
Determine if Sim A is blood related to Sim B.
- Returns:
True, if Sim A is blood related to Sim B. False, if not.
- Return type:
bool
- classmethod get_family_tree_service()¶
Retrieve the Family Tree Service.
- Returns:
The family tree service or None if not found.
- Return type:
Union[FamilyTreeService, None]
Genealogy¶
- class CommonSimGenealogyUtils¶
Bases:
objectUtilities for managing and manipulating the Genealogy of Sims.
- classmethod get_children_sim_info_gen(sim_info)¶
Get the blood related children of a Sim.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
An iterable of children the specified Sim is blood related to.
- Return type:
Iterator[SimInfo]
- classmethod get_father_sim_info(sim_info)¶
Retrieve the Father of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The father of the Sim or None if the Sim does not have a father.
- Return type:
Union[SimInfo, None]
- classmethod get_fathers_father_sim_info(sim_info)¶
Retrieve the Grandfather of a Sim on their fathers side.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The grandfather of the Sim on their fathers side or None if the Sim does not have a father or their father does not have a mother.
- Return type:
Union[SimInfo, None]
- classmethod get_fathers_mother_sim_info(sim_info)¶
Retrieve the Grandmother of a Sim on their fathers side.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The grandmother of the Sim on their fathers side or None if the Sim does not have a father or their father does not have a mother.
- Return type:
Union[SimInfo, None]
- classmethod get_genealogy_tracker(sim_info)¶
Retrieve the Genealogy Tracker for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The genealogy tracker of the Sim or None if not found.
- Return type:
Union[GenealogyTracker, None]
- classmethod get_grandparent_sim_info_gen(sim_info)¶
Get the blood related Grandparents of a Sim.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
An iterable of Grandparents the specified Sim is blood related to.
- Return type:
Iterator[SimInfo]
- classmethod get_mother_sim_info(sim_info)¶
Retrieve the Mother of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The mother of the Sim or None if the Sim does not have a mother.
- Return type:
Union[SimInfo, None]
- classmethod get_mothers_father_sim_info(sim_info)¶
Retrieve the Grandfather of a Sim on their mothers side.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The grandfather of the Sim on their mothers side or None if the Sim does not have a mother or their mother does not have a father.
- Return type:
Union[SimInfo, None]
- classmethod get_mothers_mother_sim_info(sim_info)¶
Retrieve the Grandmother of a Sim on their mothers side.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The grandmother of the Sim on their mothers side or None if the Sim does not have a mother or their mother does not have a mother.
- Return type:
Union[SimInfo, None]
- classmethod get_parent_sim_info_gen(sim_info)¶
Get the blood related Parents of a Sim.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
An iterable of Parents the specified Sim is blood related to.
- Return type:
Iterator[SimInfo]
- classmethod get_siblings_sim_info_gen(sim_info)¶
Get the blood related siblings of a Sim.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
An iterable of siblings the specified Sim is blood related to.
- Return type:
Iterator[SimInfo]
- classmethod has_children(sim_info)¶
Determine if a Sim has any children.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim has any children. False, if not.
- Return type:
bool
- classmethod has_father(sim_info)¶
Determine if a Sim has a father.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim has a father. False, if not.
- Return type:
bool
- classmethod has_fathers_father(sim_info)¶
Determine if a Sim has a Grandfather on the Father’s side, otherwise known as the Father’s Father.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim has a grandfather on the Father’s side. False, if not.
- Return type:
bool
- classmethod has_fathers_mother(sim_info)¶
Determine if a Sim has a Grandmother on the Father’s side, otherwise known as the Father’s Mother.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim has a grandmother on the Father’s side. False, if not.
- Return type:
bool
- classmethod has_grandfather_on_fathers_side(sim_info)¶
Determine if a Sim has a grandfather on the fathers side.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim has a grandfather on the fathers side. False, if not.
- Return type:
bool
- classmethod has_grandfather_on_mothers_side(sim_info)¶
Determine if a Sim has a grandfather on the mothers side.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim has a grandfather on the mothers side. False, if not.
- Return type:
bool
- classmethod has_grandmother_on_fathers_side(sim_info)¶
Determine if a Sim has a grandmother on the fathers side.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim has a grandmother on the fathers side. False, if not.
- Return type:
bool
- classmethod has_grandmother_on_mothers_side(sim_info)¶
Determine if a Sim has a grandmother on the mothers side.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim has a grandmother on the mothers side. False, if not.
- Return type:
bool
- classmethod has_mother(sim_info)¶
Determine if a Sim has a mother.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim has a mother. False, if not.
- Return type:
bool
- classmethod has_mothers_father(sim_info)¶
Determine if a Sim has a Grandfather on the Mother’s side, otherwise known as the Mother’s Father.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim has a grandfather on the Mother’s side. False, if not.
- Return type:
bool
- classmethod has_mothers_mother(sim_info)¶
has_grandmother(sim_info)
Determine if a Sim has a Grandmother on the Mother’s side, otherwise known as the Mother’s Mother.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim has a grandmother on the Mother’s side. False, if not.
- Return type:
bool
- classmethod is_father_of(sim_info_a, sim_info_b)¶
Determine if Sim A is the father of Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is the father of Sim B. False, if not.
- Return type:
bool
- classmethod is_fathers_father_of(sim_info_a, sim_info_b)¶
Determine if Sim A is the grandfather of Sim B on the fathers side of Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is the grandfather of Sim B on their fathers side. False, if not.
- Return type:
bool
- classmethod is_fathers_mother_of(sim_info_a, sim_info_b)¶
Determine if Sim A is the grandmother of Sim B on the fathers side of Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is the grandmother of Sim B on their fathers side. False, if not.
- Return type:
bool
- classmethod is_mother_of(sim_info_a, sim_info_b)¶
Determine if Sim A is the mother of Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is the mother of Sim B. False, if not.
- Return type:
bool
- classmethod is_mothers_father_of(sim_info_a, sim_info_b)¶
Determine if Sim A is the grandfather of Sim B on the mothers side of Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is the grandfather of Sim B on their mothers side. False, if not.
- Return type:
bool
- classmethod is_mothers_mother_of(sim_info_a, sim_info_b)¶
Determine if Sim A is the grandmother of Sim B on the mothers side of Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is the grandmother of Sim B on their mothers side. False, if not.
- Return type:
bool
- classmethod remove_family_relations_with(sim_info_a, sim_info_b, remove_from_family_tree=True)¶
Remove the family relations Sim A has with Sim B and the family relations Sim B has with Sim A.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – The Sim to remove from the family of Sim A.
remove_from_family_tree (bool, optional) – If True, Sim A will remove Sim B from their family tree as well. If False, the family tree of Sim A will not be modified. Default is True.
- Returns:
True, if the family relations between the Sims was removed successfully. False, if not.
- Return type:
bool
- classmethod remove_father_relation(sim_info)¶
Remove the Father of a Sim from their Family Tree.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the father of the Sim has been removed. False, if not.
- Return type:
bool
- classmethod remove_fathers_father_relation(sim_info)¶
Remove the relation of a Sim to their Grandfather on their fathers side from their Family Tree.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the grandfather of the Sim has been removed. False, if not.
- Return type:
bool
- classmethod remove_fathers_mother_relation(sim_info)¶
Remove the relation of a Sim to their Grandmother on their fathers side from their Family Tree.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the grandmother of the Sim has been removed. False, if not.
- Return type:
bool
- classmethod remove_mother_relation(sim_info)¶
Remove the Mother of a Sim from their Family Tree.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the mother of the Sim has been removed. False, if not.
- Return type:
bool
- classmethod remove_mothers_father_relation(sim_info)¶
Remove the Father of the Mother of a Sim from their Family Tree.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the father of the mother of the Sim has been removed. False, if not.
- Return type:
bool
- classmethod remove_mothers_mother_relation(sim_info)¶
Remove the relation of a Sim to their Grandmother on their mothers side from their Family Tree.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the grandmother of the Sim has been removed. False, if not.
- Return type:
bool
- classmethod set_as_exclusive_steady_of(sim_info_a, sim_info_b)¶
Set Sim A as being in an exclusive steady relationship with Sim B
Note: All other steady relationships will be removed if they exist already!
- Parameters:
sim_info_a (SimInfo) – The info of a Sim.
sim_info_b (SimInfo) – The new steady relationship of Sim A.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
- classmethod set_as_father_of(sim_info, new_child_sim_info, propagate=False)¶
Set a Sim to be the Father of another Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
new_child_sim_info (SimInfo) – The new child of Sim A.
propagate (bool, optional) – Obsolete, no longer used. The family tree will ALWAYS be updated.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
- classmethod set_as_fathers_father_of(sim_info, new_grandchild_sim_info)¶
Set a Sim to be the Fathers Father of another Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
new_grandchild_sim_info (SimInfo) – The new grandchild of Sim A.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
- classmethod set_as_fathers_mother_of(sim_info, new_grandchild_sim_info)¶
Retrieve the Father of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
new_grandchild_sim_info (SimInfo) – The new grandchild of Sim A.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
- classmethod set_as_fiance_of(sim_info_a, sim_info_b)¶
Set Sim A as the fiance of Sim B and vice verse
- Parameters:
sim_info_a (SimInfo) – The info of a Sim.
sim_info_b (SimInfo) – The new fiance of Sim A.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
- classmethod set_as_mother_of(sim_info, new_child_sim_info, propagate=False)¶
Set a Sim to be the Mother of another Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
new_child_sim_info (SimInfo) – The new child of Sim A.
propagate (bool, optional) – Obsolete, no longer used. The family tree will ALWAYS be updated.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
- classmethod set_as_mothers_father_of(sim_info, new_grandchild_sim_info)¶
Retrieve the Father of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
new_grandchild_sim_info (SimInfo) – The new grandchild of Sim A.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
- classmethod set_as_mothers_mother_of(sim_info, new_grandchild_sim_info)¶
Retrieve the Father of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
new_grandchild_sim_info (SimInfo) – The new grandchild of Sim A.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
- classmethod set_as_spouse_of(sim_info_a, sim_info_b)¶
Set Sim A as the spouse of Sim B and vice verse
- Parameters:
sim_info_a (SimInfo) – The info of a Sim.
sim_info_b (SimInfo) – The new spouse of Sim A.
- Returns:
True, if the relation was set successfully. False, if not.
- Return type:
bool
Voice¶
- class CommonSimVoiceUtils¶
Bases:
objectUtilities for manipulating the Voice of Sims.
- static determine_available_voice_types(sim_info)¶
Retrieve a collection of Voice Actor Types that are available for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
A collection of voice actor types available for the Sim.
- Return type:
Tuple[CommonVoiceActorType]
- static get_voice_actor(sim_info)¶
Retrieve the Actor of the Voice of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
A value that represents the voice actor of a Sim.
- Return type:
int
- static get_voice_pitch(sim_info)¶
Retrieve the Pitch of the Voice of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
A value that represents the pitch of the voice of a Sim. The value can range from -1.0 to 1.0
- Return type:
float
- static has_voice_actor(sim_info, voice_actor)¶
Determine if a Sim has a specified voice actor.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
voice_actor (Union[int, CommonVoiceActorType]) – The voice actor to check.
- Returns:
The result of testing. True, if the Sim has the specified voice actor. False, if not.
- Return type:
- static has_voice_pitch(sim_info, voice_pitch)¶
Determine if a Sim has a specified voice pitch.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
voice_pitch (float) – The voice pitch to check.
- Returns:
The result of testing. True, if the Sim has the specified voice pitch. False, if not.
- Return type:
- static set_to_default_female_voice(sim_info)¶
Set the voice of a Sim to the default female voice for their Age and Species.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of setting the voice of the Sim to the default female voice. True, if successful. False, if not.
- Return type:
- static set_to_default_male_voice(sim_info)¶
Set the voice of a Sim to the default male voice for their Age and Species.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of setting the voice of the Sim to the default male voice. True, if successful. False, if not.
- Return type:
- static set_to_default_voice(sim_info)¶
Set the voice of a Sim to the default for their Age, Gender, and Species.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of setting the voice of the Sim to their default voice. True, if successful. False, if not.
- Return type:
- static set_voice_actor(sim_info, voice_actor)¶
Set the Voice Actor of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
voice_actor (Union[int, CommonVoiceActorType]) – The voice actor to set the Sim to have.
- Returns:
The result of setting the voice actor. True, if successful. False, if not.
- Return type:
- static set_voice_pitch(sim_info, voice_pitch)¶
Set the Pitch of the Voice of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
voice_pitch (float) – The value to set the voice pitch to, from -1.0 to 1.0.
- Returns:
The result of setting the voice pitch of the Sim. True, if successful. False, if not.
- Return type:
Walkstyles¶
- class CommonSimWalkstyleUtils¶
Bases:
_HasS4CLClassLogUtilities for manipulating the Walkstyle of Sims.
- classmethod get_current_walkstyle(sim_info)¶
Retrieve the current walkstyle of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The current walkstyle of the Sim or None when not found.
- Return type:
Union[Walkstyle, None]
- classmethod get_default_walkstyle(sim_info)¶
Retrieve the default walkstyle of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The default walkstyle of a Sim or None if the Sim is not available or has no default walk style.
- Return type:
Union[Walkstyle, None]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
Outfits¶
Appearance Modifiers¶
- class CommonSimAppearanceModifierUtils¶
Bases:
objectUtilities for manipulating the appearance modifiers of Sims.
- static add_appearance_modifier(sim_info, modifier, modifier_guid, priority=sims4communitylib.enums.common_appearance_modifier_priority.CommonAppearanceModifierPriority.TRANSFORMED, apply_to_all_outfits=True, additional_flags=cas.cas.OutfitOverrideOptionFlags.DEFAULT, source=None)¶
Determine if a Sim has any appearance modifiers applied to them of a specified type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
modifier (AppearanceModifier.BaseAppearanceModification) – The Appearance Modifier to apply.
modifier_guid (int) – The GUID of the appearance modifier being applied.
priority (CommonAppearanceModifierPriority, optional) – The priority of the appearance modifier. This determines which types of appearance modifiers can override this modifier and which ones this modifier overrides. Default is CommonAppearanceModifierPriority.TRANSFORMED.
apply_to_all_outfits (bool, optional) – If True, the appearance modifier will apply to all outfits. If False, the appearance modifier will only apply the current outfit of the Sim. Default is True.
additional_flags (OutfitOverrideOptionFlags, optional) – Additional flags for overriding outfit parts. Default is OutfitOverrideOptionFlags.DEFAULT.
source (Any, optional) – The source of the appearance modifier. Default is None.
- Return type:
None
- static evaluate_appearance_modifiers(sim_info)¶
Force evaluate the appearance modifiers of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Return type:
None
- static get_appearance_modifiers_by_guid_gen(sim_info, modifier_guid)¶
Retrieve the appearance modifiers applied to a Sim that have the specified GUID.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
modifier_guid (int) – The GUID of the modifiers to search for.
- Returns:
An iterator of Appearance Modifiers that have the specified GUID.
- Return type:
Iterator[ModifierInfo]
- static get_appearance_modifiers_by_type_gen(sim_info, modifier_type)¶
Retrieve the appearance modifiers applied to a Sim that match a specified type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
modifier_type (Type[AppearanceModifier.BaseAppearanceModification]) – The type of the modifiers to search for.
- Returns:
An iterator of Appearance Modifiers that match the specified type.
- Return type:
Iterator[ModifierInfo]
- static get_appearance_modifiers_gen(sim_info, include_appearance_modifier=None)¶
Retrieve the appearance modifiers applied to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
include_appearance_modifier (Callable[[CommonAppearanceModifierType, ModifierInfo], bool], optional) – If the result of this callback is True, the Appearance Modifier will be included in the results. If set to None, All Appearance Modifiers will be included. Default is None.
- Returns:
An iterator of all Appearance Modifiers applied to the Sim that match the include_appearance_modifier filter.
- Return type:
Iterator[ModifierInfo]
- static get_appearance_tracker(sim_info)¶
Retrieve the appearance tracker of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The appearance tracker for the Sim or None if not found.
- Return type:
Union[AppearanceTracker, None]
- static has_any_appearance_modifiers(sim_info)¶
Determine if a Sim has any appearance modifiers applied to them.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim has any appearance modifiers applied to them. False, if not.
- Return type:
bool
- static has_any_appearance_modifiers_of_type(sim_info, modifier_type)¶
Determine if a Sim has any appearance modifiers applied to them of a specified type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
modifier_type (Type[AppearanceModifier.BaseAppearanceModification]) – The type of modifier to search for.
- Returns:
True, if the Sim has any appearance modifiers applied to them of the specified type. False, if not.
- Return type:
bool
- static has_any_appearance_modifiers_with_guid(sim_info, modifier_guid)¶
Determine if a Sim has any appearance modifiers applied to them with a specified GUID.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
modifier_guid (int) – The GUID of the modifier to search for.
- Returns:
True, if the Sim has any appearance modifiers applied to them with the specified GUID. False, if not.
- Return type:
bool
- static remove_appearance_modifiers_by_guid(sim_info, modifier_guid, source='S4CL Removal')¶
Remove appearance modifiers from a Sim by their GUID.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
modifier_guid (int) – The GUID of the modifiers to remove.
source (str, optional) – The source of the removal. Default is “S4CL Removal”.
- Return type:
None
CAS¶
- class CommonCASUtils¶
Bases:
_HasS4CLClassLogUtilities for manipulating the CAS parts of Sims.
- classmethod attach_cas_part_to_all_outfits_of_sim(sim_info, cas_part)¶
Attach a CAS part to all outfits of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
cas_part (CommonCASPart) – The CAS Part to attach.
- Returns:
True, if the CAS part was successfully attached to the Sim. False, if not.
- Return type:
bool
- classmethod attach_cas_part_to_outfit_of_sim(sim_info, cas_part, outfit_category_and_index=None)¶
Attach a CAS part to an outfit of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
cas_part (CommonCASPart) – The CAS Part to attach.
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. Default is current outfit.
- Returns:
True, if the CAS part was successfully attached to the Sim. False, if not.
- Returns:
True, if the CAS part was successfully attached to the outfit of the Sim. False, if not.
- Return type:
bool
- classmethod attach_cas_part_to_sim(sim_info, cas_part_id, body_type=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[CommonBodySlot, BodyType, int], optional) – The BodyType the CAS part will be attached to. If no value is provided, the BodyType of the CAS part itself will be used. Default is None.
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
- classmethod attach_cas_parts_to_all_outfits_of_sim(sim_info, cas_parts)¶
Attach a collection of CAS Parts to all outfits of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
cas_parts (Iterator[CommonCASPart]) – A collection of CAS Parts to attach.
- Return type:
bool- Returns:
True, if all CAS Parts were successfully attached to the Sim. False, if not.
- classmethod attach_cas_parts_to_outfit_of_sim(sim_info, cas_parts, outfit_category_and_index=None)¶
Attach CAS parts to an outfit of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
cas_parts (Iterator[CommonCASPart]) – A collection of CAS Parts to attach.
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. Default is current outfit.
- Returns:
True, if the CAS parts were successfully attached to the Sim. False, if not.
- Return type:
bool
- static convert_value_to_body_type(value)¶
Retrieve an BodyType by value.
- Parameters:
value (Union[CommonBodySlot, BodyType, int]) – The value of a body type.
- Returns:
The BodyType with the specified value or the specified value if no BodyType was found.
- Return type:
Union[BodyType, int]
- classmethod detach_body_type_from_all_outfits_of_sim(sim_info, body_type_to_remove)¶
Detach a body type from all outfits of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
body_type_to_remove (Union[CommonBodySlot, BodyType, int]) – The body type to remove.
- classmethod detach_body_type_from_outfit_of_sim(sim_info, body_type_to_remove, outfit_category_and_index=None)¶
Detach the CAS Part at a specific body type from an outfit of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
body_type_to_remove (Union[CommonBodySlot, BodyType, int]) – The body type to remove.
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. Default is current outfit.
- Returns:
True, if the body type was successfully detached from the outfit of the Sim. False, if not.
- Return type:
bool
- classmethod detach_body_types_from_all_outfits_of_sim(sim_info, body_types_to_remove)¶
Detach body types from all outfits of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
body_types_to_remove (Iterator[Union[CommonBodySlot, BodyType, int]]) – A collection of body types to remove.
- classmethod detach_body_types_from_outfit_of_sim(sim_info, body_types_to_remove, outfit_category_and_index=None)¶
Detach any CAS Parts at specific body types from an outfit of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
body_types_to_remove (Iterator[Union[CommonBodySlot, BodyType, int]]) – A collection of body types to remove.
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. Default is current outfit.
- Returns:
True, if the body types were successfully detached from the outfit of the Sim. False, if not.
- Return type:
bool
- classmethod detach_cas_part_from_all_outfits_of_sim(sim_info, cas_part)¶
Detach a CAS Part from all outfits of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
cas_part (CommonCASPart) – A CAS Part to detach.
- Return type:
bool- Returns:
True, if the CAS Part was successfully detached from all outfits of the Sim. False, if not.
- classmethod detach_cas_part_from_outfit_of_sim(sim_info, cas_part, outfit_category_and_index=None)¶
Detach a CAS part from an outfit of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
cas_part (CommonCASPart) – A CAS Part to detach.
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. Default is current outfit.
- Returns:
True, if the CAS part was successfully detached from the outfit of the Sim. False, if not.
- Return type:
bool
- classmethod detach_cas_part_from_sim(sim_info, cas_part_id, body_type=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 BodyType.NONE 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. Default is None.
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. Default is current outfit.
- 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
- classmethod detach_cas_parts_from_all_outfits_of_sim(sim_info, cas_parts)¶
Detach a collection of CAS Parts from all outfits of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
cas_parts (Iterator[CommonCASPart]) – A collection of CAS Parts to detach.
- Return type:
bool- Returns:
True, if all CAS Parts were successfully detached from all outfits of the Sim. False, if not.
- classmethod detach_cas_parts_from_outfit_of_sim(sim_info, cas_parts, outfit_category_and_index=None)¶
Detach CAS parts from an outfit of a Sim.
- Parameters:
sim_info (SimInfo) – The SimInfo of a Sim to modify.
cas_parts (Iterator[CommonCASPart]) – A collection of CAS Parts to detach.
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. Default is current outfit.
- Returns:
True, if the CAS parts were successfully detached from the outfit of the Sim. False, if not.
- Return type:
bool
- static get_body_type_by_name(name, default_body_type=0)¶
Retrieve an BodyType by name.
- Parameters:
name (str) – The name of a body type.
default_body_type (Union[BodyType, None], optional) – The default body type to use if a body type is not found using the specified name. Default is BodyType.NONE
- Returns:
The BodyType with the specified name or the default body type if no body type was found using the specified name.
- Return type:
BodyType
- classmethod get_body_type_cas_part_is_attached_to(sim_info, cas_part_id, outfit_category_and_index=None, mod_identity=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.
mod_identity (CommonModIdentity, optional) – The identity of the mod performing the function. Default is None. Optional, but highly recommended!
- 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]
- classmethod get_cas_part_id_at_body_type(sim_info, body_type, outfit_category_and_index=None, mod_identity=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[CommonBodySlot, 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.
mod_identity (CommonModIdentity, optional) – The identity of the mod performing the function. Default is None. Optional, but highly recommended!
- Returns:
The CAS part identifier attached to the specified BodyType or -1 if the BodyType is not found.
- Return type:
int
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- static get_skin_tone(sim_info)¶
Retrieve the id for the Skin Tone of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The decimal identifier of the skin tone of the specified Sim.
- Return type:
int
- static get_skin_tone_value_shift(sim_info)¶
Retrieve the value shift for the Skin Tone of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The value shift for the Skin Tone of a Sim.
- Return type:
int
- static has_any_cas_part_attached_to_body_type(sim_info, body_type, outfit_category_and_index=None, mod_identity=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[CommonBodySlot, 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.
mod_identity (CommonModIdentity, optional) – The identity of the mod performing the function. Default is None. Optional, but highly recommended!
- Returns:
True, if the Sim has any CAS Part attached to the specified BodyType for the specified outfit. False, it not.
- Return type:
bool
- classmethod has_cas_part_attached(sim_info, cas_part_id, body_type=None, outfit_category_and_index=None, mod_identity=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 BodyType.NONE is provided, the body type of the CAS Part itself will be used. If set to None, the CAS part will be located within any BodyType. Default is None.
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.
mod_identity (CommonModIdentity, optional) – The identity of the mod performing the function. Default is None. Optional, but highly recommended!
- 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
- static set_skin_tone(sim_info, skin_tone)¶
Set the skin tone of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
skin_tone (int) – The decimal identifier of the skin tone to set the Sim to.
Outfit¶
- class CommonOutfitUtils¶
Bases:
HasClassLogUtilities for handling Sim outfits.
- classmethod convert_value_to_outfit_category(value)¶
Retrieve an OutfitCategory by value.
- Parameters:
value (Union[OutfitCategory, int]) – The value of an outfit category.
- Returns:
The OutfitCategory with the specified value or the specified value if no OutfitCategory was found.
- Return type:
Union[OutfitCategory, int]
- classmethod copy_outfit(mod_identity, sim_info, from_outfit_category_and_index, to_outfit_category_and_index, change_sim_to_outfit_after_apply=False)¶
Copy one Outfit of a Sim to another Outfit of the same Sim.
- Parameters:
mod_identity (CommonModIdentity) – The identity of the mod copying the outfit.
sim_info (SimInfo) – An instance of a Sim.
from_outfit_category_and_index (Tuple[OutfitCategory, int]) – The Outfit Category and Index to copy CAS Parts from.
to_outfit_category_and_index (Tuple[OutfitCategory, int]) – The Outfit Category and Index to copy CAS Parts to.
change_sim_to_outfit_after_apply (bool, optional) – Set to True to change the Sim to the outfit after the changes are applied. Default is False.
- Returns:
True, if CAS Parts were copied successfully. False, if not.
- Return type:
bool
- classmethod generate_outfit(sim_info, outfit_category_and_index, tag_list=(), outfit_filter_flag=singletons.DEFAULT, body_type_flags=singletons.DEFAULT, ignore_if_exists=False, **kwargs)¶
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 (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to generate an outfit for.
outfit_category_and_index (Tuple[OutfitCategory, int]) – The OutfitCategory and Index of the outfit to generate.
tag_list (Tuple[CommonGameTag], optional) – A collection of tags to match CAS Parts to. Default is any tag.
outfit_filter_flag (OutfitFilterFlag, optional) – Flags to filter CAS Parts with. Default is no flags.
body_type_flags (BodyTypeFlag, optional) – Flags to filter CAS Parts with. Default is no flags.
ignore_if_exists (
bool) – If set to True, the outfit will not be generated if an outfit already exists at the specified Outfit Category and Index.
- Returns:
True, if an outfit was generated successfully. False, if not.
- Return type:
bool
- classmethod get_all_outfit_categories()¶
Retrieve a collection of all OutfitCategory types.
- Returns:
A collection of all OutfitCategories.
- Return type:
Tuple[OutfitCategory]
- classmethod get_all_outfit_category_and_indexes(sim_info, include_outfit_categories=())¶
Retrieve a collection of outfit category and index for each outfit available to a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – An instance of a Sim.
include_outfit_categories (Tuple[OutfitCategory], optional) – A collection of outfit categories to include. If empty, all outfit categories will be included. Default is empty.
- Returns:
A collection of outfit category and index for each outfit available to a Sim.
- Return type:
Tuple[Tuple[OutfitCategory, int]]
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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]
- classmethod get_appearance_modifiers_gen(sim_info, appearance_modifier_type, include_appearance_modifier_callback=None)¶
Retrieve the appearance modifiers of a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – 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]
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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]
- classmethod get_current_outfit_category(sim_info)¶
Retrieve the current OutfitCategory and Index of a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to get the outfit category of.
- Returns:
The OutfitCategory of the current outfit a Sim is wearing.
- Return type:
OutfitCategory
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_maximum_number_of_outfits_for_category(outfit_category)¶
Retrieve the maximum number of outfits allowed for an outfit category.
- Parameters:
outfit_category (OutfitCategory) – The outfit category to check.
- Returns:
The maximum number of Outfits a Sim may have within the specified outfit category.
- Return type:
int
- classmethod get_mod_identity()¶
Retrieve the identity of the mod that owns the class.
Warning
Override this function with the
CommonModIdentityof your mod.This is a MUST override to allow for proper Exception Handling and Logging!
- Returns:
An instance of CommonModIdentity
- Return type:
- Raises:
NotImplementedError – Thrown when the function is not implemented.
- classmethod get_outfit_category_by_name(name, default_category=-1)¶
Retrieve an OutfitCategory by name.
- Parameters:
name (str) – The name of an outfit category.
default_category (Union[OutfitCategory, None], optional) – The default outfit category to use if the outfit category is not found using the specified name. Default is OutfitCategory.CURRENT_OUTFIT.
- Returns:
The OutfitCategory with the specified name or OutfitCategory.CURRENT_OUTFIT if no outfit category was found using the specified name.
- Return type:
OutfitCategory
- classmethod get_outfit_data(sim_info, outfit_category_and_index=None)¶
Retrieve OutfitData for the specified OutfitCategory and Index of a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – 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 or None if the Sim does not have the specified outfit.
- Return type:
Union[OutfitData, None]
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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. If an outfit does not exist, an empty dict will be returned.
- Return type:
Dict[Union[BodyType, int], int]
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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]]
- classmethod get_previous_outfit(sim_info, default_outfit_category_and_index=(0, 0))¶
Retrieve the previous outfit a Sim was wearing before their current outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – 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]
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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
- classmethod has_cas_part_attached(sim_info, cas_part_id, outfit_category_and_index=None)¶
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 (Union[SimInfo, SimInfoBaseWrapper]) – 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
- classmethod 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 (Union[Union[SimInfo, SimInfoBaseWrapper], SimInfoBaseWrapper]) – 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
- classmethod has_permission_to_change_to_nude(sim_info)¶
Determine if a Sim has permission to change to their Nude (Bathing) outfit.
Note
In the vanilla game, only Adult and Elder Sims have permission to change to Nude.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if the test fails.
- Return type:
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod is_wearing_athletic_outfit(sim_info)¶
Determine if a Sim is wearing an Athletic outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing an athletic outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_bathing_outfit(sim_info)¶
Determine if a Sim is wearing a Bathing outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing their bathing/nude outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_batuu_outfit(sim_info)¶
Determine if a Sim is wearing a Batuu outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a batuu outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_career_outfit(sim_info)¶
Determine if a Sim is wearing a Career outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a career outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_cold_weather_outfit(sim_info)¶
Determine if a Sim is wearing a Cold Weather outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a cold weather outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_everyday_outfit(sim_info)¶
Determine if a Sim is wearing an Everyday outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing an everyday outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_formal_outfit(sim_info)¶
Determine if a Sim is wearing a Formal outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a formal outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_hot_weather_outfit(sim_info)¶
Determine if a Sim is wearing a Hot Weather outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a hot weather outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_party_outfit(sim_info)¶
Determine if a Sim is wearing a Party outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a party outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_situation_outfit(sim_info)¶
Determine if a Sim is wearing a Situation outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a situation outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_sleep_outfit(sim_info)¶
Determine if a Sim is wearing a Sleep outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a sleep outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_special_outfit(sim_info)¶
Determine if a Sim is wearing a Special outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a special outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_swimwear_outfit(sim_info)¶
Determine if a Sim is wearing a Swimwear outfit.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
True, if the sim is wearing a swimwear outfit. False, if not.
- Return type:
bool
- classmethod is_wearing_towel(sim_info)¶
Determine if a Sim is currently wearing a towel.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to check.
- Returns:
The result of testing. True, if the sim is wearing a towel. False, if not.
- Return type:
- classmethod refresh_outfit(sim_info, outfit_category_and_index=None)¶
Refresh the outfit of a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The info of a Sim.
outfit_category_and_index (Tuple[OutfitCategory, int], optional) – The OutfitCategory and index to refresh. Default is the Sims current outfit.
- classmethod regenerate_all_outfits(sim_info)¶
Delete and regenerate all outfits for a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – An instance of a Sim.
- Return type:
None
- classmethod regenerate_outfit(sim_info, outfit_category_and_index)¶
Delete and regenerate an outfit of a Sim.
Note
If the Sim does not have the specified outfit to regenerate, it will be generated instead.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – An instance of a Sim.
outfit_category_and_index (Tuple[OutfitCategory, int]) – The OutfitCategory and index to regenerate for the Sim.
- Return type:
None
- classmethod remove_previous_outfit(sim_info)¶
Remove the outfit a Sim was wearing before their current outfit, from the cache.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to remove the outfit from.
- classmethod resend_outfits(sim_info)¶
Resend outfit data to a Sim to refresh their outfits.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to resend the outfit for.
- Returns:
True, if outfits were resent successfully. False, if not.
- Return type:
bool
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to change the outfit of.
outfit_category_and_index (Tuple[OutfitCategory, int]) – The OutfitCategory and index to change to.
- classmethod set_outfit_clean(sim_info, outfit_category)¶
Flag the specified OutfitCategory of a Sim as clean.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to flag the OutfitCategory for.
outfit_category (OutfitCategory) – The OutfitCategory being flagged.
- classmethod 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 (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to flag the OutfitCategory for.
outfit_category (OutfitCategory) – The OutfitCategory being flagged.
- classmethod trigger_outfit_generated(sim_info, outfit_category_and_index)¶
Trigger the outfit generated callbacks for a Sim with an OutfitCategory and Index.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The info of a Sim.
outfit_category_and_index (Tuple[OutfitCategory, int]) – The OutfitCategory and index to send.
- classmethod update_outfits(sim_info)¶
Update all outfits of a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper]) – The Sim to update outfits for.
- Returns:
True, if the outfits were updated successfully. False, if not.
- Return type:
bool
Stats¶
Bucks¶
- class CommonSimBucksUtils¶
Bases:
objectUtilities for bucks.
- classmethod add_all_perks(sim_info, bucks_type, no_cost=True, **__)¶
remove_all_perks(sim_info, bucks_type, refund_cost=True, **__)
Add all Perks of a specified Bucks type to a Sim.
Note
A Sim needs to be spawned before their perks can be added.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the perks being added.
no_cost (bool, optional) – Set True to unlock the perk without spending perk points. Set False to spend perk points to unlock the perk. Default is False
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod can_afford_perk(sim_info, perk)¶
Determine if a Sim can afford to purchase a perk.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
perk (Union[BucksPerk, int]) – The perk to check.
- Returns:
The result of the test. True, if the perk can be afforded by the Sim. False, if not.
- Return type:
- classmethod get_available_perks_gen(sim_info, bucks_type)¶
Retrieve all available Perks for the specified Bucks Type and Sim.
Note
A Sim needs to be spawned before perks can be checked.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the perks being returned.
- Returns:
An iterator of Bucks Perks available to a Sim, regardless of locked status.
- Return type:
Iterator[BucksPerk]
- classmethod get_bucks_amount(sim_info, bucks_type)¶
Retrieve the number of available bucks to a Sim.
Note
A Sim needs to be spawned before bucks can be checked.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the amount to return.
- Returns:
The number of available bucks to a Sim for the specified Bucks Type or 0 if the Sim is not spawned, the bucks type does not exist, or a bucks tracker is not found.
- Return type:
int
- classmethod get_bucks_tracker(sim_info, bucks_type, add_if_none=False)¶
Retrieve the tracker on a Sim for a specified bucks type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The type of tracker to retrieve.
add_if_none (bool, optional) – Set True, to add the tracker to the Sim when it does not exist. Set False to only return the tracker if it exists. Default is False.
- Returns:
The tracker on the Sim associated with the specified Bucks Type or None when not found.
- Return type:
Union[BucksTrackerBase, None]
- classmethod get_locked_perks_gen(sim_info, bucks_type)¶
Retrieve all Perks for the specified Bucks Type a Sim has locked.
Note
A Sim needs to be spawned before perks can be checked.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the perks being returned.
- Returns:
An iterator of Bucks Perks that are locked for a Sim.
- Return type:
Iterator[BucksPerk]
- classmethod get_perk_bucks_type(perk)¶
Retrieve the Bucks Type associated with a Perk.
- Parameters:
perk (Union[BucksPerk, int]) – The identifier or instance of a Perk.
- Returns:
The type of bucks the perk is associated to.
- Return type:
CommonBucksType
- classmethod get_perk_unlock_cost(perk)¶
Retrieve the amount of points a perk costs to unlock.
- Parameters:
perk (Union[BucksPerk, int]) – The identifier or instance of a Perk.
- Returns:
The amount of points the perk costs to unlock.
- Return type:
int
- classmethod get_unlocked_perks_gen(sim_info, bucks_type)¶
Retrieve all Perks for the specified Bucks Type a Sim has unlocked.
Note
A Sim needs to be spawned before perks can be checked.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the perks being returned.
- Returns:
An iterator of Bucks Perks that are unlocked for a Sim.
- Return type:
Iterator[BucksPerk]
- classmethod has_perk_locked(sim_info, perk)¶
Determine if a Sim has a perk locked.
Note
The Sim being checked needs to be spawned.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
perk (Union[BucksPerk, int]) – The perk to check.
- Returns:
The result of the test. True, if the test passed. False, if the test failed.
- Return type:
- classmethod has_perk_unlocked(sim_info, perk)¶
Determine if a Sim has a perk unlocked.
Note
A Sim needs to be spawned to check this.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
perk (Union[BucksPerk, int]) – The perk to lock.
- Returns:
The result of the test. True, if the test passed. False, if the test failed.
- Return type:
- classmethod load_perk_by_guid(perk)¶
Load an instance of a Bucks Perk by its GUID.
- Parameters:
perk (Union[int, BucksPerk]) – The decimal identifier of a Bucks Perk.
- Returns:
An instance of a Bucks Perk matching the decimal identifier or None if not found.
- Return type:
Union[BucksPerk, None]
- classmethod lock_all_perks(sim_info, bucks_type, refund_cost=True)¶
Lock all perks of a specific Bucks type for a Sim.
Note
A Sim needs to be spawned before their perks can be locked.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the perks being locked.
refund_cost (bool, optional) – Set True to refund the cost of all unlocked perks. Set False to give no perk points back. Default is True
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod lock_perk(sim_info, perk, refund_cost=True)¶
Lock a perk for a Sim.
Note
A Sim needs to be spawned before their perks can be locked.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
perk (Union[BucksPerk, int]) – The perk to lock.
refund_cost (bool, optional) – Set True to refund the cost of the perk. Set False to give no perk points back. Default is True
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod modify_bucks(sim_info, bucks_type, amount, reason=None, **__)¶
Modify the number of points available for a specific Bucks Type.
Note
A Sim needs to be spawned before their Bucks can be modified.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the perk points.
amount (int) – The amount of points that will be added/removed from the Sim.
reason (str, optional) – The reason the perk points are being modified. Default is None.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod remove_all_perks(sim_info, bucks_type, refund_cost=True, reason=None, remove_perk_points=False, **__)¶
Remove all Perks of a specified Bucks type from a Sim.
Note
A Sim needs to be spawned before their perks can be removed.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the perks being removed.
refund_cost (bool, optional) – Set True to refund the cost of all unlocked perks. Set False to give no perk points back. Default is True
reason (str, optional) – The reason the perks are being removed. Default is None.
remove_perk_points (bool, optional) – Set True to remove all perk points in addition to all the perks. Set False to remove only the perks. If this is True, refund_cost will be ignored. Default is False.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod set_bucks(sim_info, bucks_type, amount, reason=None, **__)¶
Set the amount of Bucks available to a Sim.
Note
A Sim needs to be spawned before their Bucks can be modified.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
bucks_type (Union[CommonBucksType, BucksType]) – The Bucks associated with the perk points.
amount (int) – The amount of points that will be available to the Sim. The value should be at or above zero.
reason (str, optional) – The reason the perk points are being modified. Default is None.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod unlock_perk(sim_info, perk, no_cost=False)¶
Unlock a perk.
Note
A Sim needs to be spawned before their perks can be unlocked.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
perk (Union[BucksPerk, int]) – The perk to lock.
no_cost (bool, optional) – Set True to unlock the perk without spending perk points. Set False to spend perk points to unlock the perk. Default is False
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
Buffs¶
- class CommonBuffUtils¶
Bases:
_HasS4CLClassLogUtilities for manipulating Buffs on Sims.
- classmethod add_buff(sim_info, *buff, buff_reason=None)¶
Add a Buff to a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to add the buff to.
buff (Union[int, CommonBuffId, Buff]) – The buff being added.
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:
The result of adding the buffs. True, if the specified buff was successfully added. False, if not.
- Return type:
- classmethod add_buffs(sim_info, buffs, buff_reason=None)¶
Add Buffs to a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to add the specified buffs to.
buffs (Iterator[Union[int, CommonBuffId, Buff]]) – An iterator of identifiers of buffs being added.
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:
The result of adding the buffs. True, if all of the specified buffs were successfully added. False, if not.
- Return type:
- classmethod get_buff_component(sim_info)¶
Retrieve the buff component of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The buff component of the Sim or None if not found.
- Return type:
Union[BuffComponent, None]
- classmethod get_buff_id(buff_identifier)¶
Retrieve the GUID (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]
- classmethod get_buff_ids(sim_info)¶
Retrieve decimal identifiers for all Buffs of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to checked.
- Returns:
A collection of Buff identifiers on a Sim.
- Return type:
List[int]
- classmethod 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]
- classmethod 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]
- classmethod 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]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod has_all_buffs(sim_info, buffs)¶
Determine if the Sim has all the specified buffs.
- Parameters:
sim_info (SimInfo) – The Sim being checked.
buffs (Iterator[Union[int, CommonBuffId, Buff]]) – An iterator of buffs to check for.
- Returns:
The result of testing. True, if the Sim has all of the specified buffs. False, if not.
- Return type:
- classmethod has_any_buffs(sim_info, buffs)¶
Determine if the Sim has any of the specified buffs.
- Parameters:
sim_info (SimInfo) – The Sim being checked.
buffs (Iterator[Union[int, CommonBuffId, Buff]]) – An iterator of buffs to check for.
- Returns:
The result of testing. True, if the Sim has any of the specified buffs. False, if not.
- Return type:
- classmethod has_buff(sim_info, *buff)¶
Determine if the Sim has a Buff.
- Parameters:
sim_info (SimInfo) – The Sim being checked.
buff (Union[int, CommonBuffId, Buff]) – The buff to check for.
- Returns:
The result of testing. True, if the Sim has the specified buff. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if they have any fertility boosting buffs. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if they have any morning person buffs. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if they have any night owl buffs. False, if not.
- Return type:
- classmethod is_buff_available(buff)¶
Determine if a Buff is available for use.
Note
If the Buff is part of a package that is not installed, it will be considered as not available.
- Parameters:
buff (Union[int, CommonBuffId, Buff]) – The buff to check for.
- Returns:
True, if the Buff is available for use. False, if not.
- Return type:
bool
- classmethod load_buff_by_id(buff)¶
Load an instance of a Buff by its identifier.
- Parameters:
buff (Union[int, CommonBuffId, Buff]) – The identifier of a Buff.
- Returns:
An instance of a Buff matching the decimal identifier or None if not found.
- Return type:
Union[Buff, None]
- classmethod remove_buff(sim_info, *buff)¶
Remove a Buff from a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to remove the buff from.
buff (Union[int, CommonBuffId, Buff]) – The buff being removed.
- Returns:
The result of removing the buff. True, if the buff was successfully removed. False, if not.
- Return type:
- classmethod remove_buffs(sim_info, buffs)¶
Remove Buffs from a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to remove the specified buffs from.
buffs (Iterator[Union[int, CommonBuffId, Buff]]) – An iterator of identifiers of buffs being removed.
- Returns:
The result of removing the buffs. True, if all of the specified buffs were successfully removed. False, if not.
- Return type:
Currency¶
- class CommonSimCurrencyUtils¶
Bases:
objectUtilities for modifying various currency types of Sims.
- classmethod add_simoleons_to_household(sim_info, amount, reason, **kwargs)¶
Add an amount of simoleons to the Household of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
amount (int) – The amount of simoleons to add.
reason (CommonCurrencyModifyReason) – The reason the simoleons are being added.
- Returns:
True, if simoleons were added successfully. False, if not.
- Return type:
bool
- classmethod can_afford_simoleons(sim_info, amount)¶
Determine if a Sim can afford an amount of simoleons.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
amount (int) – The amount of simoleons to check.
- Returns:
True, if the household of the Sim can afford the simoleon amount. False, if not.
- Return type:
bool
- classmethod get_household_funds(sim_info)¶
Retrieve the Funds object that manages the Household Simoleons for the Household of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The FamilyFunds object of the Household of the specified Sim or None if the Sim did not have a Household.
- Return type:
Union[FamilyFunds, None]
- classmethod remove_simoleons_from_household(sim_info, amount, reason, require_full_amount=True, **kwargs)¶
Remove an amount of simoleons from the Household of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
amount (int) – The amount of simoleons to add.
reason (CommonCurrencyModifyReason) – The reason the simoleons are being removed.
require_full_amount (bool, optional) – If True, then the Sim must have the full amount for the removal to be successful. If False, the Sim does not require the full amount. Default is True.
- Returns:
The amount of simoleons removed from the household of the specified Sim. This amount may be lower than the specified amount, if the Sim did not have enough simoleons for removal.
- Return type:
float
Mood¶
Motives¶
Skills¶
Spells¶
- class CommonSimSpellUtils¶
Bases:
objectUtilities for unlocking and locking things, usually learned things such as Spells.
- classmethod add_all_spells(sim_info)¶
Make a Sim learn all Spells.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod add_spell(sim_info, spell, mark_as_new=True)¶
Make a Sim learn a Spell.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
spell (Union[int, Spell]) – The spell to add.
mark_as_new (bool, optional) – Set True to mark the Spell as being new. Set False to refrain from marking the spell as new. Default is True.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod add_spells(sim_info, spells, mark_as_new=True)¶
Make a Sim learn Spells.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
spells (Tuple[Union[int, Spell]]) – A collection of spells to add.
mark_as_new (bool, optional) – Set True to mark the Spells as being new. Set False to refrain from marking the spells as new. Default is True.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod load_spell_by_id(spell)¶
Load an instance of a Spell by its decimal identifier.
- Parameters:
spell (Union[int, CommonSpellId, Spell]) – The identifier of a Spell.
- Returns:
An instance of a Spell matching the decimal identifier or None if not found.
- Return type:
Union[Spell, None]
- classmethod remove_all_spells(sim_info)¶
Make a Sim unlearn all Spells.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod remove_spell(sim_info, spell)¶
Make a Sim unlearn a Spell.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
spell (Union[int, Spell]) – The spell to remove.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
- classmethod remove_spells(sim_info, spells)¶
Make a Sim unlearn Spells.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
spells (Tuple[Union[int, Spell]]) – A collection of spells to remove.
- Returns:
The result of executing the function. True, if successful. False, if not.
- Return type:
Traits¶
- class CommonTraitUtils¶
Bases:
_HasS4CLClassLogUtilities for manipulating Traits on Sims.
- classmethod add_trait(sim_info, *trait)¶
Add a Trait to a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to add the specified traits to.
trait (Union[int, CommonTraitId, Trait]) – The trait being added.
- Returns:
The result of adding the trait. True, if the trait was successfully added to the Sim. False, if not.
- Return type:
- classmethod 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, Trait]) – 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.
- classmethod add_traits(sim_info, traits)¶
Add Traits to a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to add the specified traits to.
traits (Iterator[Union[int, CommonTraitId, Trait]]) – An iterator of identifiers of traits being added.
- Returns:
The result of adding the traits. True, if all specified traits were successfully added to the Sim. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim can be impregnated. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim can create pregnancies. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim can impregnate other Sims. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim can not be impregnated. False, if not.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim can not impregnate other Sims. False, if not.
- Return type:
- classmethod can_not_reproduce(sim_info)¶
Determine if a pet Sim can reproduce.
..note:: Use
can_not_impregnate()andcan_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:
The result of testing. True, if the Sim can not reproduce. False, if not.
- Return type:
- classmethod can_reproduce(sim_info)¶
Determine if a pet Sim can reproduce.
Note
Use
can_impregnate()andcan_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:
The result of testing. True, if the Sim can reproduce. False, if not.
- Return type:
- classmethod 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]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod 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]
- classmethod get_trait_ids(sim_info)¶
Retrieve decimal identifiers for all Traits of a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper, PregnancyOffspringData]) – The Sim to check.
- Returns:
A collection of Trait identifiers on a Sim.
- Return type:
List[int]
- classmethod 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]
- classmethod 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]
- classmethod get_traits(sim_info)¶
Retrieve all Traits of a Sim.
- Parameters:
sim_info (Union[SimInfo, SimInfoBaseWrapper, PregnancyOffspringData]) – The Sim to check.
- Returns:
A collection of Traits on a Sim.
- Return type:
List[int]
- classmethod has_all_traits(sim_info, traits)¶
Determine if a Sim has any of the specified traits.
- Parameters:
sim_info (SimInfo) – The Sim to check.
traits (Iterator[Union[int, CommonTraitId, Trait]]) – An iterator of identifiers of Traits.
- Returns:
The result of testing. True, if the Sim has any of the specified traits. False, if not.
- Return type:
- classmethod has_animal_attraction(sim_info)¶
Determine if a Sim has an Animal Attraction.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if not.
- Return type:
- classmethod has_animal_whisperer(sim_info)¶
Determine if a Sim is an Animal Whisperer.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if not.
- Return type:
- classmethod has_any_traits(sim_info, traits)¶
Determine if a Sim has any of the specified traits.
- Parameters:
sim_info (SimInfo) – The Sim to check.
traits (Iterator[Union[int, CommonTraitId, Trait]]) – An iterator of identifiers of Traits.
- Returns:
The result of testing. True, if the Sim has any of the specified traits. False, if not.
- Return type:
- classmethod has_challenge_kindness_ambassador(sim_info)¶
Determine if a Sim has Challenged the Kindness Ambassador.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has challenged the kindness ambassador. False, if not.
- Return type:
- classmethod has_commitment_issues(sim_info)¶
Determine if a Sim has Commitment Issues.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if not.
- Return type:
- classmethod has_feminine_frame(sim_info)¶
Determine if a Sim has a Feminine Body Frame.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has a feminine frame. False, if not.
- Return type:
- classmethod has_masculine_frame(sim_info)¶
Determine if a Sim has a Masculine Body Frame.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has a masculine frame. False, if not.
- Return type:
- classmethod has_trait(sim_info, *trait)¶
Determine if a Sim has a Trait.
- Parameters:
sim_info (SimInfo) – The Sim to check.
trait (Union[int, CommonTraitId, Trait]) – The trait to check for.
- Returns:
The result of testing. True, if the Sim has the specified trait. False, if not.
- Return type:
- classmethod hates_children(sim_info)¶
Determine if a Sim Hates Children.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Hates Children trait. False, if not.
- Return type:
- classmethod is_active(sim_info)¶
Determine if a Sim is active.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_aggressive_pet(sim_info)¶
Determine if a pet Sim is Aggressive.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_alluring(sim_info)¶
Determine if a Sim is Alluring.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_antiseptic(sim_info)¶
Determine if a Sim is Antiseptic.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_bro(sim_info)¶
Determine if a Sim is a Bro.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_carefree(sim_info)¶
Determine if a Sim is Care Free.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_cat_lover(sim_info)¶
Determine if a Sim is a Cat Lover.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_clumsy(sim_info)¶
Determine if a Sim is Clumsy.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_conflicting_trait(sim_info, trait_id)¶
Determine if a Trait conflicts with any of the Sims current Traits.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
trait_id (int) – The identifier of the trait to check.
- Returns:
The result of testing. True, if the specified Trait conflicts with any Traits the Sim currently has. False, if not.
- Return type:
- classmethod is_criminal(sim_info)¶
Determine if a Sim is a Criminal.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_dastardly(sim_info)¶
Determine if a Sim is Dastardly.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_dog_lover(sim_info)¶
Determine if a Sim is a Dog Lover.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_evil(sim_info)¶
Determine if a Sim is Evil.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_fertile(sim_info)¶
Determine if a Sim is Fertile.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_friendly_pet(sim_info)¶
Determine if a pet Sim is Friendly.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_geek(sim_info)¶
Determine if a Sim is a geek.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_genius(sim_info)¶
Determine if a Sim is a Genius.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_ghost_trait(trait_identifier)¶
Determine if a trait is a Ghost trait.
- Parameters:
trait_identifier (Union[int, CommonTraitId, Trait]) – An identifier of a trait.
- Return type:
bool- Returns:
True, if the specified trait is a ghost trait. False, if not.
- classmethod is_glutton(sim_info)¶
Determine if a Sim is a Glutton.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_glutton_human(sim_info)¶
Determine if a non pet Sim is a Glutton
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_glutton_pet(sim_info)¶
Determine if a pet Sim is a Glutton.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_good(sim_info)¶
Determine if a Sim is Good.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_gregarious(sim_info)¶
Determine if a Sim is Gregarious.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_hot_headed(sim_info)¶
Determine if a Sim is Hot Headed.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_hunter_pet(sim_info)¶
Determine if a pet Sim is a Hunter.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_incredibly_friendly(sim_info)¶
Determine if a Sim is Incredibly Friendly.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_insane(sim_info)¶
Determine if a Sim is Insane.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_insider(sim_info)¶
Determine if a Sim is an Insider.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_lazy(sim_info)¶
Determine if a Sim is Lazy.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_loner(sim_info)¶
Determine if a Sim is a Loner.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_love_guru(sim_info)¶
Determine if a Sim is a Love Guru.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_loyal_pet(sim_info)¶
Determine if a pet Sim is Loyal.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_mean(sim_info)¶
Determine if a Sim is Mean.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_mentor(sim_info)¶
Determine if a Sim is a Mentor.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_morning_person(sim_info)¶
Determine if a Sim is a Morning Person.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_naughty_pet(sim_info)¶
Determine if a pet Sim is Naughty.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_neat(sim_info)¶
Determine if a Sim is neat.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_night_owl(sim_info)¶
Determine if a Sim is a Night Owl.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_player(sim_info)¶
Determine if a Sim has the Player trait.
Note
This does not indicate whether the Sim is one of the Players Sims, it simply indicates if they have the trait that makes other Sims less jealous.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_self_absorbed(sim_info)¶
Determine if a Sim is Self Absorbed.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_self_assured(sim_info)¶
Determine if a Sim is Self Assured.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_service_sim(sim_info)¶
Determine if a Sim is a service Sim.
..warning:: Obsolete: Use
is_service_sim()inCommonSimTypeUtilsinstead.- Return type:
- classmethod is_shameless(sim_info)¶
Determine if a Sim is Shameless.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_sincere(sim_info)¶
Determine if a Sim is Sincere.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_skittish_pet(sim_info)¶
Determine if a pet Sim is Skittish.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_slob(sim_info)¶
Determine if a Sim is a Slob.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_snob(sim_info)¶
Determine if a Sim is a Snob.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod 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:
The result of testing. True, if the Sim is a special NPC. False, if the Sim is not a Special NPC.
- Return type:
- classmethod is_squeamish(sim_info)¶
Determine if a Sim is Squeamish.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_survivalist(sim_info)¶
Determine if a Sim is a Survivalist.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod is_trait_available(trait)¶
Determine if a Trait is available for use.
Note
If the Trait is part of a package that is not installed, it will be considered as not available.
- Parameters:
trait (Union[int, CommonTraitId, Trait]) – The trait to check for.
- Returns:
True, if the Trait is available for use. False, if not.
- Return type:
bool
- classmethod is_unflirty(sim_info)¶
Determine if a Sim is Unflirty.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim has the Trait. False, if the Sim does not have the Trait.
- Return type:
- classmethod load_trait_by_id(trait)¶
Load an instance of a Trait by its identifier.
- Parameters:
trait (Union[int, CommonTraitId, Trait]) – The identifier of a Trait.
- Returns:
An instance of a Trait matching the decimal identifier or None if not found.
- Return type:
Union[Trait, None]
- classmethod prefers_menswear(sim_info)¶
Determine if a Sim prefers Mens Clothing.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim prefers menswear. False, if not.
- Return type:
- classmethod prefers_womenswear(sim_info)¶
Determine if a Sim prefers Womens Clothing.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim prefers womenswear. False, if not.
- Return type:
- classmethod remove_trait(sim_info, *trait)¶
Remove a Trait from a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to remove the specified traits from.
trait (Union[int, CommonTraitId, Trait]) – The trait being removed.
- Returns:
The result of removing the trait. True, if the trait was successfully removed from the Sim. False, if not.
- Return type:
- classmethod 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, Trait]) – 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.
- classmethod remove_traits(sim_info, traits)¶
Remove Traits from a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to remove the specified traits from.
traits (Iterator[Union[int, CommonTraitId, Trait]]) – An iterator of Trait identifiers of traits being removed.
- Returns:
The result of removing the traits. True, if all specified traits were successfully removed from the Sim. False, if not.
- Return type:
- classmethod 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, Trait]) – The first trait to remove/add
trait_id_two (Union[int, CommonTraitId, Trait]) – The second trait to remove/add
- Returns:
The result of swapping traits. True, if the Traits were swapped successfully. False, if neither Trait exists on a Sim or the traits were not swapped successfully.
- Return type:
- classmethod uses_toilet_sitting(sim_info)¶
Determine if a Sim uses the toilet while sitting.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim uses toilets while sitting. False, if not.
- Return type:
- classmethod uses_toilet_standing(sim_info)¶
Determine if a Sim uses the toilet while standing.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim uses toilets while standing. False, if not.
- Return type:
Statistics¶
Whims¶
- class CommonWhimUtils¶
Bases:
objectUtilities 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]
Unlocks¶
- class CommonSimUnlockUtils¶
Bases:
objectUtilities for unlocks.
- classmethod get_unlock_tracker(sim_info)¶
Retrieve tracker for unlocks for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The tracker for unlocks for the Sim or None if not found.
- Return type:
Union[UnlockTracker, None]
Locational¶
Location¶
- class CommonSimLocationUtils¶
Bases:
objectUtilities for manipulating the locations of Sims.
- classmethod are_in_same_room(sim_info_a, sim_info_b)¶
Determine if two Sims are in the same room.
Note
The entirety of “Outside” is considered the same “Room”, so if both Sims are outside, this function will return True.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is in the same room as Sim B. False, if not.
- Return type:
bool
- 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_object(sim_info, script_object)¶
Determine if a Sim can route to an Object.
Note
This function will account for locked doors as well.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
script_object (ScriptObject) – The Object to check.
- Returns:
True, if the Sim can route to the Object. False, if not.
- Return type:
bool
- static can_route_to_position(sim_info, position, routing_surface, orientation=sims4.math.Quaternion)¶
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_route_to_sim(sim_info_a, sim_info_b)¶
Determine if Sim A can route to Sim B.
- Parameters:
sim_info_a (SimInfo) – The Sim that would be routing to Sim B.
sim_info_b (SimInfo) – The Sim that Sim A would be routing to.
- Returns:
True, if Sim A can route to Sim B. 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
- classmethod get_current_room_id(sim_info)¶
Retrieve the id of the room a Sim is currently in.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The id of the room the Sim is currently in or -1 if their room is not found.
- Return type:
int
- 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:
- 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:
- 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
- classmethod is_in_shade(sim_info)¶
Determine if a Sim is currently in the shade.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim is in the shade. False, if not.
- Return type:
bool
- classmethod is_inside(sim_info)¶
Determine if a Sim is currently inside.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim is inside. False, if not.
- Return type:
bool
- classmethod is_inside_building(sim_info)¶
Determine if a Sim is currently inside a building.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim is inside a building. 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_outside(sim_info)¶
Determine if a Sim is currently outside.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim is outside. 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 is_within_range_of_location(sim_info, location, distance_in_squares)¶
Determine if a Sim is within a certain distance of a Location.
- Parameters:
sim_info (SimInfo) – The Sim to check.
location (CommonLocation) – A location.
distance_in_squares (float) – A unit measured in squares. 1 square is the size of 1 square in the Build/Buy mode visual grid. For comparison, a dining chair would be 1 square by 1 square. 0.5 would be half a square, or half a dining chair.
- Return type:
bool- Returns:
True, if the distance between the Sim and the Location is less than or equal to the specified distance in squares. False, if not.
- Returns:
bool
- static is_within_range_of_position(sim_info, position, distance_in_squares)¶
Determine if a Sim is within a certain distance of a Position.
- Parameters:
sim_info (SimInfo) – The Sim to check.
position (CommonVector3) – A position.
distance_in_squares (float) – A unit measured in squares. 1 square is the size of 1 square in the Build/Buy mode visual grid. For comparison, a dining chair would be 1 square by 1 square. 0.5 would be half a square, or half a dining chair.
- Return type:
bool- Returns:
True, if the distance between the Sim and the Position is less than or equal to the specified distance in squares. False, if not.
- Returns:
bool
- static send_near_location(sim_info, location, go_here_interaction_id=None, location_search_flags=0)¶
Send a Sim near the specified location.
- Parameters:
sim_info (SimInfo) – The Sim to send.
location (CommonLocation) – The location to send the sim near to.
go_here_interaction_id (int, optional) – If supplied, this interaction will be used instead of the vanilla Go Here interaction. Default is None.
location_search_flags (FGLSearchFlag, optional) – Flags used when locating a nearby location. Default is FGLSearchFlag.STAY_IN_CURRENT_BLOCK, which will limit the search to the current Room.
- Returns:
The result of sending the Sim near the specified location.
- Return type:
CommonEnqueueResult
- static send_near_position(sim_info, position, level, go_here_interaction_id=None, position_search_flags=0)¶
Send a Sim near the specified position.
- 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.
go_here_interaction_id (int, optional) – If supplied, this interaction will be used instead of the vanilla Go Here interaction. Default is None.
position_search_flags (FGLSearchFlag, optional) – Flags used when locating a nearby position. Default is FGLSearchFlag.STAY_IN_CURRENT_BLOCK, which will limit the search to the current Room.
- Returns:
The result of sending the Sim near the specified position.
- Return type:
CommonEnqueueResult
- static send_to_location(sim_info, location, go_here_interaction_id=None)¶
Send a Sim to the specified location.
- Parameters:
sim_info (SimInfo) – The Sim to send.
location (CommonLocation) – The location to send the sim near to.
go_here_interaction_id (int, optional) – If supplied, this interaction will be used instead of the vanilla Go Here interaction. Default is None.
- Returns:
The result of sending the Sim to the specified location.
- Return type:
CommonEnqueueResult
- static send_to_position(sim_info, position, level, go_here_interaction_id=None)¶
Send a Sim to the specified position.
- 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.
go_here_interaction_id (int, optional) – If supplied, this interaction will be used instead of the vanilla Go Here interaction. Default is None.
- Returns:
The result of sending the Sim to the specified position.
- Return type:
CommonEnqueueResult
- 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:
HasClassLogUtilities for manipulating households.
- classmethod 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
- classmethod add_sim_to_target_household(sim_info, target_sim_info, destroy_if_empty_household=True)¶
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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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]
- classmethod 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
- classmethod get_all_households_generator()¶
Retrieve a collection of all households.
- Returns:
An iterator of all Households.
- Return type:
Iterator[Household]
- classmethod 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
- classmethod 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]
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod get_household_members_from_household_gen(household)¶
Retrieve the Sims within a Household.
- Parameters:
household (Household) – An instance of a Household
- Returns:
An iterator of Sims within the specified household.
- Return type:
Iterator[SimInfo]
- classmethod get_household_members_gen(sim_info)¶
Retrieve the Sims within the household of a Sim.
Note
The result will include the specified Sim as well.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
- Returns:
An iterator of Sims within the household of the specified Sim.
- Return type:
Iterator[SimInfo]
- classmethod 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]
- classmethod 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]
- classmethod 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
- classmethod get_id(household)¶
Retrieve the decimal identifier of a Household.
- Parameters:
household (
Household) – An instance of a Household.- Type:
Household
- Returns:
The identifier of the Household or 0 if an error occurs.
- Return type:
int
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_mod_identity()¶
Retrieve the identity of the mod that owns the class.
Warning
Override this function with the
CommonModIdentityof your mod.This is a MUST override to allow for proper Exception Handling and Logging!
- Returns:
An instance of CommonModIdentity
- Return type:
- Raises:
NotImplementedError – Thrown when the function is not implemented.
- classmethod 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
- classmethod 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 (
SimInfo) – An instance of a Sim.- Type:
sim_info: SimInfo
- Returns:
The number of Sims in the household of the specified Sim.
- Return type:
int
- classmethod 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 iterator of Sims in the active household.
- Return type:
Iterator[SimInfo]
- classmethod 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 iterator of Sims in the specified Household.
- Return type:
Iterator[SimInfo]
- classmethod 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
- classmethod 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
- classmethod is_alone_on_home_lot(sim_info)¶
Determine if a Sim is alone on their home lot.
- Parameters:
sim_info (
SimInfo) – 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
- classmethod 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
- classmethod 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 (
SimInfo) – 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
- classmethod 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
- classmethod 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]
- classmethod 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]
- classmethod 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 iterator of Households with the specified name.
- Return type:
Iterator[Household]
- classmethod 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¶
Crafting¶
Misc¶
Sim¶
- class CommonSimUtils¶
Bases:
objectUtilities for retrieving Sims in different ways.
Note
Available commands:
s4clib_testing.display_name_of_currently_active_sim
s4clib_testing.display_names_of_all_sims
- classmethod 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 or None if not found.
- Return type:
Union[Sim, None]
- classmethod get_active_sim_id()¶
Retrieve the decimal identifier for the Currently Active Sim.
Note
The Active Sim is the Sim with the Plumbob above their head.
- Returns:
The decimal identifier of the active Sim or -1 if the active Sim does not have an id or if no active Sim was found.
- Return type:
int
- classmethod get_active_sim_info()¶
Retrieve a SimInfo object of the Currently Active Sim.
- Returns:
The SimInfo of the Active Sim or None if not found.
- Return type:
Union[SimInfo, None]
- classmethod get_all_sims_generator(include_sim_callback=None, allow_hidden_flags=objects.ALL_HIDDEN_REASONS)¶
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.
allow_hidden_flags (HiddenReasonFlag, optional) – Flags to indicate the types of hidden Sims to consider as being instanced. Default is ALL_HIDDEN_REASONS
- Returns:
An iterator of all Sims matching the include_sim_callback filter.
- Return type:
Iterator[Sim]
- classmethod get_instanced_sim_info_for_all_sims_generator(include_sim_callback=None, allow_hidden_flags=objects.ALL_HIDDEN_REASONS)¶
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.
allow_hidden_flags (HiddenReasonFlag, optional) – Flags to indicate the types of hidden Sims to consider as being instanced. Default is ALL_HIDDEN_REASONS
- Returns:
An iterator of all Sims matching the include_sim_callback filter.
- Return type:
Iterator[SimInfo]
- classmethod get_sim_id(sim_identifier)¶
Retrieve a SimId (int) from a Sim identifier.
- Parameters:
sim_identifier (Union[int, Sim, SimInfo, SimInfoBaseWrapper, ScriptObject]) – The identifier or instance of a Sim.
- Returns:
The decimal identifier for the Sim instance or 0 if a problem occurs.
- Return type:
int
- classmethod get_sim_info(sim_identifier)¶
Retrieve a SimInfo instance from a Sim identifier.
- Parameters:
sim_identifier (Union[int, Sim, SimInfo, SimInfoBaseWrapper, ScriptObject]) – 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, SimInfoBaseWrapper, None]
- classmethod 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 iterator of all Sims matching the include_sim_callback filter.
- Return type:
Iterator[SimInfo]
- classmethod get_sim_info_for_all_sims_with_first_name_generator(first_name)¶
Retrieve a SimInfo object for each and every Sim with the specified First Name.
- Parameters:
first_name (str) – A first name to look for.
- Returns:
An iterator of Sims found with the specified first name.
- Return type:
Iterator[SimInfo]
- classmethod get_sim_info_for_all_sims_with_last_name_generator(last_name)¶
Retrieve a SimInfo object for each and every Sim with the specified Last Name.
- Parameters:
last_name (str) – A last name to look for.
- Returns:
An iterator of Sims found with the specified last name.
- Return type:
Iterator[SimInfo]
- classmethod 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 iterator of Sims found with the specified first and last name.
- Return type:
Iterator[SimInfo]
- classmethod get_sim_info_manager()¶
Retrieve the manager that manages the Sim Info of all Sims in a game world.
- Returns:
The manager that manages the Sim Info of all Sims in a game world.
- Return type:
SimInfoManager
- classmethod 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]
- classmethod get_sim_instance(sim_identifier, allow_hidden_flags=objects.ALL_HIDDEN_REASONS)¶
Retrieve a Sim instance from a Sim identifier.
- Parameters:
sim_identifier (Union[int, Sim, SimInfo]) – The identifier or instance of a Sim to use.
allow_hidden_flags (HiddenReasonFlag, optional) – Flags to indicate the types of hidden Sims to consider as being instanced. Default is ALL_HIDDEN_REASONS
- Returns:
The instance of the specified Sim or None if no instance was found.
- Return type:
Union[Sim, None]
- classmethod is_active_sim(sim_info)¶
Determine if a Sim is the active Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the specified Sim is the active Sim. False, if not.
- Return type:
bool
- classmethod is_instanced(sim_info, allow_hidden_flags=objects.ALL_HIDDEN_REASONS)¶
Determine if a Sim is instanced.
Note
Only SimInfo with a Sim instance (
get_sim_instance()) are considered as instanced. In other words, if a Sim does not have a Sim instance, it means they are not loaded on the current lot.- Parameters:
sim_info (SimInfo) – The info of a Sim.
allow_hidden_flags (HiddenReasonFlag, optional) – Flags to indicate the types of hidden Sims to consider as being instanced. Default is ALL_HIDDEN_REASONS
- Returns:
True, if the Sim is instanced. False, if not.
- Return type:
bool
Autonomy¶
- class CommonSimAutonomyUtils¶
Bases:
objectUtilities for manipulating the autonomy of Sims.
- static get_autonomy_state(sim_info)¶
get_autonomy_state_setting(sim_info)
Retrieve the current autonomy state of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Return type:
AutonomyState
- 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
Career¶
- class CommonSimCareerUtils¶
Bases:
_HasS4CLClassLogUtilities for manipulating the Careers of Sims.
- classmethod add_career(sim_info, career_identifier, remove_all_existing_careers=False, randomize_agency=True, use_career_history=True, force_out_of_retirement=False, force_quit_previous_jobs=False, show_confirmation_dialog=False, user_level=None, career_level=None, give_skipped_rewards=True, defer_rewards=False, show_post_quit_message=True, schedule_shift_override=careers.career_enums.CareerShiftType.ALL_DAY, show_join_message=True, disallowed_reward_types=(), force_rewards_to_sim_info_inventory=False, defer_first_assignment=False, schedule_init_only=False, allow_outfit_generation=True)¶
Add a Career to a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
career_identifier (Union[int, Career]) – The Guid64 identifier of a Career, the decimal identifier of a Career, or a Career instance.
remove_all_existing_careers (bool, optional) – If True, all careers the Sim is currently a part of will be removed. If False, the existing careers of the Sim will not be removed. Default is False.
randomize_agency (bool, optional) – If True, a random agency from available agencies will be randomly chosen for a Career that has agencies upon being added. If False, the “Select An Agency” dialog will appear. Default is True.
use_career_history (bool, optional) – If True, then the career history of the Sim will be used when adding the Career. If False, then the career history of the Sim will not be used when adding the Career. Default is True.
force_out_of_retirement (bool, optional) – If True, the Sim will be forced out of retirement without prompting the player. If False, a dialog will prompt the player to choose whether or not to come out of retirement. Default is False.
force_quit_previous_jobs (bool, optional) – If True, the Sim will be forced to quit all of their previous jobs. If False, a confirmation will display that will prompt the player whether this should happen or not. Default is False.
show_confirmation_dialog (bool, optional) – Show Confirmation Dialog. Default is False.
user_level (int, optional) – The level of the career track to assign to the Sim upon joining the career. Default is None.
career_level (CareerLevel, optional) – The Career Level to set the Sim to upon joining the career. Default is None.
give_skipped_rewards (bool, optional) – If True, any rewards skipped due to the career level skips will be given to the Sim upon joining the career. If False, no rewards will be given for career levels before the one they join into. Default is True.
defer_rewards (bool, optional) – If True, rewards will be deferred until later. If False, rewards will be given immediately. Default is False.
show_post_quit_message (bool, optional) – If True, the quit message for their existing career before switching will be displayed. If False, the quit message will not be displayed. Default is True.
schedule_shift_override (CareerShiftType, optional) – An override for the Sims shift schedule. Default is CareerShiftType.ALL_DAY.
show_join_message (bool, optional) – If True, the joined career message will be displayed after joining the career. If False, the join message will not be displayed. Default is True.
disallowed_reward_types (Tuple[RewardType], optional) – A collection of rewards types not allowed to be collected by the Sim that is joining. If empty, all rewards will be allowed to be rewarded. Default is empty.
force_rewards_to_sim_info_inventory (bool, optional) – If True, rewards will be forced in the inventory of the joining Sim. If False, rewards will be sent to their intended locations as specified by the career. Default is False.
defer_first_assignment (bool, optional) – If True, the first assignment upon joining the career will be delayed until later. If False, the first assignment will not be delayed. Default is False.
schedule_init_only (bool, optional) – If True, Shift schedule will only be initialized. If False, Shift schedule will be setup fully. Default is False.
allow_outfit_generation (bool, optional) – If True, an outfit for the career will be generated upon join. If False, an outfit will not be generated. Default is True.
- Returns:
The result of adding the Career or the reason why it was not properly added.
- Return type:
- classmethod attend_career(career, allow_career_events=True)¶
Start a career without running any career events (If they are an active career).
- Parameters:
career (Career) – The career to mark.
allow_career_events (
bool) – If True, a career event will be started for active careers. If False, a career event will not be started for active careers. No effect on non active careers. Default is True.
- Return type:
allow_career_events: bool, optional
- Returns:
Tbe result of the action.
- Return type:
- classmethod determine_entry_level_into_career_for_sim(sim_info, career, use_career_history=True)¶
Determine the entry level into a Career for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
career (Career) – The career to retrieve an entry level of.
use_career_history (bool, optional) – If True, then the career history of the Sim will be used when adding the Career. If False, then the career history of the Sim will not be used when adding the Career. Default is True.
- Returns:
The career level for the career track (or branch career track) used, the level of the user in that career track, and the career track itself.
- Return type:
Tuple[int, int, TunableCareerTrack]
- classmethod get_all_careers_for_sim_gen(sim_info, include_career_callback=None)¶
Retrieve all Careers of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
include_career_callback (Callable[[Career], bool], optional) – If the result of this callback is True, the Career of the Sim will be included in the results. If set to None, All Careers of the Sim will be included. Default is None.
- Returns:
An iterator of all Careers matching the include_career_callback filter.
- Return type:
Iterator[Career]
- classmethod get_career(sim_info, career_identifier)¶
Retrieve the Career of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
career_identifier (Union[int, Career]) – The Guid64 identifier of a Career, the decimal identifier of a Career, or a Career instance.
- Returns:
The career of the Sim that matches the identifier or None if not found.
- Return type:
Union[Career, None]
- classmethod get_career_at_current_zone(sim_info)¶
Retrieve the Career of a Sim that has its location set to the current zone.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim works at the current zone. False, if not.
- Return type:
bool
- classmethod get_career_by_category(sim_info, career_category)¶
Retrieve the career of a Sim by its career category.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
career_category (CareerCategory) – The category to retrieve the career of.
- Returns:
A career matching the career category specified or None if not found.
- Return type:
Union[Career, None]
- classmethod get_career_tracker(sim_info)¶
Retrieve a career tracker for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The career tracker of the Sim or None if not found.
- Return type:
Union[CareerTracker, None]
- classmethod get_first_career(sim_info, include_career_callback=None)¶
Retrieve the first Career a Sim has.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
include_career_callback (Callable[[Career], bool], optional) – If the result of this callback is True, the Career of the Sim will be considered in the result. If set to None, All Careers of the Sim will be considered. Default is None.
- Returns:
The first career the Sim has, or None if they do not have a career.
- Return type:
Union[Career, None]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod has_career(sim_info, career_identifier)¶
has_career_by_guid(sim_info, career)
Determine if a Sim has a Career.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
career_identifier (Union[int, Career]) – The Guid64 identifier of a Career, the decimal identifier of a Career, or a Career instance.
- Returns:
True, if the Sim has the specified Career. False, if not.
- Return type:
bool
- classmethod has_career_at_current_zone(sim_info)¶
Determine if a Sim has a Career at the current zone.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim has a Career at the current zone. False, if not.
- Return type:
bool
- classmethod has_career_tracker(sim_info)¶
Determine if a Sim has a career tracker or not.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim has a career tracker. False, if not.
- Return type:
bool
- classmethod is_at_work(sim_info)¶
Determine if a Sim is currently at work.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim is currently at work for any of their careers. False, if not.
- Return type:
bool
- classmethod is_career_available_for_sim(sim_info, career, from_join=False)¶
Determine if a Career is available for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
career (Career) – A career.
from_join (bool, optional) – Use to flag whether the career is planned to be tested as though the Sim is joining it. Default is False.
- Returns:
The result of testing for availability. True, if the Career is available for the specified Sim. False, if not.
- Return type:
- classmethod is_sim_household_part_of_active_career_event(sim_info)¶
is_household_part_of_active_career_event(sim_info)
Determine if any members of a Sims Household are part of an active career event.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if any members of the Sims Household are taking part in an active career event. False, if not.
- Return type:
bool
- classmethod is_taking_part_in_active_career_event(sim_info)¶
Determine if a Sim is taking part in an active career event.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim is taking part in an active career event. False, if not.
- Return type:
bool
- classmethod randomize_career(sim_info, randomize_career_level=True, remove_all_existing_careers=True, randomize_agency=True, use_career_history=True, force_out_of_retirement=True, force_quit_previous_jobs=True, check_availability=True)¶
set_random_career( sim_info, choose_random_career_level=True, remove_all_existing_careers=True, randomize_agent=True, use_career_history=True, force_out_of_retirement=False, force_quit_previous_jobs=False, check_availability=True )
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
randomize_career_level (bool, optional) – If True, a random Career Level will be chosen in addition to the Career. If False, the Career Level will be dictated by the Sim that is joining. Default is True.
remove_all_existing_careers (bool, optional) – If True, all careers the Sim is currently a part of will be removed. If False, the existing careers of the Sim will not be removed. Default is False.
randomize_agency (bool, optional) – If True, a random agency from available agencies will be randomly chosen for a Career that has agencies upon being added. If False, the “Select An Agency” dialog will appear. Default is True.
force_out_of_retirement (bool, optional) – If True, the Sim will be forced out of retirement without prompting the player. If False, a dialog will prompt the player to choose whether or not to come out of retirement. Default is False.
force_quit_previous_jobs (bool, optional) – If True, the Sim will be forced to quit all of their previous jobs. If False, a confirmation will display that will prompt the player whether this should happen or not. Default is False.
use_career_history (bool, optional) – If True, then the career history of the Sim will be used when adding the Career. If False, then the career history of the Sim will not be used when adding the Career. Default is True.
check_availability (bool, optional) – If True, every career will be checked for availability before becoming available. If False, every career regardless of availability will be selectable. Default is True. WARNING: A Career that is not allowed for a Sim may be chosen if this is set to False!
- Returns:
The result of setting their career.
- Return type:
- classmethod remove_careers(sim_info, show_post_quit_message=False, update_ui_after_remove=True, include_career_callback=None)¶
Remove Careers of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
show_post_quit_message (bool, optional) – If True, the post quit message will show for each removed Career. If False, no post quit message will show for each removed Career. Default is False.
update_ui_after_remove (bool, optional) – If True, the UI will be updated after the Career is removed. If False, the UI will not be updated. Default is True.
include_career_callback (Callable[[Career], bool], optional) – If the result of this callback is True, the Career of the Sim will be removed. If set to None, All Careers of the Sim will be removed. Default is None.
- Return type:
None
- classmethod start_active_career_on_current_lot(career, career_event=None)¶
Start a career event on the current lot for an Active career.
Note
This function only works if the Career is flagged as an Active Career (is_active in the Tuning).
- Parameters:
career (Career) – The career to begin.
career_event (CareerEvent, optional) – The career event to trigger. If set to None, a random career event will be chosen from the career. Default is None.
- Returns:
Tbe result of the action.
- Return type:
Club¶
- class CommonSimClubUtils¶
Bases:
objectUtilities for manipulating the Clubs of Sims.
- static are_part_of_same_club_gathering(sim_info_a, sim_info_b)¶
Determine if two Sims are at the same Club Gathering
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is taking part in the same Club Gathering as Sim B. False, if not.
- Return type:
bool
- static get_clubs_currently_gathering_gen(sim_info, include_club_callback=<function CommonFunctionUtils.noop_true>)¶
Retrieve all Clubs the Sim is in that are currently hosting a gathering.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
include_club_callback (Callable[[Club], bool], optional) – If the result of this callback is True, the Club will be included in the results. The default callback will allow all.
- Returns:
An iterator of all Clubs the Sim is in that are currently gathering and that pass the include_club_callback filter.
- Return type:
Iterator[Club]
- static get_clubs_gen(sim_info, include_club_callback=<function CommonFunctionUtils.noop_true>)¶
Retrieve all Clubs a Sim is a part of.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
include_club_callback (Callable[[Club], bool], optional) – If the result of this callback is True, the Club will be included in the results. The default callback will allow all.
- Returns:
An iterator of all Clubs the specified Sim is a part of and that pass the include callback filter.
- Return type:
Iterator[Club]
- static get_current_club_gathering(sim_info)¶
Retrieve the Club Gathering a Sim is currently taking part in.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The Club Gathering the specified Sim is a part of or None if the Sim is not a part of any Club Gathering.
- Return type:
Union[ClubGatheringSituation, None]
- 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 Options¶
- class CommonSimGenderOptionUtils¶
Bases:
_HasS4CLClassLogUtilities 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:
The result of testing. True, if the Sim can be impregnated. False, if the Sim can not be impregnated.
- Return type:
- 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:
The result of testing. True, if the Sim can create pregnancies. False, if the Sim can not create pregnancies.
- Return type:
- 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:
The result of testing. True, if the Sim can impregnate other Sims. False, if the Sim can not impregnate other Sims.
- Return type:
- 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:
The result of testing. True, if the Sim can not be impregnated. False, if the Sim can be impregnated.
- Return type:
- 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:
The result of testing. True, if the Sim can not impregnate other Sims. False, if the Sim can impregnate other Sims.
- Return type:
- static can_not_reproduce(sim_info)¶
Determine if a pet sim can reproduce.
..note:: Use
can_not_impregnate()andcan_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:
The result of testing. True, if the Sim can not reproduce. False, if the Sim can reproduce.
- Return type:
- static can_reproduce(sim_info)¶
Determine if a Pet Sim can reproduce.
Note
Use
can_impregnate()andcan_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:
The result of testing. True, if the Sim can reproduce. False, if the Sim can not reproduce.
- Return type:
- static determine_toilet_sitting_trait(sim_info)¶
Determine the trait that would indicate a Sim uses the toilet while sitting.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The trait that would indicate the Sim uses the toilet while sitting or None if no trait is found.
- Return type:
Union[CommonTraitId, None]
- static determine_toilet_sitting_trait_by_species(species)¶
Determine the trait that would indicate a Sim uses the toilet while sitting.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The species to get the trait for.
- Returns:
The trait that would indicate the Sim uses the toilet while sitting or None if no trait is found.
- Return type:
Union[CommonTraitId, None]
- static determine_toilet_standing_trait(sim_info)¶
Determine the trait that would indicate a Sim uses the toilet while standing.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The trait that would indicate the Sim uses the toilet while standing or None if no trait is found.
- Return type:
Union[CommonTraitId, None]
- static determine_toilet_standing_trait_by_species(species)¶
Determine the trait that would indicate a Sim uses the toilet while standing.
- Parameters:
species (Union[CommonSpecies, Species, SpeciesExtended, int]) – The species to get the trait for.
- Returns:
The trait that would indicate the Sim uses the toilet while standing or None if no trait is found.
- Return type:
Union[CommonTraitId, None]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_sexuality_status_trait(sim_info, sexuality_status)¶
Retrieve the trait associated with a sexuality status.
- Parameters:
sim_info (SimInfo) – An instance of the Sim to receive or be checked for the trait.
sexuality_status (ExploringOptionsStatus) – The sexuality status to look for.
- Returns:
The trait associated with the specified sexuality status or None if not found.
- Return type:
Union[Trait, None]
- static has_breasts(sim_info)¶
Determine if a Sim has breasts.
Note
This will True if breasts are being forced on the Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of testing. True, if the Sim has breasts. False, if not.
- Return type:
- static has_feminine_frame(sim_info)¶
Determine if a sim has a Feminine Body Frame.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim does. False, if the Sim does not.
- Return type:
- static has_masculine_frame(sim_info)¶
Determine if a sim has a Masculine Body Frame.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim does. False, if the Sim does not.
- Return type:
- classmethod has_sexuality_exploration_status(sim_info, sexuality_status)¶
Determine if a Sim has the specified exploration status for their sexuality.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
sexuality_status (ExploringOptionsStatus) – The exploration status to check for.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod is_exploring_sexuality(sim_info)¶
Determine if a Sim is open to exploring their sexuality.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod is_not_exploring_sexuality(sim_info)¶
Determine if a Sim is not open to exploring their sexuality.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- static prefers_menswear(sim_info)¶
Determine if a sim prefers Mens Clothing.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim does. False, if the Sim does not.
- Return type:
- static prefers_womenswear(sim_info)¶
Determine if a sim prefers Womens Clothing.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim does. False, if the Sim does not.
- Return type:
- static set_can_use_toilet_sitting(sim_info, can_use_toilet_sitting)¶
Set whether a Sim can use a toilet while sitting or not.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
can_use_toilet_sitting (bool) – Whether or not the Sim will be able to use a toilet while sitting.
- Returns:
The result of setting toilet use posture. True, if successful set. False, if not.
- Return type:
- static set_can_use_toilet_standing(sim_info, can_use_toilet_standing)¶
Set whether a Sim can use a toilet while standing or not.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
can_use_toilet_standing (bool) – Whether or not the Sim will be able to use a toilet while standing.
- Returns:
The result of setting toilet use posture. True, if successful set. False, if not.
- Return type:
- classmethod set_is_exploring_sexuality(sim_info, is_exploring)¶
Set whether a Sim is open to explore their sexuality or not.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
is_exploring (bool) – Set True if the Sim should be set to Exploring. Set False if the Sim should be set to Not Exploring.
- Return type:
- 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:
The result of updating. True, if successful. False, if not.
- Return type:
- 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:
The result of updating. True, if successful. False, if not.
- Return type:
- 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:
The result of updating. True, if successful. False, if not.
- Return type:
- 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:
The result of updating. True, if successful. False, if not.
- Return type:
- 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:
The result of updating. True, if successful. False, if not.
- Return type:
- static update_gender_options_to_vanilla_female(sim_info, return_on_failure=False)¶
Update a Sim to the vanilla Sims 4 default gender options for Female Sims. (Feminine, Womenswear Preference, etc.)
Note
This will change the following things: Body Frame (Feminine), Clothing Preference (Feminine), Can Be Impregnated (True), Can Impregnate (False), Can Reproduce (True), Toilet Usage Posture (Sitting), Voice Actor (FEMALE).
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
return_on_failure (bool, optional) – If True, if any update attempt fails, the function will return that result. If False, any failures will be ignored. Default is False.
- Returns:
The result of updating. True, if successful. False, if not.
- Return type:
- static update_gender_options_to_vanilla_male(sim_info, return_on_failure=False)¶
Update a Sim to the vanilla Sims 4 default gender options for Male Sims. (Masculine, Menswear Preference, etc.)
Note
This will change the following things: Body Frame (Masculine), Clothing Preference (Masculine), Can Be Impregnated (False), Can Impregnate (True), Can Reproduce (True), Toilet Usage Posture (Standing), Voice Actor (MALE).
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
return_on_failure (bool, optional) – If True, if any update attempt fails, the function will return that result. If False, any failures will be ignored. Default is False.
- Returns:
The result of updating. True, if successful. False, if not.
- Return type:
- static update_has_breasts(sim_info, has_breasts)¶
Give or Take Away the breasts of a Sim.
Note
Will only update Human Sims.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
has_breasts (bool) – If True, the Sim will be given breasts. If False, the Sim will not longer have breasts.
- Returns:
The result of updating. True, if the state of a Sim having breasts or not was changed. False, if not.
- Return type:
- static update_toilet_usage(sim_info, uses_toilet_standing)¶
Update how a Sim uses the toilet. i.e. Toilet Standing or Toilet Sitting.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
uses_toilet_standing (bool) – If True, the Sim will use toilets while standing and will not use toilets while sitting. If False, the Sim will use toilets while sitting and will not use toilets while standing.
- Returns:
The result of updating toilet use posture. True, if successful. False, if not.
- Return type:
- static uses_toilet_sitting(sim_info)¶
Determine if a sim uses the toilet while sitting.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim uses toilets while sitting. False, if the Sim does not use toilets while sitting.
- Return type:
- static uses_toilet_standing(sim_info)¶
Determine if a sim uses the toilet while standing.
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim uses toilets while standing. False, if the Sim does not use toilets while standing.
- Return type:
Gender Preferences¶
- class CommonSimGenderPreferenceUtils¶
Bases:
objectUtilities for Sim gender preferences.
- HIGH_PREFERENCE_THRESHOLD = 80¶
- LOW_PREFERENCE_THRESHOLD = 20¶
- classmethod determine_preferred_genders(sim_info, like_threshold=None, love_threshold=None, preference_type=sims4communitylib.enums.common_gender_preference_type.CommonGenderPreferenceType.ROMANTIC)¶
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. (This argument is obsolete, do not use)
love_threshold (int, optional) – A value indicating a high amount of preference. Default is cls.HIGH_PREFERENCE_THRESHOLD. (This argument is obsolete, do not use)
preference_type (Union[CommonGenderPreferenceType, GenderPreferenceType], optional) – The type of preference to use. Default is CommonGenderPreferenceType.ROMANTIC.
- Returns:
A collection of CommonGenders the specified Sim prefers.
- Return type:
Tuple[CommonGender]
- classmethod 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 the default preferred genders.
- Return type:
Tuple[CommonGender]
- classmethod get_gender_preference_amount(sim_info, gender, preference_type=sims4communitylib.enums.common_gender_preference_type.CommonGenderPreferenceType.ROMANTIC)¶
get_gender_preference_value(sim_info, gender, preference_type=CommonGenderPreferenceType.ROMANTIC)
Retrieve the amount a Sim prefers the specified gender.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
gender (CommonGender) – An instance of a gender.
preference_type (Union[CommonGenderPreferenceType, GenderPreferenceType], optional) – The type of preference to use. Default is CommonGenderPreferenceType.ROMANTIC.
- Returns:
The amount the Sim prefers the specified gender.
- Return type:
int
- classmethod has_preference_for(sim_info, target_sim_info, like_threshold=None, love_threshold=None, preference_type=sims4communitylib.enums.common_gender_preference_type.CommonGenderPreferenceType.ROMANTIC)¶
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. (This argument is obsolete, do not use)
love_threshold (int, optional) – A value indicating a high amount of preference. Default is CommonSimGenderPreferenceUtils.HIGH_PREFERENCE_THRESHOLD. (This argument is obsolete, do not use)
preference_type (Union[CommonGenderPreferenceType, GenderPreferenceType], optional) – The type of preference to use. Default is CommonGenderPreferenceType.ROMANTIC.
- Returns:
True, if the Source Sim has a preference for the Target Sim. False, if not.
- Return type:
bool
- classmethod has_preference_for_gender(sim_info, gender, like_threshold=None, love_threshold=None, preference_type=sims4communitylib.enums.common_gender_preference_type.CommonGenderPreferenceType.ROMANTIC)¶
Determine if a Sim has a preference for the specified gender.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
gender (CommonGender) – An instance of a CommonGender.
like_threshold (int, optional) – A value indicating a low amount of preference. Default is CommonSimGenderPreferenceUtils.LOW_PREFERENCE_THRESHOLD. (This argument is obsolete, do not use)
love_threshold (int, optional) – A value indicating a high amount of preference. Default is CommonSimGenderPreferenceUtils.HIGH_PREFERENCE_THRESHOLD. (This argument is obsolete, do not use)
preference_type (Union[CommonGenderPreferenceType, GenderPreferenceType], optional) – The type of preference to use. Default is CommonGenderPreferenceType.ROMANTIC.
- Returns:
True, if the Sim has a preference for the specified gender. False, if not.
- Return type:
bool
- classmethod set_gender_preference_amount(sim_info, gender, amount, preference_type=sims4communitylib.enums.common_gender_preference_type.CommonGenderPreferenceType.ROMANTIC)¶
Set the amount a Sim prefers the specified gender.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
gender (CommonGender) – An instance of a gender.
amount (int) – The amount the Sim prefers the specified gender.
preference_type (Union[CommonGenderPreferenceType, GenderPreferenceType], optional) – The type of preference to use. Default is CommonGenderPreferenceType.ROMANTIC.
- Returns:
True, if successfully set. False, it not.
- Return type:
bool
- classmethod set_preference_for_gender(sim_info, gender, is_attracted_to_gender, preference_type=sims4communitylib.enums.common_gender_preference_type.CommonGenderPreferenceType.ROMANTIC)¶
Set the preference a Sim has for a gender.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
gender (CommonGender) – An instance of a gender.
is_attracted_to_gender (Union[bool, None]) – True, if you want the Sim to be attracted to the gender. False, if you want the Sim to NOT be attracted to the gender. None, if you want the Sim to have no preferences.
preference_type (Union[CommonGenderPreferenceType, GenderPreferenceType], optional) – The type of preference to use. Default is CommonGenderPreferenceType.ROMANTIC.
- Returns:
True, if successfully set. False, it not.
- Return type:
- classmethod set_to_default_gender_preferences(sim_info)¶
Set a Sim to the default gender preferences.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Return type:
None
Interactions¶
- class CommonSimInteractionUtils¶
Bases:
HasClassLogUtilities for manipulating the interactions of Sims.
- static apply_pressure_to_next_interaction_of(sim_info)¶
Apply pressure to the interaction queue of a Sim for their next interaction.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- classmethod cancel_all_queued_interactions(sim_info, cancel_reason, finishing_type=interactions.interaction_finisher.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
- classmethod cancel_all_queued_or_running_interactions(sim_info, cancel_reason, finishing_type=interactions.interaction_finisher.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 that pass the “include” callback were successfully cancelled. False, if not.
- Return type:
bool
- classmethod cancel_all_running_interactions(sim_info, cancel_reason, finishing_type=interactions.interaction_finisher.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
- classmethod cancel_interaction(interaction, cancel_reason, finishing_type=interactions.interaction_finisher.FinishingType.USER_CANCEL, **kwargs)¶
Cancel an interaction.
- Parameters:
interaction (Interaction) – The interaction to cancel.
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.
- Returns:
True, if the interaction was cancelled successfully. False, if not.
- Return type:
bool
- classmethod create_interaction_context(sim_info, interaction_source=interactions.context.InteractionContext.SOURCE_SCRIPT_WITH_USER_INTENT, priority=interactions.priority.Priority.High, run_priority=interactions.priority.Priority.High, insert_strategy=interactions.context.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]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_mod_identity()¶
Retrieve the identity of the mod that owns the class.
Warning
Override this function with the
CommonModIdentityof your mod.This is a MUST override to allow for proper Exception Handling and Logging!
- Returns:
An instance of CommonModIdentity
- Return type:
- Raises:
NotImplementedError – Thrown when the function is not implemented.
- classmethod 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 iterator of all queued Interactions that pass the include callback filter.
- Return type:
Iterator[Interaction]
- classmethod get_queued_or_running_interactions_gen(sim_info, include_interaction_callback=None)¶
Retrieve all interactions that a Sim has queued or 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 iterator of all queued or running Interactions that pass the include callback filter.
- Return type:
Iterator[Interaction]
- classmethod 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 iterator of all running Interactions that pass the include callback filter.
- Return type:
Iterator[Interaction]
- classmethod 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]
- classmethod get_stand_passive_interaction(sim_info)¶
Retrieve a Stand Passive interaction appropriate for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The decimal identifier of a Stand Passive interaction appropriate for the Sim or -1 if no Stand interaction was found to be appropriate.
- Return type:
Union[int, CommonInteractionId]
- classmethod 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]
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod 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 iterator 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
- classmethod 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 iterator 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
- classmethod 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 iterator 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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod lock_interaction_queue(sim_info)¶
Lock the interaction queue of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- classmethod queue_interaction(sim_info, interaction_id, social_super_interaction_id=None, target=None, picked_object=None, interaction_context=None, 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.picked_object (Any, optional) – The picked object of the interaction. Default is None.
skip_if_running (
bool) – 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:
CommonEnqueueResult
- classmethod 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:
CommonEnqueueResult
- classmethod queue_social_mixer_interaction(sim_info, social_mixer_interaction_id, social_super_interaction_id, target=None, picked_object=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.
picked_object (Any, optional) – The picked object 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:
CommonEnqueueResult
- classmethod queue_super_interaction(sim_info, super_interaction_id, target=None, picked_object=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.
picked_object (Any, optional) – The picked object 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:
CommonEnqueueResult
- classmethod test_interaction(sim_info, interaction_id, social_super_interaction_id=None, target=None, picked_object=None, interaction_context=None, **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.
picked_object (Any, optional) – The picked object 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:
- classmethod 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:
- classmethod test_social_mixer_interaction(sim_info, social_mixer_interaction_id, social_super_interaction_id, target=None, picked_object=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.
picked_object (Any, optional) – The picked object 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:
- classmethod test_super_interaction(sim_info, super_interaction_id, target=None, picked_object=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.
picked_object (Any, optional) – The picked object 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:
- classmethod unlock_interaction_queue(sim_info)¶
Unlock the interaction queue of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
Inventory¶
- class CommonSimInventoryUtils¶
Bases:
_HasS4CLClassLogUtilities for manipulating the inventory of Sims.
- classmethod add_to_inventory(sim_info, object_definition_id, count=1, on_added=<function CommonFunctionUtils.noop>)¶
Add a number of Newly Created Objects to the Inventory of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
object_definition_id (int) – The decimal identifier of an Object.
count (int, optional) – The number of the specified Object to add. Default is 1.
on_added (Callable[[GameObject], None]) – A callback invoked when the object is added to the inventory.
- Returns:
True, if the count of the specified Object were added successfully. False, it not.
- Return type:
- classmethod 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]
- classmethod 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.
- Return type:
int- Returns:
The number of the specified Object in the inventory of the specified Sim.
- Type:
int
- classmethod get_inventory(sim_info)¶
Retrieve the inventory of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The inventory component of the Sim or None if not found.
- Return type:
Union[SimInventoryComponent, None]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_objects_in_inventory_by_definition_id_gen(sim_info, object_definition_id, include_object_callback=None)¶
Retrieve all Objects in the inventory of a Sim that match the definition id.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
object_definition_id (int) – The Definition ID of the objects to locate.
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]
- classmethod get_objects_in_inventory_by_definition_ids_gen(sim_info, object_definition_ids, include_object_callback=None)¶
get_objects_in_inventory_by_definition_id_gen(sim_info, object_definition_ids, include_object_callback=None)
Retrieve all Objects in the inventory of a Sim that match the definition ids.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
object_definition_ids (Tuple[int]) – The Definition IDs of the objects to locate.
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]
- classmethod has_inventory(sim_info)¶
Determine if a Sim has an inventory.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim has an inventory. False, if not.
- Return type:
bool
Change the flags of the inventory of a Sim so that it becomes hidden to the player.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the inventory of the specified Sim was made hidden. False, if not.
- Return type:
bool
- classmethod make_inventory_visible(sim_info)¶
Change the flags of the inventory of a Sim so that it becomes visible to the player.
Note
A Sim needs to be Instances in order to have an inventory to make visible.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the inventory of the specified Sim was made visible. False, if not.
- Return type:
bool
- classmethod 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
- classmethod 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
- classmethod open_inventory(sim_info)¶
Open the inventory of a Sim.
- Parameters:
sim_info (SimInfo) – The Sim to open the inventory of.
- Return type:
None
- classmethod 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.
- Return type:
bool- Returns:
True, if the count of the specified Object were removed successfully. False, if not.
- classmethod remove_from_inventory_by_definition(sim_info, object_definition, count=1)¶
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.
- Return type:
bool- Returns:
True, if the count of the specified Object were removed successfully. False, if not.
- classmethod set_ownership_of_all_items_in_sim_inventory_to_sim(sim_info_a, sim_info_b)¶
Change the ownership status of all items in the inventory of Sim A to be owned by the household of Sim B
- Parameters:
sim_info_a (SimInfo) – The objects in the inventory of this Sim will become owned by the household of Sim B
sim_info_b (SimInfo) – The household of this Sim will be the new owner for all items in the inventory of Sim A.
- Returns:
True, if ownership was transferred successfully. False, if not.
- Return type:
bool
Loot Actions¶
- class CommonSimLootActionUtils¶
Bases:
objectUtilities for manipulating Loot Actions for Sims.
- static apply_loot_actions_by_id_to_duo_sims(loot_actions_id, sim_info_actor, sim_info_target)¶
Apply loot actions by decimal identifier to two Sims at once.
- Parameters:
loot_actions_id (int) – The decimal identifier of a loot actions instance to apply.
sim_info_actor (SimInfo) – The Actor Sim to apply the loot actions to.
sim_info_target (SimInfo) – The Target Sim to apply the loot actions to.
- Returns:
True, if the loot actions applied successfully. False, if not.
- Return type:
bool
- static apply_loot_actions_by_id_to_sim(loot_actions_id, sim_info)¶
Apply loot actions to a Sim.
- Parameters:
loot_actions_id (int) – The decimal identifier of a loot actions instance to apply.
sim_info (SimInfo) – The Sim to apply the loot actions to.
- Returns:
True, if the loot actions applied successfully. False, if not.
- Return type:
bool
- static apply_loot_actions_by_ids_to_duo_sims(loot_actions_ids, sim_info_actor, sim_info_target)¶
apply_loot_actions_by_id_to_duo_sims(loot_actions_ids, sim_info_actor, sim_info_target)
Apply loot actions by decimal identifiers to two Sims at once.
- Parameters:
loot_actions_ids (Tuple[int]) – The decimal identifiers of the loot actions to apply.
sim_info_actor (SimInfo) – The Actor Sim to apply the loot actions to.
sim_info_target (SimInfo) – The Target Sim to apply the loot actions to.
- Returns:
True, if the loot actions applied successfully. False, if not.
- Return type:
bool
- static apply_loot_actions_by_ids_to_sim(loot_actions_ids, sim_info)¶
Apply loot actions to a Sim.
- Parameters:
loot_actions_ids (Tuple[int]) – The decimal identifiers of the loot actions to apply.
sim_info (SimInfo) – The Sim to apply the loot actions to.
- Returns:
True, if the loot actions applied successfully. False, if not.
- Return type:
bool
- static apply_loot_actions_to_duo_sims(loot_actions, sim_info_actor, sim_info_target)¶
Apply loot actions to two Sims at once.
- Parameters:
loot_actions (LootActions) – The loot actions to apply.
sim_info_actor (SimInfo) – The Actor Sim to apply the loot actions to.
sim_info_target (SimInfo) – The Target Sim to apply the loot actions to.
- Returns:
True, if the loot actions applied successfully. False, if not.
- Return type:
bool
- static apply_loot_actions_to_sim(loot_actions, sim_info)¶
Apply loot actions to a Sim.
- Parameters:
loot_actions (LootActions) – The loot actions to apply.
sim_info (SimInfo) – The Sim to apply the loot actions to.
- Returns:
True, if the loot actions applied successfully. False, if not.
- Return type:
bool
Relationships¶
- class CommonRelationshipUtils¶
Bases:
_HasS4CLClassLogUtilities for manipulating relationship bits, tracks, etc.
- classmethod 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:
- classmethod are_any_family_relatives(sim_info_a, sim_info_b)¶
Determine if two Sims are any family relatives.
Note
This includes only Family Relationship Bits, this does not check for blood relations.
Note
This includes Step relations or Cousins too.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A and Sim B are any family relatives. False, if not.
- Return type:
bool
- classmethod are_blood_relatives(sim_info_a, sim_info_b)¶
Determine if two Sims are blood relatives.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is blood relative of Sim B. False, if not.
- Return type:
bool
- classmethod are_direct_family_relatives(sim_info_a, sim_info_b)¶
Determine if two Sims are direct family relatives.
Note
This includes only Family Relationship Bits, this does not check for blood relations.
Note
This does not consider Step relations or Cousins.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A and Sim B are direct family relatives. False, if not.
- Return type:
bool
- classmethod 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
- classmethod 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
- classmethod get_all_family_relationship_bit_ids()¶
Retrieve a collection of Family Relationship Bits.
Note
This collection includes things like Step Siblings and Cousins.
Note
This collection does not include Husband and Wife.
- Returns:
A collection of relationship bits.
- Return type:
Tuple[CommonRelationshipBitId, …]
- classmethod get_direct_relation_family_relationship_bit_ids()¶
Retrieve a collection of Family Relationship Bits.
Note
This collection does not include things like Step Siblings and Cousins.
Note
This collection does not include Husband and Wife.
- Returns:
A collection of relationship bits.
- Return type:
Tuple[CommonRelationshipBitId, …]
- classmethod get_friendship_level(sim_info, target_sim_info)¶
Retrieve the level of Friendship between two Sims.
Note
The return will be “0.0” if a friendship relationship track is not found.
- 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
- classmethod get_friendship_relationship_track(sim_info_a, sim_info_b)¶
Get an appropriate Friendship Relationship track between Sim A and Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
The decimal identifier of the Friendship Relationship Track appropriate for Sim A to have with Sim B or None if not found.
- Return type:
Union[CommonRelationshipTrackId, None]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_relationship_bit_guid(relationship_bit)¶
Retrieve the GUID (Decimal Identifier) of a RelationshipBit.
- Parameters:
relationship_bit (Union[int, RelationshipBit]) – The identifier or instance of a RelationshipBit.
- Returns:
The decimal identifier of the RelationshipBit or None if the RelationshipBit does not have an id.
- Return type:
Union[int, None]
- classmethod 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
- classmethod get_relationships_gen(sim_info)¶
Retrieve all relationships a Sim has with other Sims.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
An iterator of Relationships a Sim has with other Sims.
- Return type:
Iterator[Relationship]
- classmethod get_romance_level(sim_info, target_sim_info)¶
Retrieve the level of Romance between two Sims.
Note
The return will be “0.0” if a romance relationship track is not found.
- 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
- classmethod get_romance_relationship_track(sim_info_a, sim_info_b)¶
Get an appropriate Romance Relationship track between Sim A and Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
The decimal identifier of the Romance Relationship Track appropriate for Sim A to have with Sim B or None if not found.
- Return type:
Union[CommonRelationshipTrackId, None]
- classmethod get_romantic_satisfaction_level(sim_info, target_sim_info)¶
Retrieve the level of Romantic Satisfaction between two Sims.
Note
The return will be “0.0” if a romance satisfaction track is not found.
- Parameters:
sim_info (SimInfo) – The Sim to use.
target_sim_info (SimInfo) – The Target Sim to use.
- Returns:
The current level of Romantic Satisfaction between two Sims.
- Return type:
float
- classmethod get_romantic_satisfaction_track(sim_info_a, sim_info_b)¶
Get an appropriate Romantic Satisfaction Relationship Track between Sim A and Sim B.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
The decimal identifier of the Romantic Satisfaction Relationship Track appropriate for Sim A to have with Sim B or None if not found.
- Return type:
Union[CommonRelationshipTrackId, None]
- classmethod get_romantically_committed_relationship_bits()¶
Retrieve a collection of relationship bits that signify two Sims are in a committed relationship.
- Returns:
A collection of relationship bits.
- Return type:
Tuple[CommonRelationshipBitId]
- classmethod 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
Promised
- 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 iterator of Sims the specified Sim is romantically committed to.
- Return type:
Iterator[SimInfo]
- classmethod 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 iterator of Sims that have the specified relationship bit with the specified Sim.
- Return type:
Iterator[SimInfo]
- classmethod 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 iterator of Sims that have any of the specified relationship bits with the specified Sim.
- Return type:
Iterator[SimInfo]
- classmethod 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
- classmethod has_permission_for_romantic_relationship_with(sim_info_a, sim_info_b)¶
Determine if two Sims are allowed to have a Romantic relationship together.
- Return type:
- classmethod has_permission_for_romantic_relationships(sim_info)¶
Determine if a Sim has permission to have romantic relationships with other Sims.
Note
In the vanilla game, only Teen, Adult, and Elder Sims have permission for romantic relationships.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if the test fails.
- Return type:
- classmethod has_permission_to_be_blood_relative_of(sim_info_a, sim_info_b)¶
Determine if Sim A has permission to be a Blood Relative of Sim B. (Such as Mother, Daughter, etc.)
Note
In the vanilla game, only Sims of the same species have permission to be Blood Relatives.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if the test fails.
- Return type:
- classmethod 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
- classmethod has_relationship_bit_with_any_sims(sim_info, relationship_bit_id, instanced_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
- classmethod 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
- classmethod 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
- classmethod 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
- classmethod is_any_family_relative_of(sim_info_a, sim_info_b)¶
Determine if Sim A is any family relative of Sim B.
Note
This includes only Family Relationship Bits, this does not check for blood relations.
Note
This includes Step relations or Cousins too.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is a direct family relative of Sim B. False, if not.
- Return type:
bool
- classmethod is_direct_family_relative_of(sim_info_a, sim_info_b)¶
Determine if Sim A is a direct family relative to Sim B.
Note
This includes only Family Relationship Bits, this does not check for blood relations.
Note
This does not consider Step relations or Cousins.
- Parameters:
sim_info_a (SimInfo) – An instance of a Sim.
sim_info_b (SimInfo) – An instance of a Sim.
- Returns:
True, if Sim A is a direct family relative of Sim B. False, if not.
- Return type:
bool
- classmethod is_friendly_with(sim_info, target_sim_info)¶
Determine if a Sim is friendly with a Target Sim.
Note
By default, a Sim is friendly with another Sim when their Friendship relationship is at or above 30. If both Sims are Animals, they are friendly with each other if they have the Friendly relationship bit.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
target_sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim is friendly with the Target Sim. False, if not.
- Return type:
bool
- classmethod is_romantic_with(sim_info, target_sim_info)¶
Determine if a Sim is romantic with a Target Sim.
Note
By default, a Sim is romantic with another Sim when their Romance relationship is at or above 30.
- Parameters:
sim_info (SimInfo) – The info of a Sim.
target_sim_info (SimInfo) – The info of a Sim.
- Returns:
True, if the Sim is romantic with the Target Sim. False, if not.
- Return type:
bool
- classmethod 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
- classmethod 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
- classmethod load_relationship_bit_by_id(relationship_bit)¶
Load an instance of a Relationship Bit by its identifier.
- Parameters:
relationship_bit (Union[int, CommonRelationshipBitId, RelationshipBit]) – The identifier of a Relationship Bit.
- Returns:
An instance of a Relationship Bit matching the decimal identifier or None if not found.
- Return type:
Union[RelationshipBit, None]
- classmethod load_relationship_track_by_id(relationship_track)¶
Load an instance of a Relationship Track by its identifier.
- Parameters:
relationship_track (Union[int, CommonRelationshipTrackId, RelationshipTrack]) – The identifier of a Relationship Track.
- Returns:
An instance of a Relationship Track matching the decimal identifier or None if not found.
- Return type:
Union[RelationshipTrack, None]
- classmethod 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:
- classmethod remove_relationship_bit_from_all(sim_info, relationship_bit_id)¶
Remove a relationship bit between a Sim and all other 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.
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
- classmethod set_friendship_level(sim_info, target_sim_info, level)¶
Set the level of Friendship between two Sims.
- Parameters:
sim_info (SimInfo) – The Sim to use.
target_sim_info (SimInfo) – The Target Sim to use.
level (float) – The new level of relationship between the Sims.
- classmethod set_relationship_level_of_sims(sim_info, target_sim_info, relationship_track_id, level)¶
Set 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 set.
level (float) – The amount to set the relationship track to (Can be positive or negative).
- Returns:
True, if the relationship track was set successfully. False, if not.
- Return type:
bool
- classmethod set_romance_level(sim_info, target_sim_info, level)¶
Set the level of Romance between two Sims.
- Parameters:
sim_info (SimInfo) – The Sim to use.
target_sim_info (SimInfo) – The Target Sim to use.
level (float) – The new level of relationship between the Sims.
- classmethod set_romantic_satisfaction_level(sim_info, target_sim_info, level)¶
Set the level of Romantic Satisfaction between two Sims.
- Parameters:
sim_info (SimInfo) – The Sim to use.
target_sim_info (SimInfo) – The Target Sim to use.
level (float) – The new level of Romantic Satisfaction between the Sims.
Phone¶
- class CommonPhoneUtils¶
Bases:
objectUtilities 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.
- Return type:
None
- static unsilence_phone()¶
Unsilence the phone.
- Return type:
None
Plumbob¶
- class CommonSimPlumbobUtils¶
Bases:
objectUtilities for manipulating the Plumbob of a Sim.
- static hide_plumbob(sim_info)¶
Hide the plumbob of a Sim.
Note
If the plumbob of the Sim is already hidden, this function will do nothing.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- static reset_plumbob_position(sim_info)¶
Reset the position of the Plumbob for a Sim to it’s original position.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- static set_plumbob_position(sim_info, position, bone_name='b__ROOT__', balloon_position=sims4.math.Vector3)¶
Set the position of the Plumbob for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
position (CommonVector3) – The position to set the plumbob to.
bone_name (str, optional) – The name of the bone to slot the Plumbob to. Default is ‘b__ROOT__’
balloon_position (CommonVector3, optional) – The position of the Balloon above Sims heads. Default is CommonVector3.empty().
- static show_plumbob(sim_info)¶
Show the plumbob of a Sim.
Note
If the plumbob of the Sim is already shown, this function will do nothing.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
Posture¶
- class CommonSimPostureUtils¶
Bases:
_HasS4CLClassLogUtilities for managing the posture of Sims.
- classmethod can_sim_be_picked_up(sim_info)¶
can_be_picked_up(sim_info)
Determine if a Sim can be picked up.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim can be picked up. False, it not.
- Return type:
bool
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_posture(sim_info)¶
Retrieve the posture of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The posture of a Sim.
- Return type:
Union[Posture, None]
- classmethod get_posture_aspects(sim_info)¶
Retrieve the posture aspects of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The aspects of the posture of the Sim.
- Return type:
Tuple[Posture]
- classmethod get_posture_state(sim_info)¶
Retrieve the posture aspects of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The posture state of a Sim.
- Return type:
Union[PostureState, None]
- classmethod get_posture_target(sim_info)¶
Retrieve the target of the posture of a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The target of the posture of a Sim.
- Return type:
Union[Any, None]
- classmethod has_posture(sim_info, posture)¶
Determine if a Sim has a posture.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
posture (Union[int, CommonPostureId, Posture, CommonInt]) – The identifier of the posture to check.
- Return type:
- classmethod has_posture_with_sim(sim_info, target_sim_info, posture)¶
Determine if a Sim has a posture with another Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
target_sim_info (SimInfo) – An instance of another Sim.
posture (Union[int, CommonPostureId, Posture, CommonInt]) – The identifier of the posture to check.
- Return type:
- classmethod is_on_container_supporting_posture(sim_info, posture)¶
Determine if the container a Sim is interacting with has a posture.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
posture (Union[int, CommonPostureId, Posture, CommonInt]) – The identifier of the posture to check.
- Return type:
- classmethod is_on_container_supporting_posture_with_sim(sim_info, target_sim_info, posture)¶
is_on_container_supporting_posture(sim_info, target_sim_info, posture)
Determine if the container a Sim is interacting with has a posture that supports another Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
target_sim_info (SimInfo) – An instance of another Sim.
posture (Union[int, CommonPostureId, Posture, CommonInt]) – The identifier of the posture to check.
- Return type:
- classmethod load_posture_by_id(posture)¶
Load an instance of a Posture by its identifier.
- Parameters:
posture (Union[int, CommonPostureId, Posture, CommonInt]) – The identifier of a Posture.
- Returns:
An instance of a Posture matching the decimal identifier or None if not found.
- Return type:
Union[Posture, None]
Pregnancy¶
Rabbit Hole¶
- class CommonSimRabbitHoleUtils¶
Bases:
objectUtilities for manipulating Rabbit Holes for Sims.
- classmethod get_first_rabbit_hole_id_for_sim(sim_info)¶
get_rabbit_hole_id(sim_info)
Retrieve the id of the rabbit hole a Sim is in.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The id of the first rabbit hole the Sim is in or None if not found.
- Return type:
Union[int, None]
- classmethod put_sim_into_rabbit_hole(sim_info, rabbit_hole, on_exit_rabbit_hole_callback=None)¶
Put a Sim into a Rabbit Hole.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
rabbit_hole (Union[RabbitHole, int]) – The identifier of a rabbit hole to put the Sim into.
on_exit_rabbit_hole_callback (Callable[[SimInfo, bool], None]) – A callback invoked upon the Sim leaving the rabbit hole. Default is None.
- Returns:
A result indicating the success of putting the Sim into the rabbit hole.
- Return type:
- classmethod try_remove_sim_from_rabbit_hole(sim_info, on_remove_from_rabbit_hole_result_callback=None)¶
Remove a Sim from a rabbit hole.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
on_remove_from_rabbit_hole_result_callback (Callable[[SimInfo, bool], None]) – A callback invoked upon the Sim being removed from the rabbit hole. Default is None.
- Returns:
A result indicating the success of the removal.
- Return type:
Relationship Expectations¶
- class CommonSimRelationshipExpectationUtils¶
Bases:
objectUtilities for Sim relationship expectations.
- classmethod does_not_have_emotional_exclusivity(sim_info)¶
Determine if the Sim does not have emotional exclusivity.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod does_not_have_physical_exclusivity(sim_info)¶
Determine if the Sim does not have physical exclusivity.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod does_not_have_woohoo_exclusivity(sim_info)¶
Determine if the Sim does not have woohoo exclusivity.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod has_emotional_exclusivity(sim_info)¶
Determine if the Sim has emotional exclusivity.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod has_physical_exclusivity(sim_info)¶
Determine if the Sim has physical exclusivity.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod has_woohoo_exclusivity(sim_info)¶
Determine if the Sim has woohoo exclusivity.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod is_not_open_to_change(sim_info)¶
Determine if the jealousy triggers of a Sim can not be changed through talking.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod is_open_to_change(sim_info)¶
Determine if the jealousy triggers of a Sim can be changed through talking.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod set_emotional_exclusivity(sim_info, has_emotional_exclusivity)¶
Set if a Sim has emotional exclusivity with their partner.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
has_emotional_exclusivity (bool) – Set True to indicate a Sim has emotional exclusivity with their partner. Set False, if not.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod set_open_to_change(sim_info, is_open_to_change)¶
Set if the jealousy triggers of a Sim can be changed through talking.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
is_open_to_change (bool) – Set True to indicate a Sim is open to change. Set False, if not.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod set_physical_exclusivity(sim_info, has_physical_exclusivity)¶
Set if a Sim has physical exclusivity with their partner.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
has_physical_exclusivity (bool) – Set True to indicate a Sim has physical exclusivity with their partner. Set False, if not.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
- classmethod set_woohoo_exclusivity(sim_info, has_woohoo_exclusivity)¶
Set if a Sim has woohoo exclusivity with their partner.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
has_woohoo_exclusivity (bool) – Set True to indicate a Sim has woohoo exclusivity with their partner. Set False, if not.
- Returns:
The result of the test. True, if the test passes. False, if not.
- Return type:
Situations¶
- class CommonSimSituationUtils¶
Bases:
HasClassLogUtilities for manipulating the Situations of Sims.
- static complete_situation_goal(sim_info, situation_goal_id, target_sim_info=None, score_override=None, start_cooldown=True)¶
Complete a situation goal for a Sim using the specified Target Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_goal_id (int) – The decimal identifier of a Situation Goal to mark as completed.
target_sim_info (SimInfo, optional) – A target used in the completion of the situation goal. Default is None.
score_override (int, optional) – An alternative score to award to the Sim instead of the score specified by the goal. Default is None.
start_cooldown (bool, optional) – Whether or not to start a cooldown for the situation. Default is True.
- static create_situation_for_sim(sim_info, situation_type, creation_source, invite_only=True, user_facing=False, situation_job=None, purpose=situations.situation_guest_list.SituationInvitationPurpose.INVITED, **__)¶
Create a situation and put a Sim in it.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_type (Type[Situation]) – The type of situation to create.
invite_only (bool, optional) – If True, the situation will be invitation only. Default is True.
user_facing (bool, optional) – If True, the situation will be visible to the player (Like an Active Situation would be). If False, it will not be visible. Default is False.
situation_job (SituationJob, optional) – The Situation Job to assign to the Sim upon situation creation. Default is whatever the situation specifies as the default job.
creation_source (str) – The source of creation.
purpose (SituationInvitationPurpose, optional) – The purpose of the situation. Default is SituationInvitationPurpose.INVITED.
- Returns:
The identifier of the situation that was created or 0 if an error occurs.
- Return type:
int
- static create_visit_situation(sim_info, duration_override_in_sim_seconds=None, visit_situation_override=None)¶
Create a visit situation for a Sim.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
duration_override_in_sim_seconds (int, optional) – An override in Sim seconds for the visit to last. Default is None.
visit_situation_override (Situation, optional) – An instance of a Situation to use for the Visit. If not specified, the default visit situation will be used. Default is None.
- static get_first_running_situation_sim_is_in_by_tag(sim_info, tag)¶
Retrieve the first Situation that a Sim is currently involved in that has a tag.
- Parameters:
sim_info (SimInfo) – An instance of a Sim
tag (CommonGameTag) – The tag to locate a situation with.
- Returns:
A situation the Sim is involved in that has the specified tag or None if not found.
- Return type:
Union[Situation, None]
- static get_first_running_situation_sim_is_in_by_type(sim_info, situation_type)¶
Retrieve the first Situation that a Sim is currently involved in that is a specific type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim
situation_type (Type[Situation]) – A situation type to locate a situation with.
- Returns:
A situation the Sim is involved in that is of the specified type or None if not found.
- Return type:
Union[Situation, None]
- static get_guids_of_all_running_situations_for_sim(sim_info)¶
Retrieve GUIDs for all Situations a Sim is involved in.
- Parameters:
sim_info (SimInfo) – The sim to check.
- Returns:
A collection of Situation GUIDs the specified Sim is involved in.
- Return type:
Tuple[int]
- classmethod get_log_identifier()¶
A string identifier for the log of the class.
Note
This is the text that will appear when logging messages.
- Returns:
The identifier for the log
- Return type:
str
- classmethod get_mod_identity()¶
Retrieve the identity of the mod that owns the class.
Warning
Override this function with the
CommonModIdentityof your mod.This is a MUST override to allow for proper Exception Handling and Logging!
- Returns:
An instance of CommonModIdentity
- Return type:
- Raises:
NotImplementedError – Thrown when the function is not implemented.
- static get_running_situations_sim_is_in_by_tag(sim_info, tag)¶
Retrieve all Situations that a Sim is currently involved in that have the specified tag.
- Parameters:
sim_info (SimInfo) – An instance of a Sim
tag (CommonGameTag) – The tag to locate situations with.
- Returns:
An iterator of Situations the Sim is running that have the specified tag.
- Return type:
Iterator[Situation]
- static get_running_situations_sim_is_in_by_tags(sim_info, tags)¶
get_running_situations_sim_is_in_by_tag(sim_info, tags)
Retrieve all Situations that a Sim is currently involved in that have the specified tag.
- Parameters:
sim_info (SimInfo) – An instance of a Sim
tags (Iterator[CommonGameTag]) – A collection of tags to locate situations with. Matching situations will have at least one of these tags.
- Returns:
An iterator of Situations the Sim is running that have any of the specified tags.
- Return type:
Iterator[Situation]
- static get_running_situations_sim_is_in_by_type(sim_info, situation_type)¶
Retrieve all Situations that a Sim is currently involved in that match the specified type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim
situation_type (Type[Situation]) – A situation type to locate situations with.
- Returns:
An iterator of Situations the Sim is running that are of the specified type.
- Return type:
Iterator[Situation]
- static get_situation_goals(sim_info)¶
Retrieve the goals of all situations a Sim is currently in.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
The situation goals of all Situations the Sim is currently involved in.
- Return type:
Tuple[Union[SituationGoal, SituationGoalTargetedSim]]
- static get_situation_guids(sim_info)¶
Retrieve GUIDs for all Situations a Sim is involved in.
- Parameters:
sim_info (SimInfo) – The sim to check.
- Returns:
A collection of Situation GUIDs the specified Sim is involved in.
- Return type:
List[int]
- static get_situation_ids(sim_info)¶
Retrieve decimal identifiers for all Situations a Sim is involved in.
- Parameters:
sim_info (SimInfo) – The sim to check.
- Returns:
A collection of Situation decimal identifiers the specified Sim is involved in.
- Return type:
List[int]
- 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 iterator of Situations that pass the include callback filter.
- Return type:
Iterator[Situation]
- static has_leave_situation(sim_info)¶
has_situation_jobs(sim_info, situation_job_ids)
Determine if a Sim is currently involved in a leaving situation.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- Returns:
True, if the Sim is currently involved in a leaving situation. False, if not.
- Return type:
bool
- static has_situation(sim_info, situation_guid)¶
Determine if a Sim is involved in the specified Situation.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_guid (Union[int, CommonSituationId]) – The GUID of a Situation.
- Returns:
True, if the Sim is involved in the specified Situation. False, if not.
- Return type:
bool
- static has_situation_job(sim_info, situation_job_id)¶
Determine if a Sim has been assigned a situation job.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_job_id (int) – The situation job to check for.
- Returns:
True, if the Sim has the specified situation job. False, if not.
- Return type:
bool
- static has_situation_jobs(sim_info, situation_job_ids)¶
Determine if a Sim has been assigned any specified situation jobs.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_job_ids (Tuple[int]) – The situation jobs to check for.
- Returns:
True, if the Sim has any of the specified situation jobs. False, if not.
- Return type:
bool
- static has_situations(sim_info, situation_guids)¶
Determine if a Sim is involved in any of the specified Situations.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_guids (Iterator[Union[int, CommonSituationId]]) – The GUID of Situations.
- Returns:
True, if the Sim has any of the specified situations. False, if not.
- Return type:
bool
- static is_assigned_situation_job(sim_info, situation_job_id)¶
Determine if a Sim is currently assigned a situation job.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_job_id (int) – The decimal identifier of a Situation Job.
- Returns:
True, if the Sim is assigned the specified situation job. False, if not.
- Return type:
bool
- static is_assigned_situation_jobs(sim_info, situation_job_ids)¶
Determine if a Sim is currently assigned any of the specified situation jobs.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_job_ids (Tuple[int]) – A collection of decimal identifier for Situation Jobs.
- Returns:
True, if the Sim is assigned any of the specified situation jobs. False, if not.
- Return type:
bool
- static is_in_situations_of_type(sim_info, situation_type)¶
Determine if a Sim is currently in a situation that is of the a specific type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_type (Type[Situation]) – The type of situation to check.
- Returns:
True, if the Sim is involved in any situations with any of the specified tags. False, if not.
- Return type:
bool
- static is_in_situations_with_any_tags(sim_info, tags)¶
Determine if a Sim is currently in a situation with any of the specified tags.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
tags (Tuple[CommonGameTag]) – A collection of game tags.
- Returns:
True, if the Sim is involved in any situations with any of the specified tags. False, if not.
- Return type:
bool
- static is_in_situations_with_tag(sim_info, tag)¶
Determine if a Sim is currently in a situation with a tag.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
tag (CommonGameTag) – A tag to check for.
- Returns:
True, if the Sim is involved in any situations with any of the specified tags. False, if not.
- Return type:
bool
- static make_sim_leave(sim_info)¶
Make a Sim leave the current lot.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
- static remove_sim_from_situation(sim_info, situation_id)¶
Remove a Sim from a Situation.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
situation_id (int) – The instance identifier of the Situation to remove the Sim from.
- Returns:
True, if the Sim was successfully removed from the situation. False, if not.
- Return type:
bool
State¶
- class CommonSimStateUtils¶
Bases:
objectUtilities 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:
The result of testing. True, if the Sim is dying. False, if the Sim is not dying.
- Return type:
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()inCommonOutfitUtilsinstead.- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the sim is wearing a towel. False, if not.
- Return type:
Types¶
- class CommonSimTypeUtils¶
Bases:
objectUtilities for determining the type of Sim. i.e. Player, NPC, Service, etc.
- static are_same_age_and_species(sim_type_one, sim_type_two)¶
Determine if two Sim Types are comprised of the same Age and Species.
- Parameters:
sim_type_one (CommonSimType) – An instance of a Sim Type.
sim_type_two (CommonSimType) – An instance of a Sim Type.
- Returns:
True, if both Sim types are the same Age and Species, ignoring Occult Types. False, if not.
- Return type:
bool
- static convert_sim_type_to_age(sim_type)¶
Break down a Sim Type and return the resulting Age associated with it.
- Parameters:
sim_type (CommonSimType) – A Sim Type.
- Returns:
The age associated with the Sim Type.
- Return type:
CommonAge
- static convert_sim_type_to_occult_type(sim_type)¶
Break down a Sim Type and return the resulting Occult Type associated with it.
- Parameters:
sim_type (CommonSimType) – A Sim Type.
- Returns:
The occult type associated with the Sim Type.
- Return type:
CommonOccultType
- static convert_sim_type_to_species(sim_type)¶
Break down a Sim Type and return the resulting Species associated with it.
- Parameters:
sim_type (CommonSimType) – A Sim Type.
- Returns:
The species associated with the Sim Type.
- Return type:
CommonSpecies
- static convert_to_non_occult_variant(sim_type)¶
convert_sim_type_to_non_occult_variant(sim_type)
Convert an Occult sim type to a Non-Occult Sim Type.
- Parameters:
sim_type (CommonSimType) – The Sim Type to convert.
- Returns:
The Non-Occult variant of the Sim Type or itself, if no Non-Occult variant is found.
- Return type:
CommonSimType
- static convert_to_signature(sim_type)¶
Convert a Sim Type to a unique signature.
- Parameters:
sim_type (CommonSimType) – The sim type to convert.
- Returns:
A string signature that uniquely represents the Sim Type or the name of the Sim Type, if no unique signature is found.
- Return type:
str
- static determine_sim_type(sim_info, combine_teen_young_adult_and_elder_age=True, combine_child_dog_types=True, use_current_occult_type=False)¶
Determine the type of Sim a Sim is based on their Age, Species, and Occult Type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
combine_teen_young_adult_and_elder_age (bool, optional) – If set to True, Teen, Young Adult, Adult, and Elder, will all receive an ADULT denoted Sim Type instead of TEEN, YOUNG_ADULT, ADULT, and ELDER respectively. i.e. A Human Teen Sim would be denoted as ADULT_HUMAN. If set to False, they will receive their own Sim Types. i.e. A Human Teen Sim would be denoted as TEEN_HUMAN. Default is True.
combine_child_dog_types (bool, optional) – If set to True, the Child Dog Sim Types will be combined into a single Sim Type, i.e. CHILD_DOG. If set to False, the Child Dog Sim Types will be returned as their more specific values. i.e. CHILD_LARGE_DOG, CHILD_SMALL_DOG, etc. Default is True.
use_current_occult_type (
bool) – If set to True, the Sims current occult type will be used, for example an Adult Human Mermaid with no tail would return ADULT_HUMAN instead of ADULT_HUMAN_MERMAID. If set to False, the Sims occult type will be used (whether current or not), for example an Adult Human Mermaid wearing or not wearing their tail would return ADULT_HUMAN_MERMAID. Default is False.use_current_occult_type – bool, optional
- Returns:
The type of Sim the Sim is or NONE if no type was found for the Sim.
- Return type:
CommonSimType
- static determine_sim_type_for_species_age_occult(species, age, occult_type, combine_teen_young_adult_and_elder_age=True, combine_child_dog_types=True)¶
Determine the type of Sim a Sim is based on their Age, Species, and Occult Type.
- Parameters:
species (CommonSpecies) – A CommonSpecies.
age (CommonAge) – An Age.
occult_type (CommonOccultType) – An Occult Type.
combine_teen_young_adult_and_elder_age (
bool) – If set to True, Teen, Young Adult, Adult, and Elder, will all receive an ADULT denoted Sim Type instead of TEEN, YOUNG_ADULT, ADULT, and ELDER respectively. i.e. If True, a Human Teen Sim would be denoted as ADULT_HUMAN.
If set to False, they will receive their own Sim Types. i.e. If False, a Human Teen Sim would be denoted as TEEN_HUMAN. Default is True. :type combine_teen_young_adult_and_elder_age: bool, optional :type combine_child_dog_types:
bool:param combine_child_dog_types: If set to True, the Child Dog Sim Types will be combined into a single Sim Type, i.e. CHILD_DOG. If set to False, the Child Dog Sim Types will be returned as their more specific values. i.e. CHILD_LARGE_DOG, CHILD_SMALL_DOG, etc. Default is True. :type combine_child_dog_types: bool, optional :return: The type of Sim the Sim is or NONE if no type was found for the Sim. :rtype: CommonSimType
- static get_all_sim_types_gen(sim_info, combine_teen_young_adult_and_elder_age=True, combine_child_dog_types=True)¶
Determine all types a Sim is based on their Age, Species, and Occult Types.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
combine_teen_young_adult_and_elder_age (bool, optional) – If set to True, Teen, Young Adult, Adult, and Elder, will all receive an ADULT denoted Sim Type instead of TEEN, YOUNG_ADULT, ADULT, and ELDER respectively. i.e. A Human Teen Sim would be denoted as ADULT_HUMAN. If set to False, they will receive their own Sim Types. i.e. A Human Teen Sim would be denoted as TEEN_HUMAN. Default is True.
combine_child_dog_types (bool, optional) – If set to True, the Child Dog Sim Types will be combined into a single Sim Type, i.e. CHILD_DOG. If set to False, the Child Dog Sim Types will be returned as their more specific values. i.e. CHILD_LARGE_DOG, CHILD_SMALL_DOG, etc. Default is True.
- Returns:
An iterator of all types the Sim is.
- Return type:
Iterator[CommonSimType]
- static is_batuu_alien(sim_info)¶
Determine if a Sim is a Batuu Alien.
Note
Alien Sims:
Bith
Twilek
Weequay
Abednedo
Mirialan
Zabrak
- Parameters:
sim_info (SimInfo) – The Sim to check.
- Returns:
The result of testing. True, if the Sim is a Batuu Alien. False, if not.
- Return type:
- 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_occult(sim_info, combine_teen_young_adult_and_elder_age=True, combine_child_dog_types=True)¶
Determine if a Sim has an Occult Sim Type.
- Parameters:
sim_info (SimInfo) – An instance of a Sim.
combine_teen_young_adult_and_elder_age (bool, optional) – See description of CommonSimTypeUtils.determine_sim_type. Default is True.
combine_child_dog_types (bool, optional) – See description of CommonSimTypeUtils.determine_sim_type. Default is True.
- Returns:
True, if the specified Sim has an Occult Sim Type. False, if not.
- Return type:
bool
- static is_occult_type(sim_type)¶
Determine if a Sim Type is for an Occult Sim.
- Parameters:
sim_type (CommonSimType) – A Sim Type.
- Returns:
True, if the Sim Type is for an Occult Sim. 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 if 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)¶
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:
The result of testing. True, if the Sim is a Service Sim. False, if not.
- Return type: