Mod Support¶
Mod Info¶
-
class
CommonModInfo
¶ Bases:
sims4communitylib.services.common_service.CommonService
Provide information about your mod.
For information on what each of the properties represents, see
CommonModIdentity
Example usage: from sims4communitylib.mod_support.common_mod_info import CommonModInfo # This is how the sims4communitylib.modinfo.ModInfo implementation works. class ModInfo(CommonModInfo): _FILE_PATH: str = str(__file__) @property def _name(self) -> str: return 'Sims4CommunityLib' @property def _author(self) -> str: return 'ColonolNutty' @property def _base_namespace(self) -> str: return 'sims4communitylib' @property def _file_path(self) -> str: return ModInfo._FILE_PATH @property def _version(self) -> str: return '3.5.6'
-
classmethod
get_identity
() → sims4communitylib.mod_support.mod_identity.CommonModIdentity¶ The identity of a mod
Note
It contains information about a mod such as Mod Name, Mod Author, the script base namespace, and the file path to your mod.
Returns: The identity of a mod. Return type: CommonModIdentity
-
classmethod
Has Mod Identity¶
-
class
HasModIdentity
¶ Bases:
object
An inheritable class that provides Mod Info for a class.
-
mod_identity
¶ The identity of a mod.
Note
It contains information about a mod such as Mod Name, Mod Author, the script base namespace, and the file path to your mod.
Returns: The identity of a mod. Return type: CommonModIdentity Raises: NotImplementedError – Thrown when the property is not implemented.
-
Has Class Mod Identity¶
-
class
HasClassModIdentity
¶ Bases:
sims4communitylib.mod_support.has_mod_identity.HasModIdentity
An inheritable class that provides Mod Info for a class.
Note
This class inherits from
HasModIdentity
and may be used as an alternative to it.-
classmethod
get_mod_identity
() → sims4communitylib.mod_support.mod_identity.CommonModIdentity¶ The identity of a mod.
Note
It contains information about a mod such as Mod Name, Mod Author, the script base namespace, and the file path to your mod.
Returns: The identity of a mod. Return type: CommonModIdentity
-
mod_identity
¶ The identity of a mod.
Note
It contains information about a mod such as Mod Name, Mod Author, the script base namespace, and the file path to your mod.
Returns: The identity of a mod. Return type: CommonModIdentity Raises: NotImplementedError – Thrown when the property is not implemented.
-
classmethod
Mod Identity¶
-
class
CommonModIdentity
(name, author, base_namespace, file_path)¶ Bases:
object
The identity of a mod
Note
It contains information about a mod such as Mod Name, Mod Author, the script base namespace, and the file path to your mod.
Parameters: - name (str) – The name of a mod.
- author (str) – The author of a mod.
- base_namespace (str) – The base namespace of the .ts4script file of a mod.
- file_path (str) – The path to the ts4script file of a mod.
The author of a mod.
Returns: The name of the author of a mod. Return type: str
-
base_namespace
¶ The base namespace of the .ts4script file of a mod.
Note
S4CL has the base namespace of sims4communitylib.
Returns: The base script namespace of a mod. Return type: str
-
file_path
¶ The path to the ts4script file of a mod.
Note
A good override value can be __file__, it will retrieve the file path automatically, assuming the inheriting class is at the root of the mod.
Returns: The file path to a mod. Return type: str
-
name
¶ The name of a mod.
Note
The name should not contain spaces.
Returns: The name of a mod. Return type: str
-
version
¶ The version a mod is currently at.
Returns: The version of a mod. The Default value is ‘1.0’. Return type: str