verona Posted September 11, 2012 Share Posted September 11, 2012 Hi. Its possible to get coordinates all objects of map loaded in Race (for example to table)? I know this function can get coords from object, but if object is created in lua script, not in map file local x,y,z = getElementPosition(theObject) I know it's weird, but you really need it Link to comment
Kenix Posted September 11, 2012 Share Posted September 11, 2012 for _, pObjectData in ipairs( getElementsByType 'object', mapmanager:getRunningGamemodeMap() ) do local fX, fY, fZ fX = tonumber( getElementData( pObjectData, 'posX' ) ) fY = tonumber( getElementData( pObjectData, 'posY' ) ) fZ = tonumber( getElementData( pObjectData, 'posZ' ) ) outputChatBox( 'x = ' .. tostring( fX ) .. ', y = ' .. tostring( fY ) .. ', z = ' .. tostring( fZ ) ) end Your mapmanager resource should running. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now