[request] Spawning vehicles - damaged - db_spawn_vehicles

dagg929

Well-Known Member
Does anyone have a way here to spawn vehicles fully screwed up within reason? I've changed db_spawn_vehicles.pl
# Generate parts damage
my $health = "[" . join(',', map { (sprintf(rand(), "%.3f") > 0.2) ? "[\"$_\",1]" : () } split(/,/, $vehicle->{parts})) . "]";

The >0.2 influences how much/if at all stuff gets damaged. Problem is when it sets motor to 1, which means the vehicle would be blown up-- the stuff spawning is is fixed fully, or damaged entirely based on the damage entry within the db.

basically, anyone know/have an idea on how to either make all vehicles screwed up beyond belief for fresh spawns, or know how to edit:
# Generate parts damage
my $health = "[" . join(',', map { (sprintf(rand(), "%.3f") > 0.2) ? "[\"$_\",1]" : () } split(/,/, $vehicle->{parts})) . "]";

So that it runs that, but will set motor=.8 maximum as a part of it.

Any ideas here?
 
Back
Top