replacing the earth

All about writing scripts for Celestia in Lua and the .cel system
Topic author
blueberry
Posts: 11
Joined: 19.03.2006
With us: 13 years 5 months
Location: z??rich, switzerland

replacing the earth

Post #1by blueberry » 19.03.2006, 17:09

hi everyone

i am trying to replace the earth by a construct that i have designed. adding a 3d model and scripting it so it takes over the properties of the earth seems straightforward. but how can i, first of all, remove earth from my celestia?

answers are greatly appreciated, best -blueberry

amaury
Posts: 32
Joined: 05.03.2006
With us: 13 years 5 months
Location: paris

Post #2by amaury » 19.03.2006, 17:19

Hello blueberry,

the Earth is declared in the data folder, in the solarsys.ssc file, under:
"Earth" "Sol"
if you comment (#) or remove all the lines declaring the properties of a planet, it will disappear from the solar system

you can also use these lines to replace the model or texture used, etc.

Do read the Celestia (and scripting) documentation to go any further...

amaury

Avatar
selden
Developer
Posts: 10065
Joined: 04.09.2002
With us: 16 years 11 months
Location: NY, USA

Post #3by selden » 19.03.2006, 17:40

The easiest way to replace the default spheroid that Celestia uses for the Earth by a model of your choice is to use the SSC directive "Modify." Editing solarsys.ssc is dangerous: errors will cause the rest of the solar system to disappear, too.

You just have to create an SSC file containing the single line

Code: Select all

Modify "Earth" "Sol" { Mesh "name-of-mesh.3ds" }

and put it in your Addon's directory.

This assumes that your model is aligned properly, of course.
Selden

amaury
Posts: 32
Joined: 05.03.2006
With us: 13 years 5 months
Location: paris

Post #4by amaury » 19.03.2006, 23:33

oops, didn't know about that one, it clearly is safer.

Topic author
blueberry
Posts: 11
Joined: 19.03.2006
With us: 13 years 5 months
Location: z??rich, switzerland

Post #5by blueberry » 30.03.2006, 06:32

hi selden

in my early celestiadays, you suggested "modify" to replace the earth:

selden wrote:You just have to create an SSC file containing the single line

Code: Select all

Modify "Earth" "Sol" { Mesh "name-of-mesh.3ds" }
.


can i use "modify" in conjunction with "beginning" and "ending" to switch a texture or change the radius or expand the atmosphere at a certain time?

Avatar
selden
Developer
Posts: 10065
Joined: 04.09.2002
With us: 16 years 11 months
Location: NY, USA

Post #6by selden » 30.03.2006, 09:52

Yes.

The Modify operator tells Celestia to insert or replace in the old object definition just those parameters declared in the new definition.

Alternatively, you can use the Replace operator, which essentially deletes the old definition entirely, replacing it by the new definition.
Selden


Return to “Scripting”

Who is online

Users browsing this forum: 3 guests