-
-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpawnShipNear velocity matching #3674
SpawnShipNear velocity matching #3674
Conversation
Wonderful. I tried it and, as it is, significantly improves the function. If you want, an additional parameter to set a speed_plus would be really good. |
I've added a 6th optional parameter, you can pass the 5th hyperspace information as
Maybe @laarmen has an opinion on these changes too? |
No, What I mean is add, to your original PR, a "fine tune"; for to do, for example:
-- * case1: the ship appears chasing the target, to initial vel = vel_target + 450 m/s -- * case2: the ship appears chasing the target, to initial vel_target - 450 m/s |
I'm not looking at the code, but from the example it isn't exactly clear: On Tue, Apr 5, 2016 at 2:58 PM Walter Arnolfo notifications@github.com
|
@fluffyfreak I'm testing this, as you see it?
|
Sorry @walterar what am I looking for in that post? |
I corrected some errors in the original documentation. It is not "Ship.SpawnNear (" is "Space.SpawnNear ("
|
@fluffyfreak If I have to choose, I prefer the first option of this PR. It is really improved a lot, and it works without touching anything in the lua modules. |
@walterar you can use it without changing any code, the other parameters are optional so everything work just as in the first commit. If you do want to write some new code and set a velocity though, that is when you can add the 6th parameter :) |
@fluffyfreak 👍 :) |
Right I'll consider this review ready then. |
Will try to do it tonight (or this afternoon if I can catch 20mn, although On Wed, Apr 6, 2016 at 2:34 PM Andrew Copland notifications@github.com
|
Allright. I haven't even tested it but AFAIUI you wanted the 6th argument to be optional, right? Then you need to check for the existence of the said 6th argument. Otherwise apocalypse, mayhem, looting corpses and application crashes will likely occur (in that specific order) with legacy code. Further more, as the author of the pi_lua_strict_pull family of methods, I would advise you NOT to use them directly in "application" code, they're more intended for use in higher abstraction parts. So, all in all I'd replace the argument parsing part by something along the lines of
Cheers mate! |
Thanks @laarmen made that change |
I'll get back to that when we get the #3678 sorted out. |
Use the target bodies velocity, if it's a ship then it will inherit their velocity, otherwise the behaviour is the same as it currently is.
@walterar this is how I'd prefer to fix what you suggested in #3669, alternatively it could take an extra parameter to specify the velocity if you like.