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: GetConnectedParts

Previous Thread :: Next Thread 
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 04:24 PM
Is there a way I can ignore a single (or multiple) instances?
I'm doing this recursively (GetConnectedParts(true)) and in some cases, it might be connected to the BasePlate which might connect it with other instances much further away, but still on the BasePlate.

I've tried making all the sides of the BasePlate 'unjoinable' but it still is returned in GetConnectedParts.

I don't want to have to loop over all the returned parts, check if it's BasePlate and GetConnnectedParts(false) with that and remove those from the original table because that just a little bit extreme.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 04:32 PM
Never mind I just realized something like this is going to be very hard.
I guess I'll just recursively GetConnectedParts(false)
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
13 Jun 2015 04:36 PM
does GetConnectedParts return a table? if so, just loop thru the table and remove the parts you DONT WAnT
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 04:40 PM
That's the thing, I won't always know what parts I don't want since it's constantly changing. Imagine redstone on minecraft, the 'ground' doesn't transfer electricity past more than 1 part.
prntscr/7gmjtc

Say my target is the top-most part of the left-column, I only want the left-column returned.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
13 Jun 2015 04:41 PM
maybe check if the part isnt equal to a redstone part and then if it isnt, remove it from the table
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 04:43 PM
How do you suppose I do that? The right-most column are all redstone parts.
GetConnectedParts(true) will return EVERYTHING connected to the object directly or indirectly. Sure I can filter out non-redstone parts but the redstone parts that were indirectly connected to begin with won't be filtered out.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
13 Jun 2015 04:46 PM
so

redstone
redstone
redstone
non-redstone
baseplate?

baseplate:GetConnectedParts(true)

for i,v in next, ^^^^ do
if v.Name == "non-redstone" then
table.remove(^^^^, v)
end
end

idk jus tryin to help
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 04:47 PM
I know what you're saying, but look at the picture.
If the baseplate connects redstone parts even when those redstone parts aren't in contact to each other directly/indirectly (excluding the baseplate), those can't get filtered out so easily.

If I just filter out non-redstone, I will still have a table filled with redstones that might not be touching in any way.
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
13 Jun 2015 04:49 PM
OH you're trying to find redstone connected to redstone to the baseplate?

uh... idk then. that sounds rly complicated, but you could do it another way... i think?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 04:51 PM
Yeah I'm doing it another way, but it was so simple with the recursive argument of GCP D:

I thought maybe there was a method I didn't know about that might do something similar with an ignore list idk
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 05:34 PM
well, it works right now but i think it's pretty inefficient, maybe i'll rewrite it soon but for now :)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
13 Jun 2015 05:41 PM
Yay http://www.roblox.com/games/183611668/Testing-Place

It's going to cause lag if you have a lot probably (I'm going to rewrite it to work with filtering and make sure the server does everything, so I don't have to 'turn off the power every tick') but it works :)
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