Announcement

Collapse
No announcement yet.

NPC: change appearance

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NPC: change appearance

    Hello. I cannot change the appearance of NPCs (sellers, ...).
    Everything else is working fine.
    CreateNPC is presented in two different syntaxes and SetNPCClothingPreset gives me the following error:
    Error in MariaDB callback: [string "onsetrp / shops / server.lua"]: 74: attempt to call a nil value (global 'SetNPCClothingPreset')

    Here are the two examples from the dev wiki i try :

    https://dev.playonset.com/wiki/SetNPCPropertyValue

    https://dev.playonset.com/wiki/CreateText3D

    #2
    You can't set a NPCClothingPreset serverside.
    If you want to do this, you can use : https://github.com/vugi99/onset-networked-clothes

    Comment


      #3
      Originally posted by Voltaism View Post
      You can't set a NPCClothingPreset serverside.
      If you want to do this, you can use : https://github.com/vugi99/onset-networked-clothes
      Thanks a lot.
      It is good.

      Comment


        #4
        Now I would like to create a female NPC.

        Are there any presets ? (other than https://dev.playonset.com/wiki/ClothingPresets)

        Using "SetNPCNetworkedCustomClothes (npc, Custom Clothes Table)" does not work :
        example of script :
        "
        AddEvent("OnPackageStart", function()
        LicensesNpc = CreateNPC(LicensesNpcLocation.x, LicensesNpcLocation.y, LicensesNpcLocation.z, LicensesNpcLocation.h)
        GetNPCPropertyValue(LicensesNpc, "NetworkedClothes")
        table.insert(CustomClothesTable, {
        body = {"/Game/CharacterModels/SkeletalMesh/BodyMerged/HZN_CH3D_Normal06_LPR",{1.3,1.3,1.3},false,false,{ "/Game/CharacterModels/Materials/HZN_Materials/M_HZN_Body_NoShoesLegsTorso",0}},
        clothing0 = {"/Game/CharacterModels/SkeletalMesh/HZN_CH3D_Hair_Scientist_LP"},
        clothing1 = {"/Game/CharacterModels/SkeletalMesh/Outfits/HZN_Outfit_Piece_FormalShirt_LPR"},
        clothing2 = {"/Game/CharacterModels/SkeletalMesh/Outfits/HZN_Outfit_Piece_FormalPants_LPR"},
        clothing3 = {"/Game/CharacterModels/SkeletalMesh/Outfits/HZN_Outfit_Piece_BusinessShoes_LPR"},
        clothing4 = false,
        clothing5 = false,
        clothing6 = false,
        clothing7 = false,
        clothing8 = false,
        clothing9 = false
        })
        SetNPCNetworkedCustomClothes(LicensesNpc,CustomClo thesTable)

        CreateText3D(_("license_shop").."\n".._("press_e") , 12, LicensesNpcLocation.x, LicensesNpcLocation.y, LicensesNpcLocation.z + 120, 0, 0, 0)
        end)
        "


        Comment


          #5
          Are there any presets ? (other than https://dev.playonset.com/wiki/ClothingPresets) No
          Do that (untested) :
          Code:
          AddEvent("OnPackageStart", function()
          LicensesNpc = CreateNPC(LicensesNpcLocation.x, LicensesNpcLocation.y, LicensesNpcLocation.z, LicensesNpcLocation.h)
          local CustomClothesTable = {
          body = {"/Game/CharacterModels/SkeletalMesh/BodyMerged/HZN_CH3D_Normal06_LPR",{1.3,1.3,1.3},false,false,{ "/Game/CharacterModels/Materials/HZN_Materials/M_HZN_Body_NoShoesLegsTorso",0}},
          clothing0 = {"/Game/CharacterModels/SkeletalMesh/HZN_CH3D_Hair_Scientist_LP"},
          clothing1 = {"/Game/CharacterModels/SkeletalMesh/Outfits/HZN_Outfit_Piece_FormalShirt_LPR"},
          clothing2 = {"/Game/CharacterModels/SkeletalMesh/Outfits/HZN_Outfit_Piece_FormalPants_LPR"},
          clothing3 = {"/Game/CharacterModels/SkeletalMesh/Outfits/HZN_Outfit_Piece_BusinessShoes_LPR"},
          clothing4 = false,
          clothing5 = false,
          clothing6 = false,
          clothing7 = false,
          clothing8 = false,
          clothing9 = false
          }
          SetNPCNetworkedCustomClothes(LicensesNpc, CustomClothesTable)
          CreateText3D(_("license_shop").."\n".._("press_e") , 12, LicensesNpcLocation.x, LicensesNpcLocation.y, LicensesNpcLocation.z + 120, 0, 0, 0)
          end)

          Comment


            #6
            it seems to work
            Click image for larger version

Name:	Image1.jpg
Views:	145
Size:	22.3 KB
ID:	2427
            (npc a little giant...)

            Thanks a lot









            Comment


              #7
              (npc a little giant...) It's because you do :
              {1.3,1.3,1.3} for the body size

              Comment

              Working...
              X