Company of Heroes 2

Company of Heroes 2

The Living Dead [Legacy]
Janne252 29 Apr, 2015 @ 7:14am
Technical suggestions
It would seem that the current setup relies on axis being in team 2:
axisPlayers = Team_GetPlayers(1)

Improvement:

-- Improvement suggestion for the CoH2 Mod "The Living Dead" by Janne252 -- Suggestion for more dynamic control over players; Not forcing users to use fixed starting positions and Axis in team 2 -- Example use local axisPlayes = World_GetPlayersByRaceName({"german", "west_german"}) -- The utility function itself function World_GetPlayersByRaceName(raceName) local result = {} if scartype(raceName) ~= ST_TABLE then raceName = {raceName} end for i = 1, World_GetPlayerCount() do local player = World_GetPlayerAt(i) local playerRaceName = Player_GetRaceName(player) for key, _raceName in ipairs(raceName) do if playerRaceName == _raceName then table.insert(result, player) break end end end return result end

I would also recommend changing
Rule_AddInterval(TLD_CheckStrategicPointStatus, 1);
to
Rule_Add(TLD_CheckStrategicPointStatus);
That way it will be ran 8 times a second, resulting a smoother cap prevention.
Last edited by Janne252; 29 Apr, 2015 @ 1:33pm