Modify and Barycenters

Report bugs, bug fixes and workarounds here.
Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Modify and Barycenters

Post #1by ajtribick » 17.01.2009, 00:31

SVN 4599

Is it supposed to be possible to convert a star into a barycenter via Modify (or vice-versa)? The following .stc will result in Arcturus being turned into a sphere with uninitialised texture (seems to depend on what textures have been loaded). The information display gives it as a star with class "Bary" (complete with magnitudes, radius, temperature) rather than a Barycenter entry...

Code: Select all

# convert Arcturus into a barycenter
Modify Barycenter 69673
{
}

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

Re: Modify and Barycenters

Post #2by chris » 19.01.2009, 17:35

ajtribick wrote:SVN 4599

Is it supposed to be possible to convert a star into a barycenter via Modify (or vice-versa)? The following .stc will result in Arcturus being turned into a sphere with uninitialised texture (seems to depend on what textures have been loaded). The information display gives it as a star with class "Bary" (complete with magnitudes, radius, temperature) rather than a Barycenter entry...

Code: Select all

# convert Arcturus into a barycenter
Modify Barycenter 69673
{
}

Yes, this is intended to work. It should be possible to override a single star definition and convert it into a multistart system, e.g. Sirius to Sirius, Sirius A, and Sirius B. I'll look into this today (as soon as I've sorted out the cmod bug you reported.)

--Chris

Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Re: Modify and Barycenters

Post #3by Chuft-Captain » 19.01.2009, 20:41

To: "the artist formerly known as chaos_syndrome"

You may find it helpful to download and examine my Castor addon: http://shatters.net/forum/viewtopic.php?f=6&t=12104&st=0&sk=t&sd=a

Download here:http://celestiamotherlode.net/catalog/show_addon_details.php?addon_id=1281

Latest build I've run it in is 4585. I hope it still works in 4599. :?

CC
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Re: Modify and Barycenters

Post #4by ajtribick » 19.01.2009, 21:28

The add-on doesn't use Modify therefore doesn't trigger the bug.

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

Re: Modify and Barycenters

Post #5by chris » 20.01.2009, 05:48

I've attached a small patch to stardb.cpp that fixes the bug and makes stars convertable to barycenters (and vice versa) with Modify. The patch affects two lines of code: one is the functional change, the other just fixes a typo in a comment.

...Well, phpbb doesn't want to let me attach a patch file, so here it is inline:

Code: Select all

Index: stardb.cpp
===================================================================
--- stardb.cpp   (revision 4582)
+++ stardb.cpp   (working copy)
@@ -823,7 +823,7 @@
     {
         StarDetails* existingDetails = star->getDetails();
         
-        // If we're modifying and existing star and it already has a
+        // If we're modifying an existing star and it already has a
         // customized details record, we'll just modify that.
         if (!existingDetails->shared())
         {
@@ -839,6 +839,7 @@
                     existingDetails->setTexture(details->getTexture());
                 if ((existingDetails->getKnowledge() & StarDetails::KnowRotation) == 0)
                     existingDetails->setRotationModel(details->getRotationModel());
+                existingDetails->setVisibility(details->getVisibility());
             }
             
             details = existingDetails;


--Chris

Avatar
Chuft-Captain
Posts: 1779
Joined: 18.12.2005
With us: 18 years 11 months

Re: Modify and Barycenters

Post #6by Chuft-Captain » 20.01.2009, 06:34

ajtribick wrote:The add-on doesn't use Modify therefore doesn't trigger the bug.
It was offered as a workaround, however I'm pretty sure that if you change the addon to use a "Modify" it still works...at least prior to build 4599 anyway. :wink:

CC
"Is a planetary surface the right place for an expanding technological civilization?"
-- Gerard K. O'Neill (1969)

CATALOG SYNTAX HIGHLIGHTING TOOLS LAGRANGE POINTS

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

Re: Modify and Barycenters

Post #7by chris » 21.01.2009, 23:31

Andrew, have you had a chance to see if my patch works for you? I'll commit it once you've verified it.

--Chris

Topic author
ajtribick
Developer
Posts: 1855
Joined: 11.08.2003
With us: 21 years 3 months

Re: Modify and Barycenters

Post #8by ajtribick » 23.01.2009, 20:37

Sorry, a variety of circumstances conspired to prevent me from testing it until now. As far as I can tell it works fine.

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

Re: Modify and Barycenters

Post #9by chris » 23.01.2009, 23:20

ajtribick wrote:Sorry, a variety of circumstances conspired to prevent me from testing it until now. As far as I can tell it works fine.

Thanks. I'll go ahead and check it in.

--Chris


Return to “Bugs”