Immersive Vehicles (Formerly Transport Simulator)

Immersive Vehicles (Formerly Transport Simulator)

5M Downloads

`hookupVariables` cannot be used in VMs

DrprofLuigi opened this issue · 5 comments

commented

On trailers, hookupVariables cannot be used in VMs.

For example I have a basic VM thatapplies the p_brake lever when either t_brake or !connection_1_1_connected is 1.

		{
			"variable": "p_brake",
			"animations": [
				{
					"animationType": "translation",
					"variable": "t_brake",
					"axis": [0, 0, 1]
				},
				{
					"animationType": "translation",
					"variable": "!connection_1_1_connected",
					"axis": [0, 1, 0]
				}
			],
			"minValue": 0,
			"maxValue": 1
		}

But because t_brake is pulled from the towing truck via hookupVariables, it does not effect this VM.

This also applies to subParts. If a subPart references the brake in animations, lightObjects, etc. it works fine. However when that subpart tries to use brake in a VM, it doesn't work.

For UNU specifically, this also prevents animated suspension from being able to activate.

commented

Addressed in 22.18.0.

commented

This may actually be due to VMs not working on trailers period.

I have two gauges on my tank trailers. One simply references a part variable, and the other does math with VMs. The latter does not work when the trailer is attached to a vehicle, but it does when it is not connected.

commented

Also needs CVs done like the other bug. Not touching variables till that beta is tested.

commented

This is solved by swapping the VM order:

		{
			"variable": "p_brake",
			"animations": [
				{
					"animationType": "translation",
					"variable": "!connection_1_1_connected",
					"axis": [0, 0, 1]
				},
				{
					"animationType": "translation",
					"variable": "t_brake",
					"axis": [0, 1, 0]
				}
			],
			"minValue": 0,
			"maxValue": 1
		}

The other issue of axle animations not working is also fixed by using the vehicle_ prefix.

commented

It looks like the main issue of VMs not accepting hookupVariables seems to be holding true.

The trailer has the following VMÖ

		{
			"variable": "p_brake",
			"animations": [
				{
					"animationType": "translation",
					"variable": "!connection_1_1_connected",
					"axis": [0, 0, 1]
				},
				{
					"animationType": "translation",
					"variable": "t_brake",
					"axis": [0, 1, 0]
				}
			],
			"minValue": 0,
			"maxValue": 1
		}

When the trailer is disconnected, the p_brake is properly VM'd by connection_1_1_connected as seen by the brakes animating:
image

When the t_brake is applied in the truck, the trailer properly receives the variable:
image

But the brakes no longer animate (when the trailer is connected), indicating the VM is not receiving the updated t_brake value:
image