Honestly, the best thing you can do is create a Win Condition Pack. That way, you can use it on any map in multiplayer.
Create a Win Condition Pack as seen in my tutorials.
Then, download this and extract ONLY the data folder to your mod. 
Find "local function WinCondition_Init()" in default.scar and put the code I posted on the previous page in that function.
			Camera mod
									19 Nov 2015, 18:59 PM
				
	#21					
								
					
				
		
 
    		            							
			    		Posts: 756 | Subs: 8
									19 Nov 2015, 19:13 PM
				
	#22					
								
					
				
		
Posts: 67
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)
			
		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)
									19 Nov 2015, 19:29 PM
				
	#23					
								
					
				
		
Posts: 67
right I have got it now all sorted but the game only does victory point and I normaly play anih.
			
		
									19 Nov 2015, 19:31 PM
				
	#24					
								
					
				
		
Posts: 67
thank you fur time and patience im a bit long in the tooth for all this programing lark my first pc was a zx spectrum lol !!!!.
thank you
			
		thank you
									19 Nov 2015, 19:49 PM
				
	#25					
								
					
				
		
 
    		            							
			    		Posts: 756 | Subs: 8
Did you specify a .win and .scar file or check "Requires VP Ticker" when creating the Win Condition Pack? If so, that would be why. If not, the data folder you should have extracted is for Annihilate.
Also, you have:
which should be:
			
		Also, you have:
Code
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
which should be:
Code
local function WinCondition_Init()
local distmin = 5;
local distMax = 50;
Camera_SetTuningValue(TV_DistMin, distmin);
Camera_SetTuningValue(TV_DistMax, distmax);
Camera_SetZoomDist(distMax);
Rule_AddInterval(WinCondition_Check, 3)
end
									19 Nov 2015, 22:02 PM
				
	#26					
								
					
				
		
Posts: 67
yeh its ok I realized what I did so I have both vp and anih thanks for all your help I can sleep properly now lol.
			
		
	1 user is browsing this thread: 
	1 guest	
	
		
	
Livestreams
|   |   |   | 5 | ||
|   |   |   | 3 | ||
|   |   |   | 1 | 
Ladders Top 10
- 
							#Steam AliasWL%Streak
- 1.46467.874+6
- 2.794136.854-1
- 3.14465.689-1
- 4.21154.796+4
- 5.400212.654+2
- 6.353186.655+2
- 7.501325.607+4
- 8.298128.700-1
- 9.327117.736+4
- 10.857232.787+4
Replay highlight
VS
					- 
									 cblanco ★ cblanco ★
- 
									 보드카 중대 보드카 중대
- 
									 VonManteuffel VonManteuffel
- 
									 Heartless Jäger Heartless Jäger
 
											
						Einhoven Country
						
							
								
									 
								
								 
								
								
				 
								
								Honor it
								15
							
						
						
												
							
								
									 
								
								Download
								2705
							
						
												
					Board Info
						615 users are online:
			1 member			 and 			614 guests
789wintercom1
		789wintercom1
			2 posts in the last 24h
2 posts in the last week
24 posts in the last month
		
		2 posts in the last week
24 posts in the last month
			
			
				Registered members: 61853
Welcome our newest member, 789wintercom1
Most online: 4501 users on 26 Oct 2025, 01:00 AM
	Welcome our newest member, 789wintercom1
Most online: 4501 users on 26 Oct 2025, 01:00 AM
 
	
 
			 
			 
 
 
  
										 
									 
  
  
						 
						 
						 
						 
						 
						 Relic Entertainment
						 Relic Entertainment