Jump to content

Sam's Car and Truck Respawner - A20, Server-Side


saminal
 Share

Recommended Posts

I decided with the extra options for vehicles in the game I'd like a respawner mod that would be more randomised. This mod will allow cars, army trucks, service trucks, ambulances and buses to respawn to a similar vehicle after a few hours.

  • Cars will respawn to a random car (with a random stage of damage)
  • Army trucks (open or closed) will respawn to a randomly open or closed army truck
  • Service trucks and ambulances are grouped together to respawn each other
  • Big buses will respawn big buses, the short school bus will respawn itself - to avoid respawning through parts of buildings.

 

Download here - file will be updated automatically as the mod is updated.

 

before.jpg.dca5c0d21f1fd52a8df59e7e3e0f9fc7.jpg

 

after.jpg.e8f1bc368439e1de83434e081c5045f7.jpg

Edited by saminal
clarification of server side friendliness (see edit history)
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • saminal changed the title to Sam's Car and Truck Respawner - A20, Server-Side
  • 4 weeks later...

Hallo Saminal,

 

I am still quite the tyro regarding xml, and coding in general, so I apologize that what follows is obvious to a professional or hobbyist software engineer. I am far more comfortable throwing lead and launching 227mm rockets, and even that was 30 years ago.

 

Which attribute do we alter to extend the amount of time before respawn occurs?  I found prob=".3" in blockplaceholders.xml and that seems to be what I would want to change, but I wish to make sure prior to committing to any edits.

 

example on Line 13

Quote

    <block name="cntBusSchool" prob=".3"/>

 

If prob ("probability" from what I can glean) is the attribute I should change, does the ".3" represent the probability of the block spawning at any time during an in-game day?

 

Best regards,

mprojekt

 

Link to comment
Share on other sites

2 hours ago, mprojekt said:

Which attribute do we alter to extend the amount of time before respawn occurs?

 

In the blocks.xml you will see a number of blocks called "RandomRespawner". On each of these there is a property "PlantGrowing.GrowthRate", for example line 97. This value is in minutes, so if you'd like to extend it to a week, assuming you have 1 hour days, you would set it to 420.

 

Do this on each of the RandonRespawner blocks :)

  • Like 1
Link to comment
Share on other sites

6 hours ago, saminal said:

 

In the blocks.xml you will see a number of blocks called "RandomRespawner". On each of these there is a property "PlantGrowing.GrowthRate", for example line 97. This value is in minutes, so if you'd like to extend it to a week, assuming you have 1 hour days, you would set it to 420.

 

Do this on each of the RandonRespawner blocks :)

 

Oho? I was looking at the wrong variable or attribute, indeed the wrong file, all along! Thank you for the correction and the advice! 😊

 

Link to comment
Share on other sites

  • 1 month later...
6 hours ago, Real_ASP_Sy said:

Hi sorry to just drop in, but I have a quick question.  Can this mod be added to a server already active, or does it need to be applied to a fresh world?

I have a lot of players that don't wanna lose their progress!

TIA

 

It can be added to an existing world without causing errors, but any car wrecks or trucks that already exist in the world will fail to respawn as they were generated before the extra code went in.

 

Only wrecks and trucks that come from POI resets or manually placing them will respawn going forward.

Link to comment
Share on other sites

On 2/12/2022 at 8:35 PM, saminal said:

 

It can be added to an existing world without causing errors, but any car wrecks or trucks that already exist in the world will fail to respawn as they were generated before the extra code went in.

 

Only wrecks and trucks that come from POI resets or manually placing them will respawn going forward.

Thank you for getting back to me, much appreciated. :)

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
3 minutes ago, tanman said:

Quick question.  If take a vehicle right down and want to build there, will it still respawn?

Yes, when you dismantle it you'll see a snowy shrub left behind. If you remove the block underneath the shrub, it'll fall and then you can build over it without worrying about the vehicle coming back.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...