A voice from the past

All about writing scripts for Celestia in Lua and the .cel system
Topic author
cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 7 months
Location: Victoria, BC Canada

A voice from the past

Post #1by cpotting » 01.11.2007, 16:32

Hello fellow scripters,

Just wanted to say that I'm back. Well, I haven't really been gone, but I haven't had any time to devote to Celestia and scripting in almost two years. I hope to be a little more active now.

I see that there is a new version of LUA being used - I am trying to bring myself up to speed with it. Plus I'm trying to figure out how to get 1.5.0 pre 4 compiled (managed to get CVS to download the source, now I have to figure out how to get VS2005 to compile it).

I see a lot of familiar names in the list of posters (Selden, Bob, Andrea, etc) - it's like coming home after long trip.
Clive Pottinger
Victoria, BC Canada

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #2by ElChristou » 01.11.2007, 16:36

Welcome back Clive!

If needed, you can easily find a 1.5pre4 on Windows using the search on the forum...
Image

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #3by selden » 01.11.2007, 17:43

Clive,

Hi!

1. There are lotsa new Lua scripting possibilities now, especially since ScriptedOrbit and ScriptedRotation can be used to animate models. There are two videos on YouTube showing some preliminary results with Addons I've been working on. See http://www.youtube.com/user/CelestiaGuru

2. I've made the pre4 announcements stickies at the top of the Users Forum.
Selden

Topic author
cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 7 months
Location: Victoria, BC Canada

Post #4by cpotting » 01.11.2007, 19:56

ElChristou wrote:Welcome back Clive!
Thanks.
ElChristou wrote:If needed, you can easily find a 1.5pre4 on Windows using the search on the forum...

Yes. But all the one's I've downloaded don't seem to have all the LUA libraries activated.

Looking at the code, it appears that the symbol LUA_VER must be defined with a value of 0x050100 or higher in order to access LUA's package, io and os libraries. The default value is 0x050000.

Would you happen to know where there is a version with the proper LUA_VER value? I know I will be useful to get to point where I can compile on my own, but, until I get that worked out, it would be nice to get started on some scripting ideas I have.
Clive Pottinger
Victoria, BC Canada

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #5by Vincent » 01.11.2007, 20:06

Clive,

You'll find the Lua 5.1 libraries here:
http://www.celestiaproject.net/~claurel/celestia/lua/

In the meantime, you can use this build:
http://vincent.gian.club.fr/celestia/ce ... 1.5CVS.exe

I thought that 1.5pre4 was built against Lua 5.1, though...
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Topic author
cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 7 months
Location: Victoria, BC Canada

Post #6by cpotting » 01.11.2007, 20:14

selden wrote:Clive,

Hi!

1. There are lotsa new Lua scripting possibilities now, especially since ScriptedOrbit and ScriptedRotation can be used to animate models. There are two videos on YouTube showing some preliminary results with Addons I've been working on. See http://www.youtube.com/user/CelestiaGuru

2. I've made the pre4 announcements stickies at the top of the Users Forum.


W 8O O 8O W
I love it. That must have taken a lot of work to create, but end result is fabulous. Don't let Andrea see those videos - she'll have a thousand requests lined up before the weekend! :D
Clive Pottinger
Victoria, BC Canada

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #7by selden » 01.11.2007, 20:33

Oh, Andrea's already seen it. :) But he's not the problem. Certain Frenchies in Paraguay are more of an issue.... ;)

