Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I know vectors, and all of that, but how does it actully help you develop a game?

Asked by
N0rap 0
10 years ago

Well, most of know basics of scripting, but how does it help you build? In the tutorials, it shows you how to do transparency loops, but no one needs that. Please awnser, also i need a teacher.

2 answers

Log in to vote
1
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

You need Vectors

Hi!

I made one of the most popular and complicated Portal places on ROBLOX.

I just checked the current engine's source. Just the word Vector3 appears 93 times in the latest version of the engine.

This does not include any of the math done on Vector3 values:

  • .unit appears 20 times

  • .magnitude appears 35 times

  • :Dot appears 4 times (though I do the computation more than that on my own)

  • .z appears 112 times

  • .y appears 583 times

  • .x appears 196 times

This doesn't include everything: the vector addition and multiplication which I do repeatedly, or the reasoning involving CFrames.


Vectors are the only way to represent direction and position in space.

This means if you are doing any computation, logic, or math involving:

  • Directions
  • Sizes and sizing
  • Orientation
  • Pointing
  • Positioning
  • Turning
  • Moving

You need loops

I use different types of for loops in that same engine 51 times and I use while loops 7 times.

Loops are necessary (excepting functional programming) to do computation. This is not only convenient but also provable

Ad
Log in to vote
0
Answered by 10 years ago

Every word in Lua is there for a purpose. You might not need a transparency loop, but that doesn't mean that other people don't need one. You could use a transparency loop to:

Make bricks that disappear when they are hit

Make bullet hole textures that disappear after some time

Make an energy shield that is constantly changing transparency

Etc...

Vectors, loops, conditionals, all that stuff has a purpose in Lua, or it would've never been added.

Answer this question