Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant archive_postsperpage - assumed 'archive_postsperpage' (this will throw an Error in a future version of PHP) in ..../archive/index.php on line 456
Fishing Coordinates [Archive] - Forums

PDA

View Full Version : Fishing Coordinates



OsQu
03-25-2007, 10:09 PM
In packet structures there is that "Use With from Container" structure. I'm using it as doing my auto fisher. But I have no idea where to get those coordinates:


packetBuffer(11) = LongToByte(X, 1)
packetBuffer(12) = LongToByte(X, 2)
packetBuffer(13) = LongToByte(Y, 1)
packetBuffer(14) = LongToByte(Y, 2)
packetBuffer(15) = Z

I can get TileId of the water, but how do I get those coordinates. (Converting them from map coords => No idea, or somewhere else)?

OsQu

Veritias
03-25-2007, 10:14 PM
from tile ID 7 to 7- I believe if I understood your request correctly

Cameri
03-26-2007, 04:33 AM
Let's say you do know where your character is, given that information, you can fish the tiles given a relative position.
A relative position means that there is a place on the map that is your new origin, and the other positions are relative to that. In Tibia, if my memory is alright, if you go north /\, your X decreases, that means, tiles north of you are closer to the absolute origin. If you go west <--, the position decreases, that means you are closer to the absolute origin.

Ok so back to relative position, knowing that /\ decreases your Y and <- decreases your X. The tile right north of u, relatively will be: (YourX+0,YourY -1)
The tile two steps north, and one step east will be: (yourX+1, YourY-2).



Hope it helps.

OsQu
03-27-2007, 05:00 AM
If I get that right, the relative coordinants are those what I call map coordinants, and they are like 14,15,16,17,0,1,2,3.. When going left. Because there's that zero I can't figure out how to calculate my real coordinants from those relative coordinants.

OsQu

Juapillo
03-27-2007, 12:55 PM
If I get that right, the relative coordinants are those what I call map coordinants, and they are like 14,15,16,17,0,1,2,3.. When going left. Because there's that zero I can't figure out how to calculate my real coordinants from those relative coordinants.

OsQu

it's impossible

OsQu
03-27-2007, 06:19 PM
Nice to know, I've came to same result too. But I need those coordinants for packet (Or I think so), so what's the way then?

MadPrgmr
03-27-2007, 06:39 PM
You CAN convert relative coordinates to real coordinates. It's a bit easier if your relative coordinates have 0, 0 set at your character's position. If your 0 point lies on your character, 1 tile south would be 0, -1...one tile north would be 0, 1, etc. Then you merely add your relative coordinate to the actual location of your character (can be read from memory).

If you feel that it's necessary to keep 0, 0 at the bottom-left corner of the visible map, merely add your relative coordinates to (yourRealX - visibleMapWidth / 2, yourRealY - visibleMapWidth / 2).

Note that interacting with different Z levels is a little more difficult, but in this case, there's no need to worry about that.

OsQu
03-27-2007, 08:17 PM
I don't get it. How can I set my charecters position? a little bit example code would be great! :> (don't matter what language, I think I can convert it to vb)

MadPrgmr
03-27-2007, 08:42 PM
You don't set any sort of position...relative coordinates are something that you handle yourself. It's just like doing translations on a x/y coordinate grid. What I mean by setting your character's position as 0, 0 is that YOU call 0, 0 the center of your map...a.k.a. where your character is.

You can't literally set your character's position...I meant it as where you arbitrarily decide to call your character's position in the visible map 0, 0.

In case you aren't entirely clear on how relative coordinates work, here's a link to a formal definition: http://thesaurus.maths.org/mmkb/entry.html?action=entryById&id=3072

Your "map coordinates" are merely relative coordinates. Where you put 0, 0 is up to you, as you are designing the system yourself (or so I am assuming).

OsQu
03-27-2007, 09:08 PM
Hmm, I think I get it. I was just trying to make in wrong way. Gonna test it tomorrow.

Thanks MadPrgmr, Cameri and Juapillo (see the spelling ;D).

OsQu

Cameri
03-29-2007, 02:38 PM
There are two things you need to know about, what is an absolute position, and what is a relative position. The absolute position is a point taking as reference the origin of everything. In math you were told that the origin is always at 0,0, well, that's the absolute origin... in your math class of course. Now let's say you were told that your origin is at 1,1... It might sound strange, but there's nothing wrong about it. Now let's say you are told that a point relative to that new origin is at 0,1. That point is a relative position, because it's relative to another point, not the absolute origin. Now if you want to obtain the point that is an absolute position, but this point is a relative point, you can do that doing this:
AbsolutePosX = NewOriginX + RelativePosX
AbsolutePosY = NewOriginY + RelativePosY
AbsolutePosZ = NewOriginZ + RelativePosZ
That way you can obtain a point that is an absolute position from the origin.

In tibia, the origin is NOT where you are standing, you CONSIDER this to be YOUR origin. You can look at the LAND MAP of Tibia as a 3 dimensional array of tiles, whichever floor you are standing on, the origin will be at the upper left corner of the map, you'll never make it there because Cipsoft.
Knowing that our origin is there, you can then make the following assumptions and be right about it:
Anything north of you, is closer to the origin.
Anything west of you, is closer to the origin.
So if you move west, in the X axis, you move -1.
If you move east, in the X axis you move +1.
If you go north, you move -1 in the Y axis.
If you go south, you move +1 in the Y axis.

If you know what a quadrant is, you'll understand that each floor in Tibia is like... located somehow in the 4th quadrant, but when you move away from the origin, the position is NOT negative, it's positive.

Give it some thought and you'll understand.

Hope it helps.!

OsQu
03-29-2007, 07:25 PM
I like this kind of help really much. It's not just pasting source codes and then get things work. In my opinion the most of programming is using you own brains, and this kind of help really encourages to do that! (If there had been that respect thing, You would have get my respect!)