Make LuaTrain.kill_count and LuaTrain.killed_players writable
Posted: Sat Jan 03, 2026 2:14 am
I'm requesting that LuaTrain.kill_count and LuaTrain.killed_players be writable.
When rolling stock is added or removed from a train, the old LuaTrain is invalidated and a new LuaTrain created with kill_count successfully being carried over to the new train. However, I am teleporting trains across surfaces which necessitates the complete destruction of the old train with no way of copying the kill count over. I would like to be able to maintain the trains kill count on the newly created train by writing to the new train's kill_count attribute.
Similarly with killed_players though that may be complicated by needing the player id to be verified when written to. Also, killed_players doesn't appear to work as referenced here viewtopic.php?t=132269
When rolling stock is added or removed from a train, the old LuaTrain is invalidated and a new LuaTrain created with kill_count successfully being carried over to the new train. However, I am teleporting trains across surfaces which necessitates the complete destruction of the old train with no way of copying the kill count over. I would like to be able to maintain the trains kill count on the newly created train by writing to the new train's kill_count attribute.
Similarly with killed_players though that may be complicated by needing the player id to be verified when written to. Also, killed_players doesn't appear to work as referenced here viewtopic.php?t=132269