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 » Scripting Helpers
Home Search
 

Re: FindPartsInRegion3WithIgnoreList Help

Previous Thread :: Next Thread 
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 11:05 AM
I am trying to make a A* (A Star) pathfinder. I am currently trying to make it so that the pathfinder can detect if there are walls, and avoid them. Would this be the correct way to do it?


FindPartsInRegion3WithIgnoreList( Region3.new( Vector3.new(1, 1, 1), Vector3.new(9, 9, 9) ), ClosedList, int maxParts = 100)

And just have a lot of those set up so that they cover the whole map?
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 11:47 AM
Any help? I cant figure this put, and there no explanation on the wiki.
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
27 Jul 2012 11:53 AM
int maxParts = 100)

shoulld be:

maxParts = 100)

Maybe?
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 11:54 AM
Well here is the wiki page that i got it off of. I did it like they did, but like I said there are no examples on the wiki page.

http://wiki.roblox.com/index.php/FindPartsInRegion3WithIgnoreList_(Method)
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
27 Jul 2012 11:55 AM
The "int" is just telling you the type of number that should be given to the function. It'll make more sense when you move onto another language like Java or C++. For now, just remove the int when you call the function.
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 12:01 PM
Well, I now have this code.

FindPartsInRegion3WithIgnoreList(Region3.new( Vector3.new(1, 1, 1), Vector3.new(9, 9, 9) ), ClosedList, maxParts = 100 )

But i get this error.

Line 89: ')' expected near '='

The script above is all line 89.
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
27 Jul 2012 12:04 PM
Oh yeah, remove the "maxParts = " too, just keep the 100.
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 12:08 PM
Ok, Thanks.

So this is now the code.

FindPartsInRegion3WithIgnoreList(Region3.new( Vector3.new(1, 1, 1), Vector3.new(9, 9, 9) ), ClosedList, 100 )

But when I run it I get this error.

Workspace.A*:89: attempt to call global 'FindPartsInRegion3WithIgnoreList' (a nil value)
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
27 Jul 2012 12:09 PM
workspace:FindPartsIn... etc
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 12:11 PM
OK. Changed it to this.

game.Workspace:FindPartsInRegion3WithIgnoreList(Region3.new( Vector3.new(1, 1, 1), Vector3.new(9, 9, 9) ), ClosedList, 100 )

But got this error.

Unable to cast value to Object
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
27 Jul 2012 12:13 PM
Lol wut?
Does ClosedList exist?
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 12:19 PM
Yes, its a table, which has a few objects in it. These objects are added into it right before this is ran.
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
27 Jul 2012 12:20 PM
O.o
Add prints
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 12:35 PM
OK, i got it to work.

But how do i access what parts are in the area?
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
27 Jul 2012 12:37 PM
That method returns a table with all the parts it found.
Report Abuse
unholysoda is not online. unholysoda
Joined: 15 May 2010
Total Posts: 9024
27 Jul 2012 12:38 PM
OK, so this is my script, so how do i use that tables info?

game.Workspace:FindPartsInRegion3WithIgnoreList(Region3.new( Vector3.new(1, 1, 1), Vector3.new(9, 9, 9) ), Walls, 100 )
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
27 Jul 2012 12:40 PM
local foundPartsTable = workspace:FindPartsIn...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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