Page 3 of 3
Re: What is your maximum speed
Posted: Thu Apr 07, 2011 7:33 am
by Griff
@ Eric & Thargoid, you guys don't happen to have an example script or oxp using 'Velocity' do you, it sounds perfect for throwing out bits of debris when something explodes, especially if the direction could be randomised - is this the sort of thing that the sparks use when a ship goes into 'throwingSparks' mode?
Re: What is your maximum speed
Posted: Thu Apr 07, 2011 8:04 am
by Eric Walch
Griff wrote:@ Eric & Thargoid, you guys don't happen to have an example script or oxp using 'Velocity' do you, it sounds perfect for throwing out bits of debris when something explodes, especially if the direction could be randomised - is this the sort of thing that the sparks use when a ship goes into 'throwingSparks' mode?
Its used in the current version of military fiasco. When subentities are shot of a loose subentity is spawned at the old place with a velocity of 70% of the mothers velocity. That way it floats in the same direction as the mother. Before 1.75 such spawned subs suddenly had no speed at all and you flew into it during chasing the hydras. I used only 70% so that they still flew a bit backward compared to the mother.
For explosions, you probably you must generate a random vector:
randomDirectionAndLength
Code: Select all
debris.velocity = new Vector3D.randomDirectionAndLength(maxSpeed);
I experimented with it for an exploding station in UPS, but I never implemented it.
Re: What is your maximum speed
Posted: Thu Apr 07, 2011 2:23 pm
by JensAyton
Thargoid wrote:One thing I did note though was that velocity has no effect on speed. I chucked several asteroids at the main station (as you do :twisted: ) and they all still had speed zero, despite moving at around 2500m/s.
Speed is and will remain the inertialess engine speed component. Making physical sense has never been much of a priority around here. :-) Internally, this is
completely separate from
velocity
, but it’s added (more precisely,
[url=http://wiki.alioth.net/index.php/Oolite_JavaScript_Reference:_Ship#thrustVector]thrustVector[/url]
is) when retrieving
velocity
and subtracted when setting it so you don’t have to be exposed to the full madness.
Switeck wrote:Shouldn't ramming/nudging asteroids impart a speed on them as well?
It does, but they’re rather heavy. It’s more noticeable if you nudge some debris.
Re: What is your maximum speed
Posted: Thu Apr 07, 2011 4:29 pm
by Thargoid
Fair enuff - as I said it just seemed a little unexpected. But I figured the reasoning would be something like that, hence why I just mentioned it in passing rather than raising it as a bug.