Community Forum

Deactivating parts of a mod when folded

Forum Overview >> Farming Simulator 19

CategoryFarming Simulator 19
Created17.04.2020 17:17


Unknown 17.04.2020 17:17
I have a trailer which has a removable backdoor in real life. I use the folding animation for this, making it invisible at the end of the animation.

However, in reality, you wouldn't be able to fill the trailer with the door removed as everything would just pour out. Is there a command I can use in the folding animation to prevent the trailer from being filled when the door is removed? Can't seem to find much info about possible commands to use in the XML animation, and I don't see an ingame example where the same principle is used.

I can't use the cover animation, because the trailer also has a cover.

Anybody any idea?

Bilbo Beutlin (BBeutlin) 17.04.2020 20:18
'Foldable' is used commonly by tools and disables functionality until the tool is unfolded. However this doesn't work for trailers.
The complete attributes you see in
https://gdn.giants-software.com/documentation_scripting_fs19.php?version=script&category=70&class=10548#onLoad166469
As you see, there's no special command to de/activate the functionality of a vehicle.

You could combine the un/cover and un/fold, so you have the states "cover open + backdoor closed" and vice versa.

Or you use the un/fold function for the cover and the cover function for the backdoor.

Unknown 18.04.2020 13:02
Thanks for the reply! I also thought about switching the cover and fold functions, but then I would end up with a trailer that can be filled through the cover no?

Actually, for the original question I had, changing fillvolume shape would also be an option! Maybe I can create an extra fillvolume, put both in a transformgroup to which the fillvolume part in the XML refers, so both will will 'grow' when filling, and then toggle visibility according do the state of the fold function. Or does the XML expect a shape at the fillVolume node, and not a transform group containing shapes?

Bilbo Beutlin (BBeutlin) 18.04.2020 14:41
The fillVolume must be a shape, since the engine calculates several physical values by effective volume dimensions.

Unknown 18.04.2020 16:44
Okay, I think I'll just leave it as is right now, maybe play with the shape of the fill volume to not make it look too unrealistic when the tailgate is removed. Thanks for your help!

Another question, kind of the same subject as the previous one. Can you make tensionbelts invisible in an animation? Right now when you close the cover, the tensionbelts partially stick out of the cover because it is sagging slightly in the middle. So I would like to hide the tensionbelts when the cover is closed. Tried to hide the tensionbelt nodes but as I suspected hiding those doesn't hide the belts themselves.

You, or someone else, have any idea if this is possible? I know I could do it with a configuration where you have either a cover or tensionbelts, but then you wouldn't be able to use the belts with the cover open and I find that unrealistic. (I know I'm making things difficult)

Luca Braun (Bigfarmer145) 18.04.2020 19:16
Usually other modders use configuration-sets and dont make it invisible by pressing a button. There are many mods in the modhub working this way. it also makes sense because u often need a workshop for unmount a backdoor in real life.

Then you need to work with configurationSets and another fillUnit-configuration like this:

<fillUnitConfiguration name="$l10n_configuration_ABC" >
<fillUnits>
<fillUnit unit="$l10n_unit_literShort" fillTypeCategories="bulk" capacity="0"/>
</fillUnits>
</fillUnitConfiguration>

Unknown 19.04.2020 00:49
Yeah but the thing is, in real life the backdoor can be removed in a matter of seconds. I'm making a small car trailer, and the backdoor can be taken out of its hinges, no need for a workshop. That's what I'm using the folding animation for now, the door goes open, slides to the side and then disappears.


Luca Braun (Bigfarmer145) 19.04.2020 09:42
ok, that means you need the animation to stop if the trailer filled and the fillable needs to be prohibit while animated. The second thing can be realized with cover animation. But there is no way to leave the animation off when filled as i understand of the game.

And because the cover-animation is already in use for a real cover there will be no way of realizing it without configuration.
I know its an annoying workaround, but it is a clean way combining a fillable trailer with tension belts and foldable doors.

Also keep in mind there could be issues with loading a bigbag. When you want to carry them but they unload itself, because the trailer is fillable at the same time.

Unknown 20.04.2020 23:13
Yeah but for my own gameplay I want a trailer that can do everything, so making configurations isn't a solution for me. I guess I'll just keep it as is right now and maybe tweak the shape of the fillVolume to make it look somewhat realistic.

Good point about the big bags, thanks!! Tested it and indeed, they empty into the trailer. I will make a configuration that isn't fillable, for people who want to transport big bags.

Unknown 23.04.2020 22:06
I just thought of another way I could make this more realistic. What if, when you open the tailgate and the trailer is filled, some of the material spills out? I was looking at shovels and whether I could use some of their functionality for this.
But I'm unsure about what part exactly allows the shovel to be emptied when it is tilted past a certain point. Is this done by the position of the rigid body in space, ie when the main rigid body is tilted a certain amount? Or is this done through the <shovel> function and the dischargeNode, so that when the dischargeNode is pointing downwards it will start emptying?


Note: Log in to post. Create a new account here.