Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
SCIV

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

Recommended Posts

SCIV

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.

 

 

 

Share this post


Link to post
Share on other sites
SCIV

Sorry wrong place but don't now how to remove it...

Share this post


Link to post
Share on other sites
Hullian111

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.

Share this post


Link to post
Share on other sites
SCIV

Hi, now It's in "Coding", thanks.

Now is there any solution for my problem?

Share this post


Link to post
Share on other sites
LeFix
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.

Share this post


Link to post
Share on other sites
SCIV

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.

Share this post


Link to post
Share on other sites
SCIV

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.

Share this post


Link to post
Share on other sites
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
Edited by winject

Share this post


Link to post
Share on other sites
SCIV

 

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.

Share this post


Link to post
Share on other sites
LeFix

Ok i assumed you were german.

Edited by LeFix

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
NOTHING2

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);  

Share this post


Link to post
Share on other sites
George Costanza

create your own thread for your own question.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • 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.