in0finite / SanAndreasUnity

Open source reimplementation of GTA San Andreas game engine in Unity
https://discord.gg/p6jjud5
MIT License
2.13k stars 352 forks source link

Textures of some vehicles flickering #86

Open CrosRoad95 opened 4 years ago

CrosRoad95 commented 4 years ago

as on image

MULE: image

BENSON: image

atirut-w commented 2 years ago

I think this might be caused by loading all the signs and them being in the exact same place.

GoverLabs commented 2 years ago

Hello I've take a look at the issue. Seems it is caused because no "extra" was chosen for vehicle. E.g. on the MULE there are 4 extras for chasis, and one random should be choosen. It works fine when only one of them is enabled. image

Another example is STALLION, wich have several "extra" for its roof, it also have some precondition, how to choose the correct one. Preconditions are described in Comprules in vehicles.ide. image

https://gtamods.com/wiki/CARS_(IDE_Section)#Comprules

I can investigate it more and fix the issue like my "first simple one".

in0finite commented 2 years ago

@GoverLabs that was very well investigated 👍 I wasn't even aware of these "extras". Yeah, this seems like a good issue to start with.

Having a look at the wiki page, I found there is a bit more to it than described. They have a link at bottom which leads to: https://gtaforums.com/topic/530575-tutcomponent-rules/ . There is more detailed explanation how it works.

We already have CARS ide section parsed, it's in VehicleDef.cs. So basically, all we need to do is, when creating a vehicle, check the VehicleDef.CompRules and enable corresponding "extra" object. This would probably be done in Vehicle.Initialize().

You can also send me PM in discord for quicker response.