Tractor - broken trigger - trigger availability cycles rapidly [FS2015]

Your forum for all discussions around Modding.
CptTractor
Posts: 18
Joined: Tue Oct 19, 2021 2:13 pm

Tractor - broken trigger - trigger availability cycles rapidly [FS2015]

Post by CptTractor »

Mod: I'm unable to refuel the tractor in this mod and interacting with trigger points is extremely difficult. When the tractor enters any trigger area (fueling, attachable wheel crate, unload, etc. )the trigger interaction switches on and off rapidly (60+ Hz) seen in the info panel in the upper left "Refuel - R". Pressing R at a fueling point has no effect unless you try and rapidly press R in which case I can get a liter every now and then.

There are 2 separate sets of scripts, BuyTwinWheels and toggleanimatedparts. I "turned off" both by renaming buytwinwheels so it errors, failing to load, and then commented out the references to toggleanimated parts in the moddesc and vehicle xml.

Seems like it's the tractor itself. I updated the schema to use the default for 2015.

The major difference I see is that most stock tractors have separate collision meshes col1-5 and this tractor's collision meshes seem to be integrated with the topmost parent. I'm trying to compare the bitmap collision settings but it's not clear that there's a 1:1 comparison to be made without the col meshes.
CptTractor
Posts: 18
Joined: Tue Oct 19, 2021 2:13 pm

Re: Tractor - broken trigger - trigger availability cycles rapidly [FS2015]

Post by CptTractor »

Problem: Trigger point interactions including refueling, when triggered, are rapidly flashing in the info menu and impossible to interact with.
The meshes of buildings and environment are oscillating/flickering when entered in the model and viewing the F5 debug overlay.

Refueling requires the overlap of the tractor's collision meshes with the collision mesh of the trigger point. For the fuel tank this is a large rectangle extending a few meters around the tank.

This morning I randomly found a Youtube video which stated:
1. All collision meshes need to not be scaled, i.e. scale at x:1 y:1 z:1. Front wheel collision meshes were scaled down. Scaled them up, made my fixes below, and scaled them back down, no issues. This may or may not be true.

2. All child rigid bodies need to have the same collision mesh as the parent body. Many conversions have collision mask children values of "ff" instead of the standard "202042".

My model had two sets of decorative lights with rigid bodies of "ff". I removed the rigid body property from each set instead of changing the value and checked the values of other rigid bodies.

My deduction:
3. All default 2015 tractors have collision parts colpart1...colpart5 starting with a mesh for the main body and then four more, one for each wheel. The respective wheel meshes do not move with the wheels.

Using the F5 debug overlay I discovered the front wheel collision meshes were rotating with the wheels on this model. The refuel prompt appeared and began flashing immediately as soon as the wheel collision intersected the refuel mesh.

I moved the collision meshes from being children of the wheels to being direct children of the main body and repositioned them. This stopped them from moving as if they were no longer defined as subparts of the wheels. I can now refuel without issue and have no more flickering in any scenario.

Since the front wheel collision meshes were children of the front wheels and moving, my guess is that their positions and their trigger eligibility were being recalculated at the game's tick-rate.
Post Reply