Ok - found something new - this is either a bug, or my coding SUCKS... It looks to me as if the game engine does not recognize naval units...
When I try to call for naval reinforcements, the game crashes with the following error:
Code: Select all
-- Setup reinforcement wave unit tipes --
FirstAttackWave = { "2tnk", "2tnk", "1tnk", "1tnk", "arty", "jeep", "jeep" }
SecondThirdAttackWave = { "2tnk", "2tnk", "2tnk", "1tnk", "1tnk", "arty", "arty" }
FourthFifthAttackWave = { "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "arty", "arty" }
SixthAttackWave = { "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "mlrs", "mlrs" }
SeventhAttackWave = { "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "mlrs", "mlrs", "mlrs" }
EigthAttackWave = { "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "2tnk", "mlrs", "mlrs", "mlrs" }
FirstNavalAttackWave = { "pt", "pt", "dd", "dd" }
SecondNavalAttackWave = { "pt", "pt", "dd", "ca" }
ThirdNavalAttackWave = { "pt", "dd", "dd", "ca" }
MissionAccomplished = function()
Mission.MissionOver({ player }, nil, false)
--Media.PlayMovieFullscreen("snowbomb.vqa")
end
MissionFailed = function()
Mission.MissionOver(nil, { player }, false)
--Media.PlayMovieFullscreen("bmap.vqa")
end
-- Configuring attack wave functions
SendFirstAttackWave = function()
for FirstAttackWaveCount = 1, 7 do
local waveunit = Actor.Create(FirstAttackWave[FirstAttackWaveCount], { Owner = enemy, Location = LandSpawn.Location })
Actor.AttackMove(waveunit, PlayerBase.Location)
end
end
SendSecondAttackWave = function()
for SecondAttackWaveCount = 1, 7 do
local waveunit = Actor.Create(SecondThirdAttackWave[SecondAttackWaveCount], { Owner = enemy, Location = LandSpawn.Location })
Actor.AttackMove(waveunit, PlayerBase.Location)
end
end
SendThirdAttackWave = function()
for ThirdAttackWaveCount = 1, 7 do
local waveunit = Actor.Create(SecondThirdAttackWave[ThirdAttackWaveCount], { Owner = enemy, Location = LandSpawn.Location })
Actor.AttackMove(waveunit, PlayerBase.Location)
end
end
SendFourthAttackWave = function()
for FourthAttackWaveCount = 1, 7 do
local waveunit = Actor.Create(FourthFifthAttackWave[FourthAttackWaveCount], { Owner = enemy, Location = LandSpawn.Location })
Actor.AttackMove(waveunit, PlayerBase.Location)
end
end
SendFifthAttackWave = function()
for FifthAttackWaveCount = 1, 7 do
local waveunit = Actor.Create(FourthFifthAttackWave[FifthAttackWaveCount], { Owner = enemy, Location = LandSpawn.Location })
Actor.AttackMove(waveunit, PlayerBase.Location)
end
end
SendSixthAttackWave = function()
for SixthAttackWaveCount = 1, 7 do
local waveunit = Actor.Create(SixthAttackWave[SixthAttackWaveCount], { Owner = enemy, Location = LandSpawn.Location })
Actor.AttackMove(waveunit, PlayerBase.Location)
end
end
SendSeventhAttackWave = function()
for SeventhAttackWaveCount = 1, 9 do
local waveunit = Actor.Create(SeventhAttackWave[SeventhAttackWaveCount], { Owner = enemy, Location = LandSpawn.Location })
Actor.AttackMove(waveunit, PlayerBase.Location)
end
end
SendEigthAttackWave = function()
for EigthAttackWaveCount = 1, 9 do
local waveunit = Actor.Create(EigthAttackWave[EigthAttackWaveCount], { Owner = enemy, Location = LandSpawn.Location })
Actor.AttackMove(waveunit, PlayerBase.Location)
end
end
SendFirstNavalAttackWave = function()
for FirstNavalAttackWaveCount = 1, 4 do
local waveunit = Actor.Create(FirstNavalAttackWave[FirstNavalAttackWave], { Owner = enemy, Location = NavalSpawn.Location })
Actor.AttackMove(waveunit, PlayerShore.Location)
end
end
SendSecondNavalAttackWave = function()
for SecondNavalAttackWaveCount = 1, 4 do
local waveunit = Actor.Create(SecondNavalAttackWave[SecondNavalAttackWave], { Owner = enemy, Location = NavalSpawn.Location })
Actor.AttackMove(waveunit, PlayerShore.Location)
end
end
SendThirdNavalAttackWave = function()
for ThirdNavalAttackWaveCount = 1, 4 do
local waveunit = Actor.Create(ThirdNavalAttackWave[ThirdNavalAttackWave], { Owner = enemy, Location = NavalSpawn.Location })
Actor.AttackMove(waveunit, PlayerShore.Location)
end
end
-- Creates a patrol function with two waypoints and one unit.
LoopPatrol = function(actor, waypoints)
Utils.Do(waypoints, function(waypoint)
Actor.AttackMove(actor, waypoint.Location)
end)
Actor.CallFunc(actor, function() LoopPatrol(actor, waypoints) end)
end
tick = 0 -- Used for Briefing display code.
WorldLoaded = function() -- used to call previously created functions
player = OpenRA.GetPlayer("Nod")
enemy = OpenRA.GetPlayer("Allies")
LoopPatrol(PatrolN1, { PatrolN1A, PatrolN1B })
LoopPatrol(PatrolN2, { PatrolN1B, PatrolN1A })
LoopPatrol(PatrolL1, { PatrolL1B, PatrolL1A })
LoopPatrol(PatrolN5, { PatrolN2B, PatrolN2A })
LoopPatrol(PatrolN4, { PatrolN2B, PatrolN2A })
LoopPatrol(PatrolN3, { PatrolN2A, PatrolN2B })
LoopPatrol(PatrolL2, { PatrolL2B, PatrolL2A })
LoopPatrol(PatrolL4, { PatrolL2B, PatrolL2A })
LoopPatrol(PatrolL3, { PatrolL2A, PatrolL2B })
LoopPatrol(PatrolL5, { PatrolL2A, PatrolL2B })
LoopPatrol(PatrolL6, { PatrolL3A, PatrolL3B })
LoopPatrol(Truck1, { TibRouteA, TibRouteB })
LoopPatrol(Truck2, { TibRouteA, TibRouteB })
OpenRA.RunAfterDelay(25 * 240, SendFirstAttackWave)
OpenRA.RunAfterDelay(25 * 5, SendFirstNavalAttackWave) --360
OpenRA.RunAfterDelay(25 * 480, SendSecondAttackWave)
OpenRA.RunAfterDelay(25 * 600, SendThirdAttackWave)
OpenRA.RunAfterDelay(25 * 660, SendSecondNavalAttackWave)
OpenRA.RunAfterDelay(25 * 780, SendFourthAttackWave)
OpenRA.RunAfterDelay(25 * 840, SendFifthAttackWave)
OpenRA.RunAfterDelay(25 * 960, SendSixthAttackWave)
OpenRA.RunAfterDelay(25 * 1080, SendSeventhAttackWave)
OpenRA.RunAfterDelay(25 * 1200, SendEigthAttackWave)
OpenRA.RunAfterDelay(25 * 1320, SendThirdNavalAttackWave)
print(" Briefing: The Tiber river meteor sample you acquired contains an element foreign to our solar system. Our scientists speculate that has multiple uses - a power source, a perfect semiconductor, it can reinforce alloys... ")
print(" Capture the Allied base near your LZ then secure the meteor crash site for the Brotherhood and push the allies out of the region. ")
end
-- Briefing and win/lose check Code
Tick = function()
if Mission.RequiredUnitsAreDestroyed(player) then
MissionFailed()
end
tick = tick + 1
if tick % 3000 == 0 then
print(" Secure the meteor crash site. Eliminate all Allied units and structures. ")
end
end