Calling TraceLine menu

Shout-Out

User Tag List

Results 1 to 9 of 9
  1. #1
    ap0stle2482's Avatar Member
    Reputation
    1
    Join Date
    Oct 2006
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Calling TraceLine

    I started writing my first bot a few months back, it was pretty slow going at first as i havent been programming very long, but with alot of reading books, forums etc.. i now have a bot that can follow waypoints, use ppather for navigation(navmesh is beyond me at this point) mine herb, blah blah blah. Anyway my problem is, that i get a target by going through the objectmanager and finding the closest target to me and using that as my target, which works very well until... i get into an area with buildings, i can check to see if my target is indoors to filter out those targets, but targets on the opposite side of a building still give me los issues, so i figured the next logical step would be to implement traceline. Ive searched and read all the threads on this site, i understand the values you need to pass and the flags however i really dont understand how to call this, my bot is in c# and the only c# example ive been able to find is in this thread http://www.mmowned.com/forums/wow-memory-editing/278757-traceline-implementation.html
    The only hook i use is endscene and im assuming the example in this thread is for an injected dll, i guess basically what im asking is, is it possible to call traceline without injecting a dll into wow, and if so can you give me a push in the right direction.

    Thanks for any help and sorry for the wall o text :yuck:

    Calling TraceLine
  2. #2
    Mr.Zunz's Avatar Contributor
    Reputation
    92
    Join Date
    Mar 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IIRC you an only call traceline when your in-process


  3. #3
    YetiHunter's Avatar Member
    Reputation
    6
    Join Date
    Aug 2006
    Posts
    57
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    umm you said you have a endscene hook.. so you're inprocess or whatever you want to call it. so it should be possible for you to call traceline from inside your endscene hook.

  4. #4
    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 ap0stle2482 View Post
    The only hook i use is endscene /* snip */ without injecting a dll into wow
    More in/out-process mixups, yay.

    I have no clue of your program's architecture so:

    If you're hooking WoW's EndScene from a remote process (your C# program I assume) using EasyHook or w/e it would be best to allocate some memory in the target process, write the asm opcodes for the TraceLine call and invoke CreateRemoteThread (?), the return value of the TraceLine call will be in the eax register, which CreateRemoteThread returns. (Or somehow feed those opcodes to your hook, whatever is possible - you shouldn't run into any threading issues with traceline though)

    If you inject a C# dll (.NET CLR hosting) then you can use the following prototype in your code:
    Code:
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            protected delegate byte Traceline(ref WoWPoint end, ref WoWPoint start, ref WoWPoint result, ref float distance, uint flags, ref WoWPoint Optional);
    "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

  5. #5
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Robske what is the uint flags thing for?
    And what is TraceLine giving you anyway, how do you know if s.th. is behind a building?
    Viano

  6. #6
    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 Viano View Post
    Robske what is the uint flags thing for?
    And what is TraceLine giving you anyway, how do you know if s.th. is behind a building?

    - Hitflags (WMO, Ground, Liquids...), look at the sticky
    - The return value can be interpreted as a boolean, true if the traceline succeeds, false if there's something in the way. If that's the case, the actual point of intersection will be stored in 'result', the distance from 'start' to 'end' (or the intersection) is stored in 'distance'.
    "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

  7. #7
    Apoc's Avatar Angry Penguin
    Reputation
    1388
    Join Date
    Jan 2008
    Posts
    2,750
    Thanks G/R
    0/13
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Robske View Post
    More in/out-process mixups, yay.

    I have no clue of your program's architecture so:

    If you're hooking WoW's EndScene from a remote process (your C# program I assume) using EasyHook or w/e it would be best to allocate some memory in the target process, write the asm opcodes for the TraceLine call and invoke CreateRemoteThread (?), the return value of the TraceLine call will be in the eax register, which CreateRemoteThread returns. (Or somehow feed those opcodes to your hook, whatever is possible - you shouldn't run into any threading issues with traceline though)

    If you inject a C# dll (.NET CLR hosting) then you can use the following prototype in your code:
    Code:
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            protected delegate byte Traceline(ref WoWPoint end, ref WoWPoint start, ref WoWPoint result, ref float distance, uint flags, ref WoWPoint Optional);
    The last param isn't a Vec3 btw. (It's a struct, roughly 0x77C large.) It's optional, so I suggest just passing an int with the value of 0.

  8. #8
    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 Robske View Post

    - Hitflags (WMO, Ground, Liquids...), look at the sticky
    - The return value can be interpreted as a boolean, true if the traceline succeeds, false if there's something in the way. If that's the case, the actual point of intersection will be stored in 'result', the distance from 'start' to 'end' (or the intersection) is stored in 'distance'.
    Actually, distance will be the percentage the ray was cast before hit. 0.5 = 50%, which means it intersected when it had completed half of the trace.
    [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

  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)
    Originally Posted by Apoc View Post
    The last param isn't a Vec3 btw. (It's a struct, roughly 0x77C large.) It's optional, so I suggest just passing an int with the value of 0.
    Originally Posted by MaiN View Post
    Actually, distance will be the percentage the ray was cast before hit. 0.5 = 50%, which means it intersected when it had completed half of the trace.
    Thanks for clearing that up.
    "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

Similar Threads

  1. i call it exploration editing
    By davidpro in forum World of Warcraft Model Editing
    Replies: 11
    Last Post: 05-11-2007, 06:35 PM
  2. Buy gold/powerlvling without beeing called on the phone?
    By Lysvir in forum World of Warcraft General
    Replies: 4
    Last Post: 04-13-2007, 07:12 AM
  3. Call of duty 2 crack cd key.
    By Goggelpuff in forum Gaming Chat
    Replies: 3
    Last Post: 11-01-2006, 09:18 AM
  4. How To Get to Que'thelas or w/e its called!!!
    By Tbone in forum World of Warcraft Exploits
    Replies: 17
    Last Post: 07-25-2006, 10:28 AM
All times are GMT -5. The time now is 09:33 PM. 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