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. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    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 IV 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 SA Mods
    10. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III 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

Rob.Zombie

[Q] Make the npcs stop behind my car

Recommended Posts

Rob.Zombie

Is there a way to make npcs stop behind my car? When I stop at a red light they all think there's no driver in my car and they try to overtake me. I've found out that I have to move forward a bit (even a press on the forward key button will do) and then their timer starts again. They wait for about 3 seconds then they try to overtake. A simple mod would do when you stop your car, niko would automatically hit the break pedals and npcs wouldn't overtake you. Yeah yeah I know, wtf you stop at red lights? Well yeah sometimes when I'm roleplaying in a taxi cab or whatever I'd like biggrin.gif

Share this post


Link to post
Share on other sites
algrn912005

It's ok to stop at red light lol, that's why they were made. I like to stop once in a while and be a "good" person. I would also like this mod...

Share this post


Link to post
Share on other sites
a-k-t-w

I think the stupidity of the peds is hilarious! lol.gif

Share this post


Link to post
Share on other sites
dukee152

ya well i like to keep my cars clean and i love the stupidity of the peds so we will have to fix that bug but make them stupider at another task

Share this post


Link to post
Share on other sites
Symbiote

I notice this all the time too. A fix would be awesome. And yeah sometimes I like to just cruise around without driving on the sidewalks and running red lights, especially when someone else is in the car and there's some dialogue going.

Share this post


Link to post
Share on other sites
warclaw

i hope that too its not feel real please ALEX or other make that mod that fix that!

Share this post


Link to post
Share on other sites
Andrew

You could using the .net script hook. Write a script that, gets the NPC behind your car (a certain distance and only facing a certain heading and your speed = 0). And freeze the position of that car, until you start to move away.

Share this post


Link to post
Share on other sites
Hergonan

