Merge pull request #4386 from Mailaender/gdi01-lua

Ported first GDI mission to Lua
This commit is contained in:
Paul Chote
2013-12-30 19:19:24 -08:00
7 changed files with 126 additions and 270 deletions

View File

@@ -26,18 +26,18 @@ Options:
Shroud: True
AllyBuildRadius: False
FragileAlliances: False
StartingCash: 500
StartingCash: 5000
ConfigurableStartingUnits: False
Players:
PlayerReference@BadGuy:
Name: BadGuy
PlayerReference@Nod:
Name: Nod
Race: nod
ColorRamp: 3,255,127
Allies: BadGuy
Enemies: GoodGuy,Creeps
PlayerReference@GoodGuy:
Name: GoodGuy
Allies: Nod
Enemies: GDI,Creeps
PlayerReference@GDI:
Name: GDI
Playable: True
AllowBots: False
Required: True
@@ -47,8 +47,8 @@ Players:
ColorRamp: 31,222,183
LockSpawn: True
LockTeam: True
Allies: GoodGuy
Enemies: BadGuy,Creeps
Allies: GDI
Enemies: Nod,Creeps
PlayerReference@Neutral:
Name: Neutral
OwnsWorld: True
@@ -58,7 +58,7 @@ Players:
Name: Creeps
NonCombatant: True
Race: Random
Enemies: BadGuy,GoodGuy
Enemies: Nod,GDI
Actors:
Actor0: sbag
@@ -312,110 +312,110 @@ Actors:
Owner: Neutral
Actor83: gun
Location: 46,55
Owner: BadGuy
Owner: Nod
Health: 0.5
Facing: 160
Actor84: gun
Location: 41,55
Owner: BadGuy
Owner: Nod
Health: 0.5
Facing: 160
Actor85: gun
Location: 49,55
Owner: BadGuy
Owner: Nod
Health: 0.1875
Facing: 160
mcv: mcv
Location: 56,53
Owner: GoodGuy
Owner: GDI
Health: 1
Facing: 0
Gunboat: boat
Location: 53,59
Owner: GoodGuy
Owner: GDI
Health: 1
Facing: 64
Actor88: e1
Location: 56,55
Owner: GoodGuy
Owner: GDI
Health: 1
Facing: 0
SubCell: 2
Actor89: e1
Location: 56,55
Owner: GoodGuy
Owner: GDI
Health: 1
Facing: 0
SubCell: 4
Actor90: e1
Location: 56,55
Owner: GoodGuy
Owner: GDI
Health: 1
Facing: 0
SubCell: 3
Actor91: e1
Location: 56,55
Owner: GoodGuy
Owner: GDI
Health: 1
Facing: 0
SubCell: 1
Actor92: e1
Location: 57,45
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 160
SubCell: 2
Actor93: e1
Location: 56,41
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 192
SubCell: 2
Actor94: e1
Location: 48,41
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 96
SubCell: 3
Actor95: e1
Location: 59,45
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 160
SubCell: 1
Actor96: e1
Location: 46,50
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 96
SubCell: 3
Actor97: e1
Location: 48,47
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 96
SubCell: 1
Actor98: e1
Location: 38,43
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 128
SubCell: 4
Actor99: e1
Location: 38,43
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 128
SubCell: 1
Actor100: e1
Location: 48,41
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 96
SubCell: 2
Actor101: e1
Location: 41,39
Owner: BadGuy
Owner: Nod
Health: 1
Facing: 96
SubCell: 4
@@ -454,9 +454,15 @@ Rules:
-SpawnMPUnits:
-MPStartLocations:
-CrateSpawner:
Gdi01Script:
PlayMusicOnMapLoad:
Music: aoi
Loop: false
LuaScriptInterface:
LuaScripts: mission.lua
Player:
-ConquestVictoryConditions:
^Infantry:
MustBeDestroyed:
PROC:
-Buildable:
SILO:
@@ -475,6 +481,7 @@ Rules:
-Buildable:
GUN:
-Buildable:
MustBeDestroyed:
GTWR:
-Buildable:
ATWR:
@@ -488,10 +495,24 @@ Rules:
RMBO:
-Buildable:
BOAT:
Mobile:
OnRails: false
Health:
HP: 1000
AutoTarget:
InitialStance: AttackAnything
RejectsOrders:
Except: Attack
OLDLST:
Inherits: LST
-WithRoof:
Sequences:
oldlst:
idle: lst
Start: 0
Facings: 1
unload: lst
Start: 0
Facings: 1
VoxelSequences:

