SAM Site Targeting

Hello! I am trying to make a plugin with a vast amount of features, one of these features is custom sam site targets. Say I wanted it to target animals, or the attack helicopter. How would I do this?

Are you planning to make this plugin open source? I was planning to implement a plugin along these lines (custom targets) to allow drones and custom vehicles to be targeted, so maybe there is an opportunity for us to collaborate.

Also, a plugin with a "vast amount of features" sounds like it might be taking on too much scope. Small modular plugins are usually more maintainable, so I advise that you take some time to think about the scope of the plugin and whether it would be feasible to implement it as multiple.

As for how to implement custom targets, there are a few plugins that do this already (Sky Turrets and Heli Sams), though I've heard they have issues. I believe they work by adding a custom MonoBehavior component to the Sam Site to identify targets in the trigger, and set the Sam Site's target to that entity if the Sam Site does not already have a target. You could also disable the native targeting and simply use the custom targeting, which will likely improve the consistency and performance.

Thank you! I appreciate this information. Just a bit ago I made a custom class for Auto Turrets and SAM Sites, once you assign the class to the auto turret or SAM site, you set the prefab name/collider name of what you want to target within the newly created class. The auto turret then will look for the target and attempt to destroy it! I just demonstrated this on my youtube taking down the patrol helicopter. I did try this with SAM sites, and the SAM sites did lock on and shoot at the patrol helicopter, although it didn't hit ANY shots. So I'm going to have to make prediction if I do want to implement this. (Unless there is another way)

Sam Sites already implement prediction. You should definitely check out the vanilla code. If you aren't sure how to do this, use a program like ILSpy or DnSpy to decompile the RustDedicated_Data/Managed/Assembly-CSharp.dll file from the Rust/Oxide installation.

Oh thanks! I appreciate this, this will help a lot!