You can get the vehicle behind you by using getrandomvehicle behind you (and using your car's angles to define "behind") etc

hmmm

I can take a look at it.

After I finish my two projects sad.gif

Share this post


Link to post
Share on other sites
Rob.Zombie

That'd be so great. I would help you out but I don't know anything about scripting (no lua script, no .net scripts no nothing) confused.gif

Or maybe if some1 could just actually make Niko use the break when the vehicle is stopped. I think this might stop the vehicles behind us since every npc hits the break when it is stopped (you can see it by the red light)

Share this post


Link to post
Share on other sites
Andrew
That'd be so great. I would help you out but I don't know anything about scripting (no lua script, no .net scripts no nothing) confused.gif

Or maybe if some1 could just actually make Niko use the break when the vehicle is stopped. I think this might stop the vehicles behind us since every npc hits the break when it is stopped (you can see it by the red light)

I don't think there is a brake. I've tried holding Accelerate and Reverse down at the same time and its not worked.

Share this post


Link to post
Share on other sites
Tuhnafisch

i`m also very interisted(?) in this mOd i like to play as a "good" i would say normal civilian from LC alien.gif

Share this post


Link to post
Share on other sites
dukee152

also somtimes when i park the people dont go around me they just stop the car and honk

Share this post


Link to post
Share on other sites
Rob.Zombie

Really? Maybe the worst thing is that when they try to overtake me, but they fail. Like hitting my car. I'm so pissed that sometimes I get out of my car and shoot the bitch in the head. And it'd be great if some1 could make the npcs drive a little better. Like the light is red and npc is approaching the light with 80 Km/s and trys to stop in the last second, so npc can't stop and passes the red light. This always occur at Star Junction for me. If we could only change their reaction time (or I dunno what)

Share this post


Link to post
Share on other sites
Shof

i had at various time, another car rear end my car when i stopped at a red light. Then that driver will drag niko out of my car to start a fight as if i caused the accident

Share this post


Link to post
Share on other sites
Andrew

Alright give this a try -> http://www.gtagarage.com/mods/show.php?id=5601

 

It uses the .net script hook 0.86. Just put the file into the scripts folder. Hopefully it will stop the peds from running into the back of you, they'll still get pissed off at waiting and attempt to either run into or or drive past you, this just sets the peds speed to 0 when it detects them trying that.

 

At the moment if you get close enough to a car while driving, they'll stop too. Only at the side of you though.

Share this post


Link to post
Share on other sites
Hergonan
Alright give this a try -> http://www.gtagarage.com/mods/show.php?id=5601

 

It uses the .net script hook 0.86. Just put the file into the scripts folder. Hopefully it will stop the peds from running into the back of you, they'll still get pissed off at waiting and attempt to either run into or or drive past you, this just sets the peds speed to 0 when it detects them trying that.

 

At the moment if you get close enough to a car while driving, they'll stop too. Only at the side of you though.

Gangsta are you using getclosestcar with your own xyz?

Share this post


Link to post
Share on other sites
Andrew

I'm using the GetClosestCar with the players position and a radius of about 6. function of the scripthook. Sadly this will even return closest cars to the side of you as well. Providing they are in the same heading as you. I'm going to change it to only come into effect when you're speed is slow.

Share this post


Link to post
Share on other sites
Hergonan

Why not get your car rotation, flip its axes to get your behind, then use a smaller radius to get npcs only behind you?

Share this post


Link to post
Share on other sites
Andrew

Hmm that could work better.

Share this post


Link to post
Share on other sites
HazardX

I tried it that way. Seems to work great:

 

Imports SystemImports System.Windows.FormsImports System.Collections.GenericImports Microsoft.VisualBasicImports GTAPublic Class HaltBehindScript  Inherits Script  Private list As New List(Of Vehicle)  Private bStopped As Boolean = False  Private offset As New Vector3(0.0F, -4.0F, 0.0F)  Public Sub New()     'Interval = 250  End Sub  Private Sub HaltBehindScript_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Tick     Dim v As Vehicle = Player.Character.CurrentVehicle     If v Is Nothing Then        If bStopped Then Disable()        Return     End If     If Not bStopped Then        If v.Speed >= 1.0F Then Return        bStopped = True     Else        If v.Speed >= 2.0F Then           Disable           Return        End If     End If     CheckForNewCar(v.GetOffsetPosition(offset))     ProcessCars()  End Sub  Private Sub Disable()     bStopped = False     list.Clear()  End Sub  Private Sub CheckForNewCar(ByVal Position As Vector3)     Dim v As Vehicle = World.GetClosestVehicle(Position, 3.0F)     If v Is Nothing OrElse list.Contains(v) Then Return     list.Add(v)     v.SetMetadata("maxspeed", False, v.Speed)  End Sub  Private Sub ProcessCars()     Dim CurrentSpeed As Single     Dim MaxSpeed As Single     For Each v As Vehicle In list        CurrentSpeed = v.Speed        MaxSpeed = v.GetMetadata(Of Single)("maxspeed", False)        If CurrentSpeed < MaxSpeed Then           v.SetMetadata("maxspeed", False, CurrentSpeed)        ElseIf CurrentSpeed > MaxSpeed Then           v.Speed = MaxSpeed        End If     Next  End SubEnd Class

 

It checks only behind the car and also will not lower vehicle speeds, but instead just don't allow them to accelerate again.

Edited by HazardX

Share this post


Link to post
Share on other sites
Symbiote

Got tired of waiting for a download on this... Decided to try to figure out how to copy HazardX's code somewhere and have it work, but I don't know what I'm doing. I fooled around in Visual Basic for a little while, then I tried just opening one of the sample scripthook scripts in Notepad and replacing the 'Public Class' part with Hazard's code, but the scripthook log returns errors. I guess I need to refer to some GTA files or something for it to work? Maybe I should just wait for someone who knows what they're doing to put up a download...

 

For what it's worth here is the log entry.

 

2009-02-24 23:34:13 - 1 Errors in script 'C:\Installations\Rockstar Games\Grand Theft Auto IV\scripts\HaltBehindScript.vb': in Line 8: Type 'List' is not defined.

Share this post


Link to post
Share on other sites
Hergonan

Google it, there are some answers to that problem

Since I don't know VB, I cannot help

If you want it so bad I can add it to my queue of work to be done

(3 items in that queue atm)

Share this post


Link to post
Share on other sites
Symbiote

Well I don't want to inconvenience anyone. It's not a game-breaking bug, I just wanted to try to get it working myself if I could.

Share this post


Link to post
Share on other sites
Hergonan

Then google is your friend!

Search for "vb Type 'List' is not defined. "

(without the " )

Share this post


Link to post
Share on other sites
Symbiote

Yes, thank you, I googled it after my reply and eventually found just what I needed. Log file says it loaded successfully, so now I'll test and see if it's working.

 

EDIT: Seems to work perfectly. icon14.gif Now if only there were some way to make people who are turning left yield to oncoming traffic until it's clear to go. All the time I see people yielding to left-turners, which is just backwards.

Edited by AngryAmoeba

Share this post


Link to post
Share on other sites
HazardX
Got tired of waiting for a download on this... Decided to try to figure out how to copy HazardX's code somewhere and have it work, but I don't know what I'm doing. I fooled around in Visual Basic for a little while, then I tried just opening one of the sample scripthook scripts in Notepad and replacing the 'Public Class' part with Hazard's code, but the scripthook log returns errors. I guess I need to refer to some GTA files or something for it to work? Maybe I should just wait for someone who knows what they're doing to put up a download...

Sorry, i forgot to include the Imports. They are included now.

Share this post


Link to post
Share on other sites
Rob.Zombie
Yes, thank you, I googled it after my reply and eventually found just what I needed. Log file says it loaded successfully, so now I'll test and see if it's working.

 

EDIT: Seems to work perfectly. icon14.gif Now if only there were some way to make people who are turning left yield to oncoming traffic until it's clear to go. All the time I see people yielding to left-turners, which is just backwards.

Hey that's great news. Can you release it? biggrin.gif Maybe under realistic traffic or something similar smile.gif

Share this post


Link to post
Share on other sites
Symbiote

 

Yes, thank you, I googled it after my reply and eventually found just what I needed. Log file says it loaded successfully, so now I'll test and see if it's working.

 

EDIT: Seems to work perfectly.  icon14.gif Now if only there were some way to make people who are turning left yield to oncoming traffic until it's clear to go. All the time I see people yielding to left-turners, which is just backwards.

Hey that's great news. Can you release it? biggrin.gif Maybe under realistic traffic or something similar smile.gif

I'm sorry, I meant HazardX's code works perfectly. The part about left-turners yielding was just an idea, but if anyone wants to try to do it I will help in any way I can. By myself, I wouldn't even know where to begin. confused.gif Seems like we need some way to access Rockstar's traffic system.

Share this post


Link to post
Share on other sites
Rob.Zombie

And what about npcs stopping behind the car? Is that done? If yes can you release? smile.gif

Share this post


Link to post
Share on other sites
warclaw

yea realese it !! tounge.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


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