Rigebi (G3) stations issue

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Rigebi (G3) stations issue

Post by Eric Walch »

Wildeblood wrote:
The quickest, simplest fix for this until either Taxi Galactica or Galactic Navy are updated, is to add the Sensible Sun micro-OXP. The two stations should then be spawned well apart.
That would work. It also reveals a bug in the way Taxi defines its position. It should be a station in planet orbit. But the location depends on the planet-sun distance. A distance based on planes radii seems better for an orbiting station.
Probably it should use the positioning of the secCom station but a bit out of the centre:

Code: Select all

Vector3D(0, 0.15, 2).fromCoordinateSystem("psp")
That will still position it at the sunny side of the planet and roughly at 2 planet radii hight, but now a bit aside from the direct line.

(For geeks: To keep it exactly at 2 radii, the 3th parameter should be Math.sqrt(2*2 - 0.15*0.15) = 1.9943)
ilNibbio
Above Average
Above Average
Posts: 21
Joined: Tue Jul 24, 2012 10:11 pm

Re: Rigebi (G3) stations issue

Post by ilNibbio »

The good people make the good game.
Chapeau
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Rigebi (G3) stations issue

Post by JensAyton »

Incidentally, if you want to position a station randomly around a planet instead of at a fixed position, here’s how:

Code: Select all

let azimuth = Math.random() * 2 * Math.PI;
let elevation = 0.1 * (Math.random() - 0.5);  // .05 planetary radii of the equator either way
let altitude = 0.1 * (Math.random() - 0.5) + 2.2;  // 2.15 to 2.25 planetary radii

elevation *= planet.radius;
altitude *= planet.radius;

let position = new Vector3D(Math.sin(azimuth) * altitude, Math.cos(azimuth) * altitude, elevation);
station.position = position.add(planet);
Vary the altitude range slightly to avoid collisions.
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Rigebi (G3) stations issue

Post by Pleb »

Ah the code that Ahruman has posted above seems to be a good idea. I will try this out and if it does not conflict with any other OXP I will implement it into the next release of Taxi Galactica. Thanks for that, Ahruman!
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Post Reply