Statistics: Posted by Ze_PilOt — 30 Dec 2013, 22:33
gwReinforcements = {
transportedUnits = {
{
playerName = "Kathlyn Murders",
delay = 4,
unitNames = {
"UEL0101",
},
},
{
playerName = "Kathlyn Murders",
delay = 60,
unitNames = {
"UEL0103",
"UEL0103",
"UEL0103",
"UEL0103",
},
},
{
playerName = "Jarvis Bielefield",
delay = 56,
unitNames = {
"UEL0103",
"UEL0103",
"UEL0103",
"UEL0103",
},
},
},
initialStructure = {
},
initialUnitWarp = {
},
periodicUnitWarp = {
},
builtByEngineerStructure = {
},
}
assignSupports = function()
local ArmiesList = ScenarioInfo.ArmySetup
for name,army in ScenarioInfo.ArmySetup do
if army.ArmyIndex == 1 then
factions[1] = army.Faction
teams[1] = army.Team
beaconTime[1] = 0
elseif army.ArmyIndex == 2 then
factions[2] = army.Faction
teams[2] = army.Team
beaconTime[2] = 0
end
end
for name,army in ScenarioInfo.ArmySetup do
if army.ArmyName == "SUPPORT_1" then
army.Team = teams[1]
army.Civilian = false
army.ArmyColor = 1
army.PlayerColor= 1
army.Faction = factions[1]
army.PlayerName="gw_support_1"
armySupport[1] = army.ArmyName
armySupportIndex[1] = army.ArmyIndex
army.Support = true
elseif army.ArmyName == "SUPPORT_2" then
army.Team = teams[2]
army.ArmyColor = 2
army.PlayerColor=2
army.Civilian = false
army.Faction = factions[2]
army.PlayerName="gw_support_2"
army.Support = true
armySupport[2] = army.ArmyName
armySupportIndex[2] = army.ArmyIndex
end
end
end
SpawnTransportedReinforcements = function(beacon, unitsToSpawn)
WARN('Spawningtransported Reinforcements')
local NearestOffMapLocation = beacon.NearestOffMapLocation
local UnitsToTransport = {}
UnitsToTransport[1] = {}
UnitsToTransport[2] = {}
UnitsToTransport[3] = {}
local NumberOfTransportsNeeded = 0
#this spawns our units
for index, unitBPid in unitsToSpawn do
#WARN('spawning reinforcement unit bpid is ' .. repr(unitBPid))
#WARN('spawning beacon.ArmyName unit bpid is ' .. repr(beacon.ArmyIndex))
local newUnit = CreateUnitHPR(unitBPid, armySupport[beacon.ArmyIndex], NearestOffMapLocation[1], NearestOffMapLocation[2], NearestOffMapLocation[3],0,0,0)
local TransportClass = newUnit:GetBlueprint().Transport.TransportClass
table.insert(UnitsToTransport[TransportClass], newUnit)
end
assignSupports = function()
local ArmiesList = ScenarioInfo.ArmySetup
for name,army in ScenarioInfo.ArmySetup do
if army.ArmyIndex == 1 then
factions[1] = army.Faction
teams[1] = army.Team
beaconTime[1] = 0
elseif army.Team == teams[1] then
factions[1] = army.Faction
teams[1] = army.Team
beaconTime[1] = 0
elseif not army.Team == team[1] then
factions[2] = army.Faction
teams[2] = army.Team
beaconTime[2] = 0
end
end
for name,army in ScenarioInfo.ArmySetup do
if army.ArmyName == "SUPPORT_1" then
army.Team = teams[1]
army.Civilian = false
army.ArmyColor = 1
army.PlayerColor= 1
army.Faction = factions[1]
army.PlayerName="gw_support_1"
armySupport[1] = army.ArmyName
armySupportIndex[1] = army.ArmyIndex
army.Support = true
elseif army.ArmyName == "SUPPORT_2" then
army.Team = teams[2]
army.ArmyColor = 2
army.PlayerColor=2
army.Civilian = false
army.Faction = factions[2]
army.PlayerName="gw_support_2"
army.Support = true
armySupport[2] = army.ArmyName
armySupportIndex[2] = army.ArmyIndex
end
end
end
Statistics: Posted by FunkOff — 30 Dec 2013, 01:24