Skip to content

Client: Wire remote humans to dressed student proxies#15

Merged
Kheartz merged 1 commit into
mainfrom
human_proxy_spawn
Jun 14, 2026
Merged

Client: Wire remote humans to dressed student proxies#15
Kheartz merged 1 commit into
mainfrom
human_proxy_spawn

Conversation

@Kheartz

@Kheartz Kheartz commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

StudentProxy gains a registry-free per-avatar API:

  • SpawnProxy(x,y,z,yaw, Appearance, &skin) / DestroyProxy(actor)
  • Appearance { bool female; int house; } selects the per-gender outfit and per-house tint/crest overlay (kit_params_houses.h)

human.cpp wiring (this is the Hogwarts stand-in for the native EntityFactory MafiaMP drives in its human.cpp):

  • Create spawns a proxy at the entity's streamed Transform; the actor + GC-guard index + skin component live in a new Avatar component
  • Update/UpdateRemoteHuman interpolate position and rotation and apply them via K2_TeleportTo; teleport-sized jumps snap instead of crawling
  • Remove destroys the proxy
  • Two fixes carried over from the broom work: read the local pawn's WORLD location via K2_GetActorLocation (RootComponent->RelativeLocation is parent-relative and stays static), and fetch Tracking only after all add()s so the player ref isn't written through a dangling archetype slot

Appearance is plumbed but defaults to Gryffindor male. Broom mount/dismount stays on broom_proxy and re-applies on top.

StudentProxy gains a registry-free per-avatar API:
  - SpawnProxy(x,y,z,yaw, Appearance, &skin) / DestroyProxy(actor)
  - Appearance { bool female; int house; } selects the per-gender outfit
    and per-house tint/crest overlay (kit_params_houses.h)

human.cpp wiring (this is the Hogwarts stand-in for the native
EntityFactory MafiaMP drives in its human.cpp):
  - Create spawns a proxy at the entity's streamed Transform; the actor +
    GC-guard index + skin component live in a new Avatar component
  - Update/UpdateRemoteHuman interpolate position and rotation and apply
    them via K2_TeleportTo; teleport-sized jumps snap instead of crawling
  - Remove destroys the proxy
  - Two fixes carried over from the broom work: read the local pawn's
    WORLD location via K2_GetActorLocation (RootComponent->RelativeLocation
    is parent-relative and stays static), and fetch Tracking only after
    all add()s so the player ref isn't written through a dangling
    archetype slot

Appearance is plumbed but defaults to Gryffindor male; deriving it from
the wire waits on the HumanSpawn message carrying it (a MAJOR bump).
Broom mount/dismount stays on broom_proxy and re-applies on top.
@Kheartz Kheartz merged commit de5bd3e into main Jun 14, 2026
1 check passed
@Kheartz Kheartz deleted the human_proxy_spawn branch June 14, 2026 01:14
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

Successfully merging this pull request may close these issues.

1 participant