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: Struct

Previous Thread :: Next Thread 
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Jun 2014 01:29 PM
I checked the wiki, I don't understand what it is, how to use it, nor why you would use it. Can anybody explain or at least give me an example of a Struct/using a Struct?

The only thing I know is it's properties making up a big property (So like maybe Position.X Position.Y Position.Z) and that it is a Data Type.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Jun 2014 01:44 PM
12 views no posts.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
16 Jun 2014 01:56 PM
Think of a struct like a library.
It is a way to organize variables etc.

One example is an array.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Jun 2014 01:58 PM
How can I use it?
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
16 Jun 2014 02:00 PM
Where it says "other data structures"

It will show you different data structures that can be used in lua.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Jun 2014 02:03 PM
How can I use a Struct!?!?!
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
16 Jun 2014 02:04 PM
A struct (short for structure) allows you to make an 'object'. At least in C.
Though there are no real objects in C.

Where are you trying to use it? They don't exist in Lua.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
16 Jun 2014 02:05 PM
I just told you, look in the wiki, it will show you. -___-
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Jun 2014 02:08 PM
@agent

http://wiki.roblox.com/index.php?title=Data_Types


In Roblox Lua, as well as most programming languages, you will encounter data types. These are the types of values that you can store in variables and used in code. Roblox Lua implements several new data types to Lua in addition to the native data types.

[edit]Native Lua
These are usable in all Lua code - not just Roblox Lua.

Type Description
Boolean Represents either true or false
Coroutine An object that represents a splitting of the normal thread of execution
Function Represents executable Lua code that can be ran with arguments
Nil A state of non-being or nothingness
Number A numerical quantity
Integer A number without a fractional part (for example, -2 or 3, but not 4.5)
String A chain of characters (for example, "hello")
Table A list of key-value pairs
Userdata An interface to the parent application
[edit]Roblox Lua Specific
These data types are specific to Roblox Lua and most of them have constructors.

Type Description
Axes Represents a selection of X, Y and/or Z
BrickColor Represents a color of a brick, has a name
CFrame Represents a position and orientation in 3D space
Color3 Represents a color
Content A property that represents an image, sound, or mesh
Enumeration Represents one of a specific selection (for example, CameraType)
Faces Represents any combination of NormalIds (Front, Back, Left, Right, Top, Bottom)
Instance An object in the Roblox game hierarchy
Ray Represents a point and a direction in 3D space
Region3 Represents a rectangular prism shaped space in 3D space
Region3int16 Same as Region3 but with integral coordinates
Struct Is a collection of properties to represent one property (not used in most Roblox Lua code)
UDim Two of these are used with UDim2s
UDim2 Used with GUI positions and sizing
Vector2 A 2-dimensional vector. Also used as a 2D point
Vector3 A 3-dimensional vector. Also used as a 3D point
Vector3int16 Similar to Vector3, but uses integral coordinates. Used with Region3int16s
Vector2int16 Similar to Vector2, but uses integral coordinates. Used with the PlayerMouse object
CellId An unused data type that is related to terrain cells
Category: Scripting Tutorials






It's there. It exists.
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
16 Jun 2014 02:10 PM
"(not used in most Roblox Lua code)"
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Jun 2014 02:11 PM
"most"


...
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
16 Jun 2014 02:13 PM
did you even check out what I gave you:

http://wiki.roblox.com/index.php?title=Struct

"SEE ALSO" (in bold)
Report Abuse
lupine is not online. lupine
Joined: 24 Jun 2008
Total Posts: 3561
16 Jun 2014 02:14 PM
I'd imagine it's something similar to OOP.

obj = {["Name"] = "SpecialModel", ["Color"] = BrickColor.new("Bright blue"), ["Struct"] = {["Whatever"] = true, ["WhateverElse"] = false}}

Just my guess, though. The wiki says it's like the 'ResizeableSides' (or whatever), a member of BasePart
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
16 Jun 2014 02:14 PM
If you want me to explain the data structures stated there I can.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Jun 2014 02:18 PM
So you can't use Struct directly?
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
16 Jun 2014 02:22 PM
no, you create one.
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
16 Jun 2014 02:25 PM
Thanks.
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