loki79uk / FS22_UniversalAutoload

Mod for FS22. Please download latest release below.
122 stars 35 forks source link

Add support for the Gyrax P22700 Straw Blower (or a base game straw blower) #233

Closed ggoosen closed 4 months ago

ggoosen commented 5 months ago

If possible, could you add support for in game straw blowers or this mod?

I tried adding this myself to the mod, and it works to an extent, but i have some issues.

I defined the "cube" in giants as large as the open doors, that helps the mod calculate the placement of the 1) The trailer is super heavy after loading 2) As soon as i start "unloading" or cutting up the straw the bales disapear (even though they still in there)

https://www.farming-simulator.com/mod.php?mod_id=283397&title=fs2022

Farming Simulator 22 15_06_2024 10_36_01 PM

Screenshot 2024-06-15 223750

loki79uk commented 5 months ago

Hi, that is an idea I had never even thought of. It would need some modifications to standard autoload, since you would load the bales and then not expect to unload them. It could work in a similar way for a TMR wagon too. It might be more of a feature to add to the next version of UAL, which I'm thinking of starting soon with all the talk about FS25!

ggoosen commented 5 months ago

Thanks @loki79uk, it works currently (supprisingly) other than the fact that the bales disapear visually. I thought i might be easy with a quick tweek. But ill leave it to you to decide :)

loki79uk commented 5 months ago

Try with the latest release now. There is no actual support for straw blowers, but it should work now without the errors caused by disappearing bales. I noticed the first issue that needs solving is that the loading triggers need to be lower. i.e. Putting the loading zone too high up means you cannot detect bales on the ground. https://github.com/loki79uk/FS22_UniversalAutoload/releases/tag/v1.5.1.5

ggoosen commented 5 months ago

Tested it now, that works. Just need to make sure you bind the horizontal loading so that it doesnt stack.

Uploading the updated version of the MOD incase anyone wants to try it.

FS22_Gyrax_P22700_UAL.zip

Note this is not my work, this is Black Sheep Moddings work, credit goes to them https://www.farming-simulator.com/mod.php?mod_id=283397&title=fs2022

loki79uk commented 5 months ago

Tested it now, that works. Just need to make sure you bind the horizontal loading so that it doesnt stack.

That is good! I will see what I can do about a more general mode specific to straw blowers and TMR mixers. It worked quite well for me to limit the shape of the loading zone above the mixer so it was only big enough for a single bale.

As an aside, you shouldn't need to edit an actual mod to use with UAL. Just add the settings to your local mod settings file. e.g.: %userprofile%\Documents\My Games\FarmingSimulator2022\modSettings\UniversalAutoload.xml. This works on MP too if you edit it on the server file system. Obviously you can do what you like, but it should be less work this way, and then you can update mods without changing anything.

ggoosen commented 5 months ago

Will look into adding it to mod settings, i assume that would work for the standard items as well? Like the little John Deer trailer which doesnt have standard support?

Below is what it looks like for me when i load and have it as "double" Ideally i would want a small gap between left and right bales, but it still works like this when you close the trailer.

Farming Simulator 22 17_06_2024 11_55_25 AM

ggoosen commented 5 months ago

I tried to add the following and received an error that it cannot load the XML

<vehicleConfiguration configFileName="FS22_StrawBlower_Gyrax_P22700/Gyrax_P22700.xml>
        <loadingArea offset="0.000 1.000 -1.241" width="5.5" height="5.25" length="5.2"/>
        <options noLoadingIfFolded="true" isBaleTrailer="true" enableSideLoading="true" showDebug="false"/>
</vehicleConfiguration>

I did however manage to add the little trailer, using the below. What does the "selectedConfigs" do?

<vehicleConfiguration configFileName="data/vehicles/salek/ans1900/ans1900.xml" selectedConfigs="2">
        <loadingArea offset="0 1.000 -0.446" width="1.3" height="1.25" length="2.3"/>
        <options enableRearLoading="true" enableSideLoading="true" showDebug="true"/>
</vehicleConfiguration>

Also the "placement" zone is slightly higher than it should be? is that calculated?

Farming Simulator 22 17_06_2024 4_25_03 PM

