OnBoatGroupSpawned
OxideCarbonNavalobject OnBoatGroupSpawned(BoatGroupSpawner boatGroupSpawner, Vector2 vector2, Quaternion quaternion, HashSet<RHIB> list, bool boolean, bool spawnsPT)
object OnBoatGroupSpawned()Works — the game method in this build is the one the hook was written for.
Parameters
- boatGroupSpawner
- BoatGroupSpawner
- vector2
- Vector2
- quaternion
- Quaternion
- list
- HashSet<RHIB>
- boolean
- bool
- spawnsPT
- bool
Return value
objectReturn non-null to stop the game method.
Example
object — you can affect the game: return a value to change or cancel the action.
private object OnBoatGroupSpawned(BoatGroupSpawner boatGroupSpawner, Vector2 vector2, Quaternion quaternion, HashSet<RHIB> list, bool boolean, bool spawnsPT)
{
Puts("OnBoatGroupSpawned");
// change nothing — the game continues as usual
return null;
// to affect the game:
// return null; // null — the game continues as usual
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point 1
Rust.opj (Oxide)
void BoatGroupSpawner.SpawnBoatGroup(HashSet<RHIB>, BoatAI.AILoadMode, bool, ScientistBoatOilrigManager)
Passes: BoatGroupSpawner boatGroupSpawner, Vector2 vector2, Quaternion quaternion, HashSet<RHIB> list, bool boolean, bool spawnsPT
WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this, l1, l4, a0, l3, a2)Assembly-CSharp.dll
Injection point 2
Rust.opj (Oxide)
void BoatGroupSpawner.SpawnBoatGroup(HashSet<RHIB>, BoatAI.AILoadMode, bool, ScientistBoatOilrigManager)
Passes: —
WorksReturnBehavior: ExitWhenNonNullAssembly-CSharp.dll
Where it is called (this branch's game code)
public void SpawnBoatGroup(HashSet<RHIB> list, BoatAI.AILoadMode loadMode = BoatAI.AILoadMode.LoadAi, bool spawnsPT = true, ScientistBoatOilrigManager manager = null)
{
Vector2 vector = new Vector2(transform.position.x, transform.position.z);
if (Interface.CallHook("OnBoatGroupSpawned") != null)
{
return;
}
if (!BoatAI.FindBoatSpawnPositionInRadius(vector, radius, out var position))
{
return;
}
Vector3 forward = (vector - position).normalized;
// …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.