10 posts
Posted 11 March 2013 - 11:53 PM
how do i get the distance between two computers? they are on the same x and z coordinates so it´s only y i need to know.
7508 posts
Location
Australia
Posted 11 March 2013 - 11:57 PM
you can use the GPS or Rednet systems for the easiest way
GPS requires some maths. but with GPS you need at least 4 computers with their position programmed and then they get the x,y,z coord.
Using Rednet this happens (its similar with 'modem_message' in CC1.5+)
local event, senderId, message, distanceSent = os.pullEvent('rednet_message')
148 posts
Posted 12 March 2013 - 12:08 AM
GPS requires some maths. but with GPS you need at least 4 computers with their position programmed and then they get the x,y,z coord.
GPS sends a rednet ping and waits for the GPS hosts to send back a message, then calculates the position using trilateration. So if you use GPS to calculate the distance it is the same as if you send a message directly to the computer, as you mentioned too. That means it wouldn't make sense to use GPS. (unless your computers are too far away from each other)
7508 posts
Location
Australia
Posted 12 March 2013 - 12:10 AM
(unless your computers are too far away from each other)
And that is why I included that method as well.
10 posts
Posted 12 March 2013 - 12:37 AM
thanks