Private
Public Access
1
0

Enhance player death tracking, add train statistics, and update version to 0.1.11

This commit is contained in:
Jan Grießhaber
2026-01-03 16:01:45 +01:00
parent 1e736c89ab
commit 0739dac907
6 changed files with 303 additions and 29 deletions

View File

@@ -21,6 +21,24 @@ function GetPlayerKills()
return table.concat(killParts,"\n")
end
function GetPlayerEntityStats()
local entityParts = {}
entityParts[#entityParts+1] = "---player-build-stats---"
for playerIndex, items in pairs(storage.constructedEntites) do
local playerName = game.players[playerIndex].name
for itemName, itemCount in pairs(items) do
entityParts[#entityParts+1] = ("%s:%s:constructed:%s:%s"):format(playerIndex,playerName,itemName,itemCount)
end
end
for playerIndex, items in pairs(storage.deconstructedEntities) do
local playerName = game.players[playerIndex].name
for itemName, itemCount in pairs(items) do
entityParts[#entityParts+1] = ("%s:%s:deconstructed:%s:%s"):format(playerIndex,playerName,itemName,itemCount)
end
end
return table.concat(entityParts)
end
function GetMapSeed()
return("---map-seed---\n%d"):format(game.surfaces["nauvis"].map_gen_settings.seed)
end