Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Traffic Spawner BETA

Featured Replies

  • Author

There's no good way I've found to make it work. They do different things. The chances is used to randomly select a set from the list, in such a way that one and only one set is selected. The key properties are:

If A has twice the chances of B, then A spawns twice as often as B

The probability of *some* spawn occurring is constant.

Given these constraints, I'm pretty sure this is the only way to do it.

The Response is just deciding a yes/no question; this is much easier.

  • Replies 136
  • Views 11.5k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

^Yes I understand it,but I'm still very confused as to why my policebikes and traffic units aren't showing up.

Okay,lets say if I want:

  • Chances of spawning Securicar as 10%
  • [sWATPOLPAT removed]
  • Chances of spawning polpat as 50%
  • Chances of spawning NOoSE as 30%
  • Chances of spawning CopBike as 40%
  • Chances of spawning HWP1 as 60%
  • Chances of spawning Stinger as 60%
  • Chances of spawning nstock as 10%
  • Chances of spawning FBI as 10%

...what am I supposed to fill the values in "chances" slots,respectively?

Thanks in advance,cp ;)

Edited by Dhruv

  • Author

To try to alleviate confusion:

There are two things that control chance: overall probability and chances. The pseudocode is this:


if (random() < overallProbability)

    spawn();

spawn() will spawn a car if able (it will *not* spawn if there are more than 5 spawned cars that still exist, or if it can't find a car to despawn in 5 attempts).

The "chances" value controls the chance that a car will spawn, relative to the chance that other cars will spawn. So, if you set one car with 1 chance, and the other with 4, the one with 4 will spawn 4 times as often as the one with 1.

The sum of the probabilities for each car to spawn in a tick is the overall probability. This can't be greater than 1; to prevent spamming, there is at most 1 car spawned per tick.

So, what do you mean by 60% chance? Each tick, there's a 60% chance that HWP1 will spawn?

To try to alleviate confusion:

There are two things that control chance: overall probability and chances. The pseudocode is this:


if (random() < overallProbability)

	spawn();



spawn() will spawn a car if able (it will *not* spawn if there are more than 5 spawned cars that still exist, or if it can't find a car to despawn in 5 attempts).

The "chances" value controls the chance that a car will spawn, relative to the chance that other cars will spawn. So, if you set one car with 1 chance, and the other with 4, the one with 4 will spawn 4 times as often as the one with 1.

The sum of the probabilities for each car to spawn in a tick is the overall probability. This can't be greater than 1; to prevent spamming, there is at most 1 car spawned per tick.

So, what do you mean by 60% chance? Each tick, there's a 60% chance that HWP1 will spawn?

To try to alleviate confusion: There are two things that control chance: overall probability and chances. The pseudocode is this:

spawn() will spawn a car if able (it will *not* spawn if there are more than 5 spawned cars that still exist, or if it can't find a car to despawn in 5 attempts).

The "chances" value controls the chance that a car will spawn, relative to the chance that other cars will spawn. So, if you set one car with 1 chance, and the other with 4, the one with 4 will spawn 4 times as often as the one with 1.

The sum of the probabilities for each car to spawn in a tick is the overall probability. This can't be greater than 1; to prevent spamming, there is at most 1 car spawned per tick.

So, what do you mean by 60% chance? Each tick, there's a 60% chance that HWP1 will spawn?


if (random() < overallProbability)

	spawn();

^Yup.And then I intend to increase the interval.

Okay, so I got it to work, but it behaves odd.

When it spawns a vehicle, this happens:

It does not move...

Picture:

VIHl7.jpg

It spawns it as a target

Picture:

rPARM.jpg

Edited by Intensified

[url=http://www.gtagaming.com/downloads/author/145769]sy10Oxj.png[/url]

CLICKY

CP,I'm having some problems with 0.6

TBoGT police cars are not appearing at all.Even if the stinger appears,it does with civvies spawning in them.

And,yes I have all the cars in cops' popcycle.It was working in 0.5,but isn't working in 0.6 You must fix it ASAP for us.

  • Author

Did you re-enable the TBOGT cars in the INI? The one distributed has them disabled.

@Intensified: The target is when it's spawned as an emergency response with debug mode or with TsbForceSpawn. It adds a blip under all circumstances; it just makes it "enemy" if it's responding (to distinguish).

Hye, cp, just to let you know, I'm getting a lot of "Response" vehicles not using lights and sirens. It seems to mostly be police vehicles (I don't think I've yet seen a speeding Fire or Aid without it being Code 3.) Most of them also drive terribly, but that's most likely the game itself.

Also, I can't seem to turn debug on anymore.

Edited by The Loot

  • Author

The no lights and sirens are emergency vehicles, just not using sirens for some reason. I'm still trying to figure it out myself. As for the debug mode, what happens when you enter it? Is there anything? Can you check for a file SpawnCars.log that is in your main game directory, and see if it was modified when you last turned on debug?

I enabled them myself.

Checked it,again.They're enabled.There's something with the mod only.

Also,as The Loot mentioned,driving is terrible.This happens mostly with them NoOSE girls,but I see them driving their NoOSE cruiser @ high sppeds in streets,only to turn left and ram into a building.And they keep hitting it as if that CVPI will make it come down.Or is it just the way ladies drive? o_O

  • Author

Try "TsbForceSpawn HWY1"; see what happens.

For driving: Enable debug mode, see what kind of blip they have.

Okay okay.I just managed to catch one.The one with blip.It had cops in it.I'm spotting one more across the street but this one has no one in them.Like they do most of the times.Civvies/ghosts driving them.

  • Author

If there is no blip, it's not spawned by the mod. GTA has a bug, where it can periodically spawn police3 and police4 with no passengers or driver (since it's supposed to be MP-only). I have an idea for how to stop the spawns; it'd work similarly to "car exclusion" (stopping cars of a given type that aren't spawned by the mod). That should be the big thing for 0.7 (it will also give a better way to prevent spamming, and, in slightly modified form, could even let you use it in MP without spawning too much traffic [as long as you're OK with all reflections from cars having a beige tint]).

BTW, warning on car exclusion: unless there's a way to tell what's spawned by LCPDFR and what's not, it would be a really bad idea to exclude default police cars (because LCPDFR expects them to spawn). Just checking that you're all OK with that (it would also not exclude cars once your wanted level is high enough that they would spawn that way, so you'd still get SWAT when you have 6 stars). It probably wouldn't be a great idea to despawn, say, police2 in favor of police1, as it could mess with LCPDFR.

Edited by cp702

But it didn't do this previously? I mean in,0.5 everything seemed to be fine.Also,what could be the possible explanation of Policeb and police3,not spawning.I just remembered that HWP_1 is a trailblazer in my case.Is that what you meant when you said TSBForceSpan HWY1? If yes,then I'm sorry but I did not spot any HWP1 (TrailBlazers) in that area.It was just the stingers which I see spawning.Still1 in 10 chance of cops spawning in stingers.Strange thing is,this bug seemed non-existent in 0.5.Or it may be just my game messing up,which seems impossible because I've all the settings right.

Edited by Dhruv

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.