port gdi03 to the new Lua API

This commit is contained in:
Matthias Mailänder
2014-10-19 15:46:40 +02:00
parent 8245b818f8
commit a29a16b921
5 changed files with 961 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tiberian Dawn Lua scripts",
ProjectSection(SolutionItems) = preProject
mods\cnc\maps\gdi01\gdi01.lua = mods\cnc\maps\gdi01\gdi01.lua
mods\cnc\maps\gdi02\gdi02.lua = mods\cnc\maps\gdi02\gdi02.lua
mods\cnc\maps\gdi03\gdi03.lua = mods\cnc\maps\gdi03\gdi03.lua
mods\cnc\maps\gdi04a\gdi04a.lua = mods\cnc\maps\gdi04a\gdi04a.lua
mods\cnc\maps\gdi04b\gdi04b.lua = mods\cnc\maps\gdi04b\gdi04b.lua
mods\cnc\maps\gdi04c\gdi04c.lua = mods\cnc\maps\gdi04c\gdi04c.lua

View File

@@ -0,0 +1,107 @@
SamSites = { Sam1, Sam2, Sam3, Sam4 }
Sam4Guards = { Sam4Guard0, Sam4Guard1, Sam4Guard2, Sam4Guard3, Sam4Guard4, HiddenBuggy }
NodInfantrySquad = { "e1", "e1", "e1", "e1", "e1" }
InfantryReinforcements = { "e1", "e1", "e1", "e1", "e1", "e2", "e2", "e2", "e2", "e2" }
JeepReinforcements = { "jeep", "jeep", "jeep" }
AttackPlayer = function()
if NodBarracks.IsDead or NodBarracks.Owner == player then
return
end
local after = function(team)
Utils.Do(team, function(actor)
actor.AttackMove(AttackWaypoint.Location)
Trigger.OnIdle(actor, actor.Hunt)
end)
Trigger.OnAllKilled(team, function() Trigger.AfterDelay(DateTime.Seconds(15), AttackPlayer) end)
end
NodBarracks.Build(NodInfantrySquad, after)
end
SendReinforcements = function()
Reinforcements.Reinforce(player, JeepReinforcements, { VehicleStart.Location, VehicleStop.Location })
Reinforcements.Reinforce(player, InfantryReinforcements, { InfantryStart.Location, InfantryStop.Location }, 5)
Trigger.AfterDelay(DateTime.Seconds(3), function()
Reinforcements.Reinforce(player, { "mcv" }, { VehicleStart.Location, MCVwaypoint.Location })
InitialUnitsArrived = true
end)
Media.PlaySpeechNotification(player, "Reinforce")
end
WorldLoaded = function()
player = Player.GetPlayer("GDI")
enemy = Player.GetPlayer("Nod")
Trigger.OnObjectiveAdded(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Media.PlayMovieFullscreen("samdie.vqa", function()
nodObjective = enemy.AddPrimaryObjective("Destroy all GDI troops")
gdiMainObjective = player.AddPrimaryObjective("Eliminate all Nod forces in the area")
gdiAirSupportObjective = player.AddSecondaryObjective("Destroy the SAM sites to receive air support")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("gameover.vqa")
end)
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlayMovieFullscreen("bombaway.vqa")
end)
end)
Trigger.OnAllKilled(SamSites, function()
player.MarkCompletedObjective(gdiAirSupportObjective)
Actor.Create("SamsDestroyed", true, { Owner = player })
end)
Utils.Do(Map.NamedActors, function(actor)
if actor.Owner == enemy and actor.HasProperty("StartBuildingRepairs") then
Trigger.OnDamaged(actor, function(building)
if building.Owner == enemy and building.Health < 0.25 * building.MaxHealth then
building.StartBuildingRepairs()
end
end)
end
end)
Trigger.OnDamaged(Sam4, function()
Utils.Do(Sam4Guards, function(sam4Guard)
if not sam4Guard.IsDead then
Trigger.OnIdle(sam4Guard, sam4Guard.Hunt)
end
end)
end)
InitialUnitsArrived = false
Trigger.AfterDelay(DateTime.Seconds(1), SendReinforcements)
Camera.Position = MCVwaypoint.CenterPosition
Trigger.AfterDelay(DateTime.Seconds(15), AttackPlayer)
end
Tick = function()
if InitialUnitsArrived then
if player.HasNoRequiredUnits() then
enemy.MarkCompletedObjective(nodObjective)
end
if enemy.HasNoRequiredUnits() then
player.MarkCompletedObjective(gdiMainObjective)
end
end
end

