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

Re: theopfor's CFraming Guide V 1.1

Previous Thread :: Next Thread 
theopfor is not online. theopfor
Joined: 08 Feb 2011
Total Posts: 11003
17 Sep 2011 01:33 PM
So... Build mode basically sucks now for you tool users well.. Time to learn how to CFrame in Studio. The command bar people say is slow, inefficient, and useless. Well that is mostly because (assuming here) A) they never tried it or B) saw the wiki version first. Now I must admit the wiki version is a very slow process but still teaches you some stuff.

Lets start!

I heavily encourage the use of command bar. People may say that plugins, tools, and CmdUtl is faster and more efficient but honestly you gotta CFrame like a pro and use command bar.

First things first open Studio mode or Studio. Next View>Toolbars>Command. That is the command bar. Pretty small object but is powerful if you use it right. This is where you put the code.

Also just a side note: the brick you are CFrame MUST BE ANCHORED!!!! I learned this the hard way and I do not want anyone to be discouraged from command bar by this one problem. Another thing is that with the command that will soon be shown all you have to do is select the brick. Also bricks cannot be welded when you CFrame them. Weld them afterwards.

The command looks very complex but I will break it down into the chunks you need to know. Here is the command:

for i = 1,#game.Selection:Get() do game.Selection:Get()[i].CFrame = game.Selection:Get()[i].CFrame * CFrame.new

(0,0,0)* CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) end

To use the command like I said looks complex but give it a chance! There are two things we need to pay attention to here. The first one is CFrame.new(0,0,0). CFrame.new is CFraming the brick. This doesn't rotate it just translates on the axis. The unit of measurement is studs. With the command bar you can go into the hundred thousandths of a stud.

Might not ever need to go down that far but you never know. So the first 0 is the X axis. If you have learned about grids in school then you should know what it is but I will explain it anyways. The X axis is side to side or think of it as left toright. The next 0 is the Y axis. Y is very easy to keep track of because it only controls the up and down position. Next we have Z. The Z axis controls depth. Depth you can think of as forwards or backwards. You can also think of the Z axis as distance. Please note that these axises are not the adjusted to the brick but to the world grid. People are discouraged by this part sometimes because they get confused but you gotta try this. Real quick to achieve!

Next we have rotation! Rotation is very very useful. The line for rotation is: CFrame.Angles(math.rad(0),math.rad(0),math.rad(0)) This looks a little confusing but when I explain it you will understand it more. Now rotation is a littledifferent for rotation so you have to experiment a little. The wiki teaches you to use radians and most people are better with angles. Lets break this down a little. CFrame.Angles is identifying the type of CFrame. math.rad() is converting the number to a radian for CFrame to use. Kinda quick to explain. Studio does have a built-in rotate tool. You might say "YAY!!!" but it is ever so inaccurate you can't rotate anything with it.

The wiki tutorial for CFrame is pretty terrible but that is why I provided the easier code at the top. The wiki does teach a basic understanding so if you seem lost use the wiki version first until you understand it. Then you can go onto the more complex versions. CFraming does take practice too so don't seem discouraged at first! Also for these commands forward will require some simple scripting knowledge of how to locate bricks.

Now the wiki teaches you two things that you cannot do with the command provided so it is a little lengthy. You need to locate the brick then put in in some other stuff and is easier to explain through an example.

workspace.brick.CFrame=workspace.brick2.CFrame

That right there will position brick inside brick2. Can be handy in many cases but once again can be lengthy.

The other thing that the wiki shows you that you cannot do with the code provided is CFrame.new(). CFrame.new moves the part to the exact coordinates provided.

workspace.brick.CFrame=CFrame.new(12,6,54)

That will position the brick at the exact grid coordinates specified.

Here is the what the wiki version teaches you for CFraming like the code above. This code doesn't really need any breaking down for it is fairly simple but I will explain it anyways for the benefit of others.

workspace.Brick.CFrame=workspace.Brick.CFrame+Vector3.new(1,1,1)

That command moves the brick 1 stud to the right, 1 stud up, and 1 stud forward. Now we are locating the brick with this part: "workspace.Brick". Next we are changing the CFrame property. We take the current CFrame value then add

the Vector3 value of 1,1,1 to the brick that moves it.

Some people really like to make vehicles but to make some nice ones CFrame really helps. Well CFrame must be

Anchored so this can create problems. Well lucky you this guide explains how!

To have unAnchored CFrame you must have an Instance Weld script. The Weld script puts in Instance Welds. An

Instance Weld keeps the welded brick at the same distance so they move together. This is very useful!

Thanks for reading and I hope you will enjoy using command bar!!!

"Death to lazy builders. Remove the CFrame tools. Command bar all the way"~pauljkl
"If it tastes bad, it's probably healthy" -RadioactiveWafflez
Report Abuse
SCARxFACIAL is not online. SCARxFACIAL
Joined: 24 Aug 2010
Total Posts: 116
17 Sep 2011 01:42 PM
First :3

Just a note, your first command:
for i = 1,#game.Selection:Get() do game.Selection:Get()[i].CFrame = game.Selection:Get()[i].CFrame * CFrame.new(0,0,0)* CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) end

