Skip to content
This repository was archived by the owner on Jul 30, 2023. It is now read-only.

Code Guide 02

Marvin Beym edited this page Apr 7, 2020 · 4 revisions

Next Saving:

Saving Parts:

  • go into your OnSave() Method

add this line ScrewablePart.SaveScrews(this, new ScrewablePart[]{ exhaust_header_screwable }, "test.txt");

  • first parameter is your mod (usually this
  • second is an array of ScrewablePart, this should be filled with all your screwable objects that belong to your mod. so only call this ONCE with an array of all ScrewablePart
  • the last parameter is the name of your saveFile (only add the NAME you want, not the complete path this is done automatically

Detecting Screwing:

inside your Update()

  • add .DetectScrewing();
  • if you want to disable Detection just use a bool value that bypasses the DetectScrewing()

Detecting Uninstall/Install of Part:

  • go into each Part class of the parts that are supposed to be screwable
  • add the lines shown in the picture. The order is important
  • it is also important that your Screwables Objects are static or else it can't access them.

Clone this wiki locally