SCIV Posted April 22, 2017 Share Posted April 22, 2017 Hi, sorry for my poor Eng and thanks for giving me your time. I created two relation group and two peds for testing(from each relation group). I started the fight by calling SetRelationshipBetweenGroups with Relationship type= 5 "Hate". Then I tried to sending one of peds to go to a coordinate. He started his new task (by running to coord) but when the other PED shot at him he postponed the plan and started to fight, finding covers, going to other directions ,.... and didn't go to coordinate until fight finish. 1 - Is it possible to make him to go to a specific coord and fight(with gun) simultaneously? If not: I need to write my own behavior So now 2 - How to force my ped to do my tasks (maybe in a sequence) and don't start other tasks. Thank you again. Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/ Share on other sites More sharing options...
SCIV Posted April 22, 2017 Author Share Posted April 22, 2017 Sorry wrong place but don't now how to remove it... Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069531373 Share on other sites More sharing options...
Hullian111 Posted April 22, 2017 Share Posted April 22, 2017 Sorry wrong place but don't now how to remove it... I think you can report it to get it removed, but I'm not sure. Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069531384 Share on other sites More sharing options...
SCIV Posted April 22, 2017 Author Share Posted April 22, 2017 Hi, now It's in "Coding", thanks. Now is there any solution for my problem? Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069532090 Share on other sites More sharing options...
LeFix Posted April 22, 2017 Share Posted April 22, 2017 http://www.dev-c.com/nativedb/func/info/5bc448cb78fa3e88Könnte die richtige Native sein, aber mein Englisch ist nicht das Beste und ich bin mir unsicher über die Bedeutung von "any means" hier. Übersetzungen die ich dazu kenne: Any means necessary - mit allen mitteln (Das würde ja bedeuten eingehende Schüsse zu ignorieren vielleich) by any means - irgendwie Notfalls musst du fortlaufend den aktuellen Task prüfen und ggf. erneut überschreiben, aber ich schätze du hast das bereits probiert oder suchst eine einfachere direkte Lösung des Problems. Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069532146 Share on other sites More sharing options...
SCIV Posted April 22, 2017 Author Share Posted April 22, 2017 http://www.dev-c.com/nativedb/func/info/5bc448cb78fa3e88 Könnte die richtige Native sein, aber mein Englisch ist nicht das Beste und ich bin mir unsicher über die Bedeutung von "any means" hier. Übersetzungen die ich dazu kenne: Any means necessary - mit allen mitteln (Das würde ja bedeuten eingehende Schüsse zu ignorieren vielleich) by any means - irgendwie Notfalls musst du fortlaufend den aktuellen Task prüfen und ggf. erneut überschreiben, aber ich schätze du hast das bereits probiert oder suchst eine einfachere direkte Lösung des Problems. Oh, Sorry, I'm not from Germany. Although I'm loving my country, I really don't want to be here and see how it's burning in this era... and I like Germans so I chose Germany. Sorry every one (I hope that it's not important to you). OK. Yes I tested "TASK_GO_TO_COORD_ANY_MEANS" before and if some body shoot at my ped after calling that function he will forget everything (ANY_MEANS too) and will start to shooting, taking cover... Now I'm trying to make my PED ignore environments events. I tested SET_PED_CONFIG_FLAG, SET_PED_COMBAT_ATTRIBUTES, SET_PED_ALERTNESS, SET_PED_COMBAT_ABILITY, SET_PED_COMBAT_RANGE, SET_PED_SEEING_RANGE Not successful yet (Maybe it's because of my mistakes!). Note:Good advice LeFix but I can't call functions on every frame (In a big combat it will drop frames, and Mod can't run perfectly on everyone's computer) But if I get successful I will put the codes here for other users. Thank you dear LeFix for your attention. Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069532366 Share on other sites More sharing options...
SCIV Posted April 23, 2017 Author Share Posted April 23, 2017 Hi, I think that it's not possible to use GoTo Task(and similar funcs) while Ped is in a combat simultaneously without editing game files (using OpenIV) But I finally found the magic function: SET_BLOCKING_OF_NON_TEMPORARY_EVENTS Now I'm writing my own task sequence to do the similar thing(RunTo, TakeCover, Fight,...) as naturally as possible... I will put the result here, thanks. Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069532855 Share on other sites More sharing options...
winject Posted April 23, 2017 Share Posted April 23, 2017 (edited) Hi, I think that it's not possible to use GoTo Task(and similar funcs) while Ped is in a combat simultaneously without editing game files (using OpenIV) But I finally found the magic function: SET_BLOCKING_OF_NON_TEMPORARY_EVENTS Now I'm writing my own task sequence to do the similar thing(RunTo, TakeCover, Fight,...) as naturally as possible... I will put the result here, thanks. No you can't, because they are tasks and need to be played individually. However, you can play with timers and different conditions : Disable your ped to take cover, use cars, etc (see combat attributes) Create a timer (for example, _fightTimer) Enable temporary events, make your ped fight When timer _fightTimer has expired, create a new timer _runTimer Make your ped run during x seconds, block temporary events When _runTimer has expired, jump back to step n°3 Add a condition that always checks the remaining distance between your ped and the final destination Edited April 23, 2017 by winject Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069533783 Share on other sites More sharing options...
SCIV Posted April 23, 2017 Author Share Posted April 23, 2017 Hi, I think that it's not possible to use GoTo Task(and similar funcs) while Ped is in a combat simultaneously without editing game files (using OpenIV) But I finally found the magic function: SET_BLOCKING_OF_NON_TEMPORARY_EVENTS Now I'm writing my own task sequence to do the similar thing(RunTo, TakeCover, Fight,...) as naturally as possible... I will put the result here, thanks. No you can't, because they are tasks and need to be played individually. However, you can play with timers and different conditions : Disable your ped to take cover, use cars, etc (see combat attributes) Create a timer (for example, _fightTimer) Enable temporary events, make your ped fight When timer _fightTimer has expired, create a new timer _runTimer Make your ped run during x seconds, block temporary events When _runTimer has expired, jump back to step n°3 Add a condition that always checks the remaining distance between your ped and the final destination Yes, you're right, and because my code have to control a lot of peds I'm using a timer to check peds state every one second or so . Then It can decide what to do next as you said... But now I have to work on other parts of the code to make it ready to run this part, It will take some time I will check this topic everyday for any new idea... Thank you winject, you know exactly what I have to do. Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069533966 Share on other sites More sharing options...
LeFix Posted April 24, 2017 Share Posted April 24, 2017 (edited) Ok i assumed you were german. Edited April 24, 2017 by LeFix Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069535396 Share on other sites More sharing options...
JustAnotherComplexKid Posted May 22, 2017 Share Posted May 22, 2017 (edited) You haven't tried the walk and combat native have you? Like this native,void TASK_GO_TO_COORD_AND_AIM_AT_HATED_ENTITIES_NEAR_COORD(Ped pedHandle, floatgoToLocationX, float goToLocationY, float goToLocationZ, float focusLocationX, floatfocusLocationY, float focusLocationZ, float speed, BOOL shootAtEnemies, floatdistanceToStopAt, float noRoadsDistance, BOOL unkTrue, int unkFlag, int aimingFlag, HashfiringPattern) // A55547801EB331FC. Since nativedb was wiped if you need the comment someone made it may help. Or the 2 natives above this one. The comment for this native tho, BELOW IS A PICTURE -> Click it for more HD view. Edited May 22, 2017 by JustAnotherComplexKid Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1069587506 Share on other sites More sharing options...
NOTHING2 Posted July 4, 2019 Share Posted July 4, 2019 After arrived to destination the ped will reload..that's what i want unfortunately... There is no function to reconize did the ped arrive to destination or not..... I need Help ...Code : AddTask.RunTo(NearestWeapon.Position); Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1070798374 Share on other sites More sharing options...
Igor Bogdanoff Posted July 4, 2019 Share Posted July 4, 2019 create your own thread for your own question. Link to comment https://gtaforums.com/topic/885927-forcing-a-ped-to-go-to-a-coordinate-while-he-is-in-combat/#findComment-1070799574 Share on other sites More sharing options...
Recommended Posts