Quantcast

Jump to content

» «
Photo

Help with Ped behavior

8 replies to this topic
julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#1

Posted 21 July 2013 - 12:22 AM

The question is: How i can avoid an unarmed ped (unarmed/knife) from fleeing?

my HULK script has a enemy feature, but my enemy ped starts to flee and i need to restart the tasks to attack sorrounding peds.

so, it's possible to make the ped more suicide? make him attack with melee even if we are shooting them?

also, it's possible to avoid the euphoria body balance? this is anothr issue that i had, when the ped is running and we shoot him he fall because of the body balance euphoria

pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#2

Posted 21 July 2013 - 03:18 PM

For the first problem, Ive faced the samething just with cars. I wanted a ped to flee away from police cars with siren (police pursuit). I tried FLEE_FROM_CHAR and FLEE_FROMCHAR_ANY_MEANS but it always started to flee away and a second later, because of the police sirens, he just parked on the side of the road.

The solution? run it every tick. Works perfect.

if (isPursuitOngoing)
FLEE_FROM_CHAR_ANY_MEANS();

Maybe this solution fits your problem.

To prevent the euphoria stuff I might have seen a native for that. Or maybe don't load colisions.

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#3

Posted 21 July 2013 - 05:59 PM

but i need to avoid the flee, he must keep attacking

pedro2555
  • pedro2555

    Open Sourcer

  • Members
  • Joined: 02 Sep 2012
  • Portugal

#4

Posted 21 July 2013 - 06:29 PM Edited by pedro2555, 21 July 2013 - 06:42 PM.

What task are you calling exactly?

Not sure what all this does, but maybe
SET_CHAR_SPHERE_DEFENSIVE_AREA,
SET_DECISION_MAKER_ATTRIBUTE_TARGET_INJURED_REACTION,
SET_DECISION_MAKER_ATTRIBUTE_TARGET_LOSS_RESPONSE,
SET_DECISION_MAKER_ATTRIBUTE_RETREATING_BEHAVIOUR,
SET_DECISION_MAKER_ATTRIBUTE_CAN_CHANGE_TARGET.

I haven't tested none of them for your case.

For the euphoria thingy maybe
SET_CHAR_SUFFERS_CRITICAL_HITS,
SET_COLLIDE_WITH_PEDS,
SET_DONT_ACTIVATE_RAGDOLL_FROM_PLAYER_IMPACT.

And while looking aroung, it maybe cool
SET_CHAR_SHOOT_RATE.

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#5

Posted 21 July 2013 - 11:25 PM

thx, i will make some tests

AgentWD40
  • AgentWD40

    GLITCHED

  • Members
  • Joined: 02 May 2009
  • Philippines

#6

Posted 29 July 2013 - 05:34 PM Edited by hardsty1e, 31 July 2013 - 03:42 AM.

you would use these natives but decision maker doesn't seem to work anymore with the updated scripthook.net or it must be implemented a different way... i've gotten to the point where police would run up to my first spotted coordinates then idle, even though it work perfectly in sco Shifty41s_beerhatsmilie2.gif


CODE

DecisionMaker dm, cdm;
//int dm,cdm;



GTA.Native.Function.Call("LOAD_CHAR_DECISION_MAKER", 2, dm);
GTA.Native.Function.Call("LOAD_COMBAT_DECISION_MAKER", 3, cdm);
GTA.Native.Function.Call("SET_DECISION_MAKER_ATTRIBUTE_SIGHT_RANGE", dm, 250);
GTA.Native.Function.Call("SET_DECISION_MAKER_ATTRIBUTE_SIGHT_RANGE(dm, 250);

//LOAD_CHAR_DECISION_MAKER(2, &dm);
//LOAD_COMBAT_DECISION_MAKER(3, &cdm);
//SET_DECISION_MAKER_ATTRIBUTE_SIGHT_RANGE(dm, 250);
//SET_DECISION_MAKER_ATTRIBUTE_SIGHT_RANGE(cdm, 250);



GTA.Native.Function.Call("SET_CAN_TARGET_CHAR_WITHOUT_LOS", ped, true);
GTA.Native.Function.Call("SET_CHAR_DECISION_MAKER", ped, dm);
GTA.Native.Function.Call("SET_COMBAT_DECISION_MAKER", ped, cdm);
GTA.Native.Function.Call("SET_DECISION_MAKER_ATTRIBUTE_CAUTION", dm, 2);
GTA.Native.Function.Call("SET_DECISION_MAKER_ATTRIBUTE_CAUTION", cdm, 2);
GTA.Native.Function.Call("SET_PED_IS_BLIND_RAGING", ped, true);

//SET_CAN_TARGET_CHAR_WITHOUT_LOS(ped, true);
//SET_CHAR_DECISION_MAKER(ped, dm);
//SET_COMBAT_DECISION_MAKER(ped, cdm);
//SET_PED_IS_BLIND_RAGING(ped, true);



GTA.Native.Function.Call("TASK_COMBAT", ped, Player.Character);
//TASK_COMBAT(ped, theplayer);

julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#7

Posted 30 July 2013 - 04:39 AM

thx, i will test and let you know the results

InfamousSabre
  • InfamousSabre

    Harpocrates

  • Members
  • Joined: 03 Jan 2013

#8

Posted 28 December 2013 - 09:50 PM

I've noticed while on a shooting spree, bouncers will chase and melee attack me, even though I'm armed. Maybe that will help, if you haven't already figured it out.

 

thx, i will test and let you know the results

So what are the results??
 


julionib
  • julionib

    Coder

  • Feroci
  • Joined: 13 Sep 2012
  • Brazil

#9

Posted 29 December 2013 - 01:45 AM

lol, i forgot to say, didnt resulted in what i need, ped still fleeing, maybe im doing something wrong





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users