Page 1 of 1

Calling external programs: 'os nil value'

Posted: 10.01.2005, 17:32
by manoweb
Hi, I would like to call an external program in the middle of my celestia script:

ret = os.execute("/usr/bin/mplayer -fs /path/intro.mpg")

(I tested also other commands of course)

I always get this error:
Celestia encountered an error while processing your script
Details
[string "/home/alesan/lavori/planetarium/celestia/scripts/t..."]:15: attempt to index global `os' (a nil value)

I tried to set celestia.cfg' ScriptSystemAccessPolicy both to "Ask" and "Allow" without luck.

Any suggestion?

thank you
Alessio Sangalli

Posted: 10.01.2005, 18:45
by manoweb
ok sorry I didn't RTFM enough. I added a:

celestia:requestsystemaccess()


and now everything is fine.

Thank you
Alessio Sangalli

What would the complete Windows line be?

Posted: 15.01.2005, 23:48
by Newbe
shatters crashed before I could get the manual.

how would you play a sound file?

Posted: 16.01.2005, 00:10
by manoweb
do you use windows? me not :)
anyway, in windows I would do:
os.execute("start c:\\path\\file.mp3")
this will start your mp3 player and immediately release the control back to celestia so it can go on displaying 3D animations. Open a DOS console and type "start /?" for more information.

If you're a linux user you can choose many ways, I'd write a small bash script that launches some command line audio player (play, mpg123, etc) in the background.

ciao
Alessio Sangalli