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

Implemented extra components selection for vehicles #135

Merged
merged 4 commits into from
Jul 17, 2022

Conversation

GoverLabs
Copy link
Contributor

@GoverLabs GoverLabs commented Jul 17, 2022

As was noted at #86 , some vehicles have extra componets, which are being selected by a few different rules. Since the original impementations of those tricky rules used some bit operations, I used this a reversed implementation as a cheat-sheet (see ::ChooseComponent method at gta_reversed

Now it works fine, and selects extra compontents according to rules explained in the topic: https://gtaforums.com/topic/530575-tutcomponent-rules/
The only exception is that rules should also consider current weather, which is not currenty implemented in the project.

As a possible improvement int can be replaced by bytes in my union-like struct, to save some memory. Unfortunately, I found no obvious way to work with separate 4 bits in C#, only with bytes, which are not really useful to parse values like 2ff0

…eDef.CompRules

fix flickering textures on vehicles, containing extra components in0finite#86
@GoverLabs
Copy link
Contributor Author

Fixed issues, specified at review

@in0finite
Copy link
Owner

I just tested it and I think it still doesn't work correctly. For some vehicles (MULE, BENSON, MESAA, SUPERGT), extras are always disabled.

However, I will merge this PR now, and we can work on this later ...

@in0finite in0finite merged commit 776ea7c into in0finite:dev Jul 17, 2022
@GoverLabs
Copy link
Contributor Author

I found one more copy-paste mistake, firstExtraIdx is being assigned twice in SelectExtras(). Sorry for that.
And yes, some vehicles really have disabled extras, and their CompRules are 0 in vehicles.ide. I will try to find out more, but until your comment I expected there should be a non-zero value for extra selection.

@in0finite
Copy link
Owner

Alright, if you fix the issue, feel free to open another PR :)

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

Successfully merging this pull request may close these issues.

2 participants