I`m Needing New OXP`s to keep excited!!!

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

Moderators: another_commander, winston

User avatar
Yah-Ta-Hey
---- E L I T E ----
---- E L I T E ----
Posts: 333
Joined: Thu Feb 24, 2011 2:31 am
Location: Traversing new opportunities in space

Re: I`m Needing New OXP`s to keep excited!!!

Post 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?????
Bartle tester says while I am drinking evil juice, I am: 80% killer/ 80 % achiever/ 33% explorer and 0% socializer.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16059
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: I`m Needing New OXP`s to keep excited!!!

Post by Cody »

Unaccustomed as I am to posting pics - heh:

Image
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Yah-Ta-Hey
---- E L I T E ----
---- E L I T E ----
Posts: 333
Joined: Thu Feb 24, 2011 2:31 am
Location: Traversing new opportunities in space

Re: I`m Needing New OXP`s to keep excited!!!

Post 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.
Bartle tester says while I am drinking evil juice, I am: 80% killer/ 80 % achiever/ 33% explorer and 0% socializer.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2286
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: I`m Needing New OXP`s to keep excited!!!

Post 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.
User avatar
Rese249er
---- E L I T E ----
---- E L I T E ----
Posts: 647
Joined: Thu Jun 07, 2012 2:19 pm
Location: Well, I WAS in G3...

Re: I`m Needing New OXP`s to keep excited!!!

Post 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!
Last edited by Rese249er on Tue Oct 23, 2012 8:58 am, edited 1 time in total.
Got all turned around, lost my nav connection... Where am I now?
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16059
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: I`m Needing New OXP`s to keep excited!!!

Post 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!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Rese249er
---- E L I T E ----
---- E L I T E ----
Posts: 647
Joined: Thu Jun 07, 2012 2:19 pm
Location: Well, I WAS in G3...

Re: I`m Needing New OXP`s to keep excited!!!

Post by Rese249er »

Oops... Edited.
Got all turned around, lost my nav connection... Where am I now?
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: I`m Needing New OXP`s to keep excited!!!

Post 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.
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: I`m Needing New OXP`s to keep excited!!!

Post 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.
User avatar
Shipbuilder
---- E L I T E ----
---- E L I T E ----
Posts: 877
Joined: Thu May 10, 2012 9:41 pm
Location: Derby

Re: I`m Needing New OXP`s to keep excited!!!

Post by Shipbuilder »

@ Commander McLane - Thanks for the confirmation. :wink:

@ 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.
The GalTech Industries Corporation - Building ships to populate the galaxies.

Increase the variety of ships within your Ooniverse by downloading my OXPs

Flying the [wiki]Serpent_Class_Cruiser[/wiki] "Thargoid's Bane"
User avatar
Rese249er
---- E L I T E ----
---- E L I T E ----
Posts: 647
Joined: Thu Jun 07, 2012 2:19 pm
Location: Well, I WAS in G3...

Re: I`m Needing New OXP`s to keep excited!!!

Post by Rese249er »

Many thanks, Shipbuilder. I appreciate it!
Got all turned around, lost my nav connection... Where am I now?
User avatar
onno256
---- E L I T E ----
---- E L I T E ----
Posts: 286
Joined: Thu Aug 12, 2010 11:31 am
Location: The Netherlands

Re: I`m Needing New OXP`s to keep excited!!!

Post by onno256 »

I won't go over to the dark side, I'm an atheist making moral choices!
Wheeling an' dealing while cruisin' the galaxies
User avatar
jnorichards
Average
Average
Posts: 15
Joined: Mon May 24, 2010 7:30 pm

Banging into railgun projectiles

Post 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
Kubuntu 12.04 on Asus A7N8X with Creative GeForce FX 5600
Cdr Trubshaw is currently flying test sorties in a Python within G3
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Re: I`m Needing New OXP`s to keep excited!!!

Post 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.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: I`m Needing New OXP`s to keep excited!!!

Post 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.
Post Reply