Jump to content

Forcing a PED to go to a coordinate while he is in combat.


Recommended Posts

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.

 

 

 

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.

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.

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.

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 :

  1. Disable your ped to take cover, use cars, etc (see combat attributes)
  2. Create a timer (for example, _fightTimer)
  3. Enable temporary events, make your ped fight
  4. When timer _fightTimer has expired, create a new timer _runTimer
  5. Make your ped run during x seconds, block temporary events
  6. When _runTimer has expired, jump back to step n°3
  7. Add a condition that always checks the remaining distance between your ped and the final destination
Edited by winject

 

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 :

  1. Disable your ped to take cover, use cars, etc (see combat attributes)
  2. Create a timer (for example, _fightTimer)
  3. Enable temporary events, make your ped fight
  4. When timer _fightTimer has expired, create a new timer _runTimer
  5. Make your ped run during x seconds, block temporary events
  6. When _runTimer has expired, jump back to step n°3
  7. 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.

  • 4 weeks later...
JustAnotherComplexKid

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. Bf5GHR5.png

Edited by JustAnotherComplexKid
  • 2 years later...
Igor Bogdanoff

create your own thread for your own question.

Guest
This topic is now closed to further replies.
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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