Closet for NPCs and players

Dressing and customising characters is a difficult task if you don’t know where to start.
With this tool you can dress and decorate both NPCs and characters to your liking as you can add objects, rotate and scale them to create infinite combinations!

  1. WHAT IS THIS PACKAGE FOR?
  2. INSTALLATION
  3. HOW TO USE
  4. FAQ
  5. CREDITS

1 - WHAT IS THIS PACKAGE FOR?

Dressing and customising characters is a difficult task if you don’t know where to start.
With this tool you can dress and decorate both NPCs and characters to your liking as you can
add objects, rotate and scale them to create infinite combinations!

Closet-Gif

Closet_Camera_Gif

2 - INSTALLATION

	* Drag and drop "User Closet" script folder into your User template
	
	* Drag and drop "Closet Stand" template into the world

	* Drag and Drop NPC1 from Closet Stand into its standScript initialNpc property even if it's already there,
	there's a bug and sometimes Crayta doesn't detect it and the closet will print a console error:
	
	[Server] [Error] standScript:64: attempt to index field 'target' (a nil value)
	stack traceback:
	standScript:64: in function <standScript:53>
	
	* Make sure the NPC you want to use as the closet model has the standNpcModelScript attached
	and its stand property references to the Closet Stand entity with the standScript.

That’s it, you can now jump into the arcade machine and see how the closet works.
The package comes with several templates and an NPC as an example of what can be done.

3 - HOW TO USE

  • Closet Stand - standScript

IMPORTANT: Drag and drop the NPC into Initial NPC property even if it’s already there. Sometimes it isn’t detected at all.

  • Use with Player - True if you want to customize your own character, false to customize NPCs
  • Settings :
    • Rotate Camera Speed - You can change… yeah, the camera rotating speed!
    • Initial NPC - The default NPC that you will customize.
    • Emotes :
      • You can add as many emotes as youy wish and you’ll be able to preview them from the closet.
        IMPORTANT: Don’t remove Emote Images even if they’re empty, they will be used in future updates.
      • Each Emote should have its own Emote Name property. It will be displayed in the closet and can be translated.
    • Sockets :
      • You can add as many Sockets as youy wish and you’ll be able to attach the templates to them from the closet.
        IMPORTANT: Don’t remove Sockets Images even if they’re empty, they will be used in future updates.
      • Each Socket should have its own Socket Name property. It will be displayed in the closet and can be translated.
    • Templates :
      • You can add as many templates as you want and they will be spawned when jumping into the closet.
        Any entity inside those templates should have its collision disabled, otherwise the player/NPC will fly away!
        IMPORTANT: Don’t remove Template Images even if they’re empty, they will be used in future updates.
      • Each Template should have its own Template Name property. It will be displayed in the closet and can be translated.
  • User : User Closet folder comes with one widget and one script:

    • closetWidget : You can modify and translate the texts from the closet.
    • closetScript : You can change the updateRate (times per second that the closet will update).
      The higher the number the faster you can move and rotate the objects.
      You can also change “scaleRateMultiplier” which will make the template you’re editing scale more or less over time.

image

  • General usage :

    • When you have the templates and emotes ready jump into the closet and start changing its properties:
      position, rotation, scale, socket…

    • When you’re done press the “Print Values” button and open the console, you should see something like this:

        		[Client] [Display] ===============================
        		[Client] [Display] Copy these values into the correspondant attachToEntityScript script:
        		[Client] [Display] Relative Position: 0.00, 0.00, 0.00
        		[Client] [Display] Relative Rotation: 0.00, 0.00, 0.00
        		[Client] [Display] Scale: 1.00, 1.00, 1.00
        		[Client] [Display] Socket: spine_01
        		[Client] [Display] ===============================
      
      • Exit Preview Mode

      • Drag and drop the template into the NPC you want to customize, make it a child of the NPC and add
        the following script: attachToEntityScript

      • The above message contains the properties that you have to copy into the script you’ve just added to the template.

      • Repeat the process with any template you want to add.

    4 - FAQ

    • How do I add templates?
      - Drag and drop any entity from the asset library into the world.
      - Disable its collision.
      - Save it as a template with a name you can remember (the templades included in this package start with t_)
      - Go to the standScript
      - Add the templates into Templates array
      - Be sure that templateImageslength is at least as long as Templates array (it is recommended leaving it at full length to avoid future errors)
      - Add its name to Template Names array. You can translate it if you want.

  • I’ve found a bug or I have a suggestion, how can I contact?
    - Feel free to join Crauta’s Discord (discord.gg/crayta) and talk to me: unairf#3072

    5 - Credits

  • Author: unairf

  • Thanks to: Tumbak - Torcuato NPC, Creator Master

  • Hisokan: Testing & Documentation Master

  • ThyrisFlare: UI Master

    6 - Thank you for using this package, I hope you find it useful!

4 Likes