loki79uk commented 5 months ago

I'm at work so can't check until later, but where did you get those numbers from for the Salek? I assume it would be the same as the other one that is added.

        <vehicleConfiguration configFileName="data/vehicles/salek/ans1900/ans1900.xml" selectedConfigs="1">
            <loadingArea offset="0 0.589 -0.48" width="1.50" height="1.85" length="2.45"/>
        </vehicleConfiguration>

The selected configs is the configuration that you have selected in the shop, e.g. bale trailer, bulk fill, etc. There are issues with loading pallets into the bulk fill trailers since they immediately unload (convert to loose fill types), so I typically don't add UAL to those trailers.

ggoosen commented 5 months ago

For the Salek, i opened the i3d file in giants editor and placed a cube onto the trailer to use the reference numbers.

If i change the 1 to 0.589 will bring the cube down? closer to the tray?

Understood on the selected config now :)

loki79uk commented 5 months ago

It sounds like you almost did it correctly, but before placing it you need to offset the y-coordinate of the cube by 0.5 and then "freeze transformations":

   · Create a unit cube and set "Translate Y" = 0.5
   · "Freeze Transformations" with default options (reference node should move to centre of lower face)
   · Use "Interactive Placement" to set the height
        - Ctrl+B with the box selected
        - Left-click on the bed of the trailer
        - Manually set both X and Z coordinates back to zero
   · Adjust Scale (X,Y,Z) and Translate Z (if required) to position and scale the loading area
   · Copy those values into the vehicle xml using the format:
    <loadingArea offset="offsetX offsetY offsetZ" width="scaleX" height="scaleY" length="scaleZ"/>
   · Delete the shape or close without saving (we ONLY need the values)

Edit: this is just because by default the root node of a cube is in the centre, but for UAL I chose to make it the centre of the bottom face. This makes it easier to adjust the height without ever changing the offset again.

ggoosen commented 5 months ago

Working through trying to use the global config file, im getting the following error in the log

2024-06-19 18:10 ** Adding Pallets for FS22_strawHarvestPack ** 2024-06-19 18:10 Error: C:/Users/georg/OneDrive/Documents/My Games/FarmingSimulator2022/modSettings/UniversalAutoload.xml. Error=XML_ERROR_PARSING_ELEMENT ErrorID=6 (0x6) Line number=31. 2024-06-19 18:10 Universal Autoload - could not open global settings file 2024-06-19 18:10 IMPORT user vehicle configurations 2024-06-19 18:10 Error: C:/Users/georg/OneDrive/Documents/My Games/FarmingSimulator2022/modSettings/UniversalAutoload.xml. Error=XML_ERROR_PARSING_ELEMENT ErrorID=6 (0x6) Line number=31. 2024-06-19 18:10 Error: Running LUA method 'loadSharedI3DFileFinished'. C:/Users/georg/OneDrive/Documents/My Games/FarmingSimulator2022/mods/FS22_UniversalAutoload/UniversalAutoloadInstaller.lua:200: attempt to index local 'xmlFile' (a nil value)

This is line 31 <vehicleConfiguration configFileName="FS22_HerculanoHF/HF.xml>

`

<!-- *** Base Game Example *** -->
<!-- <vehicleConfiguration configFileName="data/vehicles/welger/dk115/dk115.xml" selectedConfigs="2">
    <loadingArea offset="0 1.339 -0.165" width="1.95" height="2.00" length="4.525"/>
</vehicleConfiguration> -->

<!-- *** Mod Example *** -->
<!-- <vehicleConfiguration configFileName="FS22_20ftGooseneck/lizardgooseneck.xml">  
    <loadingArea offset="0.000 1.100 -0.300" width="3.00" height="2.20" length="7.50"/>
    <options enableRearLoading="true" enableSideLoading="true" showDebug="true"/>
</vehicleConfiguration> -->

<vehicleConfiguration configFileName="data/vehicles/salek/ans1900/ans1900.xml" selectedConfigs="2">
    <loadingArea offset="0 0.589 -0.444" width="1.35" height="1" length="2.3"/>
    <options enableRearLoading="true" enableSideLoading="true" showDebug="true"/>
</vehicleConfiguration>

<!--
<vehicleConfiguration configFileName="FS22_StrawBlower_Gyrax_P22700/Gyrax_P22700.xml>
    <loadingArea offset="0.000 1.000 -1.241" width="5.5" height="5.25" length="5.2"/>
    <options noLoadingIfFolded="true" isBaleTrailer="true" enableSideLoading="true" showDebug="false"/>
</vehicleConfiguration> -->

<vehicleConfiguration configFileName="FS22_HerculanoHF/HF.xml>
    <loadingArea offset="0.000 0.797 -1.452" width="1.925" height="1.596" length="4.3"/>
    <options isLogTrailer="true" enableSideLoading="true" showDebug="false"/>
</vehicleConfiguration> -->

</vehicleConfigurations>`
loki79uk commented 5 months ago

