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

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

Moderators: winston, another_commander

User avatar
jnorichards
Average
Average
Posts: 15
Joined: Mon May 24, 2010 7:30 pm

Re: Banging into railgun projectiles

Post by jnorichards »

Thargoid wrote:
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.
Ah, that's the insight I was missing. Although I can make some sense of the JavaScript code, knowing how it all hangs together is something else.
Thargoid wrote:

The modification needed is to move the launching position further forward rather than making the projectile quicker. ...
I think McLane included details of how to do that in the OXP documentation, or at least they are listed on here somewhere.
Yes, it's further up this thread, [1] but I thought my problem was qualitatively different, in that my collision was speed dependent. Usefully, the dimensions of the Dredger are listed in a comment at the top of the model spec., so I shall get on with moving the spawn point. Thanks for your help.

Oh, while I've got your attention, though :) The current code uses the collisionRadius of the ship and projectile to calculate a spawn point. I've searched through the OXPs I've got installed, and can't see where that collisionRadius is specified...? Not that I'm thinking of changing it, you understand! There are just, as the song says, More Questions Than Answers :?

Jonathan
[1] And Cdr McLane has repeated it for me below while I was writing. Thanks, both.
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: 5528
Joined: Thu Jun 12, 2008 6:55 pm

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

Post by Thargoid »

You can't change it, aside from changing the model used as it's a function of the entity itself (including any sub-entities). See here for more details.
User avatar
jnorichards
Average
Average
Posts: 15
Joined: Mon May 24, 2010 7:30 pm

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

Post by jnorichards »

Commander McLane wrote:
...
If that doesn't work, you can increase one of the numbers (15 or 5) until the problem goes away.
A bit of trial and error shows that the minimum value of the offset needed in the Dredger Trader is (23 + 5).

This works for me:

Code: Select all

this.projectile.position = player.ship.position.add(player.ship.heading.multiply((player.ship.collisionRadius * 0.925) + 23 + 5 + (player.ship.speed / 50)));
I can then avoid collision at all speeds; flat out the Dredger Trader can throw the projectile at 1780 m/s. I can't think of a good reason to be firing a mining railgun at maximum throttle, but there it is!

Regards

Jonathan
Kubuntu 12.04 on Asus A7N8X with Creative GeForce FX 5600
Cdr Trubshaw is currently flying test sorties in a Python within G3
Post Reply