View File

@@ -0,0 +1,59 @@
InfantryReinforcements = { "e1", "e1", "e1" }
VehicleReinforcements = { "jeep" }
NodPatrol = { "e1", "e1" }
MissionAccomplished = function()
Mission.MissionOver({ player }, nil, false)
Media.PlayMovieFullscreen("consyard.vqa")
end
MissionFailed = function()
Mission.MissionOver(nil, { player }, false)
Media.PlayMovieFullscreen("gameover.vqa")
end
SendNodPatrol = function()
local patrol = Reinforcements.Reinforce(enemy, NodPatrol, nod0.Location, nod1.Location, 0)
Utils.Do(patrol, function(soldier)
Actor.Move(soldier, nod2.Location)
Actor.Move(soldier, nod3.Location)
Actor.Hunt(soldier)
end)
end
SetGunboatPath = function()
Actor.AttackMove(Gunboat, gunboatLeft.Location)
Actor.AttackMove(Gunboat, gunboatRight.Location)
end
ReinforceFromSea = function(passengers)
local hovercraft, troops = Reinforcements.Insert(player, "oldlst", passengers, { lstStart.Location, lstEnd.Location }, { lstStart.Location })
Media.PlaySpeechNotification("Reinforce")
end
WorldLoaded = function()
player = OpenRA.GetPlayer("GDI")
enemy = OpenRA.GetPlayer("Nod")
Media.PlayMovieFullscreen("gdi1.vqa", function() Media.PlayMovieFullscreen("landing.vqa") end)
SendNodPatrol()
OpenRA.RunAfterDelay(25 * 5, function() ReinforceFromSea(InfantryReinforcements) end)
OpenRA.RunAfterDelay(25 * 15, function() ReinforceFromSea(InfantryReinforcements) end)
OpenRA.RunAfterDelay(25 * 30, function() ReinforceFromSea(VehicleReinforcements) end)
OpenRA.RunAfterDelay(25 * 60, function() ReinforceFromSea(VehicleReinforcements) end)
end
Tick = function()
if Actor.IsIdle(Gunboat) then
SetGunboatPath()
end
if Mission.RequiredUnitsAreDestroyed(player) then
MissionFailed()
end
if Mission.RequiredUnitsAreDestroyed(enemy) then
MissionAccomplished()
end
end

View File

@@ -284,7 +284,7 @@
Water: 100
SelectionDecorations:
Selectable:
Voice: GenericVoice
Voice: VehicleVoice
TargetableUnit:
TargetTypes: Ground, Water
HiddenUnderFog:

View File

@@ -1,4 +1,4 @@
GenericVoice:
GenericVoice:
Variants:
nod: .v01,.v03
gdi: .v01,.v03
@@ -8,27 +8,27 @@ GenericVoice:
Die: nuyell1,nuyell3,nuyell4,nuyell5
DisableVariants: Die
VehicleVoice:
VehicleVoice:
Variants:
nod: .v00,.v02
gdi: .v00,.v02
Voices:
Select: vehic1,yessir1,report1,await1,unit1
Move: ackno,affirm1,movout1
Move: ackno,affirm1,movout1
CivilianMaleVoice:
CivilianMaleVoice:
Voices:
Select: guyyeah1
Move: guyokay1
Die: nuyell1,nuyell3,nuyell4,nuyell5
CivilianFemaleVoice:
CivilianFemaleVoice:
Voices:
Select: girlyeah
Move: girlokay
Die: nuyell1,nuyell3,nuyell4,nuyell5
CommandoVoice:
CommandoVoice:
Voices:
Select: yeah1,yes1,yo1
Move: cmon1,onit1,gotit1

View File

@@ -34,15 +34,13 @@ end
Tick = function()
Mission.TickTakeOre(ussr)
if not Mission.MissionIsOver then
if Mission.RequiredUnitsAreDestroyed(player) then
MissionFailed()
end
if not trucksSent and Mission.RequiredUnitsAreDestroyed(ussr) and Mission.RequiredUnitsAreDestroyed(badGuy) then
SendTrucks()
trucksSent = true
end
if Mission.RequiredUnitsAreDestroyed(player) then
MissionFailed()
end
if not trucksSent and Mission.RequiredUnitsAreDestroyed(ussr) and Mission.RequiredUnitsAreDestroyed(badGuy) then
SendTrucks()
trucksSent = true
end
end