Check the whole file in a proper xml editor like notepad++. You have one opening comment tag <!--, but two closing tags -->

ggoosen commented 5 months ago

I was to quick on the post, i noticed that and removed it and tested again, "comment close tags" was not the issue, same error.

loki79uk commented 5 months ago

is this the full path of the xml inside the mod? FS22_HerculanoHF/HF.xml

have you edited that file at all and possibly broken the xml there?

loki79uk commented 5 months ago

Actually, it looks like it is not loading the file: https://github.com/loki79uk/FS22_UniversalAutoload/blob/2347d525eb5eb76fb39035fd1e4d947ead7ac525/UniversalAutoloadInstaller.lua#L187

Try replacing it with the default settings file again and see if that works. Otherwise the only thing I can think of is something to do with OneDrive?

ggoosen commented 5 months ago

This is the full file, it works when i add it to "default" items.

`<?xml version="1.0" encoding="utf-8" standalone="no"?>

`

mods are physically located here ->

C:\Users\georg\OneDrive\Documents\My Games\FarmingSimulator2022\mods

while the default vehicles are here

F:\Program Files (x86)\Steam\steamapps\common\Farming Simulator 22\data\vehicles

Could it be that that the script is assuming the path as being on C: or F:?

loki79uk commented 5 months ago

It uses the game path, so the "modSettings" folder that is in the same folder as your savegames and log file are created.

by default: %userprofile%\Documents\My Games\FarmingSimulator2022\modSettings\UniversalAutoload.xml

ggoosen commented 5 months ago

Fixed it was a syntax issue. Didnt close the " on the file name

Fixed version

`

<!-- *** Mod Examples *** -->   
<!-- <objectType name="FS22_GlobalTransportPallet:globalpallet"/> -->
<!-- <objectType name="FS22_GameplayExtension:PlaceableElements"/> -->
`
loki79uk commented 5 months ago

Is this working okay for you without adding a specific mode? I've recently started working on UAL 2.0, so depending how that goes I will try to add other vehicle types there.

ggoosen commented 5 months ago

Specific mode? Like having it classified as a bale trailer? Yes it works fine

It works yes, although my challenge is actually now with the teleport not working and also when I go over bale triggers that auto ‘import’ the bales the trailer sometimes thinks the bales are still in but they have already left.

On Mon, 24 Jun 2024 at 03:46, Loki_79 @.***> wrote:

Is this working okay for you without adding a specific mode? I've recently started working on UAL 2.0, so depending how that goes I will try to add other vehicle types there.

— Reply to this email directly, view it on GitHub https://github.com/loki79uk/FS22_UniversalAutoload/issues/233#issuecomment-2185259791, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW7KE6UCO4ALXW72PARC7TZI4GJVAVCNFSM6AAAAABJLWA7FOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBVGI2TSNZZGE . You are receiving this because you authored the thread.Message ID: @.***>

loki79uk commented 5 months ago

Specific mode? Like having it classified as a bale trailer? Yes it works fine It works yes, although my challenge is actually now with the teleport not working and also when I go over bale triggers that auto ‘import’ the bales the trailer sometimes thinks the bales are still in but they have already left.

So it isn't working okay then! lol

I'll see what I can do to improve it

ggoosen commented 5 months ago

Sorry, I mixed a whole bunch of things in there.

The straw overload type trailer is working fine, no issues with that since we used it.

