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
 

[ Content Deleted ]

Previous Thread :: Next Thread 
Charl3s7 is not online. Charl3s7
Joined: 07 Dec 2007
Total Posts: 4146
04 Aug 2009 03:36 PM
Although, an array could be substituted as a struct...

or CLASSES.
Lua would be super epic with classes.
Report Abuse
worldwaffle is not online. worldwaffle
Joined: 19 Feb 2008
Total Posts: 2073
04 Aug 2009 03:37 PM
then it wouldn't be lua.
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
04 Aug 2009 03:37 PM
Tables FTW!
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
04 Aug 2009 03:38 PM
Tables can be used as pass-by-reference structs, and you can use metatables to make tables work like classes anyway.
Report Abuse
XlegoX is not online. XlegoX
Joined: 16 Jun 2008
Total Posts: 14955
04 Aug 2009 03:40 PM
mystruct = {
member1 = "hello",
member2 = 3,
method1 = function(tb, val)
print(tb.member1)
end
}

mystruct.member1 = 4

mystruct:method1() --> prints 4
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
04 Aug 2009 03:40 PM
@xLeg: exactly.
Report Abuse
JKM103 is not online. JKM103
Joined: 11 Dec 2008
Total Posts: 1762
04 Aug 2009 05:23 PM
[ Content Deleted ]
Report Abuse
Charl3s7 is not online. Charl3s7
Joined: 07 Dec 2007
Total Posts: 4146
04 Aug 2009 07:47 PM
Thats what I meant by tables. They can be substituted for structs. But still. Anyone knows how to do that if they know lua.
Report Abuse
XlegoX is not online. XlegoX
Joined: 16 Jun 2008
Total Posts: 14955
04 Aug 2009 07:59 PM
*points at first post*
Report Abuse
objection234 is not online. objection234
Joined: 29 Sep 2008
Total Posts: 4678
04 Aug 2009 08:23 PM
Yeah he does. Now i have mai structs in C++ and Lua :D :D :D
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
04 Aug 2009 08:43 PM
Isn't a table and an array the same thing, just different languages?
Report Abuse
XlegoX is not online. XlegoX
Joined: 16 Jun 2008
Total Posts: 14955
05 Aug 2009 10:38 AM
tables don't have any order, arrays do...
Report Abuse
Dr01d3k4 is not online. Dr01d3k4
Joined: 11 Oct 2007
Total Posts: 17916
05 Aug 2009 10:39 AM
Order? What?
Report Abuse
ApplePiePod is not online. ApplePiePod
Joined: 28 May 2008
Total Posts: 799
05 Aug 2009 10:41 AM
Arrays mustn't have any empty values between 1 and it's last non-empty index.

Tables can be sparse.
Report Abuse
zac352 is not online. zac352
Joined: 20 Feb 2009
Total Posts: 4657
05 Aug 2009 11:46 AM
[ Content Deleted ]
Report Abuse
objection234 is not online. objection234
Joined: 29 Sep 2008
Total Posts: 4678
05 Aug 2009 03:52 PM
I still dont get metaevents. D:
Report Abuse
zac352 is not online. zac352
Joined: 20 Feb 2009
Total Posts: 4657
05 Aug 2009 03:54 PM
[ Content Deleted ]
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
05 Aug 2009 03:55 PM
@objection, zac: Try reading the Lua Reference Manual chapter 2.8. (It's available online.)
Report Abuse
bobbob9955 is not online. bobbob9955
Joined: 24 May 2008
Total Posts: 4037
05 Aug 2009 05:28 PM
[ Content Deleted ]
Report Abuse
sncplay42 is not online. sncplay42
Joined: 27 Nov 2008
Total Posts: 11891
05 Aug 2009 05:31 PM
We already have our associated-data grouper. Tables FTW!
Report Abuse
Charl3s7 is not online. Charl3s7
Joined: 07 Dec 2007
Total Posts: 4146
05 Aug 2009 09:50 PM
@*points at first post*

Um, yea I said that you could substitute an array for a struct. -_-
Report Abuse
Ozzypig is not online. Ozzypig
Joined: 27 Mar 2008
Total Posts: 4906
05 Aug 2009 10:30 PM
Arrays use numbers and tables use fields (terminology?)?
Report Abuse
robobuilder7331 is not online. robobuilder7331
Joined: 28 Aug 2008
Total Posts: 949
06 Aug 2009 08:00 AM
I'm not very good with terminiology.


With tables you can make all kinds of objects.

Script = {Source = [[print('"Hi")]], Name = "Script1"}

print(Script.Name.." says ")
f = coroutine.create(loadstring(Script.Source))
coroutine.resume(f)



--Script builder concept.
--Output:
Script1 says
Hi
Report Abuse
MicroUser is not online. MicroUser
Joined: 29 Mar 2009
Total Posts: 3601
06 Aug 2009 11:25 AM
[ Content Deleted ]
Report Abuse
Charl3s7 is not online. Charl3s7
Joined: 07 Dec 2007
Total Posts: 4146
06 Aug 2009 11:15 PM
Struct is a part of some languages. Like a class and an array put together.

BUT, those still aren't structs.

Struct example:

struct object{
char* name;
};
object milk;
milk.name="Milk";

Array:

objects={milk={name="Milk"}}

Thats the only way of doing it in lua.
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