Hi !
As a start for my "developer/modder carreer", i'm trying to modify existing mods to fit my needs, and I'm currently having a problem with a little sweeper for animal foods ...
No matter what I clean (wheat, grass, pigfdood ...) the sweeper contains MANURE. After looking a bit in the LUA script, I found this :
spec.workAreaParameters.forcedFillType = FillType.MANURE
Could someone tell me what to modify here so that the sweeper will contain what I'm cleaning (wheat or grass etc ...) ?
Thanks in advance !
LePousson
A little help for a beginner ...
10 posts
Page 1 of 1
Re: A little help for a beginner ...
Hi,
digging into existing mods and changing them to your needs is a very good approach. Keep it up!
I think you'd need to add logic to the script to read what you sweep (what the workArea picks up) and change the value of spec.workAreaParameters.forcedFillType accordingly.
Or maybe just drop the logic that changes the fill type to manure? This way, the sweeper should contain what it picks up
digging into existing mods and changing them to your needs is a very good approach. Keep it up!
I think you'd need to add logic to the script to read what you sweep (what the workArea picks up) and change the value of spec.workAreaParameters.forcedFillType accordingly.
Or maybe just drop the logic that changes the fill type to manure? This way, the sweeper should contain what it picks up
Re: A little help for a beginner ...
Thanks for the kind words, I really appreciate :=)s8080t wrote: ↑Thu Jul 08, 2021 9:06 pm Hi,
digging into existing mods and changing them to your needs is a very good approach. Keep it up!
I think you'd need to add logic to the script to read what you sweep (what the workArea picks up) and change the value of spec.workAreaParameters.forcedFillType accordingly.
Or maybe just drop the logic that changes the fill type to manure? This way, the sweeper should contain what it picks up
As I just started a few days ago to dig into the LUA scripts, I don't have (yet) the necessary knowledge to be able to know what to do exactly
What would you do if you were me ?
LePousson
Re: A little help for a beginner ...
Can you provide a link to that mod or post the lua in question?
First idea would be to remove/comment this section so that the fill type will not enforced any longer.
But we need the full lua to check if this can be done without causing problems.
First idea would be to remove/comment this section so that the fill type will not enforced any longer.
But we need the full lua to check if this can be done without causing problems.
Playing on PC - Win10
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
Re: A little help for a beginner ...
The mod is this one : https://www.farming-simulator.com/mod.p ... tle=fs2019
If someone can help, I'd really appreciate
LePousson
Re: A little help for a beginner ...
Anyone can help please ??
Re: A little help for a beginner ...
If I get the script correctly, then the fillType is not converted to manure by default but only when it's an unsupported fillType.
As supported fillType, the mod-XML states the bulk category. You could add anything else in there, of course.
As supported fillType, the mod-XML states the bulk category. You could add anything else in there, of course.
Code: Select all
spec.workAreaParameters.forcedFillType = FillType.MANURE
...
local supportedFillTypes = self:getFillUnitSupportedFillTypes(spec.fillUnitIndex)
if supportedFillTypes ~= nil then
for fillType, state in pairs(supportedFillTypes) do
if state then
local liters = -DensityMapHeightUtil.tipToGroundAroundLine(self, -math.huge, fillType, lsx, lsy, lsz, lex, ley, lez, lineRadius, nil, nil, false, nil)
if liters > 0 then
if fillType ~= spec.workAreaParameters.forcedFillType then
liters = liters * SweeperBrush.PRODUCT_LOSS_MULTIPLIER
end
pickupLiters = pickupLiters + liters
end
end
end
end
Re: A little help for a beginner ...
Even when sweep WHEAT, GRASS or PIGFOOD, it converts it to MANURE. I can't understand why it behavesw like that :'(
Any idea ?
LePousson
Re: A little help for a beginner ...
What about completely ignoring the script?
Just delete the respective entry in the modDesc.xml changing this:
to this:
This should enable it to work as you want it to work.
Just delete the respective entry in the modDesc.xml changing this:
Code: Select all
<specializations>
<specialization name="sweeperBrush" className="SweeperBrush" filename="SweeperBrush.lua"/>
</specializations>
<vehicleTypes>
<type name="tuchelSweep" className="Vehicle" parent="implement" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="fillUnit"/>
<specialization name="fillVolume"/>
<specialization name="dischargeable"/>
<specialization name="groundReference"/>
<specialization name="workArea"/>
<specialization name="workParticles"/>
<specialization name="turnOnVehicle"/>
<specialization name="dynamicMountAttacher"/>
<specialization name="sweeperBrush"/>
</type>
</vehicleTypes>
Code: Select all
<vehicleTypes>
<type name="tuchelSweep" className="Vehicle" parent="implement" filename="$dataS/scripts/vehicles/Vehicle.lua">
<specialization name="fillUnit"/>
<specialization name="fillVolume"/>
<specialization name="dischargeable"/>
<specialization name="groundReference"/>
<specialization name="workArea"/>
<specialization name="workParticles"/>
<specialization name="turnOnVehicle"/>
<specialization name="dynamicMountAttacher"/>
</type>
</vehicleTypes>
Playing on PC - Win10
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
Ryzen 3600
RX 5500XT
16GB Ram
How to post log file
How to upload pictures
Please report bugs for FS22 using the bugtracker
Re: A little help for a beginner ...
The workAreas in the XML also need to be adjusted as they use functions from the sweeper script.
I also think this is a good way to go - use some other vehicleType that picks up stuff and just drops it into a fillVolume :>
10 posts
Page 1 of 1