131p6 - .cel scripts cmd: renderflags

Report bugs, bug fixes and workarounds here.
Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

131p6 - .cel scripts cmd: renderflags

Post #1by don » 20.07.2003, 14:23

Ver. 1.3.1 pre6
.cel scripts

In the renderflags command, the "pointstars" option appears to be broken. Maybe due to the UI now having 3 options instead of 2?

Current UI Options:
* Fuzzy Points
* Points
* Scaled Discs

Thus, there should probably be three different star rendering options in the renderflags command.

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #2by chris » 20.07.2003, 19:30

Scripting needs to catch up with the rest of Celestia . . . There are two ways this could be handled. Either via the set command (which is currently limited to numeric values):

Code: Select all

set { name "starstyle" value 1 }


Or a new starstyle command:

Code: Select all

starstyle { value "discs" }


I'd prefer to use the set command, but I prefer using a string for the value rather than a number . . . Hmm.

--Chris

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #3by don » 20.07.2003, 20:38

Hi Chris,

I too like descriptive strings as "items to be selected", instead of trying to remember what number relates to which item.

Since you already have a "set" command for numeric values, maybe you could just duplicate the "set" code for a "setstring" (or something more descriptive) command for setting string values, changing any of the existing numeric validations to string validations?

I know you want to limit the work being done on the celscript side of scripting, so I'm just trying to think of an "easy way out" that would also allow future added string values to be covered also.

-Don

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Post #4by chris » 20.07.2003, 23:02

I settled on just letting the set command accept strings . . . I may change the internal implementation of this later, but any modifications will be invisible to script authors.

To set the star rendering style, use:

Code: Select all

set { name "StarStyle" value "fuzzypoints" }


The value may also be points or scaleddiscs.

--Chris

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #5by don » 21.07.2003, 00:44

Wow!

C++/OO must be a whole lot easier to change things like this than the old languages I used to work in. I thought about this, but figured it would mess up any of the existing functions that used the value passed by "set". Guess not. Very cool !

Thank you Chris. It's now in the Guide.

-Don

Topic author
don
Posts: 1709
Joined: 12.07.2003
With us: 21 years 4 months
Location: Colorado, USA (7000 ft)

Post #6by don » 21.07.2003, 01:23

Hi Chris,

Oops, forgot to ask about "pointstars" in renderFlags. Will this remain and get fixed to point to "StarStyle-points" code, for backward-compatibility (deprecated of course)?

Or?

-Don


Return to “Bugs”