It's good, but a bit lengthy. Personally I would shorten it by using a different style of loop (Which I think looks much better, I consider using numbered loops in a table to be ugly):

for i,v in pairs(game.Selection:Get()) do v.CFrame = v.CFrame * CFrame.new(0,1,0)* CFrame.Angles(math.rad(0), math.rad(0), math.rad(0)) end

Regards,
~Scarfacial
Report Abuse
SoulStealer9875 is not online. SoulStealer9875
Joined: 20 Jul 2009
Total Posts: 13119
17 Sep 2011 01:46 PM
SCARxFACIAL, you are completely wrong. for:in pairs:do is laggier than for:increment:do.




~SS9875|Programmer|Web Engineer|Wiki Writer
Report Abuse
SCARxFACIAL is not online. SCARxFACIAL
Joined: 24 Aug 2010
Total Posts: 116
17 Sep 2011 01:52 PM
For command bar, it doesn't generally matter.

And I still consider using increments in tables ugly :l

Regards,
~Scarfacial
Report Abuse
theopfor is not online. theopfor
Joined: 08 Feb 2011
Total Posts: 11003
17 Sep 2011 03:05 PM
In command bar wouldn't the lag not really matter as long as it isn't a while true loop? The lag would only be temporary wouldn't it?

"Death to lazy builders. Remove the CFrame tools. Command bar all the way"~pauljkl
"If it tastes bad, it's probably healthy" -RadioactiveWafflez
Report Abuse
Liir is not online. Liir
Joined: 01 Feb 2010
Total Posts: 3424
17 Sep 2011 03:16 PM
I only find the command bar for minor adjustments and to keep parts aligned to the grid.

Everything else I use a CFrame tool because I don't find the need to use the command bar.

on-topic:

The original post seemed to have gotten a bit worse in terms of formatting the further I read.
Report Abuse
Liir is not online. Liir
Joined: 01 Feb 2010
Total Posts: 3424
17 Sep 2011 03:19 PM
nevermind my previous post

i just skimmed through it and didn't notice the line where you said you'd break it into chunks

._.
Report Abuse
theopfor is not online. theopfor
Joined: 08 Feb 2011
Total Posts: 11003
17 Sep 2011 03:19 PM
@Liir What needs to be fixed? Trying to improve meh writing skills. :/

"Death to lazy builders. Remove the CFrame tools. Command bar all the way"~pauljkl
"If it tastes bad, it's probably healthy" -RadioactiveWafflez
Report Abuse
Liir is not online. Liir
Joined: 01 Feb 2010
Total Posts: 3424
17 Sep 2011 03:24 PM
"Some people really like to make vehicles but to make some nice ones CFrame really helps. Well CFrame must be

Anchored so this can create problems. Well lucky you this guide explains how!

To have unAnchored CFrame you must have an Instance Weld script. The Weld script puts in Instance Welds. An

Instance Weld keeps the welded brick at the same distance so they move together. This is very useful!"

-

I don't having a sentence cut off on me half-way or right at the beginning and having to read onto the next 2 lines to finish it.
... lol ..
Report Abuse
theopfor is not online. theopfor
Joined: 08 Feb 2011
Total Posts: 11003
17 Sep 2011 03:26 PM
Thought I removed all that... When I pasted it from Notepad which I was writing it from there was issues that I tried to fix but I guess I didn't get it all.

"Death to lazy builders. Remove the CFrame tools. Command bar all the way"~pauljkl
"If it tastes bad, it's probably healthy" -RadioactiveWafflez
Report Abuse
Liir is not online. Liir
Joined: 01 Feb 2010
Total Posts: 3424
17 Sep 2011 03:31 PM
Lol.
Should use preview post before you post.

"When I pasted it from Notepad"
"I pasted it from Notepad"
"from Notepad"
lol why do you use notepad to write forum posts

the built-in message box is practically the same thing AND you can preview your post with it and it'll make a new line when it needs to and according to the forum layout
Report Abuse
theopfor is not online. theopfor
Joined: 08 Feb 2011
Total Posts: 11003
17 Sep 2011 03:33 PM
I saved it to my computer... I dunno why it did that though.

"Death to lazy builders. Remove the CFrame tools. Command bar all the way"~pauljkl
"If it tastes bad, it's probably healthy" -RadioactiveWafflez
Report Abuse
Liir is not online. Liir
Joined: 01 Feb 2010
Total Posts: 3424
17 Sep 2011 03:36 PM
"I saved it to my computer... I dunno why it did that though."
When you close it out and the message pops up, do you click through it or read it before you click through it?
Report Abuse
theopfor is not online. theopfor
Joined: 08 Feb 2011
Total Posts: 11003
17 Sep 2011 03:43 PM
Yeah I had V 1 saved to my computer then edited it for V 1.1 but pasting it back had format problems I tried to fix...

"Death to lazy builders. Remove the CFrame tools. Command bar all the way"~pauljkl
"If it tastes bad, it's probably healthy" -RadioactiveWafflez
Report Abuse
Liir is not online. Liir
Joined: 01 Feb 2010
Total Posts: 3424
17 Sep 2011 03:47 PM
well next time preview post

'cause this convo ain't workin' out
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Building 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