(3.3.5) TraceLine causes WoW to hang... need help! menu

User Tag List

Results 1 to 6 of 6
  1. #1
    haku43's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    (3.3.5) TraceLine causes WoW to hang... need help!

    TraceLine sometimes causes a hang, with no error or exception.
    Edit: I also noticed that calling this function sometimes causes the character to fall through WMO's...

    Code:
    [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            public delegate byte TracelineDelegate(ref Common.Vector end, ref Common.Vector start, ref Common.Vector result, ref float distance, uint flags, uint Optional);
            public static TracelineDelegate WoWTraceLine;
    Code:
        [Flags]
        public enum CGWorldFrameHitFlags : uint
        {
            HitTestNothing = 0x0,
            /// <summary>
            /// Models' bounding, ie. where you can't walk on a model. (Trees, smaller structures etc.)
            /// </summary>
            HitTestBoundingModels = 0x1,
            /// <summary>
            /// Structures like big buildings, Orgrimmar etc.
            /// </summary>
            HitTestWMO = 0x10,
            /// <summary>
            /// Used in ClickTerrain.
            /// </summary>
            HitTestUnknown = 0x40,
            /// <summary>
            /// The terrain.
            /// </summary>
            HitTestGround = 0x100,
            /// <summary>
            /// Tested on water - should work on lava and other liquid as well.
            /// </summary>
            HitTestLiquid = 0x10000,
            /// <summary>
            /// This flag works for liquid as well, but it also works for something else that I don't know (this hit while the liquid flag didn't hit) - called constantly by WoW.
            /// </summary>
            HitTestUnknown2 = 0x20000,
            /// <summary>
            /// Hits on movable objects - tested on UC elevator doors.
            /// </summary>
            HitTestMovableObjects = 0x100000,
    
            HitTestLOS = HitTestBoundingModels | HitTestWMO, //| HitTestMovableObjects | HitTestUnknown2,
            //HitTestLand = HitTestGround | HitTestWMO, //| HitTestMovableObjects | HitTestUnknown2,
            HitTestGroundAndStructures = HitTestLOS | HitTestGround
    
        }
        [Serializable]
        public struct Vector
        {
            [XmlAttribute("x")]
            public float X;
    
            [XmlAttribute("y")]
            public float Y;
    
            [XmlAttribute("z")]
            public float Z;
    
        }
    Code:
     public bool HitTestLOS(Common.Vector end, Common.Vector start)
            {
                byte result = 0;
    
                //try
                //{
                Common.Vector res = new Common.Vector();
                float dist = 1.0f;
                uint zero = 0;
                result = FunctionInterface.WoWTraceLine(ref end, ref  start, ref res, ref dist, (uint)Common.CGWorldFrameHitFlags.HitTestLOS, zero);
    
                //}
                //catch (Exception ex)
                //{
                //    LuaInterface.LoggingInterface.LogEx(ex.Message);
                //}
    
                return (result == 0);
            }


    Any thoughts?
    Last edited by haku43; 03-30-2011 at 06:56 PM.

    (3.3.5) TraceLine causes WoW to hang... need help!
  2. #2
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're probably using the wrong offset. Also, you have start and end switched around.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  3. #3
    haku43's Avatar Member
    Reputation
    3
    Join Date
    Sep 2009
    Posts
    27
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've managed to get it working, but it usualy takes 5 - 15 ms to complete, which is kinda slow. (Calling it from endscene).

  4. #4
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,432
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by MaiN View Post
    Also, you have start and end switched around.
    Why would this matter?

  5. #5
    namreeb's Avatar Legendary

    Reputation
    658
    Join Date
    Sep 2008
    Posts
    1,023
    Thanks G/R
    7/215
    Trade Feedback
    0 (0%)
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jadd View Post
    Why would this matter?
    Wont swapping start/end give you the intersection point furthest from the actual start?

  6. #6
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Jadd View Post
    Why would this matter?
    Originally Posted by namreeb View Post
    Wont swapping start/end give you the intersection point furthest from the actual start?
    What namreeb said.

    EDIT: It also matters if they take culling into account. For instance, when you right/left click in the game world a raycast is performed, and you want that ray to hit what the user clicks, not some invisible triangle the graphics card has culled away.
    Last edited by MaiN; 04-10-2011 at 05:21 AM.
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

Similar Threads

  1. WoW Emulator for WoW 1.5 till WoW 1.8 NEEDED Help,is anybody out there?
    By xanimad in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 07-24-2021, 04:19 PM
  2. Druid form causes Tmorph to bug. Need help
    By Kumakami in forum WoW Bots Questions & Requests
    Replies: 1
    Last Post: 07-26-2015, 09:32 PM
  3. Debugging wow - ASM [intro] need help
    By abuckau907 in forum WoW Memory Editing
    Replies: 13
    Last Post: 06-20-2009, 11:24 AM
All times are GMT -5. The time now is 02:42 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search