View unanswered posts | View active topics It is currently Fri Dec 26, 2025 5:40 pm



Reply to topic  [ 4 posts ] 
 TWX 2.05 Issue 
Author Message
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post TWX 2.05 Issue
I have ran into an issue with TWX 2.05 with the getDistance command. I have been receiving bad data when plotting from an unexplored sector to an explored sector. The data should give -1 as far as I know, but I am receiving distances of 10-15. A cf from the unexplored to explored fixes the getDistance but for what I am working on it messes things up a bit. I can "see" the unexplored sector from the explored sector since it is adjacent, but I don't have any knowledge of the distance (could be a one-way out).

Am I mistaken in the -1 as what should be showing up when a route/distance is unknown? I have rebuilt my TWX database from scratch thinking I might have corrupted data.

EP, if you answered my PM, I haven't been where I can check it.

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Thu Nov 10, 2011 7:57 pm
Profile ICQ
Veteran Op
User avatar

Joined: Sat Dec 29, 2007 5:06 pm
Posts: 2059
Location: Oklahoma
Unread post Re: TWX 2.05 Issue
I ran a test using the following script in TWX 2.05:
Code:
#Check Getdistance Command
echo "*Check how many random sectors!"
getconsoleinput $max
setvar $i 1
setvar $home CURRENTSECTOR
while ($i <= $max)
   getrnd $dist[$i] 11 30000
   getdistance $test[$i] $home $dist[$i]
   add $i 1
end
setvar $i 1
send "*"
waitfor "Command [TL"
echo "*"
while ($i <= $max)
   echo $i "." " Distance from " $home " to " $dist[$i] " = " $test[$i] "*"
   add $i 1
end

halt


I got -1 for everything until I ran a ZTM.
1. Distance from 13477 to 21508 = 10
2. Distance from 13477 to 12860 = 23
3. Distance from 13477 to 3996 = 17
4. Distance from 13477 to 25537 = 19
5. Distance from 13477 to 29953 = 11
6. Distance from 13477 to 19233 = 18
7. Distance from 13477 to 8160 = 8
8. Distance from 13477 to 5875 = 13
9. Distance from 13477 to 9440 = 12
10. Distance from 13477 to 27163 = 21

I changed so both were random, ran a couple hundred.
Code:
#Check Getdistance Command
echo "*Check how many random sectors!"
getconsoleinput $max
setvar $i 1
#setvar $home[$i] CURRENTSECTOR
while ($i <= $max)
   getrnd $home[$i] 11 30000
   getrnd $dist[$i] 11 30000
   getdistance $test[$i] $home[$i] $dist[$i]
   add $i 1
end
setvar $i 1
send "*"
waitfor "Command [TL"
echo "*"
while ($i <= $max)
   echo $i "." " Distance from " $home[$i] " to " $dist[$i] " = " $test[$i] "*"
   add $i 1
end
halt

1. Distance from 27490 to 23962 = 23
2. Distance from 23492 to 8184 = 13
3. Distance from 10103 to 26118 = 14
4. Distance from 15802 to 16871 = 18
5. Distance from 27026 to 16676 = 14
6. Distance from 20756 to 5716 = 12
7. Distance from 17218 to 5903 = 24
8. Distance from 10120 to 27945 = 24
9. Distance from 11715 to 15654 = 14
10. Distance from 18853 to 29264 = 17

_________________
T0yman (Permanently Retired since 2012)
Proverbs 17:28 <-- Don't know it, most should it would stop a lot of the discussions on here.


Thu Nov 10, 2011 8:37 pm
Profile ICQ YIM WWW
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1838
Location: Guam USA
Unread post Re: TWX 2.05 Issue
I have the same thing happen in a game , it gave me distances larger then they were supposed to be ... I had expected a -1 because I didn't have a ztm.

My TWX is 2.04 , so its been that way ..
What I did was have script check if the ztm record was made and complete .. or use the cf to plot to and from .. all in script .. now everything is all good.

Kinda defeats having a getdistance command , but the script function has to be done to calc the fuel cost for the trip in many scripts.

I just thought this was just in my version ..

_________________
TWGS V2 Vids World on Guam Port 2002
Telnet://vkworld.ddns.net:2002
Discord @ DiverDave#8374
Vid's World Discord

Founding Member -=[Team Kraaken]=- Ka Pla

Image
Winners of Gridwars 2010
MBN Fall Tournament 2011 winners Team Kraaken
Undisputed Champions of 2019 HHT Just for showing up!

The Oldist , Longist Running , Orginal Registered Owner of a TWGS server :
Vids World On Guam


Thu Nov 10, 2011 8:48 pm
Profile WWW
Commander
User avatar

Joined: Tue Oct 07, 2003 2:00 am
Posts: 1133
Location: Augusta, GA
Unread post Re: TWX 2.05 Issue
I sounds like what you're saying is that TWX is returning an incorrect distance when your warp data is incomplete. TWX will return the shortest distance between two sectors using the warp data it knows about. So if your warp data is incomplete, then the calculated distance may not match a CF plot. If TWX can't plot from one sector to another, then it will return -1.

Just because a sector is unexplored doesn't mean it has no warp data. Check it using the TWX database, SECTOR.WARPCOUNT[sector]. If that number is zero, then any plot from that sector to any other sector should yield -1.

Don't hesitate to ask for further clarification if this still doesn't make sense, or if I've misunderstood.

_________________
Claim to Fame: only guy to ever crack the TW haggle algorithm, and fig/shield/hold price formula, twice.


Fri Nov 11, 2011 12:42 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 96 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.