Page 1 of 1

How about a configurable Scripts folder?

Posted: 02.01.2008, 11:45
by Chuft-Captain
Not really a bug, more of a minor request....

I like the fact that scripts can now be run directly from File->Scripts, however, would it be possible to allow the location of this Scripts directory to also be configurable in celestia.cfg?

For example it's currently possible to specify the location of the ScriptScreenshotDirectory...

Code: Select all

#------------------------------------------------------------------------
# The following parameter is used in Lua (.celx) scripting.
#
#   ScriptScreenshotDirectory defines the directory where screenshots
#   are to be stored. The default value is "", i.e. Celestia's
#   installation directory.
#------------------------------------------------------------------------
  ScriptScreenshotDirectory ""


but not the actual scripts directory itself (which appears to be hardcoded to "C:\Program Files/<Celestia-Prog-Directory>/scripts" ) in pre5.

Perhaps we could have:

Code: Select all

ScriptsDirectory ""

as well (which could still of course default to the C:\Program Files/<Celestia-Prog-Directory>/scripts" folder).

I know you're only doing bug-fixes now Chris, but even so, I think that this feature would be appeciated by those running multiple versions of Celestia, if it's very simple for you to implement in the code.

Trying not to be too demanding! :wink:

Posted: 02.01.2008, 19:38
by chris
Yes, this is possible to do without too much difficulty. Can you explain how you'd use this feature?

--Chris

Posted: 03.01.2008, 14:42
by Chuft-Captain
chris wrote:Yes, this is possible to do without too much difficulty. Can you explain how you'd use this feature?

--Chris
Since 1.4.x, I have kept all addons in a folder external to the install directory. Whenever I install a new version of Celestia, the first thing I do is edit celestia.cfg to amongst other things, point to my extras folder:

Code: Select all

ExtrasDirectories  [ "extras" "E:/Celestia/extras" ]


...which means all addons are automatically available to all installed versions. (ie. My "...Program Files/Celestia/extras" folder is typically empty for all versions.)

This IMO would be a good practice to follow with scripts in the future (or in fact anything at all which is additional to the standard installation).
ie. Anything additional to the std release package should be able to be located separately from the software, and referenced in celestia.cfg.
This would also make backing up of extras, scripts, etc much easier.

So I expect this could work in an analogous way:

Code: Select all

ScriptsDirectory [ "scripts" "E:/Celestia/scripts" ]



At the moment I need to move or copy existing scripts into the 1.5.0pre5 scripts folder in order to make them available to the new SCRIPTS menu item. This may make them un-available to previous versions (depending on whether I move or copy).

As an aside, in the past I've shared my favorite script amongst multiple versions by assigning it to the "D" key with a line like the following:

Code: Select all

DemoScript  "E:/Celestia/scripts/FOV 35.cel"


This is a bit of a hack. It would be nice if future versions allowed the re-location of all scripts to a location outside of the Program Directory.

Actually none of the above is essential, but makes life a bit easier when comparing bugs in new releases with older versions of the software, or converting existing addons to use new features such as Reference Frames. :wink:

BTW:
I think I've found a REAL bug while looking into this:

If I try to execute the scripts in the 1.5.0pre5 scripts folder using the new menu-item, it seems to execute something else altogether. If I run the script the old way ( File->Open Script ) all works fine.