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

Previous Thread :: Next Thread 
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
17 Jul 2016 10:29 AM
how would i make the blocks generate like in epic mining 2 so when i break a block more blocks appear? so i wont have to load in a few million blocks when the scritpt reloads


Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
17 Jul 2016 10:35 AM
Easy, when a block is mined you check the spaces around it and load more blocks if necessary.
Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
17 Jul 2016 10:47 AM
but what if you mine into a cave it would just place blocks so you would never get into the cave


Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
17 Jul 2016 10:51 AM
No? You would obviously check if it was already clear.
Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
18 Jul 2016 05:11 AM
one last question, how would i check if there is a part(block) at position x,y,z?


Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
18 Jul 2016 05:19 AM
I belive there was a command FindOnRay thingy... btw hi there!
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
18 Jul 2016 05:46 AM
You will figure it out after a lot more practice
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
18 Jul 2016 05:47 AM
maybe*
Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
18 Jul 2016 09:27 AM
oh i see, so i just shoot rays in all directions checking if there is a block there and if there is dont generate there?


Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
18 Jul 2016 09:31 AM
but how would i check if someone has already mined at position x,y,z?


Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
18 Jul 2016 09:57 AM
if game.Workspace.Baseplate.Position.(X/Y/Z) [<>=<==>] [] then [] end -- like that





(you can use .Position on a "Part" and "Wedge")
Report Abuse
Milenveliki is not online. Milenveliki
Joined: 14 Aug 2013
Total Posts: 1097
18 Jul 2016 09:58 AM
oops nvm
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
18 Jul 2016 10:12 AM
don't do these kind of projects until you go deeper into lua

anyways

function PartAtXYZ(x,y,z)
for i,v in next,game.Workspace:GetChildren() do
if v:IsA'BasePart' and v.Position=Vector3.new(x,y,z) then
return v
end
end
end
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
18 Jul 2016 10:15 AM
I would have just used three or four dimensional tables to do this, that way it's on a grid and you're not relying on getting the position with Vector3s.


Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
18 Jul 2016 10:31 AM
@Jarod


that's what I did lol
Report Abuse
secret6timb1 is not online. secret6timb1
Joined: 11 Sep 2013
Total Posts: 1817
18 Jul 2016 10:34 AM
although it wasn't that optimal


going to remake it real quick.
Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
18 Jul 2016 11:09 AM
thanks everyone!, i got it to work


Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
19 Jul 2016 10:09 AM
hrmmm, sometimes when i mine a block the y of the block becomes 1.52587890625e-005, always that same number everytime :P, i do not know why, it just keeps coming


Report Abuse
L2000 is not online. L2000
Joined: 03 Apr 2008
Total Posts: 77448
19 Jul 2016 10:14 AM
Why r u checking every part's position?

First like Jarod said you want this to be a grid, not position-based - otherwise you'll have those issues with people having already mined the block

Second if you do use Positions you don't have to check every Position because that's a built-in method of Workspace
http://wiki.roblox.com/index.php?title=API:Class/Workspace/FindPartsInRegion3


https://www.youtube.com/watch?v=DelhLppPSxY
Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
19 Jul 2016 10:16 AM
And when i check the block itself its y is 0


Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
19 Jul 2016 10:17 AM
that actually seems much much more efficient


Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
19 Jul 2016 10:18 AM
but i dont actually check every part, i store it in a table, i just get the blocks position and put it in the table


Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
20 Jul 2016 05:54 AM
Bump


Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
21 Jul 2016 05:52 AM
bump


Report Abuse
tekkit is not online. tekkit
Joined: 18 Mar 2012
Total Posts: 130
21 Jul 2016 06:25 AM
Well i just just used math.floor(y + .5) and it works now :)


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