OnBoatPathGenerate
OxideCarbonVehicleCalled when a boat path is generated.
Use this to scale timing based on context, player state, or location.
object OnBoatPathGenerate(BaseBoat baseBoat)Method changed — check — the game method differs from the one the hook is recorded for in Oxide. The hook is still called, but its place may have shifted — worth checking after an update.
Parameters
- baseBoat
- BaseBoat
Return value
objectThe returned value replaces the game result; null lets the game decide.
Example
object — you can affect the game: return a value to change or cancel the action.
private object OnBoatPathGenerate(BaseBoat baseBoat)
{
Puts("OnBoatPathGenerate");
// change nothing — the game continues as usual
return null;
// to affect the game:
// return default(System.Collections.Generic.List<UnityEngine.Vector3>); // your value instead of the game result
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
List<Vector3> BaseBoat.GenerateOceanPatrolPath(float, float)
Passes: BaseBoat baseBoat
Method changed — checkReturnBehavior: ExitWhenValidTypeArgumentBehavior: JustThisAssembly-CSharp.dll
Where it is called (this branch's game code)
public static List<Vector3> GenerateOceanPatrolPath(float minDistanceFromShore = 50f, float minWaterDepth = 8f)
{
object returnvar = Interface.CallHook("OnBoatPathGenerate", this);
if (returnvar is List<Vector3>)
{
return (List<Vector3>)returnvar;
}
float x = TerrainMeta.Size.x;
float num = x * 2f * MathF.PI;
float num2 = 30f;
int num3 = Mathf.CeilToInt(num / num2);
// …Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.