Page 1 of 1

Display of a political border

Posted: 15.12.2009, 08:53
by jogad
Hello,

I have a virtual texture and I added a border to it with a simple transparent billboard like this:

Image

Now I want to have a script that lets me toggle the border on/off.
I took example on a script made by Cham but that doesn’t work for me. (Nothing happened) :evil:

Here is the script:

Code: Select all

-- Title: Vatican border on/ff

front = celestia:find("Sol/Earth/frontiere_vatican")
front:setvisible(not front:visible())

if front:visible() then
   celestia:print("Vatican border ON", 2)
else
   celestia:print("Vatican border OFF", 2)
end

And the ssc file:

Code: Select all

SurfaceObject "frontiere_vatican" "Sol/Earth"
{
   Class "surfacefeature"
   Mesh "frontiere.cmod"
   Emissive true
   Radius 0.567
   FixedPosition { Planetographic [ 12.4521 41.90423 0.01 ] }
   FixedAttitude { Heading 180 }
   #Orientation [0 1 0 0]
}

What is wrong? :?:

Re: Display of a political border

Posted: 16.12.2009, 08:57
by Fenerit
Try so:

Code: Select all

-- Title: Vatican border on/ff

front = celestia:find("Sol/Earth/frontiere_vatican")
front_select = celestia:select(front)
front:setvisible(not front:visible())

if front:visible() then
   celestia:print("Vatican border ON", 2)
else
   celestia:print("Vatican border OFF", 2)
end

and put Visible false in the .ssc

Code: Select all

SurfaceObject "frontiere_vatican" "Sol/Earth"
{
   Class "surfacefeature"
   Visible false
   Mesh "frontiere.cmod"
   Emissive true
   Radius 0.567
   FixedPosition { Planetographic [ 12.4521 41.90423 0.01 ] }
   FixedAttitude { Heading 180 }
   #Orientation [0 1 0 0]
}

Re: Display of a political border

Posted: 16.12.2009, 10:28
by jogad
Massimo,

Thank you very much.
But it is not better. :?
The only difference is that now I can't even see the border.

Re: Display of a political border

Posted: 16.12.2009, 11:15
by Fenerit
Try to make 2 scripts:
front_visible.celx

Code: Select all

-- Title: Vatican border on
front = celestia:find("Sol/Earth/frontiere_vatican")
front_select = celestia:select(front)
front:setvisible(true)
celestia:print("Vatican border ON", 2)
 


front_invisible.celx

Code: Select all

-- Title: Vatican border off

front = celestia:find("Sol/Earth/frontiere_vatican")
front_select = celestia:select(front)
front:setvisible(false)
celestia:print("Vatican border OFF", 2)


and remove Visible false from .ssc. Otherwise you need a function keyboard based or the LUATOOLS. (whether I'm not wrong...)

Re: Display of a political border

Posted: 16.12.2009, 12:16
by jogad
As I was trying your suggestions I found this:
Because I work on virtual textures, I run celestia with a url link that takes me above Rome.
The problem is that this link set the time to pause and the script does not start.

The problem is solved!
The script was not guilty but I was :oops:

The line "Visible false" is a good idea and I keep it :wink:

Thank you again.

Re: Display of a political border

Posted: 16.12.2009, 15:20
by Fenerit
De rien.