Grids scripts

All about writing scripts for Celestia in Lua and the .cel system
Avatar
Topic author
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 21 years
Location: Montreal

Grids scripts

Post #1by Cham » 24.06.2008, 03:25

Here are four small CELX scripts, to toggle ON/OFF all the four grids in Celestia 1.6. Fridger made the original scripts, and I've edited them a bit for more functionality :

Code: Select all

-- Title: Equatorial grid

t = {} -- create table
t.grid =       not celestia:getrenderflags().grid
t.galacticgrid =    false
t.eclipticgrid =    false
t.horizontalgrid =    false

celestia:setrenderflags(t)

if celestia:getrenderflags().grid then

celestia:print("Equatorial grid activated", 5)
end


Code: Select all

-- Title: Galactic grid

t = {} -- create table
t.grid =       false
t.galacticgrid =    not celestia:getrenderflags().galacticgrid
t.eclipticgrid =    false
t.horizontalgrid =    false

celestia:setrenderflags(t)

if celestia:getrenderflags().galacticgrid then

celestia:print("Galactic grid activated", 5)
end


Code: Select all

-- Title: Ecliptic grid

t = {} -- create table
t.grid =       false
t.galacticgrid =    false
t.eclipticgrid =    not celestia:getrenderflags().eclipticgrid
t.horizontalgrid =    false

celestia:setrenderflags(t)

if celestia:getrenderflags().eclipticgrid then

celestia:print("Ecliptic grid activated", 5)
end


Code: Select all

-- Title: Horizontal grid

t = {} -- create table
t.grid =       false
t.galacticgrid =    false
t.eclipticgrid =    false
t.horizontalgrid =    not celestia:getrenderflags().horizontalgrid

celestia:setrenderflags(t)

if celestia:getrenderflags().horizontalgrid then

celestia:print("Horizontal grid activated", 5)
end
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Return to “Scripting”