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: 3D SandBox Pyhsics question

Previous Thread :: Next Thread 
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
06 Aug 2011 08:20 PM
How does the roblox Stamper tool identify which side to place the block at? Does it have to do with gettign the side and adding onto vectors to get to the certain vector?
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
06 Aug 2011 08:22 PM
I think it randomly does it
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
06 Aug 2011 08:23 PM
Randomly? I don't get if it's random it'd be so precise.
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
06 Aug 2011 08:31 PM
Are you referring to the stamper tool in Roblox's place? As in, the one we can't actually access?
Report Abuse
ZizZazZuz is not online. ZizZazZuz
Joined: 16 Jun 2008
Total Posts: 2743
06 Aug 2011 08:31 PM
Exactly. ;)
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
06 Aug 2011 08:47 PM
How did someone make a duplicate of it? The sand box game? And what do you mean we don't have access to it, is roblox keeping us away from the best methods EVAH?
Report Abuse
sdfgw is not online. sdfgw
Top 50 Poster
Joined: 08 Jan 2009
Total Posts: 41681
06 Aug 2011 08:53 PM
I mean, are you talking about the stamper tool in that welcome to roblox game, that has a copylocked tool I haven't seen before.
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
06 Aug 2011 08:59 PM
http://wiki.roblox.com/index.php/TargetSurface_%28Property%29
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
06 Aug 2011 11:09 PM
No, how you place the block hwo it doesn't move it's X or Z when placing it. Like it exactly is alligned on a grid. Does it have to do with vectors?
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
06 Aug 2011 11:13 PM
I have a copy of the stamper tool from free models, I just need to find out how they place blocks down directly on a grid. :D
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
06 Aug 2011 11:15 PM
They round it by however wide it is... I use this method all the time actually. It's just the number divided by however wide, then math.round(num), then multiply by however wide. And you get a number rounded by however wide it is..

~My graphic card is a crayon's box. - Spectrumw ~
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
06 Aug 2011 11:20 PM
Can anyone give me a example? I quit for like 3 months and I forget already.
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
06 Aug 2011 11:23 PM
Example??

function mathround(num,div)
div = div or 4
a = math.floor((num/div) + .5)
a = a*div
return a
end


mathround(mouse.Hit.x, 4)

Probably not like that in their code but that's my coding for it..

~My graphic card is a crayon's box. - Spectrumw ~
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
06 Aug 2011 11:27 PM
they keep it in place by :

1. decide which axis the bricks won't share based on which side was clicked. ( top and bottom==Y,right and left==X,front and back==Z )
2. Take the size of the brick clicked and the brick about to be placed and do

(clicked_brick.Size.AxisFromStep1)/2+(new_brick.Size.AxisFromStep1)/2

3. Set that number to the CFrame of the new brick on that axis and then make the other 2 axises the same as the brick clicked.

make since?
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
06 Aug 2011 11:28 PM
So this would work?

Tool = script.Parent;
CurrentBlock = "Dirt"

function mathround(num,div)
div = div or 4
a = math.floor((num/div) + .5)
a = a*div
return a
end

function Insert(block,position)
p = game.Lighting[block]:clone()
p.Parent = game.Workspace.World
p.CFrame = position
end

Tool.Equipped:connect(function(m)

m.Button1Down:connect(function()
pos = mathround(m.Hit.x, 4)
Insert(CurrentBlock,pos)
end)

end)
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
06 Aug 2011 11:33 PM
I got this output :

Players.Player.Backpack.HopperBin.LocalScript:14: bad argument #3 to '?' (CFrame expected, got number)



I changed Equipped to Selected.
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
07 Aug 2011 12:11 AM
Erm... Well you have to do it for x, y, and z based off of which side you're doing it from. And position has to be in a Vector3 or CFrame. You just gave it a number..

~My graphic card is a crayon's box. - Spectrumw ~
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
07 Aug 2011 12:45 AM
It uses JointsService::ShowPermissibleJoints()
Report Abuse
aboy5643 is not online. aboy5643
Joined: 08 Oct 2010
Total Posts: 5458
07 Aug 2011 01:03 AM
Oh. That too. Likely something like mine only Roblox decided to hide it within their own Service... Nice..

~My graphic card is a crayon's box. - Spectrumw ~
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
07 Aug 2011 07:00 AM
Example? All I wanna do is have an invisible grid made by Lua that allows blocks to only be placed on it. :)
Report Abuse
Miro034 is not online. Miro034
Joined: 07 Oct 2009
Total Posts: 6568
07 Aug 2011 07:38 AM
the stamper tool is really hard to edit.

I love pancakes and waffles
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
07 Aug 2011 07:46 AM
Anyone?
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
07 Aug 2011 07:51 AM
@SDuke
What is AxisFromStep1? And how do I get it?
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
07 Aug 2011 07:53 AM
Oh, nvm.
Report Abuse
SDuke524 is not online. SDuke524
Joined: 29 Jul 2008
Total Posts: 6267
07 Aug 2011 11:18 AM
Yeah and I skipped that the number you get you have to add or subtract to the original, depending on which side. Yet all in all it's fairly simple.
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