Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Carrying over SectorEntityTokens with specific OrbitFocus to new OrbitFocus  (Read 627 times)

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile

I'm attempting to replace a procgenned planet with another entity.
Since it's possible that the planet has stuff orbiting it, I have to set a new OrbitFocus for the orbit of any entity orbiting the old planet

This is not an issue, except for one thing: RingBand does not seem to have an actual orbit.
They only have a Focus, which is a private variable without a getter.

Generating a copy of the RingBand failed for a similar reason -  bandWidthInEngine, the field responsible for setting band width, is not accessible as well.

I'd use reflection to get these, but it's not allowed - as I found out today, to my chagrin.
Now, I'm looking for a way to fix that, since it's the last thing required to have the script working as intended.
Any ideas?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23986
    • View Profile

Hmm, I think you're out of luck here - no getters for the fields, and to add insult to injury, they're final, too. Let me add a bunch of stuff to RingBandAPI, though, so at least this'll be more doable in the future.
Logged

SirHartley

  • Global Moderator
  • Admiral
  • *****
  • Posts: 839
    • View Profile

Not what I was hoping to hear, but good to know it should be possible with the next update.
I'll work around that for now and just forbid application on ringed entities.

Thank you for the support!
Logged