MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/KerbalSpaceProgram/comments/vl60wx/self_assembling_space_station/idvsghy
r/KerbalSpaceProgram • u/lodurr_voluspa • Jun 26 '22
427 comments sorted by
View all comments
Show parent comments
5
There is an API call that will give you a list of ships nearby. Once you have a reference to the ship you can get the ships position and that position reference will keep getting updated with each physics slice.
3 u/3636373536333662 Jun 27 '22 Ah nice, must've missed that in the docs 6 u/lodurr_voluspa Jun 27 '22 function findNearbyVessels {declare local nearbyVesselList to list().list targets in nearbyVesselList.for vsl in nearbyVesselList {if (vsl:distance < 3000 and not vsl:name:contains("debris")) {trackingVessels:add(vsl).}}}
3
Ah nice, must've missed that in the docs
6 u/lodurr_voluspa Jun 27 '22 function findNearbyVessels {declare local nearbyVesselList to list().list targets in nearbyVesselList.for vsl in nearbyVesselList {if (vsl:distance < 3000 and not vsl:name:contains("debris")) {trackingVessels:add(vsl).}}}
6
function findNearbyVessels {declare local nearbyVesselList to list().list targets in nearbyVesselList.
for vsl in nearbyVesselList {if (vsl:distance < 3000 and not vsl:name:contains("debris")) {trackingVessels:add(vsl).}}}
5
u/lodurr_voluspa Jun 27 '22
There is an API call that will give you a list of ships nearby. Once you have a reference to the ship you can get the ships position and that position reference will keep getting updated with each physics slice.