Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPC spawning #118

Open
Segfaultd opened this issue Feb 13, 2025 · 1 comment
Open

NPC spawning #118

Segfaultd opened this issue Feb 13, 2025 · 1 comment
Labels

Comments

@Segfaultd
Copy link
Member

Introduction

We want to create NPC and have a few operations allowed

  • Create / Destroy human
  • Set a position
  • Set a nametag
  • Change spawnprofile
@zpl-zak
Copy link
Member

zpl-zak commented Feb 21, 2025

Ready for streamer and netcode layer, needs validation done on game layer.

Some adjustments might also be required in stream flow, we also want to set up ownership assignment proc based on player distance in case we decide to stream any client-side NPC AI logic in the far future.
this is achieved by unassigning the following field: https://github.com/MafiaHub/Framework/blob/develop/code/framework/src/world/types/player.hpp#L34

to spawn an NPC, modify the following method (https://github.com/MafiaHub/MafiaMP/blob/master/code/server/src/core/modules/human.cpp#L25) to pass an argument that would then remove the proc mentioned above. Most of the other logic might remain the same but take care to make sure we don't overlap with player dedicated branches down the line.

We should consider creating a Player class to inherit from Human and then implement additional player related logic on top in any case, instructions above are just a quick and dirty way to stream NPCs with the setup as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

2 participants