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
 

New Area Locations

Previous Thread :: Next Thread 
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 05:30 PM
This is more of a thought board question then specifically the scripting side. I don't want to reinvent the wheel if there's a better way. I want to keep track of the area of the map a character is and how many people are in that area.

Should I be writing a script that keeps track of players positions, invisible barriers that keep track of who walks through them, or is there a better option?
Report Abuse
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 05:49 PM
*ahem*
Report Abuse
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 06:21 PM
No Ideas?
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
06 May 2016 07:08 PM
What defines these "areas"? If they are not rectangles or circles (easy geometry) then creating barriers that tags players with the area they are in would be the better option.
Report Abuse
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 07:16 PM
It's not easy geometry unfortunately. I was thinking the same, but wondering how others would or have handled this situation.
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
06 May 2016 07:25 PM
Well actually, if you can define your regions as a bunch of lines to make up a rough polygon, you can do some math to figure out if they are within the region. Per wikipedia, if you can cast a ray through the player's position and check how many intersections with the lines of the polygons there are then if it's odd, the player is inside, if it's even they are outside the polygon.
Report Abuse
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 07:45 PM
Now thats starting to sound like more work than necessary lol.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
06 May 2016 07:46 PM
region3 maybe?


Report Abuse
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 07:46 PM
Enlighten me.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
06 May 2016 07:47 PM
well, with region3 you can define a square region with 2 corners(using some rather simple math)

and then you can use the method FindPartsInRegion3(check the wiki)

you could iterate through the list created by that to find characters, i think


Report Abuse
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 07:53 PM
That sounds a lot more like what I was looking for. Thanks I'll look into it.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
06 May 2016 07:54 PM
one last important thing, findparts method only takes a max of 20 parts, so you need to limit your server capacity to 20, and use the ignoreDescendants argument to not include parts in your map




Report Abuse
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 08:19 PM
It says you can change the max parts with maxParts. But not sure how to use the ignoreDescendentsInstance.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
06 May 2016 08:21 PM
it's not as complicated as it sounds(unless it is, check me on that)

also, i didn't know you can change maxParts

if you just put game.Workspace.Part for the iD argument it would ignore that(i think)

but i think if you also put game.Workspace.Model it would ignore all parts in the model(again, i may be wrong here)


Report Abuse
Syntropy is not online. Syntropy
Joined: 16 Mar 2009
Total Posts: 2272
06 May 2016 08:40 PM
So you think a table could work for the parameter.
Report Abuse
Lord_Narwhal is not online. Lord_Narwhal
Joined: 05 May 2012
Total Posts: 3242
06 May 2016 08:42 PM
you would have to try

if it doesn't, you could try iterating through the table


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