Jump to content

Reduce vehicle spawning around player via API


Captain Victory

Recommended Posts

Hi everyone,

 

Is there a way to reduce vehicle spawning around the player via the API? Something similar to "Chase.TrafficDensityMultiplier" in lspdfr.ini which sets the traffic density multiplier during chases.

 

I would like to create a plugin that lets me change traffic density at will for those times when you just don't want much traffic around you during certain callout situations. The immersion and realism goes down the drain when you're at an accident scene for example and the coroner or ambulance just picked up a body and then proceeds to crash into several vehicles before finally being able to get on its way 😛

 

Or maybe there is a trainer command that can achieve the same result?

Link to comment
Share on other sites

  • Management Team

This is not exposed via the API, but you can look into the density natives or model budget (very effective but less granular).

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

On 1/15/2022 at 9:43 AM, LMS said:

This is not exposed via the API, but you can look into the density natives or model budget (very effective but less granular).

Thank you very much for that information!

 

Would you be willing to give me some tips as to how I would use either one of these options? I have found:

SET_VEHICLE_DENSITY_MULTIPLIER_THIS_FRAME(float multiplier)

and:

SET_VEHICLE_POPULATION_BUDGET(int budget)

Those two seem to be the most likely options but I must admit that I'm not sure how to use them exactly.

 

To be more clear, I know C# (not on a professional level though) so I am familiar with calling functions etc...I'm just not sure how to code this as a .dll for use with LSPDFR.

 

I have gone through the basic callout creation tutorial but this is obviously not going to be a callout plugin.

 

Thank you again!

Link to comment
Share on other sites

  • Management Team

If you do not want to make this a callout plugin, you should look into creating RAGE Plugin Hook plugins. It comes with a plethora of examples and documentation to help get you started. It is also the same framework LSPDFR uses.

 

For those two natives, the first - as evident by the name - needs to be called per frame (that is, each tick) - in order to have an effect. Common ranges are 0.0 - 1.0 (default). The second native I think takes four different levels (might be more) where 0 indicates no traffic at all and I think 3 is the default setting. This is a permanent change and only needs to be called once.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
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.

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.



×
×
  • Create New...