generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Anyone know what this is called?

Previous Thread :: Next Thread 
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
21 Jan 2015 05:43 PM
I have a physical array of parts and I want to weld every part to it's surrounding parts, but not to any that isn't right next to it. What's the best way of doing so? Ex:

X is the selected part

O is a regular part

Z is parts that should weld to X

O O Z O
O Z X Z
O O Z O
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
21 Jan 2015 06:02 PM
--Well. Here's an attempt, doesn't work but no error. I notice there's only 1 weld per part but they don't weld

local function weld(p0, p1, type)
local w = Instance.new(type)
w.Part0 = p0
w.Part1 = p1
w.C0 = CFrame.new()
w.C1 = p1.CFrame:toObjectSpace(p0.CFrame)
w.Parent = p0
return w
end


for i,v in pairs (script.Parent:GetChildren()) do
if v:isA("BasePart") then
local curpos = v.Position
for x,z in pairs (script.Parent:GetChildren()) do
if z:isA("BasePart") then
if (curpos-z.Position).Magnitude <=1.9 then
weld(z, v, "Weld")
end
end
end
end
end
Report Abuse
Sercity is not online. Sercity
Joined: 07 Jul 2014
Total Posts: 156
21 Jan 2015 06:03 PM
idk maybe raycast

"Raycasting describes the act of casting a ray from a certain point in a certain direction, and determining what it collides with."

probably not
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
21 Jan 2015 06:04 PM
XD any idea is a good idea
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
21 Jan 2015 06:06 PM
Would it be acceptable to call this networking or would that be an ignorant thing to call it? I feel like it has to have a name
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
21 Jan 2015 08:43 PM
Basically I'm asking how this dude did it

http://www.roblox.com/Cloth-Simulation-place?id=137996622
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
21 Jan 2015 08:46 PM
Look up "Verlet Integration". Get ready for math.
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
21 Jan 2015 08:53 PM
^ But wouldn't roblox already calculate most of that for you with the glue joint?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
21 Jan 2015 09:05 PM
But he didn't use the glue joint. At least, I'm pretty certain.
But yes, the glue joints on Roblox most definitely use a form of Verlet Integration.
Report Abuse
ForeverDev is not online. ForeverDev
Joined: 04 Oct 2008
Total Posts: 13300
21 Jan 2015 09:06 PM
pfft here goes a weak attempt assuming that's a 2d array with a given x and y index

function weld(array, x, y)
for i, v in ipairs {{0, -1}, {-1, 0}, {1, 0}, {0, 1}} do
if array[x + v[1]] then
if array[x + v[1]][y + v[2]] then
--do some welding !!!!!
end
end
end
end

weld({{o, o, z, o}, {o, z, x, z}, {o, o, z, o}}, 2, 3)
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
21 Jan 2015 09:07 PM
Looking at it more I can tell he didn't use the glue joints because it's able to compress and what not, but I'm looking for a cheater's route haha. Maybe I'll get off my lazy butt and try verlet integration. Seems like a challenge
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
21 Jan 2015 09:08 PM
If you want a challenge, try understanding Simplex Noise.
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
21 Jan 2015 09:37 PM
My brain hurts
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
29 Jan 2015 11:05 PM
Thanks Jarod! Check out what I figured out at my place :)

http://www.roblox.com/Cape-Simulator-2015-place?id=206122684
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
29 Jan 2015 11:06 PM
And I didn't use glue joints
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
29 Jan 2015 11:37 PM
Sweet deal!
Report Abuse
LegendaryAccount is not online. LegendaryAccount
Joined: 02 Jun 2010
Total Posts: 13193
29 Jan 2015 11:39 PM
quenty has a script that does welding like this
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
29 Jan 2015 11:44 PM
Thanks Time ^_^

@above I don't doubt it :3
Report Abuse
earthyreuben is not online. earthyreuben
Joined: 17 Jan 2010
Total Posts: 669
29 Jan 2015 11:53 PM
Your place has been added to my list of places that I wish I could have and dissect the code. Maybe I'll give it a shot myself.
Report Abuse
neverhammer is not online. neverhammer
Joined: 13 Sep 2009
Total Posts: 963
30 Jan 2015 05:46 PM
^ Good luck! I followed a guide I found online and it was actually much easier than I thought it would be (I made the mistake of looking at wikipedia and was discouraged). Start simple and work your way up, and don't get discouraged if it doesn't work :)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image