placing objects in oolite space - understanding the co-ords
Moderators: winston, another_commander
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
placing objects in oolite space - understanding the co-ords
I would like to place 10 objects parallel to the imaginary line betwixt nav buoy and docking port, but offset (by 1km) and equi-spaced along that line, is that doable?
Related to this question the following questions:
Is there a rule about which systems have coriolis stations, dodecs, isos (natively - I know oxps can alter this)?
Is there a way to check what kind of station the system already has before replacing it.
Sub-question: How do you replace a station with one of your own?
sub-sub-question: If somebody has Griff's stations (coriolis specifically) and possibly Gritty stations installed too and I want to introduce an alternative version of the Coriolis too - is there a way to make them all play nicely together - I want my version of the Coriolis to be very rare - say 1 in 200 (+/- 50) visits to a system where a Coriolis should be the station type.
Happy to be told RTFM (although a wee nudge in the direction of the right wiki page would be much appreciated).
TIA
(Suddenly I'm a noob again!)
Related to this question the following questions:
Is there a rule about which systems have coriolis stations, dodecs, isos (natively - I know oxps can alter this)?
Is there a way to check what kind of station the system already has before replacing it.
Sub-question: How do you replace a station with one of your own?
sub-sub-question: If somebody has Griff's stations (coriolis specifically) and possibly Gritty stations installed too and I want to introduce an alternative version of the Coriolis too - is there a way to make them all play nicely together - I want my version of the Coriolis to be very rare - say 1 in 200 (+/- 50) visits to a system where a Coriolis should be the station type.
Happy to be told RTFM (although a wee nudge in the direction of the right wiki page would be much appreciated).
TIA
(Suddenly I'm a noob again!)
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- Killer Wolf
- ---- E L I T E ----
- Posts: 2278
- Joined: Tue Jan 02, 2007 12:38 pm
this is the bit in Wiki about the coords
http://wiki.alioth.net/index.php/Method ... ding_ships
not tried it myself but my new OXP needs an item somewhere near the WS beacon so i'll lurk this thread for answers!
you'll note this page says stuff appears "near" a point, so i'm not sure how accurate placement is. CmdMcLane can probbly explain stuff better as he pop'd various asteroids and sentinels in his OXP.
http://wiki.alioth.net/index.php/Method ... ding_ships
not tried it myself but my new OXP needs an item somewhere near the WS beacon so i'll lurk this thread for answers!
you'll note this page says stuff appears "near" a point, so i'm not sure how accurate placement is. CmdMcLane can probbly explain stuff better as he pop'd various asteroids and sentinels in his OXP.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Re: placing objects in oolite space - understanding the co-o
Yes. Got your linear algebra hat on?DaddyHoggy wrote:I would like to place 10 objects parallel to the imaginary line betwixt nav buoy and docking port, but offset (by 1km) and equi-spaced along that line, is that doable?
First, I’m not going to use the nav buoy itself, because you’d have to search for it, there might be more than one, and there might be none since it’s destructible. Instead, I’ll tell you that the buoy is placed 10000 m in front of the station.
Also, you’ll need a vector perpendicular to the station->nav buoy vector. I’ll just construct one randomly.
Code: Select all
this.distributeLitterInVerge = function (role, count, range)
{
let station = system.mainStation;
let buoyDirection = station.orientation.vectorForward(); // Unit vector towards buoy
// Get a random unit vector not parallel or antiparallel to buoyDirection
let sideVector = null;
do
{
sideVector = Vector3D.randomDirection();
} while (buoyDirection.dot(sideVector) == 0.0);
// Exchange sideVector for a vector perpendicular to buoyDirection
sideVector = sideVector.cross(buoyDirection).multiply(range);
let basePosition = sideVector.add(station.position);
let spacing = 10000 / count;
for (let i = 0; i < count; i++)
{
let distance = spacing * (i + 0.5);
let position = buoyDirection.multiply(distance).add(basePosition);
let added = system.addShips(role, 1, position, 0);
if (added.length > 0)
{
added = added[0];
// addShips doesn’t guarantee full precision.
added.position = position;
}
}
}
Systems with a techLevel > 10 get either dodecahedron (75 % chance) or icosahedron (25 % chance).DaddyHoggy wrote:Related to this question the following questions:
Is there a rule about which systems have coriolis stations, dodecs, isos (natively - I know oxps can alter this)?
system.mainStation.primaryRoleDaddyHoggy wrote:Is there a way to check what kind of station the system already has before replacing it.
You can’t.DaddyHoggy wrote:Sub-question: How do you replace a station with one of your own?
That is to say, once the main station is created, it’s the one true main station, unless you remove it – at which point a new main station is chosen at random from the stations in the system.
You can specify a main station role in planetinfo.plist, in which case you’ll need to check what the station type is by going there and looking.
None of this is even relevant if you just want to introduce a new variant with one of the standard station roles.
Use role weights just like with normal ships.DaddyHoggy wrote:sub-sub-question: If somebody has Griff's stations (coriolis specifically) and possibly Gritty stations installed too and I want to introduce an alternative version of the Coriolis too - is there a way to make them all play nicely together - I want my version of the Coriolis to be very rare - say 1 in 200 (+/- 50) visits to a system where a Coriolis should be the station type.
Code: Select all
roles = "coriolis(0.05)";
Last edited by JensAyton on Sun Jun 20, 2010 12:47 pm, edited 6 times in total.
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
That stuff’s paleolithic. Don’t even look at it.Killer Wolf wrote:this is the bit in Wiki about the coords
http://wiki.alioth.net/index.php/Method ... ding_ships
E-mail: [email protected]
And if you replace
with
You'll get equally spaced rather than 1km fixed distances between the spawned entities, as another variant given the code doesn't fix the count at 10.[/code]
Code: Select all
let spacing = 10000 / 10;
Code: Select all
let spacing = 10000 / (count + 1);
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
D’oh. It was supposed to be 10000/count. (Not count + 1, because there’s a half-space offset. Which is more æsthetically pleasing is of course for Mr. Hoggy to decide.)
E-mail: [email protected]
Ah yes, didn't see you'd added the offset a little below with the +0.5.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Thank-you - I will play, fail, and get back to you...
For the moment a final related question (well it's related for me) - is there a way to reverse the model data in a .dat and turn it back into a .obj (so it can be loaded into a 3D modelling tool, edited and saved back out before redoing the .obj -> .dat)?
Ahruman - the code example is much appreciated - I am grateful for such a precise (but generic) example!
Also, if I stick to systems that are TL <=10 they should all be Coriolis stations? (other OXPs notwithstanding), so I could add my Coriolis variant in a system and it may or may not be a station that could be visited by the player (I'm thinking of the station that is placed with the Tionisla Orbital Graveyard - it's just another station - if you know where it is you can go see it, dock with it). Therefore I could have a higher percentage chance of appearance, simply because people would have to chose to visit? Or, it could just be one of the stations that is randomly chosen from the station list when the system is created... (not sure which I would prefer to happen...)
For the moment a final related question (well it's related for me) - is there a way to reverse the model data in a .dat and turn it back into a .obj (so it can be loaded into a 3D modelling tool, edited and saved back out before redoing the .obj -> .dat)?
Ahruman - the code example is much appreciated - I am grateful for such a precise (but generic) example!
Also, if I stick to systems that are TL <=10 they should all be Coriolis stations? (other OXPs notwithstanding), so I could add my Coriolis variant in a system and it may or may not be a station that could be visited by the player (I'm thinking of the station that is placed with the Tionisla Orbital Graveyard - it's just another station - if you know where it is you can go see it, dock with it). Therefore I could have a higher percentage chance of appearance, simply because people would have to chose to visit? Or, it could just be one of the stations that is randomly chosen from the station list when the system is created... (not sure which I would prefer to happen...)
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- Killer Wolf
- ---- E L I T E ----
- Posts: 2278
- Joined: Tue Jan 02, 2007 12:38 pm
"That stuff’s paleolithic. Don’t even look at it." oh, heh.
if we're (i'm) wanting to add our own stations to a system, given we can't replace the game's choice of main station how do we place it in orbit say 90 or 180 around the planet from the game station, and orient the face towards the planet?
edit, @ DH :
there's a reverse Python script called DAT2OBJ you ca use, should be in here somewhere i believe
https://bb.oolite.space/viewtopic.ph ... bj&start=0
if we're (i'm) wanting to add our own stations to a system, given we can't replace the game's choice of main station how do we place it in orbit say 90 or 180 around the planet from the game station, and orient the face towards the planet?
edit, @ DH :
there's a reverse Python script called DAT2OBJ you ca use, should be in here somewhere i believe
https://bb.oolite.space/viewtopic.ph ... bj&start=0
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
@KW - nice one. Downloaded!
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
You can specify which main station to use for a specific system inside planetinfo.plistKiller Wolf wrote:
if we're (i'm) wanting to add our own stations to a system, given we can't replace the game's choice of main station how do we place it in orbit say 90 or 180 around the planet from the game station, and orient the face towards the planet?
Its initial position will be assigned by the system populator, but you can change its position and orientation from javascript.
If you add a world script with a shipWillExitWitchSpace event, you can test if you're in the right system / the main station is 'your' station, then provide all the appropriate changes in there: reposition it, change its orientation, add more bits & bobs floating in space nearby, etc...
Actually, this is just half of the story... To make sure the player will see the exact same system if they load a game previously saved from inside 'your' station, you also need some code in shipWillLaunchFromStation: in there you need to check to see if your code has already modified the system the way you want it, and if not, call the shipWillExitWitchSpace code to rearrange the system exactly the way it should be...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Re: placing objects in oolite space - understanding the co-o
Is this hardcoded or can you alter these probabilities with .plist -tampering?Ahruman wrote:Systems with a techLevel > 10 get either dodecahedron (75 % chance) or icosahedron (25 % chance).
...and keep it under lightspeed!
Friendliest Meteor Police that side of Riedquat
Far Arm ships
Z-ships
Baakili Far Trader
Tin of SPAM
Friendliest Meteor Police that side of Riedquat
Far Arm ships
Z-ships
Baakili Far Trader
Tin of SPAM
You should be able to alter the standard populator behaviour by adding the right conditions inside planetinfo.plist... unfortunately Brain is a bit broken atm so can't provide the right example...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)