Right this is what I have I managed to create the basic win condition pack in mod builder and followed you video when finished clicked build tried in game but nothing has changed.
import("ScarUtil.scar")
import("Fatalities/Fatalities.scar")
function WinCondition_GameOver(winningTeam, losingTeam)
-- Set the winning team (this will fire win/loss events for each player).
World_SetTeamWin(winningTeam)
local winningPlayers = Team_GetPlayers(winningTeam)
local losingPlayers = Team_GetPlayers(losingTeam)
Fatality_Execute(winningPlayers, losingPlayers)
end
function WinCondition_Check()
local results = {}
-- Check every player on each team for ownership of the "annihilation_condition" entity.
for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
local team = Player_GetTeam(player)
results[team] = results[team] or { surrender_count = 0, annihilation_condition_count = 0 }
-- If any player on a team has surrendered, that team loses.
if (Player_IsSurrendered(player)) then
results[team].surrender_count = results[team].surrender_count + 1
end
-- If at least one player on a given team owns an "annihilation_condition" entity, then that team has not yet lost.
if (Player_IsAlive(player)) then
local entities = Player_GetEntities(player)
for entityCount = 1, EGroup_CountSpawned(entities) do
local entity = EGroup_GetSpawnedEntityAt(entities, entityCount)
if (Entity_IsOfType(entity, "annihilation_condition")) then
results[team].annihilation_condition_count = results[team].annihilation_condition_count + 1
break
end
end
end
end
-- Check if any team has lost.
for team,result in pairs(results) do
if (result.surrender_count > 0 or result.annihilation_condition_count == 0) then
Rule_RemoveAll()
local winningTeam = Team_GetEnemyTeam(team)
local losingTeam = team
WinCondition_GameOver(winningTeam, losingTeam)
end
end
local distmin = 5;
local distMax = 50;
Camera_SetTuningValue(TV_DistMin, distmin);
Camera_SetTuningValue(TV_DistMax, distmax);
Camera_SetZoomDist(distMax);
local function WinCondition_Init()
Rule_AddInterval(WinCondition_Check, 3)
end
Scar_AddInit(WinCondition_Init)
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.34957.860+14
- 3.589215.733+4
- 4.1098613.642+2
- 5.280162.633+8
- 6.305114.728+1
- 7.916405.693-2
- 8.271108.715+22
- 9.721440.621+3
- 10.1041674.607-2