Quantcast

Jump to content

» «
Photo

[Guide] Driving Styles

37 replies to this topic
frodzet
  • frodzet

    Snitch

  • Members
  • Joined: 24 May 2015
  • Denmark

#31

Posted 12 March 2016 - 11:31 AM

Very much appreciated, thank you guys :-)


aimless
  • aimless

    Crackhead

  • Members
  • Joined: 30 Jul 2015
  • United-States

#32

Posted 22 March 2016 - 01:17 AM

512 Is can dive into oncoming traffic tested with _TASK_VEHICLE_FOLLOW


kagikn
  • kagikn

    Ghillie

  • Members
  • Joined: 05 Jun 2014
  • Japan

#33

Posted 22 March 2016 - 02:18 AM Edited by kagikn, 22 March 2016 - 08:52 AM.

RAGE Plugin Hook documantation says 512 is AllowWrongWay(which means the ped can reverse run by car) and 536870912 is AvoidHighWays (the ped can't drive a car on highways), I tested these with TASK_VEHICLE_DRIVE_TO_COORD_LONGRANGE.

Eddlm
  • Eddlm

    Newie

  • Members
  • Joined: 24 Aug 2015
  • Spain

#34

Posted 22 March 2016 - 06:07 PM Edited by Eddlm, 22 March 2016 - 06:07 PM.

After doing some testing myself, I've added both to the OP.

00000000000000000000001000000000 - 512 - allow going wrong way (only does it if the correct lane is full, will try to reach the correct lane again as soon as possible)
00100000000000000000000000000000 - 536870912 - avoid highways when possible (will use the highway if there is no other way to get to the destination)

CliffHanger
  • CliffHanger

    Default Avatars are Han Solos

  • Members
  • Joined: 14 Jan 2016
  • Canada

#35

Posted 10 May 2016 - 03:00 PM Edited by CliffHanger, 10 May 2016 - 03:01 PM.

Thanks a lot for your research, Eddlm.

 

I'm currently setting up  an AI that will attempt to escape as fast as possible once you approach it. The best flags I can imagine are:

00000000000000000000000000000100 - 4 - avoid vehicles
00000000000000000000000000001000 - 8 - avoid empty vehicles
00000000000000000000000000100000 - 32 - avoid objects
00000000000000000000001000000000 - 512 - allow going wrong way 

PED:SET_DRIVING_ABILITY to 100f

I'd like to know if anyone thinks this is closer to the most optimal escaping AI setup?

When I tested yesterday (without the driving ability) the AI would mostly drive very well in long roads, but in the city they'd just slow down (nearly coming to a stop even) in curves / intersections, it's actually a problem.

 

Thanks.


milkjunk87
  • milkjunk87

    Square Civilian

  • Members
  • Joined: 16 Nov 2015
  • United-States

#36

Posted 19 May 2016 - 09:12 AM

how do i get the peds to drive like they are being shot at? i have tried all of these:

nearpeds[i].DrivingStyle = DrivingStyle.Rushed;
                    nearpeds[i].DrivingStyle = DrivingStyle.IgnoreLights;
                    nearpeds[i].DrivingStyle = DrivingStyle.AvoidTrafficExtremely;
                    Function.Call(GTA.Native.Hash.SET_DRIVE_TASK_DRIVING_STYLE, nearpeds[i], 4);
                    Function.Call(GTA.Native.Hash.SET_DRIVE_TASK_DRIVING_STYLE, nearpeds[i], 8);
                    Function.Call(GTA.Native.Hash.SET_DRIVE_TASK_DRIVING_STYLE, nearpeds[i], 16);
                    Function.Call(GTA.Native.Hash.SET_DRIVE_TASK_DRIVING_STYLE, nearpeds[i], 32);


Cyron43
  • Cyron43

    "I'm so bad I kick my own ass!" (GTA IV quote)

  • Members
  • Joined: 14 Apr 2013
  • Germany

#37

Posted 17 February 2017 - 01:18 PM Edited by Cyron43, 17 February 2017 - 01:20 PM.

how do i get the peds to drive like they are being shot at? i have tried all of these:
nearpeds[i].DrivingStyle = DrivingStyle.Rushed;
                    nearpeds[i].DrivingStyle = DrivingStyle.IgnoreLights;
                    nearpeds[i].DrivingStyle = DrivingStyle.AvoidTrafficExtremely;
                    Function.Call(GTA.Native.Hash.SET_DRIVE_TASK_DRIVING_STYLE, nearpeds[i], 4);
                    Function.Call(GTA.Native.Hash.SET_DRIVE_TASK_DRIVING_STYLE, nearpeds[i], 8);
                    Function.Call(GTA.Native.Hash.SET_DRIVE_TASK_DRIVING_STYLE, nearpeds[i], 16);
                    Function.Call(GTA.Native.Hash.SET_DRIVE_TASK_DRIVING_STYLE, nearpeds[i], 32);

There are other functions responsible for fleeing. The native DB ( http://www.dev-c.com/nativedb/ ) has this TASK_REACT_AND_FLEE_PED and some others (expand the whole list and search flee).
ScriptHookVDotNet offers the FleeFrom Task.

ped.Task.FleeFrom(Game.Player.Character); 

pumaaa
  • pumaaa

    Player Hater

  • Members
  • Joined: 06 Jun 2017
  • Germany

#38

Posted 07 June 2017 - 03:51 PM Edited by pumaaa, 07 June 2017 - 03:51 PM.

00000000000010000000000000000000 - 524288 - Probably avoid offroad

 

( as mentioned here in fanatic2 script )

ai::set_drive_task_driving_style(Local_878.f_28[0], 786468);
func_30("Also setting Mary Ann to never go offroad");




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users