Re: [nbos] [AS2] Brad Fletcher: TradeRoutes V3
Alan Bartholet
Sat Feb 13th, 2010
Hello Brad,
I did some checking and your script does indeed have the same
problem with the routes not being flagged to be saved to an already
existing sector file. There is also another similar problem with the
sphere's of influence not being saved as well.

In order to fix the route problem is after you create the route you
need to set the Modified property to true, I do this after I add the
route to the sector but you could probably do it any time after
creating the route object.

In order to fix sphere of influence problem you need to call the
ModifySystem method on the body you added the sphere to. I suspect
there is a similar undocumented Modified property for bodies as well
that you could probably set to true and it would do the same thing but
this method is documented and it's what I use in all my scripts.

Best Regards,
Alan Bartholet

On Sat, Feb 13, 2010 at 7:57 AM, Shade Tree <shadetreeii-at-hotmail.com> wrote:
> Thanks for the heads up.  I won't be able to poke around in it for a few
> days.
>
>> Date: Sat, 13 Feb 2010 04:01:09 -0700
>> From: alan.bartholet-at-gmail.com
>> To: nbossoftware-at-nbos.com
>> Subject: [nbos] [AS2] Brad Fletcher: TradeRoutes V3
>>
>> Hello Brad,
>> Thanks to Alvin Plummer I was able to identify a bug in my Plot
>> Jump Routes plugin that I believe also affects your Trade Routes
>> plugin. The Route class has an undocumented Property called Modified,
>> this needs to be set to true otherwise AS will not save the new route
>> if the sector has been previously saved. I haven't tested this on
>> yours yet but this is the basic rundown of what was happening to mine.
>>
>> 1) Generated a new sector.
>> 2) Added some routes with my plugin.
>> 3) Saved the sector.
>> 4) Loaded the sector, the routes I had created were still there.
>> 5) Added some more routes with my plugin.
>> 6) Saved the sector.
>> 7) Loaded the sector, the old routes were still there but the new ones
>> hadn't been saved.
>> 8) Added new routes again with my plugin.
>> 9) Used "Save as..." to save the sector as a new file.
>> 10) Loaded the new sector file, both old and new routes were saved.
>>
>> So the new routes were not getting flagged as needing to be saved when
>> saving to the same sector file. After much poking around I found the
>> Modified Property and after setting it to true the routes now save
>> properly. Hope this helps you out.
>>
>> Best Regards,
>> Alan Bartholet
>> _______________________________________________
>> Nbossoftware mailing list
>>
>>
>
> ________________________________
> Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up
> now.
> _______________________________________________
> Nbossoftware mailing list
>
>
>
>
_______________________________________________
Nbossoftware mailing list


Copyright © 2003-2007, NBOS Software. All rights reserved. 'Fractal Mapper', 'ScreenMonkey', 'Character Sketcher', 'Inspiration Pad', 'Fractal World Explorer', 'Goblin API', 'AstroSynthesis' are trademarks of NBOS Software. 'Dwarven Beserker' art by V. Shane.
Member contributed resources