LabAPI icon indicating copy to clipboard operation
LabAPI copied to clipboard

[IDEA] Waypoint related Events

Open RaphaelArctic opened this issue 1 year ago • 7 comments

Goal Description

The addition of 8 total new events for the events of entering, entered, leaving and left waypoints for both Players and Pickup objects:

  • PlayerEvents.EnteringWaypoint (Player, WaypointToy, IsAllowed)

  • PlayerEvents.EnteredWaypoint (Player, WaypointToy)

  • PlayerEvents.LeavingWaypoint (Player, WaypointToy, IsAllowed)

  • PlayerEvents.LeftWaypoint (Player, WaypointToy)

  • ServerEvents.PickupEnteringWaypoint (Pickup, WaypointToy, IsAllowed)

  • ServerEvents.PickupEnteredWaypoint (Pickup, WaypointToy)

  • ServerEvents.PickupLeavingWaypoint (Pickup, WaypointToy, IsAllowed)

  • ServerEvents.PickupLeftWaypoint (Pickup, WaypointToy)

At least the "Entering" events should be deniable. <3

Notes

I have tried to patch the existing AdminToyWaypoint.Add method to disallow Players from becoming attached from certain waypoints, to no success. The following screenshot shows my attempted Harmony patch, where the LabApi Logger successfully detects Player-entry but Players still get attached to Waypoints. Screenshot below:

Image

RaphaelArctic avatar Oct 06 '25 20:10 RaphaelArctic

I see why that'd be requested, but there's also going to be a performance cost to calling these events any time a player or a pickup moves around and changes waypoint.

xCynDev avatar Oct 06 '25 20:10 xCynDev

Hopefully at least both Entering Events. Or maybe it could be an enum setting per Waypoint on what objects it affects?

RaphaelArctic avatar Oct 06 '25 22:10 RaphaelArctic

I don't think this would work as client side kinda needs to be the one deciding waypoint otherwise you get desync (maybe some sort of new ID in some sort of OnChangingWaypoint event could send client an override if the new value was changed, but I doubt that's what you want) Cyn's comment imo is kinda irrelevant as we have an event for literally every player every tick in FpcPositionDistributor, adding an event to OnWaypointChanged is hardly gonna impact performance.

The real problem here in my opinion is that I cant fake waypoint syncvars and that Priority doesnt work when negative (see #288 )

Someone-193 avatar Oct 06 '25 22:10 Someone-193

Cyn's comment imo is kinda irrelevant as we have an event for literally every player every tick in FpcPositionDistributor, adding an event to OnWaypointChanged is hardly gonna impact performance.

"Performance is already crap, why not make it worse at this point"

xCynDev avatar Oct 07 '25 00:10 xCynDev

As others have pointed out, this is inconvenient, if not horrible to implement. To work around this, you could:

  • Place a collidable, invisible primitive with the size of the waypoint to prevent players from passing through
  • Create a room-sized waypoint with a really high priority so clients don't use it (might come with some caveats)

Support the No Waypoints 2026 Movement now :trollface:

Axwabo avatar Oct 07 '25 06:10 Axwabo

Thank you for your suggestion! We've logged this issue in our internal git system for further review and tracking. Please note that this doesn't guarantee acceptance or implementation at this stage. If we need any additional information or clarification, we'll be sure to reach out to you.

Jesus-QC avatar Oct 14 '25 09:10 Jesus-QC

We've reopened this suggestion to prevent confusion and duplicate posts. As stated before, the issue has been added to our internal tracker, but that does not guarantee acceptance nor implementation.

Axwabo avatar Apr 27 '26 19:04 Axwabo