Hello all,
my team and I are currently working on a roleplay game with a customizable custom character in an editor before gameplay starts. So far my scripter tried making players invisible to each other in the editor and spawn in the same place, but that turned out to not work properly and is very ineficent. He then thought about switching to a plot system but we have no idea how to do that with a custom model.
There is little to no information about these kinds of editors on the internet and I have been researching for a while with no luck. If you need a reference: Wings of Fire, Warrior Cats Ultimate Edition and other games of that genre use this method.
Iâll add some screenshots of our work in progess as well. Any help is greatly appreciated!
Pictures
â ď¸ Warning â ď¸
Iâm only trying to help
This code was made by AI
Certainly! Iâd be happy to help you with creating a custom character editor in Roblox.
To start with, youâll need to have a basic understanding of the Roblox Studio interface and the Lua programming language.
Here are some steps you could follow to create a custom character editor:
- Create a new game in Roblox Studio and insert a character model into the workspace.
- Add a GUI (graphical user interface) to the character model using the Roblox Studio GUI editor. This GUI will be used to display the different customization options for the character, such as skin tone, hair style, and clothing.
- Write a script that allows the player to change the appearance of the character by modifying the properties of the character model, such as the skin tone or the color of the hair.
- Test the custom character editor to make sure that it works as expected.
I hope this helps to get you started! Let me know if you have any questions or if you need further assistance.
Sure! Here is an example of how you could write a script in Roblox Lua to create a custom character editor:
-- Create a local variable to hold the character model
local character = game.Workspace.Character
-- Create a function to change the skin tone of the character
function changeSkinTone(skinTone)
character.SkinColor = skinTone
end
-- Create a function to change the hair style of the character
function changeHairStyle(hairStyle)
character.Hair.Style = hairStyle
end
-- Create a function to change the color of the hair
function changeHairColor(hairColor)
character.Hair.Color = hairColor
end
-- Create a function to change the shirt of the character
function changeShirt(shirt)
character.Shirt.ShirtTemplate = shirt
end
-- Create a function to change the pants of the character
function changePants(pants)
character.Pants.PantsTemplate = pants
end
Iâm not exactly sure if this is going to help but this should be a vague idea on methods & concepts I could think of that could help you. I didnât write much code in here so this is mostly just conceptual & sorry for the lengthy post as well. I wrote the method you may want for this vs. my own recommendation on what would probably be better for you to do.
Thereâs a few ways to go about this ranging from using viewports frames, or a more interactable copy of the custom morph or just using the client to do all the work.
Although Iâve not exactly made a âcustom morphâ version I have done something similar with editing an avatar using viewports.
A Plot?:
Only writing about this incase this is the main question.
To create a plot you can put some parts into a model / folder and name it âplotâ or however you want to stay organized. Inside the plot you may want a camera angle, a platform which your character stands on, some background props. (Limiting view distance could be done with an inverted sphere mesh)
The Method You Want?: (I think)
With the method youâre asking for it sounds like you want to set up a row of plots I guess. This can be done with a few different methods as well such as creating a pre-existing amount of plot lands used solely for avatar creation / editing or automatically generating it when a player joins the game.
Regardless, Iâm assuming you have a big box or area that you want the player to start editing in, you can find the width of this area and then create a copy of it and shift that copied plot 1.5x the width away from the previous plot. And then start your method of avatar creation / editing. (Although youâll need to clean it up after the player leaves.) Youâll need to tell the client what the coordinates or what plot theyâll be using as well.
Example of what I mean since I think my explaination isnât good:
local original_plot = ThePlotYouHave -- (?) | Could be a model of some sort
local previous_plot = original_plot
local positions = 1
-- // These will be used for defaults
-- // So you can create a new plot
local bounding_box, bounding_cframe = original_plot:GetBoundingBox()
-- // pretend this is the player joined event
PlayerJoining:Connect(function(player)
-- // Whatever method you have
-- // Alternatively you can set this to a pre-existing plot
-- // and remove ownership after the user leaves
-- // Which excludes proceeding lines below
local newPlot = original_plot:Clone()
-- // So then this will offset the whole plot
newPlot:PivotTo(bounding_cframe * CFrame.new(bounding_box.X*1.5, 0, 0))
-- // You'll end up telling the client what plot is theirs etc...
end)
I didnât get much into this.
Personal opinion about what and why and how (vaguely):
Although in my person opinion which may not be the best.
You should, as you already have, a designated plot or area that you want to edit your character, everything down to the models and coloring will be on the client (You can even have the plot designed and created on the client as well).
When the player requests to edit so-so race/morph the server will place a duplicated model I suppose and put it in replicated or wherever you may want it, this will allow the client to make itâs own copy and start editing from there. This is where your player can then start editing their morph / character, which will be cached on the client until they want it saved. When saving the results of the current edit, the player will just tell the server what the client wants, mainly sending the cached list of edits (This & requesting the morph will be the only two affected by latency).
Doing so will have less bloat on the server and such and the client gets instant feedback to their desired changes. Plus, other players edits wonât be visible to other clients while theyâre editing in their plot.
Extra:
Another thing I didnât really mention at the top was, keep your plot or edit area away from Robloxâs or your morphs default spawn or spawn locations so then you donât have to turn the new players invisible.
I just highlighted any important parts so you can easily skim read the opinion version.
Hopefully this heightened your insight slightly!
Loading a model or a part to the client is the way to go, for these donât load in the server. See these:
Client, with client-sided parts selected:
Server:
The idea is you could place the players in a black box for now, load a client-sided character editor scene, and have the character editing previews appear there. Upon completion of the character editor (or while editing if you prefer) apply the changes to the playerâs character.
Animations should be carried over by code.
Thank you for all the information so far, very nice of you!
We are currently trying these things out, Iâll let you know what works best.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.