Page 1 of 1

How to make an active add-on switch off based on my location?

Posted: 13.01.2022, 12:39
by john71
Maybe it's my fault but I can't find any clue how to do it.

I want to switch off an add-on (make it invisible), when I'm inside of the Milky Way.

Is it possible?

How to make an active add-on switch off when I'm inside of the Milky Way, but switch on, when I'm outside of it?

Posted: 13.01.2022, 15:41
by SevenSpheres
You can use a celx script to toggle an object's visibility, like this:

Code: Select all

if not celestia:find("MW"):visible() then
    celestia:find("MW"):setvisible(true)
elseif celestia:find("MW"):visible() then
    celestia:find("MW"):setvisible(false)
end


You might be able to set it up so visibility depends on whether you're in the Milky Way. Try the celx scripting guides on Wikibooks.

Posted: 13.01.2022, 15:57
by john71
Thank you!

But it just toggles the "switch off", doesn't it?

What I would like to achieve is that it automatically switches on/off, depending on my location...