Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

Making a CHAR walk to a position... a problem


NTAuthority
 Share

Recommended Posts

Hi,

 

I have created a character with a neutral pedtype, and want to make him walk to a position around 150 meters away, which is randomly determined. I have tried opcode 07CD, but my character tries to walk through walls instead of just following the ped paths like the car drive_to commands.

 

Does anybody know an opcode/method to make him follow the ped paths to the position, without trying to walk into walls all the time?

 

Thanks in advance,

 

Bas

SsZgxdL.png

Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding!

Link to comment
Share on other sites

 

maybe 05DE: is what you're looking for

Nope, that's just for randomly wandering around, like the vehicle opcode 00AF with parameter '1'. I need a opcode to walk to a specific coordinate, but not trying to run a straight line... but using pathfinding like the vehicle drive_to opcodes. My code, even though it would be of no use:

 

 

           Vector3 position = Player.Character.Position.Around(400).GetClosestPathCoordinates(PathType.Ped);           PedID model = new [] { PedID.WMYCR, PedID.WMYDRUG, PedID.HMYCR, PedID.HMYDRUG, PedID.WMYKARA, PedID.HMYDRUG }.ToList().Random();           Ped ped = World.CreatePed(model, position, 24);           mission.AddCleanup(() => ped.NoLongerNeeded());           mission.AddFailureCondition(() => !ped.IsAlive, "You were suppposed to protect him!");// ...           mission.SetObjective(() => ped.Position.DistanceTo(Player.Character.Position) < 6f);           mission.Brief("Protect ~b~him~s~ while he walks to his destination.");           var target = ped.Position.Around(150).GetClosestPathCoordinates(PathType.Ped);           Native.CallOpcode(0x07cd, ped, target.pX, target.pY, target.pZ, 0, 20);           mission.AddFailureCondition(() => Player.Character.Position.DistanceTo(ped.Position) > 40f, "You went too far away!");

 

 

As you may be able to see, I'm creating random coordinates on a ped path location, but if for example the char/actor currently is at one side of the East Beach parking garage, and my coordinates lead him to somewhere on the main road... he tries to walk through that garage, which I do not want... that would lead players to headshot him and fail the mission. smile.gif Even smaller walls have him first trying to run through the walls before walking a bit on the sidewalk.

SsZgxdL.png

Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding!

Link to comment
Share on other sites

 

As you may be able to see, I'm creating random coordinates on a ped path location, but if for example the char/actor currently is at one side of the East Beach parking garage, and my coordinates lead him to somewhere on the main road... he tries to walk through that garage, which I do not want... that would lead players to headshot him and fail the mission. smile.gif Even smaller walls have him first trying to run through the walls before walking a bit on the sidewalk.

Thats the problem with the scripting. You can not spawn the actor anywhere and hope that he reaches the destionation just because of the paths.

Mostly he do it but it can also happen that he stucks.

If you wonna make shure that he reaches the destination you must make a safe route for the walk

An alternative to 07CD would be 05D3: (not 05DE:) thats my favorite opcode

or create a scm path

 

0615: define_action_sequences [email protected]: clear_scmpath05D7: add_point_to_scmpath  2474.4036 -1671.1002 13.331405D7: add_point_to_scmpath  2482.3828 -1682.174 13.330405D7: add_point_to_scmpath  2480.8169 -1726.5841 13.554705D7: add_point_to_scmpath  2522.562 -1725.4154 13.5469  05D7: add_point_to_scmpath  2522.7358 -1718.514 13.531205D7: add_point_to_scmpath  2535.6318 -1706.942 13.437205D7: add_point_to_scmpath  2528.6187 -1690.41 13.701505D7: add_point_to_scmpath  2509.6377 -1676.5874 13.546905D8: AS_assign_scmpath to_actor -1 flags  7  3  0616: define_action_sequences_end [email protected]: assign_actor [email protected] to_action_sequences [email protected]: remove_references_to_AS_pack [email protected]

 

Link to comment
Share on other sites

Hello I might not be much of help but I have a code where you can make him walk to different coordinates so he can move an inch at a time, basically so you can make him walk around the garage and not run into it.

 

05D3: AS_actor [email protected] goto_point [email protected] [email protected] [email protected] mode 4 999999 ms:NONAME_150209: [email protected] = random_int_in_ranges 0 5gosub @read_coords_table:[email protected] == [email protected] = [email protected] = [email protected] = [email protected] == [email protected] = [email protected] = [email protected] = Zend

 

Link to comment
Share on other sites

Found the solution: opcode 0A2E follows the navigation paths. I found this out by checking parameters used in IV for TASK_FOLLOW_NAV_MESH_TO_COORD and checking for anything similar... the use of '4, -1' in the example looked a lot like 05D3, and 0A2E was the only task opcode I found with 7 parameters. smile.gif

SsZgxdL.png

Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding!

Link to comment
Share on other sites

  • 7 years later...

Found the solution: opcode 0A2E follows the navigation paths. I found this out by checking parameters used in IV for TASK_FOLLOW_NAV_MESH_TO_COORD and checking for anything similar... the use of '4, -1' in the example looked a lot like 05D3, and 0A2E was the only task opcode I found with 7 parameters. smile.gif

This answer is now depreciated, 0A2E is obviously documented as TASK_FOLLOW_PATH_NODES_TO_COORD_WITH_RADIUS.

SsZgxdL.png

Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.