Celestia/Celx Scripting/CELX Lua Methods/CEL command seturl

From Wikibooks, open books for an open world
Jump to navigation Jump to search

seturl[edit | edit source]

seturl { url <urlstring> }

Move the camera to the location of a saved "location URL" (or Cel://URL), which you previously captured to the clipboard using the [Ctrl + C] or [Ctrl + Ins] keys.

Arguments:

url <urlstring>
Defines the celURL to be used. No default.
celURL strings do have a specific Celestia recognizable format:
  1. The string always start with "cel://";
  2. Then: "Follow", "SyncOrbit", "Chase", "PhaseLock" or "Freeflight"
    • Followed by the object between two "/" caharacters (e.g. "/Sol:Earth/");
    • --OR-- only one "/" character in case of "Freeflight".
  3. Date in the format: yyyy-mm-dd
    • The year may be preceded by a "-" character, to indicate a year BC.
  4. Time starting with character "T" and ending with character "?" in the format:
    • hh:mm:ss.sssss TDB-time, which is slighty different from UTC-time.
      For more information on TDB, UTC, and how time is used in Celestia, see Celestia/Time Scales.
  5. The observer's position (x,y,z) in space in the current reference frame:
    • "x=" ,followed by X-position (e.g. "AKknXYYNARE")
    • "&y=" ,followed by Y-position (e.g. "ACb9ForuURI")
    • "&z=", followed by Z-position (e.g. "AJLCIRc5vuz//////////w")
  6. The observer's orientation (ow, ox, oy, oz):
    • "ow=" ,followed by the OW-component of the rotation (e.g. "0.429893")
    • "&ox=" ,followed by the OX-component of the rotation (e.g. "0.319956")
    • "&oy=" ,followed by the OY-component of the rotation (e.g. "-0.786188")
    • "&oz=" ,followed by the OZW-component of the rotation (e.g. "-0.307779")
  7. Then other options are possible in a row, like:
    • "&track=" objectname
    • "&select=" objectname
    • "&fov=" Field of View in degrees
    • "&ts=" timescale
    • "&ltd=" light time delay (0 = off, 1 = on)
    • "&p=" paused (0 = off, 1 = on)
    • "&rf=" renderflags. The rf number is made by the sum of these individual flags:
      1 = stars
      2 = planets
      4 = galaxies
      8 = constellation lines
      16 = clouds
      32 = orbits
      64 = celestial grid
      128 = night lights
      256 = atmospheres
      512 = smooth lines for orbits
      1024 = eclipes shadows
      2048 = light travel ???
      4096 = ring shadows
      8192 = constellation boundaries
      16384 = auto magnitude
      32768 = comet tails
      65536 = marks
      131072 = partial trajectories (not implemented yet)
      262144 = nebulae
      524288 = open clusters
      1048576 = globulars
      2097152 = cloud shadows
      4194304 = galactic grid
      8388608 = ecliptic grid
      16777216 = horizontal grid
      33554432 = ecliptic
    • "&lm=" labelflags. The lm number is made by the sum of these individual flags that indicates the labels that are shown:
      1 = stars
      2 = planets
      4 = moons
      8 = constellations
      16 = galaxies
      32 = asteroids
      64 = vessels
      128 = localities
      256 = comets
      512 = nebulae
      1024 = open clusters
      2048 = local names for constellations
      4096 = dwarf planets
      8192 = minor moons
      16384 = globulars
    • "&tsrc=" ???
    • "&ver=3" for celestia 1.6 and above (at this time)

Note: celURLs for Celestia version 1.6.0 and version 1.6.1 are of type "ver=3" (last parameter in <urlstring>), and not fully compatible with urlstrings of earlier version types. So the results of the CEL: seturl command and the CELX equivalents may vary when using "ver=2" urlstring types in Celestia version 1.6.1 and version 1.6.0, compared to earlier versions of Celestia.


CELX equivalent for Celestia version 1.6.1 and later:

Based on the 1.6.1 celestia:seturl() method.

  • Get an observer instance and make the observer goto the a specified celURL.
    If no observer is precised, the command applies to the current active one.
obs=celestia:getobserver()
celestia:seturl( <urlstring>, obs)


CELX equivalent for Celestia version 1.6.0 and earlier:

For Celestia version 1.6.0 and earlier, there’s no CELX equivalent for this CEL command available. The following CELX coding can be used to integrate the CEL: seturl command within a CELX script for these Celestia versions.

Based on the celestia:createcelscript() and celscript:tick() methods.

  • Define the following function at the beginning of your CELX script:
function CEL(source) 
   local script = celestia:createcelscript(source) 
   while script:tick() do 
      wait(0) 
   end 
end
  • Within your CELX script you can now call the CEL: seturl command as follows:
CEL([[{seturl {url <urlstring> }}]])

Example:
Position yourself on top of Mount Everest and watch a very special sunrise.

CEL:

seturl {url "cel://SyncOrbit/Sol:Earth/2009-07-21T22:47:04.72721?
x=N1WRszkGAg&y=R5015O+GFA&z=h+mfTNDb2P///////////w&ow=0.551145&ox=0.273737&oy=-
0.643962&oz=0.454554&select=Sol&fov=29.1666&ts=50.0&ltd=0&p=0&rf=20227&lm=1243136&tsrc=0&ver=3" } wait { duration 180 }

CELX equivalent with celestia:seturl() method for Celestia version 1.6.1 and later:

obs=celestia:getobserver()
celestia:seturl("cel://SyncOrbit/Sol:Earth/2009-07-21T22:47:04.72721?
x=N1WRszkGAg&y=R5015O+GFA&z=h+mfTNDb2P///////////w&ow=0.551145&ox=0.273737&oy=-
0.643962&oz=0.454554&select=Sol&fov=29.1666&ts=50.0&ltd=0&p=0&rf=20227&lm=1243136&tsrc=0&ver=3", obs) wait(180.0)

CELX equivalent with celestia:createcelscript() and celscript:tick() methods for Celestia version 1.6.0 and earlier:

function CEL(source) 
   local script = celestia:createcelscript(source) 
   while script:tick() do 
      wait(0) 
   end 
end

CEL([[{seturl {url "cel://SyncOrbit/Sol:Earth/2009-07-21T22:47:04.72721?
x=N1WRszkGAg&y=R5015O+GFA&z=h+mfTNDb2P///////////w&ow=0.551145&ox=0.273737&oy=-
0.643962&oz=0.454554&select=Sol&fov=29.1666&ts=50.0&ltd=0&p=0&rf=20227&lm=1243136&tsrc=0&ver=3" }}]]) wait(180.0)


Back to CEL command index