Skip to content

MovementManager ยป Flight Pathing

Namespace: Mayo.Manager.Movement
Denpendies: GC.MM


See the very bottom for FlightPathConfig.


async Task FollowAsync(IList<Vector3> Path, GroundPathConfig?)

Follows a previously generated path.

Example
var Destination = new Vector3(..., ..., ...);
var Path = GC.Navigation.GetFlightPath(GC.OM.Me.Position, Destination);
await GC.MM.FollowAsync(Path, new FlightPathConfig(GC));

async Task FollowAsync(Vector3, FlightPathConfig?)

Generates a static path to the specified location and follows it.


new FlightPathConfig()

The FlightPathConfig allows you to set various behavioral, visual, and other settings.

Example
var ClosestUnit = GC.OM.GetClosestUnit();
if (ClosestUnit != null)
{
    await GC.MM.FollowAsync(ClosestUnit, new GroundPathConfig(GC)
    {
        StopMovingWhenArrived = true,
        StopFollowDistance = 2.0,
        StopFollowTimeInMS = 0,
        ShowWaypoints = true,
        MonitorAntiStuck = true,
        MonitorOffMesh = true,
        LoopPath = false,
        OnStuckActions = [],
        OnStuckActionsAsync = [],
        StopConditions = [],
    });
}

StopMovingWhenArrived

Type: bool
Default: true

Stops the character as soon as they reach their destination.

StopFollowDistance

Type: double
Default: 2.0

Specifies the distance to the target position where the character should stop.

StopFollowTimeInMS

Type: int
Default: 0

Stops the action once the time has expired.
0 disables this option.

ShowWaypoints

Type: bool
Default: true

Displays waypoints visually.
Requires an enabled overlay in the options.

MonitorAntiStuck

Type: bool
Default: true

Checks if the character is stuck.
If the character is stuck while flying, the process is immediately interrupted.

MonitorOffMesh

Type: bool
Default: true

Always includes all offmesh paths.

LoopPath

Type: bool
Default: false

Starts again at coordinate 1 when the last coordinate has been reached.

OnStuckActions

Type: List<Func<bool>>
Default: Empty

This allows you to implement additional synchronous anti-stuck measures.

Example
OnStuckActions = {
    () => GC.MM.ChangeHeight(),
}

OnStuckActionsAsync

Type: List<Func<Task<bool>>>
Default: Empty

This allows you to implement additional awaitable anti-stuck measures.

Example
OnStuckActionsAsync =
{
    async () =>
    {
        await GC.MM.ChangeHeightAsync();
    },
    () => MyCustomAntiStuckTask(),
}

StopConditions

Type: List<Func<bool>>
Default: Empty

Stops as soon as a condition is met.

Example
StopConditions =
{
    () => ConditionA,
    () => ConditionB,
    () => ConditionC() && ConditionD(),
    () => { /* further checks... */ return true; },
}
void Stop()

It is also possible to interrupt the process via the configuration.

Example
var ClosestUnit = GC.OM.GetClosestUnit();
if (ClosestUnit != null)
{
    var Config = new GroundPathConfig(GC);
    _ = GC.MM.FollowAsync(ClosestUnit, Config);

    await Task.Delay(3000);
    Config.Stop();

    Log.Write($"IsStopped: {Config.IsStopped}");
}