The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






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: 488
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

Dragons of Time 2000-2020
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: 488
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"

Dragons of Time 2000-2020
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: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

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)