(Sorry, ElChristou, but I really won't be able to help with your Apollo project, although I probably should have written this in the relevant threads. I doubt I'll be finished with the telescope very soon. No sooner do I get one part finished then I realize I forgot completely about some other part. And then I recognize a feature that I'd overlooked in one of the photographs that makes me have to remodel a "finished" part all over again. *sigh* )
Selden

Topic author
cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 7 months
Location: Victoria, BC Canada

Post #8by cpotting » 01.11.2007, 20:33

Vincent wrote:In the meantime, you can use this build:
http://vincent.gian.club.fr/celestia/ce ... 1.5CVS.exe
Thanks Vincent. However, that build has the same issue. You can see it if you try to execute a script with the command

Code: Select all

requires("xxx")
You will get the error

Code: Select all

attempt to call global 'require' (a nil value)
This is because the library has not been exposed to scripting environment.

Vincent wrote:I thought that 1.5pre4 was built against Lua 5.1, though...
Yes, it is. However, only LUA's basic library is exposed to the scripting environment. This library contains functions such as tostring(), type() and loadstring().
In 5.0 it included the function require(), which I have been using to build some OOP libraries. But now, in 5.1, the require() function was moved from the basic library to the package library. The only way to expose the package library (I believe) is to compile Celestia with LUA_VER set to 0x050100.
Clive Pottinger
Victoria, BC Canada

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #9by selden » 01.11.2007, 20:41

Clive,

In order to use require() in a CELX script, the script first must call
celestia:requestsystemaccess()

or be running in the LuaHook environment
or be running in a ScriptedOrbit or ScriptedRotation environment.
Selden

Topic author
cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 7 months
Location: Victoria, BC Canada

Post #10by cpotting » 01.11.2007, 20:41

selden wrote:Oh, Andrea's already seen it. :) But he's not the problem.


he? oops. If you see this, sorry Andrea - I just assumed, because of the spelling, that you were female. I guess I didn't account for differences in spelling in different cultures.

In case you didn't know, in Canada at least, Andrea would be pronounced An - dree (rhymes with tree) - ah, or An - dra (rhymes with day) - ah. In either case, it would most likely be considered a female name.

My mistake.
Clive Pottinger
Victoria, BC Canada

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #11by Vincent » 01.11.2007, 20:46

cpotting wrote:But now, in 5.1, the require() function was moved from the basic library to the package library.


Clive,

You may want to try this:
- Check out the following entry in celestia.cfg:

Code: Select all

ScriptSystemAccessPolicy "allow" 

- Then, request permission to access the libraries by adding the following lines at the beginning of your script:

Code: Select all

celestia:requestsystemaccess()
wait(0)


You should now have access to methods in the package library.

Edit: Sorry, cross post with Selden...
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

Topic author
cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 7 months
Location: Victoria, BC Canada

Post #12by cpotting » 01.11.2007, 20:57

selden wrote:In order to use require() in a CELX script, the script first must call
celestia:requestsystemaccess()
Thanks, that worked. 1.4.1 did not need permission; it's too bad that 1.5.0 does. It does limit the usefulness of the require() function a bit, but at least I can access it again.

or be running in the LuaHook environment
or be running in a ScriptedOrbit or ScriptedRotation environment.
Not sure what those are - yet.

[edit] Thanks to Vincent too.
Clive Pottinger
Victoria, BC Canada

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #13by ElChristou » 01.11.2007, 21:14

selden wrote:Oh, Andrea's already seen it. :) But he's not the problem. Certain Frenchies in Paraguay are more of an issue.... ;)

