Page 1 of 2

Reduction

Posted: Tue Feb 19, 2008 8:03 pm
by Gareth3377
Hey all - a quick query...

I'm currently playing Oolite V. 1.70 on Win Vista (running like a dream so far). Absolutely fantastic as always, but can anybody tell me how to reduce the size of the sun, or make it further away from the planet? I've tried searching the forums, but cannot find a solution.

Thanks in advance.

P.S. It's great being back in the Ooniverse - I've tried getting into X3 recently and am finding it a bit of struggle to be honest.

Posted: Tue Feb 19, 2008 8:24 pm
by Kaks
Hmmm. From javascript, you can reposition the sun itself using

Code: Select all

system.sun.setPosition();
If it's something you'd like to take on, you can always create a javascript based OXP that repositions the sun whenever you enter a system.

There's 'a few' pages worth of information on all you can do in the wiki. I foundthese pages expecially helpful! :)

Posted: Tue Feb 19, 2008 8:30 pm
by Gareth3377
Unfortunately my programming skills are zero. However, how do I access the Javascript to change the position of the sun - just to make it a bit further away from the planet?

Posted: Tue Feb 19, 2008 9:12 pm
by Kaks
Ok, try [edit2]farsun v1.01 for size. Extract it inside the AddOns directory, and the suns will all be much further away than before.

Javascript is only accessible from OXPs: the one in the link above is the smallest OXP I've seen so far. If you want, you can have a look inside farsun.oxp/Config/script.js to see how it's done. :)

Posted: Tue Feb 19, 2008 10:12 pm
by TGHC
Just as a matter of interest why do you want to reposition the sun?

Posted: Tue Feb 19, 2008 11:57 pm
by Roberto
So he can enter the Nexus?

Sorry, I'm being silly :)

Posted: Wed Feb 20, 2008 7:25 am
by Gareth3377
Heh, heh.

No, I want to replace the sun because I just think it's too close to the planet. Just wanted to add a little bit of realism (though not to much and certainly not full blown newtonian physics ho ho ho).

Posted: Wed Feb 20, 2008 11:54 am
by Commander McLane
Gareth3377 wrote:
Just wanted to add a little bit of realism.
Good luck for that, but you're fighting a lost battle there. It's not only the size/distance of the sun, but the planet is too small, the ships and stations too big, everything much too close to each other (the average witchpoint is some 500 kilometers from the planet! Imagine a position 500 kilometers of the Earth. Would Earth be a small ball in the distance, or fill half of the sky?). And of course the fact that the speed of light (1.0 LV) is a stunning 1000 meters per second!

What I want to say: Distances and speeds are hopelessly screwed up in Oolite. Just don't remind us, and we may try to be happy with it. :?

Posted: Wed Feb 20, 2008 12:30 pm
by Hoopy
light speed is 300,000 km per hour. In Oolite it's something like 1 km per second (my 0.3LM ship takes about 10 seconds to get 3 km from the station before i hit the hyperspace button) which is 3,600 km per hour.

So it's roughly 100 times slower in Oolite.

But things are 100 times closer together so it still takes the 'right' amount of time to get to the sun from the planet. Earth is 8 light minutes from the sun so it'd take my ship about 25 minutes. And that's about what it takes in Oolite.

The point of all this is that it means that a given volume of space is made (100x100x100) a million times smaller so the chances of you randomly bumping into someone are a million times higher. So you get some combat and everything is fun.

I think the ships are also made 100 times bigger in each direction as otherwise you wouldn't be able to see them until you were far too close.

Posted: Wed Feb 20, 2008 12:56 pm
by The Edible Poet
Gareth3377 wrote:
Heh, heh.

No, I want to replace the sun because I just think it's too close to the planet. Just wanted to add a little bit of realism (though not to much and certainly not full blown newtonian physics ho ho ho).
I can get with that. I happily have more than enough willing suspension of disbelief to allow some admissible technical anomalies to spoil my Boba Fet bounty hunting antics.

However when I jump into a system and the sun looks like it's blatantly sitting on top of the planet, it does tend to grate on my illusion just a little.

Posted: Wed Feb 20, 2008 1:22 pm
by Eric Walch
I have not looked at the code, but I think re-locating the sun to just other co-ordinates instead of changing the whole co-ordinate system will introduce a bug.

In UPS for instance I place a station and ships with the sun co-ordinate system "SPU". I am pretty sure this will point to the old position. The same will probably happen to oolites own sun-skim traders. And there are more sun based OXP' like "sunskimmers.OXP"

Posted: Wed Feb 20, 2008 1:56 pm
by Kaks
Bugs: probably! :?

Afaik, spu always works with the real position of the sun, not where it should have been.

If farsun is called first, UPS should place the station in the new position.

If UPS is called first, then farsun will move the sun leaving the station behind.

Changing

Code: Select all

this.shipExitedWitchspace
to

Code: Select all

this.shipWillExitWitchspace
inside farsun should be enough to make sure farsun is called before UPS... will have a look this evening, and will let you know! :)

Posted: Wed Feb 20, 2008 10:15 pm
by Eric Walch
Afaik, spu always works with the real position of the sun, not where it should have been.

If farsun is called first, UPS should place the station in the new position.
Nice. I made the changes and it works well with the UPS solar mission. All the ships are distributed over the new tradelanes and the station is at the new sun. But it takes a wile to get there. I should have got an bonus for the distance but they just gave me 100 cr. for the job.

Meaning al OXP's will work with it as long as the use no coordinates in meters, but only relative values like UPS.

Posted: Wed Feb 20, 2008 10:30 pm
by Kaks
Excellent! I'm updating the farsun micro oxp as we speak.


Eric, if you want people to get a bonus for the extra distance, you can always add something like:

Code: Select all

if (worldScripts.farsun) bonus = 25 *  worldScripts.farsun.multiple;
That would multiply a 25 Cr. bonus by the sun distance multiplier inside farsun... ;)

Posted: Thu Feb 21, 2008 8:15 am
by Eric Walch
Kaks wrote:
Excellent! I'm updating the farsun micro oxp as we speak.
Eric, if you want people to get a bonus for the extra distance, you can always add something like:

Code: Select all

if (worldScripts.farsun) bonus = 25 *  worldScripts.farsun.multiple;
That would multiply a 25 Cr. bonus by the sun distance multiplier inside farsun... ;)
Interesting. I never thought of accessing other scripts variables this way. But when I add a bonus I would calculate it based on the exact distance. (Other OXP's could do the same)

or, alternatively I could use:

Code: Select all

this.shipWillEnterWitchspace = function()
{
   if(worldsScripts.farsun) worldScripts.farsun.factor = 1
}
When I want to add the base in the next system, and the sun is on his old spot again.