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

[feat] Allow gamecontroller to override character snapshots #37

Open
TsFreddie opened this issue Aug 29, 2021 · 2 comments
Open

[feat] Allow gamecontroller to override character snapshots #37

TsFreddie opened this issue Aug 29, 2021 · 2 comments

Comments

@TsFreddie
Copy link
Contributor

e.g. in a "among-us" type of gamemode, a player can be teleported into a mini-game area while other players can still see the teleported player in the overworld doing their "task". (i.e. see the overrided character state)

Also it can be used for making a tournament lobby with character showing in the brackets or something like that, which means the team of said character should also be overridable (preferablly at the same time/in the same call).

@TsFreddie TsFreddie changed the title [feat] Allow gamecontroller overriding character snapshots [feat] Allow gamecontroller to override character snapshots Aug 29, 2021
@TsFreddie
Copy link
Contributor Author

TsFreddie commented Aug 29, 2021

Or a more general purpose solution would be to allow gamemode to force snap a character state / player state for a specific client id. And the real character/player with the same id is automatically skipped. This way MomentCap should be possible to make in a GameController as well.

@TsFreddie
Copy link
Contributor Author

TsFreddie commented Aug 29, 2021

Proposal:

struct SCharacterState {
  bool m_Enabled, // if you want to hide a player/tee, you can just override it and set this to false
  bool m_Alive,      // if you want to hide a tee but keep the player (or override it), then you can set this to false
  vec2 m_Pos,
  float m_Angle,
  // ... other states,
  // probably need to make these private and only settable via a member function that also set a dirty flag so we can notify 0.7 clients with name change/clan change
  bool m_OverridePlayerInfo, // set this to true if you want to modify the player instead of letting them control their own name/clan/skin.
  char m_aName[MAX_NAME_LENGTH],
  char m_aClan[MAX_CLAN_LENGTH],
  CTeeInfo *m_Skin
}

SCharacterState *OverrideCharacterState(int ClientID); // create a SCharacterState that copies the current character/player state and allows GameController to keep the pointer and modify the structure.
ResetCharacterState(int ClientID); // free the SCharacterState struct and resume to sending the real player/character state (if there is any).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant