Parthax
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 6941 |
|
|
| 02 Jul 2013 10:29 PM |
Appears I've been kicked out of Master Scripters. Why?
On the other hand, discuss metatables and what they could have a good use for in creating a game, as they seem to not have any special use other than to store data. |
|
|
| Report Abuse |
|
|
billiland
|
  |
| Joined: 11 Nov 2008 |
| Total Posts: 4018 |
|
|
| 02 Jul 2013 10:36 PM |
You could have just messaged me...? I kicked everyone who wasn't in the group originally, we have a test being set up.
As for metatables, they are more for hacky things than they are useful. Their main point was to link OOP to lua, but this doesn't apply to Roblox for obvious reasons. |
|
|
| Report Abuse |
|
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 02 Jul 2013 10:41 PM |
| Depends. I've found __mode useful when I want to be lazy regarding storing a list of players for something. I've also made my own class system which, in my opinion, is nicer than anything you guys have made. I think it'd be useful for a game (not a model since models are supposed to be smallish) provided I actually try and finish one (which I haven't been able to). |
|
|
| Report Abuse |
|
|
billiland
|
  |
| Joined: 11 Nov 2008 |
| Total Posts: 4018 |
|
| |
|
Legend26
|
  |
| Joined: 08 Sep 2008 |
| Total Posts: 10586 |
|
|
| 02 Jul 2013 10:43 PM |
| ^ Depends on what you call 'hacky' :/ I don't call them hacky. |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 02 Jul 2013 10:54 PM |
| Metatables are useful for making tables dynamic, like userdata. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:15 PM |
theyre only limited to what you can think of.
"Their main point was to link OOP to lua, but this doesn't apply to Roblox for obvious reasons." ehhhh no |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
| |
|
LuaWeaver
|
  |
| Joined: 28 Jun 2013 |
| Total Posts: 213 |
|
|
| 02 Jul 2013 11:23 PM |
There's a lot of purpose for object orientation in ROBLOX. In fact, might I add, I created a game with object orientation at it's core and it was pretty neato.
It's a dead project, doing a rewrite. I designed aspects without thinking of the future aspects I wanted to add. Still has object orientation at the core, though.
Also, metatables can be used to make things nice. For example, I wrote an emulation of BindableEvents and BindableFunctions to allow server-to-client usage and vice versa. The wrapper returned for events had a __call metamethod set for firing the event, and connect and wait methods like a normal event.
while obamacare() do benefitMiddleClass() end --LuaWeaver |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:24 PM |
But I can even make integers userdatas. Don't ask me how.
~1waffle1 |
|
|
| Report Abuse |
|
|
LuaWeaver
|
  |
| Joined: 28 Jun 2013 |
| Total Posts: 213 |
|
|
| 02 Jul 2013 11:25 PM |
That's simple. :l
while obamacare() do benefitMiddleClass() end --LuaWeaver |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:27 PM |
a = 5 a = newproxy(true) SHHH DONT TELL ANYONE
~1waffle1 |
|
|
| Report Abuse |
|
|
LuaWeaver
|
  |
| Joined: 28 Jun 2013 |
| Total Posts: 213 |
|
|
| 02 Jul 2013 11:28 PM |
THIS IS THE BEST I'LL LEAK IT EVERYWHERE
while obamacare() do benefitMiddleClass() end --LuaWeaver |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 02 Jul 2013 11:29 PM |
Don't or I'll hack your DLLs.
~1waffle1 |
|
|
| Report Abuse |
|
|
LuaWeaver
|
  |
| Joined: 28 Jun 2013 |
| Total Posts: 213 |
|
|
| 02 Jul 2013 11:31 PM |
I have 19 proxies, you'll never get my DLLs!
while obamacare() do benefitMiddleClass() end --LuaWeaver |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2013 11:33 PM |
I have a Dll Injector 2.0. Don't underestimate me, you incompetent moron.
~1waffle1 |
|
|
| Report Abuse |
|
|
blocco
|
  |
| Joined: 14 Aug 2008 |
| Total Posts: 29474 |
|
|
| 02 Jul 2013 11:47 PM |
| yeah well i have [insert generic hex editor here], TRY ME!!!! |
|
|
| Report Abuse |
|
|
booing
|
  |
| Joined: 04 May 2009 |
| Total Posts: 6594 |
|
|
| 02 Jul 2013 11:52 PM |
| eah well i have [insert generic hex editor here] 2.0, TRY ME!! |
|
|
| Report Abuse |
|
|
LuaWeaver
|
  |
| Joined: 28 Jun 2013 |
| Total Posts: 213 |
|
|
| 02 Jul 2013 11:54 PM |
| yeah well i have [insert generic file type here] h4xer, TRY ME!! |
|
|
| Report Abuse |
|
|
billiland
|
  |
| Joined: 11 Nov 2008 |
| Total Posts: 4018 |
|
|
| 03 Jul 2013 07:32 AM |
""Their main point was to link OOP to lua, but this doesn't apply to Roblox for obvious reasons." ehhhh no"
You are going to shoot me down, and then not explain why I am wrong? Metatables are not essential for OOP, but they are indefinitely useful. Their main point is to create custom objects or custom items of sorts. Seeing as Roblox already has an environment with the objects within that you are allowed to use, this is not extremely helpful. In the RBX environment, metatables are typically used to create little "hacks" as ways to do something differently/effciently/creatively... though it can serve a purpose beyond that, but 99.9% of the time, they are unneeded.
If you are going to tell me I am wrong, tell me why I am wrong. There is nothing wrong with what I said, so tickle me pretty if I am.... |
|
|
| Report Abuse |
|
|
jacob2233
|
  |
| Joined: 23 Aug 2007 |
| Total Posts: 723 |
|
|
| 03 Jul 2013 07:40 AM |
My biggest use for metatables is so I can create scripts that depend on eachother or even new classes. Using something similar to Anaminus' "hijack the shared metatable" method, you can do all sorts of things like:
local Rectangle = shared.require 'Rectangle'
local rect1 = Rectangle.new(xPos,yPos,zPos,xSize,ySize,zSize) --assuming variables are declared
local rect2 = Rectangle.new(xPos1,yPos1,zPos1,xSize1,ySize1,zSize1) --assuming variables are declared
rect1:draw() --create a block based on params rect2:draw() --create a block based on params
if rect1:collides(rect2:getPoints()) then print("Rectangles intersect") else print("Rectangles don't intersect") end
Makes scripting feel more like Java or C++, which is what I like. |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 10:58 AM |
"If you are going to tell me I am wrong, tell me why I am wrong. There is nothing wrong with what I said, so tickle me pretty if I am...."
i said 2 words and you came back with a paragraph. . . anyways they can be useful for implementing OOP, but thats not their sole purpose. they can be used for various other things - creating data types, libraries/utilities, syntactic sugar, hacks :P, and so on. like i said its only limited to what you can think of but its not just OOP. if you haven't looked at it - http://www.lua.org/pil/13.html |
|
|
| Report Abuse |
|
|
|
| 03 Jul 2013 11:47 AM |
@ billiland
Unless you make everyone take that test (kick everyone out and they do it for re entry), your group might as well be the same popularity test that it was in the beginning. |
|
|
| Report Abuse |
|
|
digpoe
|
  |
| Joined: 02 Nov 2008 |
| Total Posts: 9092 |
|
|
| 03 Jul 2013 11:48 AM |
| I /really/ think that BLUEwaffleBERRY isn't 1waffle1. |
|
|
| Report Abuse |
|
|