Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently pristine parts on freshly spawned vehicles #931

Open
LinusLeonard opened this issue Jan 9, 2018 · 2 comments
Open

Consistently pristine parts on freshly spawned vehicles #931

LinusLeonard opened this issue Jan 9, 2018 · 2 comments

Comments

@LinusLeonard
Copy link

LinusLeonard commented Jan 9, 2018

The vehicle_hitpoints table doesn't seem to correspond to the parts that are actually repairable on most vehicles, which means some of the parts (for instance windscreen glass, spare/middle wheels, and "sklo predni" which I believe is RGlass and LGlass) are always pristine after randomizeVehicleHitpoints is run.

For instance, running select * from object_data where hitpoints like "%glass%" on a server where all vehicles are freshly spawned seems to yield actual glass hitpoints (and thereby usually broken glass) only for BAF Offroads (W and D), Landrovers (CZ_EP1 and TK_CIV_EP1), the Offroad_DSHKM_INS, and the AH6X_DZ because those have a Hitpoints ID in vehicle_spawns corresponding to ID in vehicle_hitpoints that has glass hitpoints (ID 4, 5, 6). The rest of the vehicles have pristine glass out of the box.

Hitpoints are updated when getting in as driver. For instance, see this untouched freshly spawned Ural_TK_CIV_EP1:

[["karoserie",0.9180],["motor",0.7854],["palivo",0.6503],["wheel_1_1_steering",0.7909],["wheel_1_2_steering",0.8525],["wheel_2_1_steering",0.8899],["wheel_2_2_steering",0.8920]]

After I enter as driver:
[["glass1",0],["glass2",0],["glass3",0],["glass4",0],["wheel_1_1_steering",0.791],["wheel_2_1_steering",0.89],["wheel_1_4_steering",0],["wheel_2_4_steering",0],["wheel_1_3_steering",0],["wheel_2_3_steering",0],["wheel_1_2_steering",0.853],["wheel_2_2_steering",0.892],["motor",0.785],["sklo predni P",0],["sklo predni L",0],["karoserie",0.918],["palivo",0.65]]

That's 6 pristine glass (1 through 4 + sklo prednis) and 4 pristine wheels(1_4, 2_4, 1_3, 2_3), ripe for the taking!

As far as I can tell, this has been the case since the vehicle_hitpoints table were introduced in 1.8.

I can live with the pristine wheels since they are so hard to find in industrial areas. The only thing that's bugging me is the glass because it doesn't look right when vehicles with hull like swiss cheese have 100% pristine glass. :)

Edit: Looking even more closely, it seems that vehicles that have been "touched" by getting in as driver gets more parts written to the database than is actually needed. This is an ATV_US_EP1:

[["karoserie",0.68],["motor",0.769],["palivo",0.728],["wheel_1_1_steering",0.864],["wheel_1_2_steering",0.753],["wheel_2_1_steering",0.972],["wheel_2_2_steering",0.801],["sklo predni P",0],["sklo predni L",0],["wheel_1_4_steering",0],["wheel_2_4_steering",0],["wheel_1_3_steering",0],["wheel_2_3_steering",0],["glass1",0],["glass2",0],["glass3",0],["glass4",0]]

Lots of pristine glass and wheels on that ATV. They can't be salvaged in-game though, fortunately, and the vehicle loads fine at startup it seems. This should imply that in order to get at least some broken glass and spare wheels on most vehicles, one simply has to change the Hitpoints ID in vehicle_spawns from 1 to 5 for military vehicles and trucks/busses, and from 1 to 6 for simple civilian four wheeled vehicles (since ID 5 in vehicle_hitpoints has extra wheels which are usually visible on military vehicles, whereas ID 6 only have four wheels).

@LinusLeonard
Copy link
Author

Got some strange behavior with the middle wheels of the urals when using ID 5 (double MW entries ingame, and couldn't salvage MW even though I put a pristine wheel on them first). So I left the non-glass parts alone since I'm not too bothered with it.

I ended up making a new definition in vehicle_hitpoints. Basically made a copy of all rows with ID 1 and added glass and sklo predni, like so:

insert into vehicle_hitpoints values
(7,'palivo',0.6000000000,0.8000000000),
(7,'motor',0.6000000000,0.8000000000),
(7,'karoserie',0.6000000000,1.0000000000),
(7,'wheel_1_1_steering',0.6000000000,1.0000000000),
(7,'wheel_1_2_steering',0.6000000000,1.0000000000),
(7,'wheel_2_1_steering',0.6000000000,1.0000000000),
(7,'wheel_2_2_steering',0.6000000000,1.0000000000),
(7,'glass1',0.6000000000,1.0000000000),
(7,'glass2',0.6000000000,1.0000000000),
(7,'glass3',0.6000000000,1.0000000000),
(7,'glass4',0.6000000000,1.0000000000),
(7,'sklo predni P',0.6000000000,1.0000000000),
(7,'sklo predni L',0.6000000000,1.0000000000);

Then I replaced ID 1 with ID 7 in vehicle_spawns:

update vehicle_spawns set Hitpoints=7 where Hitpoints=1;

This gives all cars broken glass when freshly spawned, and you can't salvage any of the glass since it's broken (which is what I want).

Also noted that most helicopters had pristine glass because definition with ID 3 in vehicle_hitpoints doesn't contain glass. Switching to ID 4 which is used by AH6X_DZ results in non-pristine glass being added, but also got a missile entry on Huey helicopters that shouldn't have that part (AFAIK at least). Ended up doing something similar like above for helicopters, i.e. made a copy of all rows with ID 3 and added glass and sklo predni:

insert into vehicle_hitpoints values
(8,'motor',0.6000000000,0.8000000000),
(8,'elektronika',0.6000000000,1.0000000000),
(8,'mala vrtule',0.6000000000,1.0000000000),
(8,'velka vrtule',0.6000000000,1.0000000000),
(8,'glass1',0.6000000000,1.0000000000),
(8,'glass2',0.6000000000,1.0000000000),
(8,'glass3',0.6000000000,1.0000000000),
(8,'glass4',0.6000000000,1.0000000000),
(8,'glass5',0.6000000000,1.0000000000),
(8,'glass6',0.6000000000,1.0000000000),
(8,'sklo predni P',0.6000000000,1.0000000000),
(8,'sklo predni L',0.6000000000,1.0000000000);

... and then replaced ID 3 with ID 8:

update vehicle_spawns set Hitpoints=8 where Hitpoints=3;

Will test some more, but at least the glass get random hitpoint values now, and subsequently all vehicles looks like they've been through some heavy shit. :)

@R4Z0R49
Copy link
Member

R4Z0R49 commented Jan 11, 2018

Thanks it does need a little love we only added base line systems to get the system out and running.

Ural's would be a good one to go over. If your willing to go over all the vehicles can you start with ID 20 leave 1-19 just for future changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants