Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Celestial bodies positionning, help me sort something  (Read 1872 times)

vorpal+5

  • Captain
  • ****
  • Posts: 286
    • View Profile
Celestial bodies positionning, help me sort something
« on: June 01, 2012, 07:21:16 AM »

Hey,

Something I don't get... Tell me why my pseudo-star is not putting herself in -15000/-15000 but instead at coordinate 0/0?

      SectorEntityToken oph_anchor = system.createToken(-15000, -15000);   
      SectorEntityToken ophS = system.addPlanet(oph_anchor, "Ophiuchi", "star_red", 90, 200, 0, 100000);

It is as if oph_anchor is not used, and instead the distance to the true star (here, the sixth parameter so zero), is used instead. But it should not, she should be at 0 distance from the oph_anchor, not from the "real" star.

 ???
Logged

Vandala

  • Admiral
  • *****
  • Posts: 1841
  • We need ponies, ponies in spaceships!
    • View Profile
Re: Celestial bodies positionning, help me sort something
« Reply #1 on: June 01, 2012, 03:03:36 PM »

Where did you get the idea to set this "SectorEntityToken oph_anchor = system.createToken(-15000, -15000);" into what I assume is your SectorGen.java file?

EDIT: Also, I think you need to use a line like this vvv to set the initial star of a system. All other celestial bodies seem to take there positions from the initial star.

SectorEntityToken star = system.initStar("star_yellow", Color.white, 500f);

EDIT: Isn't an anchor something only for fleets to get them to stay put someplace? I know I've seen it get called in the SystemDefenceFleet.

EDIT: I've bin searching various mods but I can't find any who uses the anchor function in conjunction with star/planet adding. I don't think its supposed to be used in this fashion.
« Last Edit: June 01, 2012, 03:53:35 PM by Vandala »
Logged

vorpal+5

  • Captain
  • ****
  • Posts: 286
    • View Profile
Re: Celestial bodies positionning, help me sort something
« Reply #2 on: June 02, 2012, 12:30:30 AM »

Oh but the star is created...

It can be indeed that the anchor can only be used for fleets, a clarification from Alex would be welcome.



EDIT:
I think it works like you say, if you check the script from Uomoz mod, you  get that:
StarSystemAPI system = sector.getStarSystem("Corvus");
(..)
SectorEntityToken inf_rot = system.createToken(9000, 9000);
(..)
SectorEntityToken infested_asteroid = system.addPlanet(inf_rot, "Infested Asteroid Theta-B", "cryovolcanic", 48, 20, 14000, 180);

Notice that the token createn is named inf_rot ... rot as rotation, so the token is the rotation center for the infested asteroid, and don't serve as its anchor. That would explain the distance of 14.000 also... as you have anyway to position it starting with the star at the center...

Not very clear I would say... Alex should allow the anchor to be something different from the central star. For example for binary or ternary systems (2 or 3 stars) that would be more convenient to have anchors that act as real anchors...
Logged

Vandala

  • Admiral
  • *****
  • Posts: 1841
  • We need ponies, ponies in spaceships!
    • View Profile
Re: Celestial bodies positionning, help me sort something
« Reply #3 on: June 02, 2012, 04:20:39 AM »

I've looked at the "Uomoz's Corvus 15 DEV - Incursions and Relics" mod.

I think the reason for the things you mentioned is because the "UomozGen.java" file uses and adds to the standard sector generation file and can therefor not include functions like "system.initStar" but the other objects still need to be be orbiting something and a token is used instead.

If you want to be sure about any of this then just PM the creator and ask him why he did what he did with his mod.