Skip to content

KcdMp.party

The party as the server last sent it.

id is 0 in no party. members come in join order, the client’s own player among them; each has the pid, the name, the mode’s label, and the vitals of the last update - health, maxHealth, stamina, maxStamina, injuries (bits as the game’s body parts 1-6), dead, bleeding, loading (not in the world) - with vitals false until the first update arrived (the own entry never has them: the game’s HUD does). frames says whether the server’s frames are shown to this player. Read it live; a copy goes stale within half a second.

KcdMp.party

table - {id = number, leader = pid, name = string, frames = boolean, members = {{pid, name, label, health, maxHealth, stamina, maxStamina, injuries, dead, bleeding, loading, vitals}, ...}}

-- the weakest other member, for a script that marks who needs help
local function weakest()
local party, best, low = KcdMp.party, nil, 2
if not party or party.id == 0 then return nil end
for _, m in ipairs(party.members) do
if m.pid ~= KcdMp.player_id and m.vitals and not m.dead and m.maxHealth > 0 and m.health / m.maxHealth < low then
best, low = m, m.health / m.maxHealth
end
end
return best
end

KcdMp.on_party_change · KcdMp.player_id · the The party group of the index