Unit/Player Facing for Z axis menu

Shout-Out

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    g3gg0's Avatar Active Member
    Reputation
    32
    Join Date
    Mar 2008
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unit/Player Facing for Z axis

    hi,

    the 2D facing of an object (on the X/Y plane) can be read via
    addr1 = WoW.ReadInteger(curObj + 0x110);
    facing = WoW.ReadFloat(addr1 + 0x1C);

    but how to get the angle of the flight direction relative to the X/Y plane? (pitch)
    thanks in advance

    Unit/Player Facing for Z axis
  2. #2
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Getting the "pitch" isn't as easy as a mere memory read, you'll have to calculate it yourself. (getting the angle between your object and the origin, easy trignometry)

    You can either use sin(Z,3D distance) or cos(2D distance, 3D distance) or tan(Z, 2D distance)
    You can use these formula's because the angle between (1) and (2) is 90°

    Quick whipped up paint:
    Last edited by Robske; 01-15-2009 at 02:36 PM.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  3. #3
    g3gg0's Avatar Active Member
    Reputation
    32
    Join Date
    Mar 2008
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, thanks for your reply. (gave you +rep)
    but i'm already doing it that way.

    - let the character fly
    - get coordinates
    - wait
    - get coordinates
    - calcuate position deltas and using that for getting the pitch

    but i wondered if there is an easier way just by getting it through memory reading.
    because models of other players are also displayed with pitch angle when they are flying.

    the memory reading method doesnt require me to "differentiate" and gives me the correct angle without delay
    Last edited by g3gg0; 01-15-2009 at 05:14 PM.

  4. #4
    RawrSnarl's Avatar Member
    Reputation
    14
    Join Date
    May 2008
    Posts
    65
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Such a value is not found in memory. I don't see how such a small calculation could cause any sort of delay.

  5. #5
    g3gg0's Avatar Active Member
    Reputation
    32
    Join Date
    Mar 2008
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well the calculation itself is nothing
    i talk about caclucating a modified, delayed value - that requires a contoller (in means of control theory).
    i read position, wait, read again, differentiate to get the angle and modify that angle. this changes my next position that is differentiated again.

    what i now do is:
    > read XYZ, delay, read XYZ, calculate angle, correct angle, wait

    what i wanted to have:
    > read angle, correct angle, wait

    its obviously cleaner and faster to directly get the angle instead of calculating with measured values.
    of course the other method works also - but its less clean imho.
    Last edited by g3gg0; 01-15-2009 at 04:10 PM.

  6. #6
    jbrauman's Avatar Member
    Reputation
    65
    Join Date
    Dec 2007
    Posts
    72
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by g3gg0 View Post
    well the calculation itself is nothing
    i talk about caclucating a modified, delayed value - that requires a contoller (in means of control theory).
    i read position, wait, read again, differentiate to get the angle and modify that angle. this changes my next position that is differentiated again.

    what i now do is:
    > read XYZ, delay, read XYZ, calculate angle, correct angle, wait

    what i wanted to have:
    > read angle, correct angle, wait

    its obviously cleaner and faster to directly get the angle instead of calculating with measured values.
    of course the other method works also - but its less clean imho.
    Knowledgable people have posted that this value is unattainable and I'd trust them on that one. Robske007a even posted a diagram he made for you.

  7. #7
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jbrauman View Post
    Knowledgable people have posted that this value is unattainable and I'd trust them on that one. Robske007a even posted a diagram he made for you.
    I wouldn't be so sure of that I have no idea how WoW's physics engine works, perhaps it is calculated but it sure isn't part of the player struct.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  8. #8
    g3gg0's Avatar Active Member
    Reputation
    32
    Join Date
    Mar 2008
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by jbrauman View Post
    Knowledgable people have posted that this value is unattainable and I'd trust them on that one. Robske007a even posted a diagram he made for you.
    just writing some offending lines doesnt help anyone.

    - i thankfully gave +rep to Robske007a (the creator of the image) for his work
    - i explained WHY i wanted to have the angle from WoW - not the one i calculated from movement
    - wow definitely has the angle of the unit somewhere, how else would it be able to render units, players and objects that are not standing on a even surface or are flying upside down (pitchlimit)?

    @Robske007a:
    > but it sure isn't part of the player struct.

    thanks again
    yeah, i was afraid of that.
    my next alternative would be to use the camera pitch, since when using
    mouse-movement (rightclick and hold) the camera is bound to the players pitch.
    but for now i will focus on some other code cleanup. hehe

  9. #9
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After some poking around I've found 2 settings in WoW - keybinds: a key to increase your pitch and one to decrease your pitch. Pressing these buttons while flying would make you loop up/down.

    Perhaps you should take a look at those functions to find your "current pitch" adress.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  10. #10
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought this was controlled by the camera angle offsets if i'm not mistaken, Kind of like an Xy / Zy rotation.

    It's really early in the morning so don't hound me if I get you wrong, but are trying to make a flying bot?


  11. #11
    g3gg0's Avatar Active Member
    Reputation
    32
    Join Date
    Mar 2008
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Robske007a:
    ok thanks. but since i just have reverse engineered really few code, this would
    take too much time then. but thx for figuring out.

    @suicidity:
    yeah, right. its already working fine.

  12. #12
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It will be in the player structure, just not how you would have thought. Each object in WoW is rendered based on a Matrix. Inside of that matrix, is the Rotation/Location and Scale of an object.

    If i get bored later on, i'll reverse it for you. You can easily find it for yourself however, in that you just need to get on a flying mount and scan for changing floats when you change your pitch. But, ensure you start the scan from your player base otherwise you will get values from the number of client-side local player data.

  13. #13
    g3gg0's Avatar Active Member
    Reputation
    32
    Join Date
    Mar 2008
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah, thanks
    will try to figure out that address!

  14. #14
    g3gg0's Avatar Active Member
    Reputation
    32
    Join Date
    Mar 2008
    Posts
    86
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, got it. working perfectly now
    Code:
    addr1 = WoW.ReadInteger(curObj + 0x110);
    facing = WoW.ReadFloat(addr1 + 0x1C);
    pitch = WoW.ReadFloat(addr1 + 0x20);
    thanks guys. the address was not very hard to find hehe....

  15. #15
    kynox's Avatar Member
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, i forgot all about that. Obj+0x100 is the CMovementData structure which contains the Pos,Etc.

    It actually points to about Obj+0x7D0 which is where you guys read the position from.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Lua Script] Making the player face a certain direction
    By tyeeeee1 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 03-09-2012, 11:01 AM
  2. Tichondrius horde us player looking for more players!
    By Murphyman20thGTI in forum World of Warcraft General
    Replies: 3
    Last Post: 01-07-2012, 04:18 PM
  3. [Mangos] Player Bots for WoW Classic (1.12.1)
    By saphon in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 04-14-2011, 04:25 PM
  4. Looking for : online player map for server
    By darkkiller1992 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 05-07-2009, 04:31 AM
  5. [DK] Grief Players waiting for Boat//Zeppelin
    By Seraphant in forum World of Warcraft Guides
    Replies: 5
    Last Post: 01-07-2009, 02:58 PM
All times are GMT -5. The time now is 03:29 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search