Anyone trying to use getinfo( ) in a CELX script should be aware of the following problems. According to the CELX Manual:
For a body (e.g. a planet) the table may include these keys
- type
- name
- mass
- oblateness
- albedo
- infoURL
- radius
- lifespanStart
- lifespanEnd
- parent
- hasRings
- rotationPeriod
- rotationOffset
- rotationEpoch
- rotationObliquity
- rotationAscendingNode
- rotationPrecessionRate
- orbitPeriod
- atmosphereHeight
- atmosphereCloudHeight
- atmosphereCloudSpeed
However,
- mass key doesn't work, always returns 0
- infoURL key doesn't work, returns nothing (NOT 0)
- parent (may be a body or a star) key doesn't work, crashes 1.4.1, Fatal Error in 1.6.0
- hasRings key doesn't work, crashes 1.4.1, Fatal Error in 1.6.0
- rotationOffset causes Fatal Error in 1.6.0
- rotationEpoch causes Fatal Error in 1.6.0
- rotationObliquity causes Fatal Error in 1.6.0
- rotationAscendingNode causes Fatal Error in 1.6.0
- rotationPrecessionRate causes Fatal Error in 1.6.0
Anyone wanting to test this on his or her machine can use the following short script:
Code: Select all
-- FIND A PLANET'S OR MOON'S MASS
-- ------------------------------------------------
-- FUNCTIONS
function celestia_cleanup_callback()
-- empty function
end
function FindKeyValue( )
Selection = celestia : getselection ( )
SelectionTable = Selection : getinfo ( )
if celestia:getselection ( ) : name ( ) ~= "?" and
( SelectionTable.type == "planet" or SelectionTable.type == "moon" ) then
SelectionKeyValue = SelectionTable.mass
ValueString = string.format(" Your Selection's . . . is: %s", SelectionKeyValue )
celestia:print(ValueString)
else
celestia:print(" Please select a Planet or Moon:")
end
end
-- ---------------------
-- START PROGRAM
Exit = false
repeat
wait(0)
FindKeyValue( )
until Exit
To check the other table keys, you just need to substitute each one's name for .mass
If anyone gets any different behaviors, please post them.
Many thanks.