Made Colony’s map chooser Hitbox system.
(dont mind that wavy thing)
I still wonder how you do this. It feels scary and complicated. Can you probably link some sources to learn at?
I didn’t learn this from any source, only 2 years of prototyping my thoughts into code and progressively learning here on the dev forum on what habits and ways I need to write code out. If you’re beginner, I took an entire week about 3 years ago learning the basics from Peaspod with some prior basic experience from GameMaker Studio, Unity, and Java. With this project, I wanted to learn more about CFrame equations and mathematics.
Here’s what I did to make that system. It’s pretty simple, one thing to know is that planet is moving around a star, and the star is moving around a black hole with other star systems with there own planets moving around them. This poses a problem with ordinary loops, so we need to update every frame prior by using RenderStepped.
For every frame, the part position needs to be updated so
Part.CFrame = CFrame.new(Mouse.Hit.p)
.
Then I need it to face the planet’s center, so I have a part to represent the center of the planet and is welded to the planet. Part.CFrame = CFrame.new(Part.Position, HomePlanet.Center.Position)
.
After that, I need to face the bottom of the part to the planet’s center by using Part.CFrame = Part.CFrame:ToWorldSpace(CFrame.Angles(math.rad(90),math.rad(Rotation),0))
.
The math.rad(90)
makes the part flip so the bottom is facing towards the center of the planet and the Rotation is rotating the part of that position. To actually clone and place it is mostly everything I said above but I need to apply a weld constraint and set some values for other scripts to use.
--Update
Mouse.TargetFilter = Part
local Update = RunService.RenderStepped:Connect(function()
if Mouse.Target == HomePlanet then
Part.Parent = HomePlanet.PlanetSurface
Part.CFrame = CFrame.new(Mouse.Hit.p)
Part.CFrame = CFrame.new(Part.Position, HomePlanet.Center.Position)
Part.CFrame = Part.CFrame:ToWorldSpace(CFrame.Angles(math.rad(90),math.rad(Rotation),0))
else
Part.Parent = game.ReplicatedStorage
end
end)
I think my coding skills are basic to intermediate, for any other programmers reading this, is there a better way of writing code out, or is this the way to write code?
Optimized path finding for a hexagon-based world! Right now it’s A* w/ static weighting. It tries really hard to avoid grey, brown and blue tiles, in order of avoidy-ness, while trying kinda hard to not explode the server. At more than 100_000 tiles considered it just gives up.
I plan on implementing some of the same optimizations that the devs of RimWorld and Factorio detailed in videos/blog posts, to hopefully turn this into some kind of strategy game.
3D collectable items in-game that emulate the stat hotkeys I already have!
Don’t do that
Don’t give me hope.
As part of my AC-130 project, I made an air support marker to signal targets for the AI.
The automatic camera rotation to match the orientation of the character is so satisfying, nice work!
I know this was posted a while ago, but what you should consider doing is grouping messages by one person into one box to save space, similar to how Roblox’s default chat works. Looks good so far!