Frvetz / FS22_RealisticDamageSystem

Realistic Damage System
https://discord.com/invite/mfergkwhDu
49 stars 5 forks source link

suggestion mobile repair trailer #29

Open falcon470 opened 1 week ago

falcon470 commented 1 week ago

Is it possible to changee the files to make this work with the mod? https://www.farming-simulator.com/mod.php?mod_id=246043 looking though the luas to see if i can do it my self would be a great addition to the mod, alternitively is there a way i can edit the files my self, without being super hard, simple edit thanks for your time

Frvetz commented 1 week ago

Hi,

just wanted to let you know that I've had a look at it and found that it was actually more complicated than I thought, but in theory it should be easily possible. I just need to find a solution for my idea now :D I will give you clear instructions on what to do tomorrow ;)

Cheers

Frvetz commented 6 days ago

Soooo, here I am with the solution :D

It was quite tricky, but I managed to find a way so that any other vehicle or object can be used as a maintenance pallet as well. After editing my mod, you can change the vehicleType name of any other mod to "palletMaintencance" and my script will detect it as another option to open the maintenance menu.

I'll update the files on GitHub with the next bugfix, but here is what you need to do for now:

- Open my mod -

1. Open the file "modDesc.xml"
2. Remove the line 425 "<specialization name="RealisticDamageSystem"/>"
3. Save and close the file

4. Open the file "RealisticDamageSystem.lua"
5. Go to line 160 "if self.typeName == "FS22_RealisticDamageSystem.palletMaintencance" then" and replace it with "if string.find(self.typeName, "palletMaintencance") then"
6. Save and close the file

7. Open the file "registerRealisticDamageSystem.lua"
8. Go to line 44 "if hasNotRDS and ismotorized then" and replace it with "if hasNotRDS and (ismotorized or string.find(vehicleType, "palletMaintencance")) then"
9. Save and close the file

- Open the service trailer mod -
⠀
1. Open the file "modDesc.xml"
2. Go to line 183 and replace the type name "fieldServiceTrailer" with "palletMaintencance" (screenshot 1 attached)
3. Go to line 187 and replace the type name "fieldServiceTrailerStrobes" with "palletMaintencanceStrobes" (screenshot 1 attached)
4. Save and close the file

5. Open the file "fst99s.xml"
6. Go to line 2 and change the type "fieldServiceTrailerStrobes" to "palletMaintencanceStrobes" (screenshot 2 attached)
7. Go to line 436 and change the vehicleType "fieldServiceTrailerStrobes" to "palletMaintencanceStrobes" (screenshot 3 attached)
8. Go to line 440 and change the vehicleType "fieldServiceTrailer" to "palletMaintencance" (screenshot 3 attached)
9. Save and close the file

The trailer should now have the same function as the pallet. Just drive up to it and the hotkey should appear

Hope this helps :)

Let me know if everything worked!

Cheers

Screenshot 1: Screenshot 1

Screenshot 2: Screenshot 2

Screenshot 3: Screenshot 3