Option to make all cars spawn with turretsSolved
I'd like an option for all spawned cars to automatically have max turrets on them, such as roadside cars and cars spawned with /mycar plugin
Do you intend to also allow players to build cars from scratch or reconfigure the modules? If so, do you want the module entities to automatically spawn a turret on them when created this way? In other words, all car modules will always have turrets unless the turret was removed or destroyed, and removing/re-adding the module would respawn the turret.

Do you have any concerns about what players might do with unlimited turrets (such as scrap them) or is that acceptable?

Also curious, are you using any kind of plugin to fill the turrets or do players have to do that?
I'm hoping these things can be configurable in a way that the turrets cannot be spam removed to scrap.
Can you be more specific about what you would like to be able to configure about it? I don't want to implement options that will make the plugin unnecessarily complex that are not used. Designing a plugin properly takes a lot of time so the more info I get from you the better.

So far, I'm thinking of having an option with a percent chance for a turret to spawn on each module. Then you could just set everything to 100% chance for your use case. It would only apply to car spawns, not module spawns.

I was thinking like
Cars spawn with turrets: true
Number of turrets to spawn (if number is higher than car has modules, max turrets will apply: 4
Are turrets removable from modules?: false

5f1792699e67b.jpg WhiteThunder
So far, I'm thinking of having an option with a percent chance for a turret to spawn on each module. Then you could just set everything to 100% chance for your use case. It would only apply to car spawns, not module spawns.

That actually sounds perfect.

Thank you

I have implemented this feature in a branch. Please test it out and provide feedback.
https://github.com/WheteThunger/CarTurrets/tree/develop

There is now a EnableTurretPickup configuration option which you can set to false to disallow picking up car turrets, regardless of whether they were spawned automatically or manually added by a player. Also added compatibility with the popular RemoverTool plugin so players can't remove them that way either.

There is now a SpawnWithCar configuration section like below.

  "SpawnWithCar": {
    "NaturalCarSpawns": {
      "Enabled": true
    },
    "OtherCarSpawns": {
      "Enabled": true,
      "RequirePermission": false
    },
    "TurretChanceByModule": {
      "vehicle.1mod.cockpit": 100,
      "vehicle.1mod.cockpit.armored": 100,
      "vehicle.1mod.cockpit.with.engine": 100,
      "vehicle.1mod.engine": 100,
      "vehicle.1mod.flatbed": 100,
      "vehicle.1mod.passengers.armored": 100,
      "vehicle.1mod.rear.seats": 100,
      "vehicle.1mod.storage": 100,
      "vehicle.1mod.taxi": 100,
      "vehicle.2mod.flatbed": 100,
      "vehicle.2mod.fuel.tank": 100,
      "vehicle.2mod.passengers": 100
    }
  },​

The only issue with this design is that if a player removes a module from a car at a lift, it will no longer have a turret. I experimented with an alternate design that makes modules automatically spawn with a turret, but there were compatibility issues with Turret Loadouts since it's not easy to determine who placed the module, so I was just using the car owner which could result in some interesting behavior such as one player stealing a car and placing a turret which automatically authorizes the owner and turns on to kill the thief, so I just decided to leave that out for now until I decide if/how I want to solve that.

I didn't hear back from you about how this was working, so I've gone ahead and released it in the latest update: v1.1.0.

Locked automatically