Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
distance from point a to point b?
Author Message
x77x
Master
**

Posts: 479
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #1
distance from point a to point b?
how can i get the distance from src p to areadef p (position)
in number of tiles

how would you find and subtract an areadef p value and a players p value to get the distance from point a to point b

UOCG - Dragons of Time 2000-2018
http://dragonsoftime.com
(This post was last modified: 04-20-2018 08:54 PM by x77x.)
04-20-2018 08:50 PM
Find all posts by this user Like Post Quote this message in a reply
evening
Journeyman
*

Posts: 138
Likes Given: 0
Likes Received: 14 in 9 posts
Joined: Apr 2012
Reputation: 1

Finally Land

Post: #2
RE: distance from point a to point b?
[function dist]
serv.newitem 0eed
new.attr = attr_invis
new.p = <argv[0]> <argv[1]> <argv[2]> <argv[3]>
serv.log <src.distance <new>>
new.remove

you can use .dist 2291 1194 0 test
04-20-2018 10:05 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 479
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #3
RE: distance from point a to point b?
how in a sysmessage?

"xxx squares to center"

UOCG - Dragons of Time 2000-2018
http://dragonsoftime.com
(This post was last modified: 04-21-2018 12:19 AM by x77x.)
04-20-2018 10:27 PM
Find all posts by this user Like Post Quote this message in a reply
evening
Journeyman
*

Posts: 138
Likes Given: 0
Likes Received: 14 in 9 posts
Joined: Apr 2012
Reputation: 1

Finally Land

Post: #4
RE: distance from point a to point b?
So the def coordinates are defined in advance

So the def coordinates are defined in advance
(This post was last modified: 04-21-2018 02:16 PM by evening.)
04-21-2018 02:16 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 813
Likes Given: 4
Likes Received: 188 in 154 posts
Joined: Jul 2012
Reputation: 6

Dimension Shard

Post: #5
RE: distance from point a to point b?
you can use <SRC.DISTANCE <TARG.P>> or <SRC.DISTANCE <TARG.UID>>

and make sure to also check if both objects are on the same map (eg: (<SRC.P.M> == <TARG.P.M>)) because comparing distances using P from different maps will return the max value (32767), so it makes more sense just use an msg like "the targ is on another map/facet" instead "the targ is 32767 tiles away"
05-12-2018 05:41 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

This forum uses Lukasz Tkacz MyBB addons.