Skip to content

Commit

Permalink
Small shovel position fixes and added missing high dump shovels to ve…
Browse files Browse the repository at this point in the history
…hicle config
  • Loading branch information
schwiti6190 committed Oct 19, 2023
1 parent f43252e commit 77eebac
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
29 changes: 29 additions & 0 deletions config/VehicleConfigurations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ You can define the following custom settings:
<Vehicle name="wheelLoaderShovel.xml"
shovelMovingToolIx = "1"
/>
<Vehicle name="overtippingBucket.xml"
shovelMovingToolIx = "1"
/>

<!--[DLC]-->

Expand Down Expand Up @@ -549,4 +552,30 @@ You can define the following custom settings:
disablePipeMovingToolCorrection = "true"
unloadOffsetX = "-3.56"
/>

<!--Mod: FS22_lizardHTB6000-->
<Vehicle name="HTB6000.xml"
shovelMovingToolIx = "1"
/>

<!--Mod: FS22_Liebherr_Xpower-->
<Vehicle name="highTipShovel.xml"
shovelMovingToolIx = "1"
/>

<!--Mod: FS22_bresselUndLadeHighTipShovelPack-->
<Vehicle name="bresselUndLadeL67.xml"
shovelMovingToolIx = "1"
/>

<!--Mod: FS22_bresselUndLadeHighTipShovelPack-->
<Vehicle name="bresselUndLadeL71.xml"
shovelMovingToolIx = "1"
/>

<!--Mod: FS22_bresselUndLadeHighTipShovelPack-->
<Vehicle name="bresselUndLadeL71.xml"
shovelMovingToolIx = "1"
/>

</VehicleConfigurations>
19 changes: 19 additions & 0 deletions scripts/ai/ImplementUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,25 @@ function ImplementUtil.stopMovingTool(implement, tool)
local spec = implement.spec_cylindered
implement:raiseDirtyFlags(tool.dirtyFlag)
implement:raiseDirtyFlags(spec.cylinderedDirtyFlag)
local detachLock = spec.detachLockNodes and spec.detachLockNodes[tool]
if detachLock then
--- Fix shovel detach, as shovel might have angle requirements for detaching.
--- These limits are implemented without a hysteresis ...
--- So we need to force set the limit, if a difference of less than 1 degree was found.
local node = tool.node
local rot = {
getRotation(node)
}
if detachLock.detachingRotMinLimit ~=nil and
math.abs(MathUtil.getAngleDifference(detachLock.detachingRotMinLimit, rot[tool.rotationAxis])) < math.pi/180 then
Cylindered.setAbsoluteToolRotation(implement, tool, detachLock.detachingRotMinLimit)
end
if detachLock.detachingRotMaxLimit ~= nil and
math.abs(MathUtil.getAngleDifference(detachLock.detachingRotMaxLimit, rot[tool.rotationAxis])) < math.pi/180 then
Cylindered.setAbsoluteToolRotation(implement, tool, detachLock.detachingRotMaxLimit)
end
end

end

function ImplementUtil.getLevelerNode(object)
Expand Down
5 changes: 5 additions & 0 deletions scripts/specializations/CpShovelPositions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function CpShovelPositions.registerEventListeners(vehicleType)
SpecializationUtil.registerEventListener(vehicleType, "onDraw", CpShovelPositions)
SpecializationUtil.registerEventListener(vehicleType, "onUpdateTick", CpShovelPositions)
SpecializationUtil.registerEventListener(vehicleType, "onPostAttach", CpShovelPositions)
SpecializationUtil.registerEventListener(vehicleType, "onPreDetach", CpShovelPositions)
end

function CpShovelPositions.registerFunctions(vehicleType)
Expand Down Expand Up @@ -112,6 +113,10 @@ function CpShovelPositions:onPostAttach()
end
end

function CpShovelPositions:onPreDetach()
self:cpResetShovelState()
end

function CpShovelPositions:onDraw()

end
Expand Down

0 comments on commit 77eebac

Please sign in to comment.