Could a scripter help me getting started on character customization?

gui
development
scripting
help

#1

Hey everybody!

I’m currently scripting Legend of the Eldritch on my own. While I know scripting frankly well, I sometimes get stuck on certain areas like this one.
I’m trying to create a system that allows easily configurable (for when new items are being implemented), re-usable (e.g using a module script) and preferably an efficient customization functionality for characters with use of attachments, assuming that’s the best way.
The customization is done with use of GUI which looks like this:


(Click the image to enlarge if the text is too small to read)

Customization Details

The character is a custom model with a R15 setup.
The character does have accoutrements such as ears, 3D eyes, nose and the mouth (which isn’t visible there yet.) But is also able to customize armour and weaponry in separate pieces. (e.g a sword has a hilt, blade and a pommel to customize.)
Armour should allow the player to change the look of each piece on a body part:

  • Helmet / Hat; (Head)
  • Chestplate / Suit; (Upper & Lower Torso)
  • Pauldron / Upper Sleeves; (Shoulder & Upper Arm)
  • Vambrace / Lower Sleeves; (Lower Arm)
  • Gauntlet / Glove; (Hand)
  • Cuisse / Upper Pants; (Upper Leg)
  • Greave / Lower Pants; (Lower Leg)
  • Sabatons / Boots; (Foot)

On top of that players should be able to put ornaments (e.g spikes, chains, etc.) on certain parts, customize the colour and material of certain parts and eventually add an x amount of layers of patterns on them with textures.

However, I’ve never actually worked on morphing / customization before and was wondering if a scripter who did or at least knows how it works could give me a friendly push in the back?

I’ve tried looking up some tutorials / articles on the Roblox wiki and Youtube but couldn’t find something I could use.

Thank you for your time & effort in advance!


#2

Unrelated, but is it intended that the character looks like you irl? :joy:


#3

Hahahah not necessarily :joy:

Edit: Actually now that I read through the constitution, yes it’s supposed to enhance the gameplay by making the character look like yourself in real life. :stuck_out_tongue_winking_eye:


#4

Hello! I don’t know if I can help fully with what you’re trying to achieve but I’ll give my 10 cents and tell you how I would go about it!
Yeah first off, attachments/weld constraints are the way to go, adding a few on the base character via character script would be good, alongside naming them. I would put them all in one set place for easy reference.
With the amount of customization that I see here (That being individual bits and all that are also customization) Would be a form of “pseudo hierarchy”, Similar to how the child and parent hierarchy would be already. But instead of parts, they are folders with each “layer” with its own attachments.
For example,
Arm (1 Attachment point) > Armor (3 Attachment points) > Spikes/etc.

This way, you can save the data pretty modularly (similar descendant structure) and add whatever amount of attachment points to different armor sets/weapons.

But other than that, there’s a lot of nuance that I think you would have to discover on your own, actually adding the armor is as simple as you can think, just attach/weld the two bits together.

I hope I helped a little (:


#5

Not sure if this will help very much at all but I found this
https://developer.roblox.com/api-reference/function/Humanoid/AddAccessory


#6

Thank you @asmanwoks and @DanPai!
Definitely helpful and very appreciated :smile:

Now that I kind of know how to set it up, could any of you help me a bit with setting it up script-wise? That’s where my biggest concern lies namely. :worried:

Edit: With that I don’t necessarily mean to create me a script :joy: but rather some sort of clarification of where I would place the scripts (FE compatible).

Also can I use AddAccessory for the armour and such too? :thinking:


#7

I created one in a few days. It’s kind of complex but I can show you if you’d like. It is filtering enabled of course and uses two scripts to accomplish what it needs. Uses built in Roblox functions for removing and equipping faces, hats, hair etc. This is my current project, this displays the entirety of the mechanic.


#8

Please do show! :slight_smile:
Do you have Discord where we could communicate on?


#9

For sure. MrAsync#7629


#10

I hope this kind of gives an idea for you. This is how I have always done my custom characters. It may or not be the right way to go but it has always worked for me.

So, since it looks like you have a preview for your character, I would start like this:

For the client:
I’ve always liked storing stuff in the player as values. The physical object being there makes things easier to work with. Something like this stored where the both the client and server can easily access it:

Typically I just use string values.

Then, create a function that calls RemoteEventA each time the user requests to wear something on the fake player. Send the item you wish to change to.

Create RemoteEventB that will fire when the user presses proceed.

For the server:
Have a module script for controlling everything.
Create functions like:

  • UserOwnsItem(user, item)
    • Returns true if the user owns the item
  • UserCanWear(user, item)
    • Returns true if the user can actual wear the item
  • PurchaseItem(user, item)
    • Marks the item as purchased, deduct money
  • EquipItem(character, item)
    • Checks UserOwnItem(), UserCanWear()
    • Call RemoveItem() to remove current item in that spot
    • Places the item on the designated character
    • Sets the specific value in the character to the item
  • RemoveItem(character, item)
    • Removes the designated item
  • UpdateCharacter(character)
    • Loops through the user’s values, calling EquipItem() for each value.

Now for RemoteEventA, simply call EquipItem(character, item).
For RemoteEventB, simply call UpdateCharacter()

At the end, when the user presses proceed, fire RemoteEventB.


#11

I got him setup with my personal module, two scripts, one remote event. Very easy to use and he said it’s working pretty well.


#12

I’m honestly using it to learn from rather than using it :smiley:
The explanation Aqualotl gave is super useful as well.

Everything combined I’m definitely on the right road. :slight_smile:
Thank you all :smiley:


#13

Glad to hear!


#14

Hey :slight_smile:

So I do have a few questions:

  1. Why StringValues and how are they used in this case?
  2. Could you help me getting it organized a bit?
    Because I’m planning on releasing new customization content periodically. The way I planned to do it is by making packages. The initial one being the default package with content that is frankly simple. Further down the road I’d add new packages e.g chilled package (containing winter-themed content, etc.)
  3. What’s an efficient way of setting the base up? Like, where should I store the remotes, models and similar?
  4. I’d like the content not to be stored locally to prevent theft as far as possible. How can I keep the content secure like that?