GetElementChildren: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This | This function is used to retreive a list of child elements as they appear in the element table. Without passing each element in the table through [[getElementType]], you wont know what you have though. | ||
==Syntax== | ==Syntax== | ||
Line 10: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''parent:''' Supply this argument with the parent of the children you want returned. | ||
===Returns=== | ===Returns=== | ||
This function returns a ''table'' that contains a list of elements that the parent has. | |||
==Example== | ==Example== | ||
In a blank map with nothing but players, using this function will return a table with all the players in it. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | --Get root element | ||
root = getRootElement() | |||
-- | --Get ALL of root's children | ||
mytable = getElementChildren(root) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
At a later point you could loop through all the elements and process thier contents any way you wish. Remember to make sure you have the CURRENT list of elements though. If you get the root element children, then wait a while for things to change, this list won't be up to date unless you use [[getElementChildren]] again. | |||
==See Also== | ==See Also== | ||
{{ | {{Element_functions}} |
Revision as of 17:02, 21 August 2006
This function is used to retreive a list of child elements as they appear in the element table. Without passing each element in the table through getElementType, you wont know what you have though.
Syntax
table getElementChildren ( element parent )
Required Arguments
- parent: Supply this argument with the parent of the children you want returned.
Returns
This function returns a table that contains a list of elements that the parent has.
Example
In a blank map with nothing but players, using this function will return a table with all the players in it.
--Get root element root = getRootElement() --Get ALL of root's children mytable = getElementChildren(root)
At a later point you could loop through all the elements and process thier contents any way you wish. Remember to make sure you have the CURRENT list of elements though. If you get the root element children, then wait a while for things to change, this list won't be up to date unless you use getElementChildren again.
See Also
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement