Outfit Maker Package (aka OutfitMaker_Private)

The Outfit Maker was the result of me trying to make some outfits for characters and wanting an
efficient way to do so in editor. To accomplish this I essentially took a “snapshot” of the
locations and rotations of the character sockets and constructed a reference skeleton that can be
seen in editor. As such, and as stated above, in order to use this properly it is best, though
certainly doable other ways, to use all the parts of the system together and follow the guidelines
created by me, ArchDude17.

In this package there are a few different things, each of them serving a certain purpose and to be
used a certain way.

This is the main script of the package and is to be attached to the root of the Outfit that
you are making.
This script is to be attached to the individual meshes that are part of the Outfit. Without
this script attached the Outfit Maker will not see it.
This is a template that is setup to aid in the construction of an Outfit. It contains two
parts, the skeleton model and an NPC that is only there for reference and does NOT and will
NOT reflect the changes of the outfit in real time but rather shows the general look.
-Skeleton Model:
The skeleton model is a snapshot of the character and its bone locations. The literal locations of
skeleton does not really matter and is there only to help you. If you make your own “Station”
make sure you place it at the origin and with no rotation that way you get an accurate representation
of what the actual will be.
-OutfitPickUpTrigger: Template
This template is just a trigger box that can be added to an outfit to add interaction
functionality to your outfit. It has a OM_PickUpTriggerScript attached where you will find
some settings.

General Workflow:

Step 1: Create Outfit Template
First you will want to create a template for your Outfit. To do this, you will want to
make a tenmplate from a LOCATOR primitive. It is important that it is a locator and not a mesh
because the root object isn’t attached to a socket and is just attached to the character.
Name the Outfit whatever you like, and then attach the OutfitMakerScript to the root of the
template, ie the locator.

Step 2: Place Outift in the Outfit Maker Station
Now you can either create a new OutfitMakerStation template, or use the one provided as
it is created to be reusable. Make sure that the outfit is NOT a child of the skeleton or the NPC

Step 3: Add Meshes (or templates)
You are now ready to start adding meshes. The best practice for this would be to first drag
the mesh on to the outfit in the hierarchy and then move and rotate it to the position you want.
I would recommend in general the following best practices as well:
-Turn all collision off on the mesh, including the mantle boolean.
-Use the pivot point changer only to do stuff in the editor, but then reset to zero
or it WILL NOT work properly.
Along with placing the Mesh you will also need to add the OM_AttachMeshScript to EVERY mesh you add.
If you do not add this script it will not be attached properly. This script has several properties
that you can alter and I will give a brief explanation of each here:

-CalcSocket: boolean
This option is whether you want the Outfit Maker to try and calculate the socket you wish to
attach the mesh to. This works by calculating the CLOSEST socket to the mesh (based on the skeleton).
While this is reliable, it can work in odd ways when a mesh is actually closer to a different socket
than what you want. By default it is true just to help simplify things but if you click it false
more options will appear.

-Socket: socket name
This option allows you to select the socket to attach the mesh to. It has a drop down of all
the socket options by name. If you are unsure which socket you should attach it to you can go to
the skeleton which has all the placed points named.

-IsUniformMeshScale: boolean
This option is a result of testing (and a lot of frustration) in which I found that certain
meshes just don’t like to play nice. I found that uniform meshes almost always do weird things so
I added this option to automatically adjust for this on uniform meshes, so if it is uniform scale
then click this true. If ticking this still misaligns the mesh in the play view, then you may
need to experiment a little with the other properties below

-IsStubbornMesh: boolean
This option like the above is from the testing of some meshes and finding that there are some
meshes that aren’t uniform scale but still act weird when going into play mode. If you are having
issues with a particular mesh and it not keeping the right rotation, then check this option as true

-StubbornOffset: rotation Vector
This option works in tandem with the IsStubbornMesh and is used to rotate the object by some
offset to adjust for the weirdness. I have not (and don’t necessarily plan to) tested all the
meshes in the game to see which ones do this and what their necessary offsets are. I will make
a forum post to help keep track of these and try to update a list if that becomes necessary.
To figure out what the offset is you will need to just play with the offset and go into play view
to test. In general, I seem to have noticed that the rotations are usually something weird with
the roll of the object, and the solution is to set the offset roll to -180 or 180, but I have
a small sample size of ones I have encountered to know if this is true. However, I have found that
it has to do with the mesh and not the equations since the Outfit Maker functions works more
than it doesn’t.

Step 4: Copy To Template
This step is actually one of the most important parts of the whole thing working but is the
easiest to forget to do. This step requires that you click on the outfit root in the Outfit Maker
STATION and go to the properties tab, and near the top will have a part marked “Instance of Template”
and then 3 buttons. The second button which is a paper with an arrow on it is to copy this instance
to the template. It will also ask you to confirm that you wish to do this so press okay. What this
does is transfers your work to the Outfit’s template, which if attached to something like the player
should auto update (though I would always check to be sure). If you update the outfit at any point,
you MUST do this for it to update the outfit properly.

Step 5: Clean Up and Outfit Usage
Now you are basically done with your outfit! Now to use it. In general I would recommend removing
the outfit from the Outfit Maker Station after each use (though it is not necessary to function) and
only after ensurign that you copied to the template. Now to use the Outfit. I have made it so that
it can be used in two ways, either directly attached to a character template, or as a standing piece
that can be put on.

	Usage 1: Putting it on a character
		If all you want to do is have the outfit put on automatically then all you need to do
	is place the outfit in the Player (or NPC) template, under the root (main component) and
	select the AutoAttach option in the properties of the root of the outfit in the OutfitMakerScript
	You do not need to worry about orientation as it will automatically take care of that.
	Usage 2: Putting it on a stand or holder
		I might in the future add a stand or something to hold the outfits if that is requested
	but for now I will simply supply the functionality to do so. A function inside the OutfitMakerScript
	is called PutOnOutfit(CharRef) which is a function which takes a character reference as the input 
	and attaches the outfit to it. There are several different ways you could set up a method to do this
	but I have also included a way to just drop the outfit in the world and do this. 
		You must first add a OutfitPickUpTrigger template to your outfit, then adjust the location and 
	trigger box size to your liking. There are also two options in the OM_PickUpTriggerScript to either put
	the outfit on by interacting with the trigger or by just walking into it. You can you one or the other
	or both at the same time, though I recommend only one at a time. 
		Additionally you will NEED to select your Outfit's root entity (the locator) in the 
	properties tab for the property "Outfit". Note also the trigger becomes inactive after usage.

And that’s really it! Now you can create wild and crazy outfits in editor to use in your games.
If there is something that you think would be beneficial to add to the Outfit Maker system feel
free to leave a comment on the forum page or to find me in the Crayta Discord (ArchDude17) and
message me directly. If you are having issues with using the package feel free to do the same,
all I ask is that you at least read this thoroughly as well as any additional documentation that
I or others produce before messaging me directly.

If enough people request it I will create a document that contains screenshots of how to do each part, or I may just add some to here but I feel this guideline covers a good amount of possible issues.

Also if enough people ask I would also be willing to make a document explaining exactly how I got this to work, including how the math works.

I hope everyone enjoys this new functionality!

Enjoy Crayting!!



will be good to add somes pic or vid to this post, great Job Btw

Thanks. And do you have any suggestions on parts that would help to have images?