Big jump

05/18/2012 20:07 tariqx111#1
hello , im use IAmHawtness
Hook library it work 100% but i dont know how to jump in Distant point
Code:
            ActionPacket jumpPacket = new ActionPacket(_player.Id, destination, 0, (uint)Environment.TickCount, ActionType.Jump, 0, _player.Position, _currentMap.Id, 0xFFFFFFFF, 0);
            if (_player.Position.Distance(destination) < 15)
            {
                SendPacket(jumpPacket);
                _player.Position = destination;
                _screen.Update();
            }
            else
            {
                Program.Print("Big jump :" + _player.Position.Distance(destination));
                Program.Print("Dont know how to jump");
                //if me jump now it will disconnect please help me to fix it
            }
05/18/2012 22:24 pro4never#2
So the issue is in mapping a path to a distant location? This code should work just fine for single jumps. You need a pathing system, not a single 'big jump'.


Just take a destination point, your current point and the maximum distance which can be traveled in a jump...

Now use basic geometry to calculate the best point to jump to.. If it is not valid, check slightly closer. Continue doing this until you end up with a valid position which is closer to the desired location.

Once you are within 1 jump of the desired location, jump directly to it and stop your pathing code.

Note: Make sure you add in proper jump delays so you don't get dc'd for speedhacking.


Yay math?
05/18/2012 23:29 tariqx111#3
example please
@pro4never
05/19/2012 01:09 pro4never#4
.... what kind of example? I just told you exactly how to do it.

Take a piece of grid paper...

Shade in a cell near the center. This is your current location

Draw a 4x4 square around this cell. Everything inside that is a location that can be reached in a single movement.

Select a cell outside of this square (anywhere on the paper). This is the location you want to finally end up.

Draw a line connecting your current cell and the destination cell. This represents the 'ideal' route you'd like to take (Least movements. Does not account for terrain that could block you)

The cell intersected by this line that is closest to the border of your square is the 'ideal' candidate for your first movement.


Now write an equation that represents this geometric line given a starting point, ending point and max movement range.

Now modify this calculation to take into account the fact that the ideal point may not be valid... add in a small loop that checks for less ideal points (points near the ideal point that are valid in both distance and being free of obstacles). If this recursion fails, stop the path finding.


Congratz! You've now written the simplest form of path finding. It will work just fine in regards to 'simple' pathing but will fall apart as soon as you add large obstacles. If you want something more... robust, look into the A* and similar pathfinding algorithms. There's plenty of information around the net.


Ooh... by example you meant "copy and paste, fully working and robust/efficient working code"? Sorry, not my job to write your code for you <3
05/19/2012 03:01 tariqx111#5
i can't understand you
05/19/2012 03:33 tariqx111#6
i said i need example to understand, your words does not give difference
05/19/2012 08:57 pro4never#7
Does the problem lie in your ability to comprehend english? If so, work on learning english
Does the problem lie in understanding the concepts behind what I'm saying? If so, work on learning basic geometry/trig as well as some on logic.
Does the problem lie in translating my (very detailed) layout of how to write such a function into workable code? If so, work on learning to program.

All boils down to you learning what you need to be doing.
05/19/2012 10:51 xmen01235#8
Quote:
Originally Posted by pro4never View Post
Does the problem lie in your ability to comprehend english? If so, work on learning english
Does the problem lie in understanding the concepts behind what I'm saying? If so, work on learning basic geometry/trig as well as some on logic.
Does the problem lie in translating my (very detailed) layout of how to write such a function into workable code? If so, work on learning to program.

All boils down to you learning what you need to be doing.
He want you to code for him. He don't understand what you are trying to say. He is a plain lechers.
05/19/2012 14:07 shitboi#9
i can't believe the degree of patience you have shown to him, lol.
05/19/2012 22:04 tariqx111#10
lol , lol, lol, lol, why reply if you dont want to help me ?
05/19/2012 23:01 pro4never#11
Quote:
Originally Posted by tariqx111 View Post
lol , lol, lol, lol, why reply if you dont want to help me ?
I did help you.

It's not my fault if you didn't learn anything from the instructions I gave.

It's like going to a class, listening to a teacher give you all the information you need and then saying "Why talk if you aren't going to help me?!" because they didn't write your exam for you.

I gave you all the information you need... you just need to apply it.