All trailers using the Autoload mod have issues with the teleport mod, not supprised here really because i think you would have to handle that specifically to make it compatible. The issue i have will bale trailers relates to another mod where it "auto ingests" the bales, which confuses the trailer to think there are still bales in the trailer. Perhaps on the "Unload" function force a check to see if there is anything on the trailer and reset the state.

On Wed, 26 June 2024, 05:08 Loki_79, @.***> wrote:

Specific mode? Like having it classified as a bale trailer? Yes it works fine It works yes, although my challenge is actually now with the teleport not working and also when I go over bale triggers that auto ‘import’ the bales the trailer sometimes thinks the bales are still in but they have already left.

So it isn't working okay then! lol

I'll see what I can do to improve it

— Reply to this email directly, view it on GitHub https://github.com/loki79uk/FS22_UniversalAutoload/issues/233#issuecomment-2189829771, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW7KE67F36YGTGI3VW7XQLZJHBJ7AVCNFSM6AAAAABJLWA7FOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBZHAZDSNZXGE . You are receiving this because you authored the thread.Message ID: @.***>

loki79uk commented 5 months ago

How is this as a concept? Obviously needs smaller bales, but kind of works..

image image image

ggoosen commented 5 months ago

Added a few screenshots for you here of the other loader and how it works.

This is what it looks like loading and unloading. Works fine and auto places as per the images. Farming Simulator 22 27_06_2024 11_28_37 AM

Farming Simulator 22 27_06_2024 11_27_41 AM

loki79uk commented 5 months ago

You could create two loading areas, one on each side.

ggoosen commented 5 months ago

Hmm, will try that and let you know.

Is there an example / document showing how to do that?

On Fri, Jun 28, 2024 at 1:20 AM Loki_79 @.***> wrote:

You could create two loading areas, one on each side.

— Reply to this email directly, view it on GitHub https://github.com/loki79uk/FS22_UniversalAutoload/issues/233#issuecomment-2195068688, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAW7KE4CSHFN7O2LUFDANQLZJQYDDAVCNFSM6AAAAABJLWA7FOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJVGA3DQNRYHA . You are receiving this because you authored the thread.Message ID: @.***>

loki79uk commented 5 months ago

Hmm, will try that and let you know. Is there an example / document showing how to do that?

There are some examples in the base game configs, but you just add two xml tags like this:

        <vehicleConfiguration configFileName="data/vehicles/demco/steelDropDeck/steelDropDeck.xml">
            <loadingArea offset="0 1.010 -0.33" width="2.45" height="2.25" length="11.2" baleHeight="2.8"/>
            <loadingArea offset="0 1.500 6.975" width="2.45" height="2.25" length="3.20" baleHeight="2.8"/>
            <options isBaleTrailer="false" enableRearLoading="true" enableSideLoading="true"/>
        </vehicleConfiguration>
loki79uk commented 5 months ago

I've added all the base game straw blowers and TMR mixers. You can use the new features by adding:

<options isBaleProcessor="true"/>

https://github.com/loki79uk/FS22_UniversalAutoload/releases/tag/v1.5.2.1

loki79uk commented 5 months ago

Also try this configuration:

<vehicleConfiguration configFileName="FS22_StrawBlower_Gyrax_P22700/Gyrax_P22700.xml">
    <loadingArea offset="0 1.35 -1.20" width="1.85" height="1.65" length="5.3" noLoadingIfUnfolded="true"/>
    <loadingArea offset="2.4 1.35 -1.20" width="2.41" height="1.35" length="5.0" noLoadingIfFolded="true"/>
    <loadingArea offset="-2.4 1.35 -1.20" width="2.41" height="1.35" length="5.0" noLoadingIfFolded="true"/>
    <options isBaleProcessor="true"/>
</vehicleConfiguration>

image image

loki79uk commented 4 months ago

@ggoosen Have you had a chance to try this yet?

ggoosen commented 4 months ago

@ggoosen Have you had a chance to try this yet?

Yep, tested it! Sorry, i thought i had updated the thread. This works perfectly!

loki79uk commented 4 months ago

Good news! Make sure you update to 1.5.2.1 as there was a bug in 1.5.2.0