Services

General

Common Service

class CommonService

Bases: object

An inheritable class that turns a class into a singleton, create an instance by invoking get().

Example usage:
class ExampleService(CommonService):
    @property
    def first_value(self) -> str:
        return 'yes'

# ExampleService.get() returns an instance of ExampleService.
# Calling ExampleService.get() again, will return the same instance.
ExampleService.get().first_value
classmethod get()

Retrieve an instance of the service

Returns:An instance of the service
Return type:The type of the inheriting class

Sim

Sim Outfit IO

Modify Clone of Sim in CAS

Resource

Posture Constraints

class CommonPostureConstraintService

Bases: sims4communitylib.services.common_service.CommonService

Utilities for providing and manipulating posture constraints of Sims.

static combine_constraints(constraints, fallback_constraints=(), debug_name='Combined')

Attempt to combine similar constraints into a constraint set.

Parameters:
  • constraints (Iterator[Constraint]) – A collection of Constraints.
  • fallback_constraints (Iterator[Constraint], optional) – A collection of Constraints to choose from as a fallback when the primary constraints fail to combine. Default is an empty collection.
  • debug_name (str, optional) – The name of the constraint set being created. Default is ‘Combined’.
Returns:

A constraint set containing the specified constraints, a Constraint chosen from one of the specified fallback constraints, or Nowhere when everything else fails.

Return type:

Union[_ConstraintSet, Constraint, Nowhere]

stand

A posture constraint for a Sim to stand at a target.

Returns:An instance of a Constraint.
Return type:Constraint
stand_at_none

A posture constraint for a Sim to stand at no target.

Returns:An instance of a Constraint.
Return type:Constraint
stand_or_swim_at_none

A posture constraint for a Sim to stand at a target or to swim at no target.

Returns:An instance of a Constraint.
Return type:Constraint
swim_at_none

A posture constraint for a Sim to swim at no target.

Returns:An instance of a Constraint.
Return type:Constraint