NOTE
I am by no means a programmer, I don’t code, but I at least have some knowledge of coding. This is my first venture into this type of coding, so if you have any feedback on the script, please let me know! Also I did get permission from the original owner to recreate the plugin.
What does this do?
How to Use
If you don't want to read, watch the demonstration above!
Preferably before you start, have the following
-
Have a Model that is named
Road
- The parts inside have to be correctly orientated to the World Orientation -
The model has to have a
PrimaryPart
assigned to it.
- Preferably the Road part, or what ever is used for the asphalt/concrete and etc
Or just use the one in the starter pack.
Step 1
When pressing on the plugin, it brings down 2 selections.
-
Create Curved Road
- This is the main plugin, probably going to be the most used button -
Starter Pack
- This will spawn inBezierCurvedRoad StarterPack
. Inside it has a sampleRoad
model, theRoadPoints
model (containsp1
,p2
,p3
, andp4
) and a ReadMe
IF THIS IS YOUR FIRST TIME, PLEASE SELECT THE STARTER PACK
Step 2
-
Ungroup the spawned
BezierCurvedRoad StarterPack
- If your reading this, you can skip and delete theBezierRoadGen README
script, unless you want to see the Changelogs or want to read more (who does that) -
Ungroup the
RoadPoints
model (OPTIONAL)
- This is optional since you can do ALT + LeftClick the parts and drag them around. For easier movement of the parts, ungroup.
- Inside theRoadPoints
model are the control pointsp1
,p2
,p3
, andp4
. The plugin will consider these points as the control points to generate the road with. Move them around to where ever you want them to be.
If you ungrouped the RoadPoints
model, and after you placed them around, group it back with the SAME name, ensure that all of the control points are inside. MAX 4 for now
Step 3 (UI)
Press on the plugin again and this time press Create Curved Road
option.
Upon pressing,
- Select a valid
Road
Model
-It will highlight any validRoad
Model from theWorkspace
. If you have a valid road and its not highlighted, this might be the reason why.
After selecting a valid Road
Model,
- It will now highlight
RoadPoints
grouping.
-The parts inside theRoadPoints
model will be highlighted, and a line going through the vaidp
points. Select any of them.
After selecting a valid RoadPoints
grouping, the main UI will appear, giving you a few selections
Starting from the top to bottom
-
MPH
- Shows empty at start, but when a road is generated, it will provide a suggested MPH (or KMH when theSwitch to KM/H
is ticked) on either the tightest curve or if none is detected (or too close to the start/endp1
orp4
), the average speed throughout the entire generated road -
Segment Length
- Any value (numbers) you input will be considered as the length per segment. The HIGHER the value, the longer theRoad
model will be
WARNING
The LOWER the Segment Length
value, the more Road
models will be generated. This can make the generated road smoother but this can cause a Roblox Studio crash. I am not responsible for any loss of progress of your game. You have been warned.
-
Curve Strength
- Any value (numbers) you input will be considered as the strength of the curve. Higher values (>70) means more “curvy” the road generated will be -
Generate
- When pressed, it will generate a road based on the values you inputted above, and the placement of theRoadPoints
. It will appear semi-transparent.
-
Done
- After a road is generated, when pressed, it will finalize the road generated and makes the road generated no longer semi-transparent, and shut down the plugin. -
Cancel
- Cancels out any generated road, and shuts down the plugin.
Optional features
-
Flip Directions
- Upon ticking the box, it will regenerate the generated road flip fromp1 -> p2 -> p3 -> p4
top4 -> p3 -> p2 -> p1
, Untick the box again and it will revert back. -
Switch to KM/H
- Upon ticking the box, it will switch the displayedMPH
to KMH, Untick the box again and it will revert back.
Known Limitations
“My Road lines / Road looks wrong after generating!”
I have said above, that the parts inside the Road
Model has to be orientated properly to the World Oritentation. What I mean by this is that the Axes (Axis) has to correspond accordingly. Up/Down is y
and Left/Right is x
.
“My Lane lines turns into solid road lines!” (Textured lines with spacing)
A part of the limitation of the plugin. Those dashed lines cant be exempted in the code, and I don’t think there is any workaround for this apart from manually adding in those lane lines afterwards.
If you find any more, please contact me!
---Future Plans
I plan to do a few more things to flesh out the plugin.
-
Allow tilting to happen at the start/end (
p1 and p4
)
- This is very useful for creating sections of roads but needs titling to start immediately or end. I am already trying to make this work -
Allow movement of the parts inside the
RoadPoints
without going through the Explorer or manually moving them outside the plugin
- This is mainly for quality of life improvements, still thinking of a way to figure this out -
Allow generation of more than one
RoadPoints
at the same
- A long-term plan for me to implement, really helps with the highways with separate right of ways. -
Allow more than 4 Control points
- Already in the works, will allow for more longer and more defined curves. Really essential.
If you have any more features that you wish to see me implement (atleast to the best of my abilities), please let me know. Contact me at Trellux#trellux or find the MDU social link to the server.
A separate topic dedicated for changelogs will come soon.