NTAuthority Posted September 24, 2009 Share Posted September 24, 2009 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 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 More sharing options...
TheSiggi Posted September 24, 2009 Share Posted September 24, 2009 could you post your script? Link to comment Share on other sites More sharing options...
ZAZ Posted September 24, 2009 Share Posted September 24, 2009 I confirm to The_Siggi but maybe 05DE: is what you're looking for CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
NTAuthority Posted September 24, 2009 Author Share Posted September 24, 2009 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. Even smaller walls have him first trying to run through the walls before walking a bit on the sidewalk. 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 More sharing options...
ZAZ Posted September 24, 2009 Share Posted September 24, 2009 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. 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] CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
tysman Posted September 24, 2009 Share Posted September 24, 2009 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 More sharing options...
NTAuthority Posted September 25, 2009 Author Share Posted September 25, 2009 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. 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 More sharing options...
NTAuthority Posted December 24, 2016 Author Share Posted December 24, 2016 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. This answer is now depreciated, 0A2E is obviously documented as TASK_FOLLOW_PATH_NODES_TO_COORD_WITH_RADIUS. Silent, Link2012, ThirteenAG and 2 others 5 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now