get direction to a ship

Freeform discussion about anything related to modding Transcendence.
Post Reply
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

how do i use code to get the direction from a ship, to another ship, rather than just the direction of a ship?
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

you can get the direction of any ship. The problem is what ship you are referring to. For example you can use objGetTarget to get the target of the ship or sysFindObject for finding a kind of ship. You can even store ships for later use in ships with objSetObjRefData.
It would depend on how you find the correct ship.
Crying is not a proper retort!
Bobby
Militia Captain
Militia Captain
Posts: 675
Joined: Wed Jul 25, 2007 7:39 pm

yes, i understand and have used (shpGetDirection ship)

what i am asking for is a way to get the direction an object launched from my ship would have to go to hit another ship, or get close to it, the direction from my ship to another, or from my ship to a station.

intended use: create a cable for tow hook if i ever add distance, make an automated anti-ship turret using recurring events.
User avatar
Betelgeuse
Fleet Officer
Fleet Officer
Posts: 1920
Joined: Sun Mar 05, 2006 6:31 am

ah you want an angle from a vector, sorry we can get the direction and do many other things with vectors but I don't see how to get the direction from them. Maybe George will make a function to get the direction for a vector then we have both parts of the polar coordinates.
Crying is not a proper retort!
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Yeah, sorry about that. Next version definitely has a function for that.
Post Reply