Page 3 of 4
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Mon Oct 22, 2012 10:04 pm
by Yah-Ta-Hey
This is beginning to look like the rise of the MEXICAN FREE SPACEFORCE!!!!!! El Viejo's Raiders are on the loose tonight in Witchspace YE HAWWWWWWWW
All for one and one for all.... until we run out of bolts.... then it is everyone for himself... NO?????
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Mon Oct 22, 2012 10:10 pm
by Cody
Unaccustomed as I am to posting pics - heh:

Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Oct 23, 2012 1:08 am
by Yah-Ta-Hey
truly awesome pic...... loaded the railgun.oxp... got the big daddy and can't hit the side of a barn much less a moving target... back basics with this oxp. Surely don't need lots of oxp's to have fun and excitement.
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Oct 23, 2012 3:49 am
by Wildeblood
El Viejo wrote:Or try this: disable the laser fire button/key, install the [wiki]Railgun_OXP[/wiki] (assign it to the laser fire button/key, if you wish), then go out there and try some real, old-fashioned, dog-fighting.
No need to muck about with keyconfig.plist to disable the lasers, if you have
Removable Lasers OXP.
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Oct 23, 2012 7:32 am
by Rese249er
[quote="Wildeblood"...
Removable Lasers OXP.[/quote]
Think it's time for me to clone my Commander and send Rese_Beta out to fly!
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Oct 23, 2012 8:47 am
by Cody
Wildeblood wrote:No need to muck about with keyconfig.plist to disable the lasers...
No need to muck about installing an OXP if one has a
keyconfig.plist
for whichever mode one wishes to play in.
I notice a quote/link has been wrongly attributed to me!
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Oct 23, 2012 8:59 am
by Rese249er
Oops... Edited.
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Oct 23, 2012 12:21 pm
by Shipbuilder
Increase the "15" to a higher value (for instance "20"). Save the file and restart Oolite with "SHIFT" pressed.
@ Commander McLane - Is the 15 value a distance along the z co-ordinate ?
If so I can look at the Wings 3D model for the Ship Rese249er is using and provide him with the z co-ordinate from the centre of the ship to the very front so that he can specify a value slightly in excess of this if that helps to locate the effect just in front of the ship.
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Oct 23, 2012 2:30 pm
by Commander McLane
Shipbuilder wrote:Increase the "15" to a higher value (for instance "20"). Save the file and restart Oolite with "SHIFT" pressed.
@ Commander McLane - Is the 15 value a distance along the z
co-ordinate axis ?
Yep. The formula is: 92.5% of the ship's collision radius (this is the stand-in for the actual ship's length, because that's not known to JS; it's not ideal, because it has to work for both very long and very wide ships; as I said, starting from Oolite 1.77 we can use the actual length of the ship's bounding box, and don't have to guesstimate anymore)
plus 15 meters safety margin
plus another five meters safety margin for the projectile itself
plus some more meters, depending on the ship's current speed
Code: Select all
this.projectile.position = player.ship.position.add(player.ship.heading.multiply((player.ship.collisionRadius * 0.925) + 15 + 5 + (player.ship.speed / 50)));
I have left the silly-looking "15 + 5" in order to remind me what the values stand for. Alternatively to increasing one of them you also just add another number.
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Oct 23, 2012 9:10 pm
by Shipbuilder
@ Commander McLane - Thanks for the confirmation.
@ Rese249er - Further to the earlier posts the co-ordinate for the centre of the very front of the Serpent Class Cruiser is 0.0, 0.9, 111.2 .
i.e. 111.2 along the z axis.
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Wed Oct 24, 2012 5:39 pm
by Rese249er
Many thanks, Shipbuilder. I appreciate it!
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Sat Oct 27, 2012 12:55 pm
by onno256
I won't go over to the dark side, I'm an atheist making moral choices!
Banging into railgun projectiles
Posted: Tue Dec 11, 2012 7:06 pm
by jnorichards
Hi, all. I'm flying a Dredger Trader (Deep Space Dredger OXP v2.4.6), fitted with a mining railgun (Railgun OXP v1.3). When I first bought the Dredger, I noticed that the projectile collides with the front of the Dredger if we're travelling at anything faster than a few notches above Dead Stop. I put this down to the speed of the projectile being relatively low, and the ship over-running it due to its size, but then I stumbled across this thread, and realized that it's more complicated than that.
If the projectile is being spawned too close to the Dredger, surely the collision should occur irrespective of Dredger speed? But I can fire from a dead stop.
I read the scripts for railgun-firing and railgun-projectile, and thought that I might solve the problem if I *added* the speed of the Dredger to that of the projectile at launch. This might be thought to be a bit more realistic, too.
Code: Select all
this.shipSpawned = function()
{
// remember where the projectile started for the distance calculation above
this.startingCoordinates = this.ship.position;
// the projectile has to be fast, but not too fast
// a good use for the (unpropelled) velocity property
this.ship.velocity = this.ship.heading.multiply(this.ship.scriptInfo.velocity);
//Edit: add the player ship's speed to that of the projectile
this.ship.velocity = this.ship.velocity.add(player.ship.velocity);
log("railgun.oxp", "Final projectile velocity: " + this.ship.velocity.magnitude());
player.consoleMessage("Projectile velocity: " + this.ship.velocity.magnitude(), 4);
//End edit
}
This is what I see in the log. Fired from a dead stop:
Code: Select all
18:29:21.212 [railgun.oxp]: Final projectile velocity: 1500.0001220703125
Moving forward slowly:
Code: Select all
18:29:30.155 [railgun.oxp]: Final projectile velocity: 1546.8250732421875
Still in the green:
Code: Select all
18:29:33.204 [railgun.oxp]: Final projectile velocity: 1553.053955078125
Any ship speed over about 59 m/s:
Code: Select all
18:29:36.141 [railgun.oxp]: A railgun projectile hit the player ship. Normally this should not happen.
What's that? Even though the projectile is moving away from me at a relative 1500 m/s, I still hit it? Can anybody shed any light? I notice that the collision is detected and logged immediately, preempting my console message and log entry in
this.shipSpawned, which are then never called.
Oolite version is 1.76.1
Jonathan
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Dec 11, 2012 7:45 pm
by Thargoid
The problem is that not everything moves at once in the universe, so it's perfectly possible that the projectile ends up being repositioned before the player ship is when the frame is updated. But equally the opposite is also possible, it depends where they are in the array of entities in the system as it gets parsed. When that happens and you're travelling fast enough, then you of course can end up flying into it.
The modification needed is to move the launching position further forward rather than making the projectile quicker. As it's probably happening as soon as the projectile is spawned and before it's had a chance to move (ie be respositioned) then the projectile speed is actually fairly irrelevant). Essentially it's spawned and then on the next frame displayed your ship moves forward before it has moved itself, and therefore the collision only when you are moving above a given speed.
I think McLane included details of how to do that in the OXP documentation, or at least they are listed on here somewhere.
Re: I`m Needing New OXP`s to keep excited!!!
Posted: Tue Dec 11, 2012 8:45 pm
by Commander McLane
Hi, jnorichards!
The problem is just like Thargoid explained. The way to solve it is not to increase the projectile's speed, but the distance to your ship in which it's spawned. That's in line 80 of railgun-firing.js. Please try to replace the line with the following:
Code: Select all
this.projectile.position = player.ship.position.add(player.ship.heading.multiply((player.ship.collisionRadius * 0.925) + 15 + 5 + (player.ship.speed / 50)));
If that doesn't work, you can increase one of the numbers (15 or 5) until the problem goes away.