BIN
mods/cnc/maps/gdi03/map.bin Normal file

Binary file not shown.

BIN
mods/cnc/maps/gdi03/map.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -0,0 +1,853 @@
Selectable: False
MapFormat: 6
RequiresMod: cnc
Title: Destroy The SAM Sites
Description: Build up forces to destroy Nod base.\n\nOnce all Nod SAM sites are neutralized then air support will be provided to combat obstacles such as turrets.\n\nDestroy all units and structures to complete the mission objective.
Author: Westwood Studios
PreviewVideo: gdi3.vqa
Tileset: TEMPERAT
MapSize: 64,64
Bounds: 1,25,45,37
UseAsShellmap: False
Type: Campaign
Options:
Crates: False
Fog: True
Shroud: True
AllyBuildRadius: False
FragileAlliances: False
StartingCash: 5000
ConfigurableStartingUnits: False
Players:
PlayerReference@Nod:
Name: Nod
Race: nod
ColorRamp: 3,255,127
Allies: Nod
Enemies: GDI
PlayerReference@Neutral:
Name: Neutral
OwnsWorld: True
NonCombatant: True
Race: gdi
Enemies: Nod
PlayerReference@GDI:
Name: GDI
Playable: True
AllowBots: False
Required: True
LockRace: True
Race: gdi
LockColor: True
ColorRamp: 31,222,183
LockSpawn: True
LockTeam: True
Allies: GDI
Enemies: Nod
PlayerReference@Creeps:
Name: Creeps
NonCombatant: True
Race: Random
Enemies: Nod, GDI
Actors:
Actor0: wood
Location: 45,59
Owner: Neutral
Actor1: wood
Location: 44,59
Owner: Neutral
Actor2: wood
Location: 43,59
Owner: Neutral
Actor3: wood
Location: 42,59
Owner: Neutral
Actor4: wood
Location: 45,58
Owner: Neutral
Actor5: v14
Location: 44,58
Owner: Neutral
Actor6: v15
Location: 43,58
Owner: Neutral
Actor7: wood
Location: 42,58
Owner: Neutral
Actor8: wood
Location: 45,57
Owner: Neutral
Actor9: v17
Location: 44,57
Owner: Neutral
Actor10: v17
Location: 43,57
Owner: Neutral
Actor11: wood
Location: 42,57
Owner: Neutral
Actor12: sbag
Location: 35,33
Owner: Neutral
Actor13: sbag
Location: 34,33
Owner: Neutral
Actor14: sbag
Location: 33,33
Owner: Neutral
Actor15: sbag
Location: 32,33
Owner: Neutral
Actor16: sbag
Location: 31,33
Owner: Neutral
Actor17: sbag
Location: 30,33
Owner: Neutral
Actor18: sbag
Location: 29,33
Owner: Neutral
Actor19: sbag
Location: 28,33
Owner: Neutral
Actor20: sbag
Location: 23,33
Owner: Neutral
Actor21: sbag
Location: 22,33
Owner: Neutral
Actor22: sbag
Location: 21,33
Owner: Neutral
Actor23: sbag
Location: 20,33
Owner: Neutral
Actor24: sbag
Location: 35,32
Owner: Neutral
Actor25: sbag
Location: 29,32
Owner: Neutral
Actor26: sbag
Location: 28,32
Owner: Neutral
Actor27: sbag
Location: 23,32
Owner: Neutral
Actor28: sbag
Location: 22,32
Owner: Neutral
Actor29: sbag
Location: 20,32
Owner: Neutral
Actor30: sbag
Location: 35,31
Owner: Neutral
Actor31: sbag
Location: 20,31
Owner: Neutral
Actor32: sbag
Location: 35,30
Owner: Neutral
Actor33: sbag
Location: 20,30
Owner: Neutral
Actor34: sbag
Location: 35,29
Owner: Neutral
Actor35: sbag
Location: 20,29
Owner: Neutral
Actor36: sbag
Location: 35,28
Owner: Neutral
Actor37: sbag
Location: 20,28
Owner: Neutral
Actor38: sbag
Location: 35,27
Owner: Neutral
Actor39: sbag
Location: 20,27
Owner: Neutral
Actor40: sbag
Location: 35,26
Owner: Neutral
Actor41: sbag
Location: 20,26
Owner: Neutral
Actor42: sbag
Location: 35,25
Owner: Neutral
Actor43: sbag
Location: 34,25
Owner: Neutral
Actor44: sbag
Location: 33,25
Owner: Neutral
Actor45: sbag
Location: 32,25
Owner: Neutral
Actor46: sbag
Location: 31,25
Owner: Neutral
Actor47: sbag
Location: 30,25
Owner: Neutral
Actor48: sbag
Location: 29,25
Owner: Neutral
Actor49: sbag
Location: 28,25
Owner: Neutral
Actor50: sbag
Location: 27,25
Owner: Neutral
Actor51: sbag
Location: 26,25
Owner: Neutral
Actor52: sbag
Location: 25,25
Owner: Neutral
Actor53: sbag
Location: 24,25
Owner: Neutral
Actor54: sbag
Location: 23,25
Owner: Neutral
Actor55: sbag
Location: 22,25
Owner: Neutral
Actor56: sbag
Location: 21,25
Owner: Neutral
Actor57: sbag
Location: 20,25
Owner: Neutral
Actor58: t01
Location: 21,51
Owner: Neutral
Actor59: tc04
Location: 11,34
Owner: Neutral
Actor60: t01
Location: 43,59
Owner: Neutral
Actor61: t01
Location: 41,58
Owner: Neutral
Actor62: t05
Location: 12,38
Owner: Neutral
Actor63: tc01
Location: 22,44
Owner: Neutral
Actor64: t02
Location: 3,34
Owner: Neutral
Actor65: tc02
Location: 24,57
Owner: Neutral
Actor66: tc02
Location: 3,35
Owner: Neutral
Actor67: tc02
Location: 2,48
Owner: Neutral
Actor68: t03
Location: 41,57
Owner: Neutral
Actor69: t03
Location: 45,55
Owner: Neutral
Actor70: t06
Location: 45,53
Owner: Neutral
Actor71: t16
Location: 40,60
Owner: Neutral
Actor72: tc01
Location: 44,52
Owner: Neutral
Actor73: tc04
Location: 39,53
Owner: Neutral
Actor74: t01
Location: 36,38
Owner: Neutral
Actor75: t06
Location: 36,43
Owner: Neutral
Actor76: t06
Location: 35,42
Owner: Neutral
Actor77: t05
Location: 24,56
Owner: Neutral
Actor78: tc02
Location: 30,51
Owner: Neutral
Actor79: t01
Location: 30,53
Owner: Neutral
Actor80: tc05
Location: 34,56
Owner: Neutral
Actor81: tc04
Location: 24,49
Owner: Neutral
Actor82: t07
Location: 4,36
Owner: Neutral
Actor83: t06
Location: 2,37
Owner: Neutral
Actor84: t08
Location: 3,38
Owner: Neutral
Actor85: t11
Location: 2,36
Owner: Neutral
Actor86: tc05
Location: 17,31
Owner: Neutral
Actor87: t12
Location: 19,26
Owner: Neutral
Actor88: t12
Location: 33,44
Owner: Neutral
Actor89: t08
Location: 36,42
Owner: Neutral
Actor90: tc01
Location: 39,43
Owner: Neutral
Actor91: tc02
Location: 22,51
Owner: Neutral
Actor92: tc04
Location: 20,50
Owner: Neutral
Actor93: tc01
Location: 43,33
Owner: Neutral
Actor94: t17
Location: 14,33
Owner: Neutral
Actor95: t12
Location: 36,30
Owner: Neutral
Actor96: tc04
Location: 38,25
Owner: Neutral
Actor97: tc01
Location: 36,28
Owner: Neutral
Actor98: t16
Location: 38,28
Owner: Neutral
Actor99: tc01
Location: 34,45
Owner: Neutral
Actor100: tc04
Location: 20,42
Owner: Neutral
Actor101: t16
Location: 19,43
Owner: Neutral
Actor102: tc04
Location: 16,26
Owner: Neutral
Actor103: tc01
Location: 4,31
Owner: Neutral
Actor104: t17
Location: 6,31
Owner: Neutral
Actor105: t01
Location: 20,38
Owner: Neutral
Actor106: t02
Location: 23,40
Owner: Neutral
Actor107: t02
Location: 31,42
Owner: Neutral
Actor108: t07
Location: 32,39
Owner: Neutral
Actor109: t07
Location: 21,33
Owner: Neutral
Actor110: nuke
Location: 29,26
Owner: Nod
NodBarracks: hand
Location: 24,26
Owner: Nod
Actor112: silo
Location: 33,26
Owner: Nod
Actor113: silo
Location: 31,26
Owner: Nod
Actor114: proc
Location: 31,28
Owner: Nod
Actor115: nuke
Location: 22,26
Owner: Nod
Actor116: fact
Location: 26,26
Owner: Nod
Actor117: gun
Location: 20,34
Owner: Nod
Facing: 160
Actor118: v07
Location: 40,55
Owner: Neutral
Actor119: v11
Location: 44,60
Owner: Neutral
Actor120: v08
Location: 40,56
Owner: Neutral
Actor121: v01
Location: 44,54
Owner: Neutral
Sam1: sam
Location: 28,52
Owner: Nod
Sam2: sam
Location: 22,46
Owner: Nod
Sam3: sam
Location: 35,47
Owner: Nod
Actor125: gun
Location: 36,30
Owner: Nod
Facing: 96
Sam4: sam
Location: 12,34
Owner: Nod
Actor127: gun
Location: 29,34
Owner: Nod
Facing: 96
Actor129: bggy
Location: 22,29
Owner: Nod
Facing: 128
MCVwaypoint: waypoint
Location: 9,60
Owner: GDI
Health: 1
Facing: 0
VehicleStop: waypoint
Location: 10,55
Owner: GDI
Actor134: bggy
Location: 21,29
Owner: Nod
Facing: 128
Actor135: bggy
Location: 28,50
Owner: Nod
Facing: 160
HiddenBuggy: bggy
Location: 6,25
Owner: Nod
Facing: 0
Actor137: bggy
Location: 21,30
Owner: Nod
Facing: 128
Actor138: bggy
Location: 22,30
Owner: Nod
Facing: 128
Actor139: e3
Location: 17,28
Owner: Nod
Facing: 96
SubCell: 0
Actor140: e1
Location: 19,29
Owner: Nod
Facing: 160
SubCell: 4
Actor141: e1
Location: 18,28
Owner: Nod
Facing: 160
SubCell: 4
Actor142: e1
Location: 19,28
Owner: Nod
Facing: 96
SubCell: 0
Actor143: e1
Location: 31,32
Owner: Nod
Facing: 160
SubCell: 0
Actor144: e1
Location: 34,32
Owner: Nod
Facing: 96
SubCell: 4
Actor145: e3
Location: 34,31
Owner: Nod
Facing: 96
SubCell: 4
Actor146: e3
Location: 34,32
Owner: Nod
Facing: 96
SubCell: 1
Actor147: e3
Location: 18,29
Owner: Nod
Facing: 160
SubCell: 3
Actor148: e3
Location: 30,51
Owner: Nod
Facing: 160
SubCell: 0
Actor149: e1
Location: 20,42
Owner: Nod
Facing: 160
SubCell: 0
Actor150: e1
Location: 23,44
Owner: Nod
Facing: 224
SubCell: 4
Actor151: e1
Location: 24,33
Owner: Nod
Facing: 192
SubCell: 0
Actor152: e1
Location: 22,34
Owner: Nod
Facing: 96
SubCell: 4
Actor153: e1
Location: 27,33
Owner: Nod
Facing: 96
SubCell: 2
Actor154: e1
Location: 30,34
Owner: Nod
Facing: 160
SubCell: 1
Actor155: e1
Location: 14,33
Owner: Nod
Facing: 96
SubCell: 4
Actor156: e1
Location: 34,45
Owner: Nod
Facing: 64
SubCell: 1
Actor157: e1
Location: 36,45
Owner: Nod
Facing: 160
SubCell: 1
Actor158: e3
Location: 30,32
Owner: Nod
Facing: 160
SubCell: 3
Actor159: e3
Location: 21,32
Owner: Nod
Facing: 96
SubCell: 3
Actor160: e3
Location: 14,32
Owner: Nod
Facing: 96
SubCell: 3
Sam4Guard1: e1
Location: 11,31
Owner: Nod
Facing: 96
SubCell: 4
Sam4Guard2: e1
Location: 10,31
Owner: Nod
Facing: 96
SubCell: 2
Actor163: c6
Location: 42,56
Owner: Neutral
Facing: 0
SubCell: 1
Actor164: c3
Location: 43,56
Owner: Neutral
Facing: 0
SubCell: 1
Actor165: c2
Location: 40,58
Owner: Neutral
Facing: 0
SubCell: 1
Actor166: e3
Location: 40,43
Owner: Nod
Facing: 0
SubCell: 3
Actor167: e3
Location: 19,45
Owner: Nod
Facing: 160
SubCell: 2
Actor168: e3
Location: 43,33
Owner: Nod
Facing: 96
SubCell: 4
InfantryStop: waypoint
Location: 14,57
Owner: GDI
Actor177: e3
Location: 14,32
Owner: Nod
Facing: 96
SubCell: 1
Sam4Guard0: e1
Location: 9,31
Owner: Nod
Facing: 96
SubCell: 1
Actor179: e3
Location: 13,36
Owner: Nod
Facing: 96
SubCell: 2
Actor180: e3
Location: 11,34
Owner: Nod
Facing: 64
SubCell: 4
Actor181: e3
Location: 20,45
Owner: Nod
Facing: 160
SubCell: 3
Actor182: e1
Location: 25,51
Owner: Nod
Facing: 160
SubCell: 0
Actor183: e1
Location: 24,52
Owner: Nod
Facing: 160
SubCell: 0
Actor184: e3
Location: 33,46
Owner: Nod
Facing: 160
SubCell: 0
Actor185: e3
Location: 37,47
Owner: Nod
Facing: 160
SubCell: 3
Actor186: e3
Location: 37,28
Owner: Nod
Facing: 0
SubCell: 3
Actor187: e3
Location: 38,28
Owner: Nod
Facing: 0
SubCell: 0
Actor188: e3
Location: 14,32
Owner: Nod
Facing: 0
SubCell: 4
Sam4Guard3: e1
Location: 10,31
Owner: Nod
Facing: 0
SubCell: 3
Sam4Guard4: e1
Location: 10,31
Owner: Nod
Facing: 0
SubCell: 4
Actor191: e3
Location: 24,46
Owner: Nod
Facing: 128
SubCell: 1
InfantryStart: waypoint
Location: 14,61
Owner: GDI
VehicleStart: waypoint
Location: 9,61
Owner: GDI
AttackWaypoint: waypoint
Location: 6,52
Owner: Neutral
Smudges:
Rules:
World:
-SpawnMPUnits:
-MPStartLocations:
-CrateSpawner:
LuaScript:
Scripts: gdi03.lua
ObjectivesPanel:
PanelName: MISSION_OBJECTIVES
Player:
-ConquestVictoryConditions:
MissionObjectives:
EarlyGameOver: true
^Vehicle:
MustBeDestroyed:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
^Tank:
MustBeDestroyed:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
^Helicopter:
MustBeDestroyed:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
^Infantry:
MustBeDestroyed:
SpawnViceroid:
Probability: 0
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
^Plane:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
^Ship:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
^Building:
Tooltip:
GenericVisibility: Enemy
ShowOwnerRow: false
^Wall:
Tooltip:
ShowOwnerRow: false
^Husk:
Tooltip:
GenericVisibility: Enemy, Ally, Neutral
GenericStancePrefix: false
ShowOwnerRow: false
HARV:
-MustBeDestroyed:
WEAP:
Buildable:
Prerequisites: ~disabled
NUK2:
Buildable:
Prerequisites: ~disabled
FIX:
Buildable:
Prerequisites: ~disabled
HPAD:
Buildable:
Prerequisites: ~disabled
EYE:
Buildable:
Prerequisites: ~disabled
GUN:
Buildable:
Prerequisites: ~disabled
ATWR:
Buildable:
Prerequisites: ~disabled
E3:
Buildable:
Prerequisites: ~disabled
E4:
Buildable:
Prerequisites: ~disabled
E5:
Buildable:
Prerequisites: ~disabled
RMBO:
Buildable:
Prerequisites: ~disabled
AFLD:
Buildable:
Prerequisites: ~disabled
TMPL:
Buildable:
Prerequisites: ~disabled
OBLI:
Buildable:
Prerequisites: ~disabled
SAM:
Buildable:
Prerequisites: ~disabled
Building:
Power:
Amount: -10
-Capturable:
HQ:
AirstrikePower:
Prerequisites: ~airsupport
ChargeTime: 120
SamsDestroyed:
ProvidesCustomPrerequisite:
Prerequisite: airsupport
AirSupport:
Tooltip:
Name: A10 Air Strike
Sequences:
VoxelSequences:
Weapons:
Voices:
Notifications:
Translations: