Skip to content

Asset: Character

Аниса edited this page Jan 19, 2024 · 27 revisions

━ How to setup a character?

  1. Create a folder with your desired asset name under files/assets/character/.
  • Non Clumping:

    1. Asset's structure should be strictly as below attached:

      image

    2. Add your model named as asset.dff. [Note: File name matters here, it must strictly be asset.dff]

    3. Create a json file named as asset.json and configure based on your requirements as below attached: [Note: File name matters here, it must strictly be asset.json]

      image

  • Clumping:

    1. Asset's structure should be strictly as below attached:

      image

    2. Add your model's clumps under clump. [Note: File namings doesn't matter since they are referenced under asset.json]

    3. Create a json file named as asset.json and configure based on your requirements as below attached: [Note: File name matters here, it must strictly be asset.json]

    4. Add your clump names under assetClumps config as highlighted below.

      "assetClumps": {
          "yourClumpName1": "clumpFileName1",
          "yourClumpName2": "clumpFileName2",
          "yourClumpName3": "clumpFileName3"
      }

      image

  1. Create a txd file named as asset.txd and drop your necessary textures into it & save. [Note: File name matters here, it must strictly be asset.txd]

━ How to configure a character?

  • assetBase: Default model whose properties character element should inherit. [Default: 7]
  • assetTransparency: Boolean indicating whether character element should have transparency property. [Default: false]
  • shaderMaps: Required if you prefer to use any built in Assetify shaders for your character.

━ How to boot a character?

  • Attach your character name within files/assets/character/manifest.json.
    [[
      "yourCharacterName1",
      "yourCharacterName2",
      "yourCharacterName3"
    ]]
  • Incase if you have enabled autoLoad under settings/shared.lua for character assets then your character shall be automatically loaded when you restart the library, either way you could use Assetify's APIs to dynamically load/unload them.
    assetify.loadAsset("character", "yourCharacterName")
    assetify.unloadAsset("character", "yourCharacterName")

━ How to use a character?

  • Use below mentioned API to set/change your ped/player's element model.
  • Use the API server side if you prefer them to be synced.
    assetify.setElementAsset(yourPedElement, "yourAssetType", "yourAssetName", "yourClumpName", "yourClumpMaps")

Clone this wiki locally