Closed krzychu124 closed 2 years ago
Will this affect Vehicle Wealthizer mod by @klyte45
Will this affect Vehicle Wealthizer mod by @klyte45
@aubergine10 if source in github repo is not outdated then it's broken since the release date of Harmony migration.
Can this go in to 11.6.5.2? If so pls add milestone in sidebar.
Can this go in to 11.6.5.2? If so pls add milestone in sidebar.
yup, just review and test. I did a lot of tests and debugging. Looks good when running alone.
I also noticed few weird issues while running it and experimenting with bike lanes (cim walked to the intersection closest to position where he parked vehicle and started spamming pathfinding looking for CarPathToParkedVehicle literally 10m away) - need recheck (99.9999% because of shared Car/Bike lane - he thought he is in vehicle while standing on Car/Bike lane 😂)
Tourists can spawn electric cars same as in vanilla.
Were tourists able to spawn electric cars prior to this PR?
Tourists can spawn electric cars same as in vanilla.
Were tourists able to spawn electric cars prior to this PR?
Hmm, they couldn't if ParkingAI
was active and was not a DummyTourist
. Citizens moving-in also couldn't spawn electric car at outside connection, so probably only when student grew up and moved out to ElectricCars
district from family house...
One more review @kvakvs, @chameleon-tbn, @kianzarrin?
I improved detection of wrong parked vehicle type in some edge cases. Now they should always use electric car if forced by district policy.
Heh, I thought about possible null vehicle info and slightly refactored behavior for swapping vehicle to eliminate chance of throwing away currently parked vehicle even if it couldn't swap it because of no vehicle info or no free parked vehicle units. The user will still see parked cars in areas where district has forced electric cars - I hope they will figure out quickly that electric car assets are required to make the policy work 😅 (better than despawning "wrong" cars or returning null info even if cim had parked vehicle - could cause other weird issues)
You can test again if you want. I'll merge it later in the evening (it's ~4am here xD).
Is it possible to use colour of existing parked vehicle for the swapped vehicle? Sudden colour changes are going to be much more noticeable than shape changes (eg. if white car turns red, vs. red car changes shape).
Is it possible to use colour of existing parked vehicle for the swapped vehicle? Sudden colour changes are going to be much more noticeable than shape changes (eg. if white car turns red, vs. red car changes shape).
How? What's the probability of generating vehicle with the same/similar color? I think that each vanilla electric car has completely different color variants, you can change it in AVO and we are talking only about swapping cars when you drawn district or added policy and cim already has some parked car assigned.
How?
Ah, I just checked the code and it's doing GetColor()
every frame; I had assumed that would happen once and be stored per [parked] vehicle. The color index is based on pseudo-random value based on vehicleId
to ensure color remains same per instance.
Heh, no idea how those colors are selected and somehow retained on switches between parked and moving. Might be some magic in randomizer but... it uses SimulationManager randomizer so results are pseudo random compared to initializing Randomizer seed with vehicle ID and taking first value(will return always the same).
Anyways... merging :)
Fixes #1527
ElectricCars
policy (force use of electric vehicles, requiresGreen Cities DLC
) has parked vehicle and tries to use it - swap parked vehicle with electric,Update:
Something I found while debugging
ParkingAI
:ExtCitizenInstanceManager.IsAtOutsideConnection()
, prevent trying to spawn parked vehicle at outside connection road node - citizen is moving in or leaving the map (wastes time, always fails because ofParkingAI
requirements for valid parking position)VehicleInfo
only if it can actually be spawned