Skip to content

API Functions

Sanio edited this page Oct 3, 2024 · 1 revision

List of all other available API functions. Previous pages contain the more important ones.


UniqueItemsAPI.IsModRegistered(string name): boolean

Returns whether or not the mod/pack has been registered.

  • name: Name of the mod/pack.

UniqueItemsAPI.IsCharacterRegistered(string name, boolean isTainted): boolean

Returns whether or not the character has been registered.

  • name: Name of the character
  • isTainted: Set to true if your character is a Tainted version of an existing character

UniqueItemsAPI.IsObjectIDRegistered(integer: objectID, UniqueObjectType objectType): boolean

Returns whether or not this object ID has been assigned to any character.

  • objectID: The CollectibleType, FamilliarVariant, or KnifeVariant of the object.
  • objectType: Uses the UniqueItemsAPI.ObjectType enum.

UniqueItemsAPI.AssignObjectName(integer objectID, string itemName, UniqueObjectType objectType)

Sets a "display name" for the item, changing how it will be shown in Mod Config Menu.

  • objectID: The CollectibleType, FamilliarVariant, or KnifeVariant of the object.
  • itemName: The new name desired for the object.
  • objectType: Uses the UniqueItemsAPI.ObjectType enum.

UniqueItemsAPI.GetObjectData(integer objectID, UniqueObjectType objectType, PlayerType? playerType): UniqueObjectData

Returns a table of data for a Unique Object. If PlayerType is provided, returns UniqueObjectPlayerData instead.

UniqueObjectData

  • SelectedModIndex integer: Current index used for AllMods. Used exclusively for Mod Config Menu. If 0, it's disabled. If -1, it's randomized.
  • SelectedPlayerIndex integer: Current index used for AllPlayers. Used exclusively for Mod Config Menu.
  • AllMods string[]: A table of strings containing the names of all registered mods.
  • AllPlayers UniqueObjectPlayerData[]: A table of all player data for this Unique Object, indexed by PlayerType
  • Name string: Name of the Unique Object. Used for save data.
  • DisplayName string: Name of the Unique Object as it appears inside Mod Config Menu.

UniqueObjectPlayerData

  • SelectedModIndex integer: Current index used for ModData. If 0, it's disabled. If -1, it's randomized.
  • TempDisable boolean: If true, will entirely disable this player for this Unique Object. Only toggle-able from UniqueItemsAPI.SetIsCharacterObjectDisabled.
  • ModData UniqueObjectModData[]. Table that contains the params used in AssignUniqueObject in addition to ModName.

Function arguments

  • objectID: The CollectibleType, FamilliarVariant, or KnifeVariant of the object.
  • objectType: Uses the UniqueItemsAPI.ObjectType enum.
  • PlayerType: Optional. The PlayerType of the character for this Unique Object.

UniqueItemsAPI.GetObjectParams(integer objectID, Entity | PlayerType entityOrPlayerType, UniqueObjectType objectType, boolean? noModifier)

  • objectID: The CollectibleType, FamilliarVariant, or KnifeVariant of the object.
  • entityOrPlayerType: Optional. Either the PlayerType of the character for this Unique Object, or any entity. The API will attempt to fetch the player off of the entity. Will return nil if unsuccessful.
  • objectType: Uses the UniqueItemsAPI.ObjectType enum.
  • noModifier: If true, will return the params as-is without running any modifiers

UniqueItemsAPI.GetCurrentObjectMod(integer objectID, PlayerType playerType, UniqueObjectType objectType)

Returns the UniqueObjectModData associated with the provided arguments.

  • objectID: The CollectibleType, FamilliarVariant, or KnifeVariant of the object.
  • PlayerType: Optional. The PlayerType of the character for this Unique Object.
  • objectType: Uses the UniqueItemsAPI.ObjectType enum.

UniqueItemsAPI.SetIsCharacterObjectDisabled(objectID, playerType, bool, objectType)

Sets whether to temporarily disable the Unique Object for a player for the current game session.

  • objectID: The CollectibleType, FamilliarVariant, or KnifeVariant of the object.
  • PlayerType: Optional. The PlayerType of the character for this Unique Object.
  • bool: True to disable, false to use current settings.
  • objectType: Uses the UniqueItemsAPI.ObjectType enum.

UniqueItemsAPI.IsObjectDisabled(UniqueObjectPlayerData playerData)

Returns whether or not this UniqueObjectPlayerData is disabled.

  • playerData The Unique Object data for a specific character.

UniqueItemsAPI.IsObjectRandomized(UniqueObjectPlayerData playerData)

Returns whether or not this UniqueObjectPlayerData is randomized.

  • playerData The Unique Object data for a specific character.

Clone this wiki locally