Forum Mod Bakery Docs

Questions about Traffic

Posted in Support
Please login to contribute to the conversation.
[deleted user]
8 yrs ago (Statistics)
Hey guys,

I have a few quick questions about the way traffic works in SHAR.

1. I have a stage in a mission I created that has traffic disabled, to make the stage easier while keeping everything else intact. I was playing this mission, and I failed the stage (because it's still very hard) After I started the mission again (directly from the 'Mission Failed' screen) I found that the traffic was disabled even during the stages before I set it to be. Does anyone know why this happens, and how I might be able to fix it?

2. Is there any way to change what traffic group the level uses on certain missions? I don't mean just setting the amount of cars that appear on screen at a time, I mean setting it so entirely different cars appear.

Thanks a lot to anyone that can answer these!


Do you have "SetMaxTraffic(#)" in your previous stages?

As for 2, I don't know if that's possible since I haven't thought about doing something that.
I believe the Max Traffic you set is set until you set it again. So if you set it to 0 Midway through your mission and restart it without setting it in the first stage it'll stay at 0.

And at this time there is no way to switch the traffic groups at any point. The game internally supports more than one to some degree so it may be possible in the future but atm only group 0 is used.
[deleted user]
8 yrs ago (Statistics)
@Loren Goodwin

I used the command NoTrafficForStage(); to disable traffic. Does that do the same thing as SetMaxTraffic(0)?
@max_power998

Sort of. NoTrafficForStage(); instantly clears all traffic currently on the road, even if it's right in front of you.

For instance, if you're in one stage where you're driving to Moe's House, and the traffic is set to 3 and you can see a car on screen, it'll instantly disappear as soon as you reach the next stage that has NoTrafficForStage(); in it. SetMaxTraffic(0); waits for the last traffic car to despawn on it's own rather than forcefully removing it.

So NoTrafficForStage(); is useful for Street Races where traffic isn't intended at all. SetMaxTraffic(0); is useful if you want traffic to despawn more naturally I guess you could say.
[deleted user]
8 yrs ago (Statistics)
@Kenny Giles

I may just make traffic set to 1 if that's the case because it doesn't really make sense for there to be no traffic in the stage.

Thanks for your help everyone!