Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Aion > Aion Hacks, Bots, Cheats & Exploits
You last visited: Today at 21:40

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Code Snippet]Facing Character to X , Y

Discussion on [Code Snippet]Facing Character to X , Y within the Aion Hacks, Bots, Cheats & Exploits forum part of the Aion category.

Reply
 
Old   #1
 
Bl@ze!'s Avatar
 
elite*gold: 240
Join Date: Dec 2006
Posts: 1,579
Received Thanks: 1,609
[Code Snippet]Facing Character to X , Y

Hey community,

i want to share some code snippets to you because NCsoft changed a little bit in Aion and now i want to share a new Facting to X Y method.

Thanks to PharmerPhale for some help.

C# Code

Code:
        private double RotNeeded(float X, float Y)
        {

            double faceAngle = Math.Atan2(Y - Player.GetPlayerY(), X - Player.GetPlayerX());
            faceAngle = faceAngle * 180 / Math.PI;
            faceAngle -= 90;

            if (faceAngle > 180)
            {
                faceAngle -= 360;
            }

            faceAngle -= 180;

            if (faceAngle < -180 && faceAngle > -360)
            {
                faceAngle += 360;
            }

            return faceAngle;

        }
This method gives you the Player Rotation back which the character needs for the new X and Y coordinate. If you want to use it you need to insert your own GetPlayerRotation and your own GetPlayerX and Y. If you dont know how to use the math namespace, try looking at msdn.

C++ Code

Code:
double aPlayer::rotationNeed(float X, float Y)
{
	double faceAngle = atan2(Y - pCoordY(), X - pCoordX());
	faceAngle = faceAngle * 180 / 3.14159265;
	faceAngle -= 90;

	if (faceAngle > 180)
		faceAngle -= 360;

	faceAngle -= 180;

	if (faceAngle < -180 && faceAngle > -360)
		faceAngle += 360;

	return faceAngle;
}
And thats my C++ version of this. You have to include <math.h> and you have to replace my pCoordX() pCoordY() and pRotation() then it should work for you.

I hope I can help some coders.

So long,

Unknw0n0x
Bl@ze! is offline  
Thanks
3 Users
Old 10/26/2009, 10:00   #2
 
elite*gold: 0
Join Date: Jul 2006
Posts: 5
Received Thanks: 0
Frage

Kann es sein dass der Ausdruck:
Code:
 if (faceAngle < -180 && faceAngle > -360)
Nicht Wahr werden kann ?

Quote:
Logisches UND &&

Das Ergebnis des Ausdrucks ist 1, wenn beide Operanden ungleich 0 sind, andernfalls 0. Im Unterschied zum & wird der Ausdruck streng von links nach rechts ausgewertet. Wenn der erste Operand bereits 0 ergibt, wird der zweite Operand nicht mehr ausgewertet und der Ausdruck liefert in jedem Fall den Wert 0. Nur wenn der erste Operand 1 ergibt, wird der zweite Operand ausgewertet. Der && Operator ist ein Sequenzpunkt: Alle Nebenwirkungen des linken Operanden müssen bewertet worden sein, bevor die Nebenwirkungen des rechten Operanden ausgewertet werden.

Das Resultat des Ausdrucks ist vom Typ int .
faceAngle < -180 && faceAngle > -360

So wie ich das verstehe kann der Winkel doch nicht kleiner -180 UND größer -360 sein oder ?
mel andru is offline  
Old 10/26/2009, 19:10   #3
 
_revo's Avatar
 
elite*gold: 57
Join Date: Jun 2007
Posts: 10,720
Received Thanks: 5,092
Quote:
Originally Posted by mel andru View Post
Kann es sein dass der Ausdruck:
Code:
 if (faceAngle < -180 && faceAngle > -360)
Nicht Wahr werden kann ?



faceAngle < -180 && faceAngle > -360

So wie ich das verstehe kann der Winkel doch nicht kleiner -180 UND größer -360 sein oder ?
ynot?
angle is just between -180° and -360°
_revo is offline  
Old 10/26/2009, 22:59   #4
 
elite*gold: 0
Join Date: Jul 2006
Posts: 5
Received Thanks: 0
Well thanks for Info.
Another Question (Sorry for Bothering yours)

He wrote that i need "pRotation()" well i got this function but cant find it in his code something missing ?

I consoled out the function and getRot() but i dont get it.

Im really confused about this strange Compass in Aion having -90 N / -135 NE
/ -180 E / 135 SE / 90 S / 45 SW / 0 W / -45 NW ....

I used to write functions for Waypoint Navigation for Lotro so the Basics with Arctan, rad, degree and relation between the degree Value of Arctan isnt unknown but i cant handle it in Aion this Compass is really confusing me.

Im trying now since almoast a week to get this facetarget working im almoast running mad.

Any Help would be appriciated, like do i have to and how change the Compass to E = 0 or N = 0

thanks in Advance
mel andru is offline  
Old 10/27/2009, 11:18   #5
 
Bl@ze!'s Avatar
 
elite*gold: 240
Join Date: Dec 2006
Posts: 1,579
Received Thanks: 1,609
pRotation = a function which returns your rotation in a double value you have to replace it with your own function
Bl@ze! is offline  
Reply


Similar Threads Similar Threads
[New] Alba Kingz Album Snippet!! [Rap]!!
08/10/2010 - Main - 3 Replies
Hallo Leute, http://img576.imageshack.us/img576/6324/henwdseu1 .jpg Ich wollte euch mal Alba Kingz vorstellen!! Alba Kingz ist eine Albanische Musik Gruppe mit sehr viel Sehr viel Talent. Ich Hoffe das ich euch nicht Störe oder so aber wollte nur mal Zeigen!!
can u plz help me .. iam facing a problem in hacking dragonica
10/17/2009 - Dragonica - 7 Replies
please help me .. iam facing a problem in hacking dragonica... very important ------------------------------------------------- ------------------------------- hello members iam a new guy in that site please help me how can i hack a game like dragonica i need from the proffessional ppl to explain to me in detail
autoit code für correct facing
02/20/2009 - World of Warcraft - 3 Replies
ich suche ein autoit source code beispiel für "ausrichtung des spielers zum gegner (drehen)" danke
alt code in character name
11/08/2008 - Dekaron - 8 Replies
helloo. . anyone know how to create character wiht alt codes in its name. . ? i saw some player have that kind of name. . ex.: ôôXXXXôô i think with that kind of character's name. . you wont get banned. . xD
Code Character Stats (str, agi, etc) in a CO Private Server
05/01/2008 - Conquer Online 2 - 0 Replies
.



All times are GMT +2. The time now is 21:40.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.