Support non-players for teams

As a developer, it is currently painful to implement friend/foe logic for NPCs because I have to write everything from the ground up. In my game, I need to be able to do the following:

  • Fetch a list of both players and NPCs on enemy teams to find an attack target for an NPC
  • Fetch a list of both players and NPCs on allied teams to find targets for an NPC using a support spell
  • Loop through all nearby entities and check if their team is hostile to the player before allowing them to fast travel
  • Check when a team of NPCs reaches 0 (they’ve all died and been removed) to end the match
  • Show NPCs on the leaderboard so players know how many participants are still alive

These are work perfectly fine if I only have players in my game – no NPCS – but that’s not the case, and I have to re-implement teams from scratch.

Proposed solution: Deprecate Player.Team property / leaderstats and add to Humanoid.

14 Likes

Support. I have a bunch of boilerplate modules like IsTeammate and IsEnemy that I’d really be fond of axing.

2 Likes