Manually define vehicle bounding boxes
Posted: 01 Jul 2021 06:03
I'm using extra turning angles by splitting each vehicle into several parts and then use the other_veh_curv_info variable to get the correct angle. This works great. However, I have one issue:
Let's say I have an engine with the length of 8. That will also generate a bounding box with the length of 8. But in my case, I split this engine into 8 different parts, which means that I get 8 different bounding boxes, that all have the length of 1. I figurered that my best bet would be to add the sprites to one of the parts in the middle, but the bounding box is still an issue, as seen in the picture:
There are a couple of solutions. I could slice all my sprites into 8 parts. That would work great, exept for slopes, but perhaps it's possible to get around that with the other_veh_z_offset callback? But the easiest would be if it was possible to define the bounding box manually, so that I could make may midle sprite cover the "dummy" sprites as well. If this is not possible, what would you say is the best solution to my problem?
I have another question that might be off-topic, but anyway...
- I'm using the animation_counter variable to get smoother animations on my locomotives. Only problem is that the vehicle_is_stopped callback doesn't seem to fire when I expect it, which means that the animations keep playing even when the engine is stopped. Has anyone encountered this issue before?
Let's say I have an engine with the length of 8. That will also generate a bounding box with the length of 8. But in my case, I split this engine into 8 different parts, which means that I get 8 different bounding boxes, that all have the length of 1. I figurered that my best bet would be to add the sprites to one of the parts in the middle, but the bounding box is still an issue, as seen in the picture:
There are a couple of solutions. I could slice all my sprites into 8 parts. That would work great, exept for slopes, but perhaps it's possible to get around that with the other_veh_z_offset callback? But the easiest would be if it was possible to define the bounding box manually, so that I could make may midle sprite cover the "dummy" sprites as well. If this is not possible, what would you say is the best solution to my problem?
I have another question that might be off-topic, but anyway...
- I'm using the animation_counter variable to get smoother animations on my locomotives. Only problem is that the vehicle_is_stopped callback doesn't seem to fire when I expect it, which means that the animations keep playing even when the engine is stopped. Has anyone encountered this issue before?