Login

russian armor

Camera mod

19 Nov 2015, 18:59 PM
#21
avatar of eliw00d
Honorary Member Badge

Posts: 756 | Subs: 8

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.
19 Nov 2015, 19:13 PM
#22
avatar of whodareswins

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)
19 Nov 2015, 19:29 PM
#23
avatar of whodareswins

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
avatar of whodareswins

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
19 Nov 2015, 19:49 PM
#25
avatar of eliw00d
Honorary Member Badge

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:

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
avatar of whodareswins

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

United States 24
unknown 6
Russian Federation 4

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

974 users are online: 1 member and 973 guests
crypkick
2 posts in the last 24h
10 posts in the last week
28 posts in the last month
Registered members: 50011
Welcome our newest member, crypkick
Most online: 2043 users on 29 Oct 2023, 01:04 AM