Log in to reply
 

Set Ped Walk to a Distance Coord



  • Hi,

    is there any way and example on how to get a self generated ped walk to a location which is more nodes away from it?

    Example:
    Let say that I have generated my player and a ped to two different locations:

    C#
    Game.Player.Character.Position = new Vector3(-1000, -1000, 3)
    playerPed = World.CreatePed(PedHash.Swat01SMY, new Vector3(1000, 1000, 3));

    (Let's now dismiss the handling of Z-coo.)

    They are far away from each other, thus if the ped "wants to get" to the player, it has to use a path, it can't get a straight way.

    How do I get the ped to walk to me if we have this distance? If there is just a few meter distance and the ped has to walk a straight line, I get it to work, but if it has to take corners, streets, turns, etc, it does not function: the ped starts walking towards me but dismisses every object (wall, building, etc).

    It seems to me that I miss the step where I get the path nodes between the ped coords and player coords. But how to get it?

    Below are the functions that I've tried. Some of them work with small distance and straight way. Some of them get the Ped walking towards me, but in a straight line (, which makes the ped stop after it reaches an obstacle).

    GET_NTH_CLOSEST_VEHICLE_NODE_FAVOUR_DIRECTION
    TASK_GO_STRAIGHT_TO_COORD
    TASK_FOLLOW_POINT_ROUTE
    TASK_GO_STRAIGHT_TO_COORD
    TASK_GO_TO
    TASK_GO_TO_COORD_ANY_MEANS

    Thanks a lot for help!

    Laszlo



  • I continued searching the WEB. What I found is that some other guys are having same problem and that they have no solution. Others are saying that pathfinding is not working for them as well. Thus I implemented my own pathfinding solution. Consumed 2 days of my time but works great.


Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.