(Sorry, ElChristou, but I really won't be able to help with your Apollo project, although I probably should have written this in the relevant threads. I doubt I'll be finished with the telescope very soon. No sooner do I get one part finished then I realize I forgot completely about some other part. And then I recognize a feature that I'd overlooked in one of the photographs that makes me have to remodel a "finished" part all over again. *sigh* )


Oh, don't worry Selden, I'm sure Linuxman and friend will end up with some nice anim even without using reference frames.

Tx anyway and welcome to my word! :wink:
Image

Avatar
selden
Developer
Posts: 10192
Joined: 04.09.2002
With us: 22 years 2 months
Location: NY, USA

Post #14by selden » 01.11.2007, 21:31

Clive,

The documentation that Chris wrote about Scripted orbits and rotations is available in the Celestia WikiBook at http://en.wikibooks.org/wiki/Celestia
in the chapters describing orbits, trajectories and rotations under "Customizing Celestia".
Selden

Vincent
Developer
Posts: 1356
Joined: 07.01.2005
With us: 19 years 10 months
Location: Nancy, France

Post #15by Vincent » 01.11.2007, 22:16

cpotting wrote:
selden wrote:In order to use require() in a CELX script, the script first must call
celestia:requestsystemaccess()
Thanks, that worked. 1.4.1 did not need permission; it's too bad that 1.5.0 does. It does limit the usefulness of the require() function a bit, but at least I can access it again.

or be running in the LuaHook environment
or be running in a ScriptedOrbit or ScriptedRotation environment.
Not sure what those are - yet.

You'll find a concrete application of the use of Lua Hooks here:
http://celestiaproject.net/forum/viewtopic.php?t=10352

Have fun ! :wink:
@+
Vincent

Celestia Qt4 SVN / Celestia 1.6.1 + Lua Edu Tools v1.2
GeForce 8600 GT 1024MB / AMD Athlon 64 Dual Core / 4Go DDR2 / XP SP3

ANDREA
Posts: 1543
Joined: 01.06.2002
With us: 22 years 5 months
Location: Rome, ITALY

Post #16by ANDREA » 01.11.2007, 23:34

cpotting wrote:
selden wrote:Oh, Andrea's already seen it. :) But he's not the problem.
he? oops. If you see this, sorry Andrea - I just assumed, because of the spelling, that you were female. I guess I didn't account for differences in spelling in different cultures. In case you didn't know, in Canada at least, Andrea would be pronounced An - dree (rhymes with tree) - ah, or An - dra (rhymes with day) - ah. In either case, it would most likely be considered a female name. My mistake.

Don't worry Clive, and welcome back to Celestia. :wink:
I'm used to be taken as female from my name, in many nations it is used this way, but in Italy Andrea is male, Andreina is female.
A matter of conventions, I think.
Bye

Andrea :D
"Something is always better than nothing!"
HP Omen 15-DC1040nl- Intel® Core i7 9750H, 2.6/4.5 GHz- 1TB PCIe NVMe M.2 SSD+ 1TB SATA 6 SSD- 32GB SDRAM DDR4 2666 MHz- Nvidia GeForce GTX 1660 Ti 6 GB-WIN 11 PRO

BobHegwood
Posts: 1803
Joined: 12.10.2007
With us: 17 years 1 month

Post #17by BobHegwood » 02.11.2007, 03:09

Tell 'im that your ALL-MALE Andrea, and if someone wants to prove it
otherwise, BRING IT ON.

On second thought, let me do it... I'm in the mood now. Oh never mind,
I'm just trying to release anger and frustration in any way that I can.

Good to see you again Clive. I've just been brought back from the dead
meself, so it's good to see familar faces resurfacing again.

Take care, Bob
Brain-Dead Geezer Bob is now using...
Windows Vista Home Premium, 64-bit on a
Gateway Pentium Dual-Core CPU E5200, 2.5GHz
7 GB RAM, 500 GB hard disk, Nvidia GeForce 7100
Nvidia nForce 630i, 1680x1050 screen, Latest SVN

Topic author
cpotting
Posts: 164
Joined: 18.03.2004
Age: 63
With us: 20 years 7 months
Location: Victoria, BC Canada

Post #18by cpotting » 02.11.2007, 13:07

Thanks everyone.

ScriptedOrbit and ScriptedRotation look like great additions that will allow Celestia be less of a "passive" observational tool. I still have to check out the LuaHook and the Edu Tools, but that looks even more promising.

I am going to enjoy fiddling with this new version :)
Clive Pottinger
Victoria, BC Canada

Avatar
Fenerit M
Posts: 1880
Joined: 26.03.2007
Age: 17
With us: 17 years 7 months
Location: Thyrrenian sea

Post #19by Fenerit » 02.11.2007, 19:39

cpotting wrote:
selden wrote:Oh, Andrea's already seen it. :) But he's not the problem.

he? oops. If you see this, sorry Andrea - I just assumed, because of the spelling, that you were female. I guess I didn't account for differences in spelling in different cultures.

In case you didn't know, in Canada at least, Andrea would be pronounced An - dree (rhymes with tree) - ah, or An - dra (rhymes with day) - ah. In either case, it would most likely be considered a female name.

My mistake.


Andrea = un-dre(ad)-a(s)

ai = I(m)
ea = as in share
ei = as in day
oi = as in oil
aiuola (flower-bed) = I-you-o-la(st)

Sorry, but today I'm enjoying with the language's issues. :D
Never at rest.
Massimo


Return to “Scripting”