From 5ce531f2d53a5aaad6736f7542934267f1b09abb Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 17 Aug 2010 22:11:14 +1200 Subject: [PATCH] Begin fleshing out mission scriping --- OpenRA.Mods.Cnc/Missions/Gdi01Script.cs | 53 +++++++++++++++++++++---- mods/cnc/maps/gdi01/map.uid | 2 +- mods/cnc/maps/gdi01/map.yaml | 13 ++++-- mods/cnc/vehicles.yaml | 3 +- 4 files changed, 58 insertions(+), 13 deletions(-) diff --git a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs index 52acf8981a..1f92222917 100644 --- a/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs +++ b/OpenRA.Mods.Cnc/Missions/Gdi01Script.cs @@ -24,9 +24,10 @@ namespace OpenRA.Mods.RA { Dictionary Actors; Dictionary Players; - + Map Map; public void WorldLoaded(World w) { + Map = w.Map; Players = w.WorldActor.Trait().Players; Actors = w.WorldActor.Trait().Actors; Game.MoveViewport((.5f * (w.Map.TopLeft + w.Map.BottomRight).ToFloat2()).ToInt2()); @@ -57,18 +58,56 @@ namespace OpenRA.Mods.RA return; if (ticks == 0) - { - Actors["Actor87"].QueueActivity(new Move(new int2(50,59),1)); // Gunboat - } - ticks++; + SetGunboatPath(); + if (ticks == 25*5) { - DoReinforcements(self.World, new int2(54,61),new int2(54,57), new int2(53,53), new string[] {"e1","e1","e1"}); + ReinforceFromSea(self.World, + Map.Waypoints["lstStart"], + Map.Waypoints["lstEnd"], + new int2(53,53), + new string[] {"e1","e1","e1"}); } + + if (ticks == 25*15) + { + ReinforceFromSea(self.World, + Map.Waypoints["lstStart"], + Map.Waypoints["lstEnd"], + new int2(53,53), + new string[] {"e1","e1","e1"}); + } + + if (ticks == 25*30) + { + ReinforceFromSea(self.World, + Map.Waypoints["lstStart"], + Map.Waypoints["lstEnd"], + new int2(53,53), + new string[] {"jeep"}); + } + + if (ticks == 25*60) + { + ReinforceFromSea(self.World, + Map.Waypoints["lstStart"], + Map.Waypoints["lstEnd"], + new int2(53,53), + new string[] {"jeep"}); + } + + ticks++; } - void DoReinforcements(World world, int2 startPos, int2 endPos, int2 unload, string[] items) + void SetGunboatPath() + { + Actors["Gunboat"].QueueActivity(new Move( Map.Waypoints["gunboatRight"],1)); + Actors["Gunboat"].QueueActivity(new Move( Map.Waypoints["gunboatLeft"],1)); + Actors["Gunboat"].QueueActivity(new CallFunc(() => SetGunboatPath())); + } + + void ReinforceFromSea(World world, int2 startPos, int2 endPos, int2 unload, string[] items) { world.AddFrameEndTask(w => { diff --git a/mods/cnc/maps/gdi01/map.uid b/mods/cnc/maps/gdi01/map.uid index 155efa3283..58b5d7a60c 100644 --- a/mods/cnc/maps/gdi01/map.uid +++ b/mods/cnc/maps/gdi01/map.uid @@ -1 +1 @@ -da082330f1e6a33caa8b631dda4fab8d3f1c1839 \ No newline at end of file +8a67362f59ab8f4ecb9f92abd817304ab0692a52 \ No newline at end of file diff --git a/mods/cnc/maps/gdi01/map.yaml b/mods/cnc/maps/gdi01/map.yaml index e37b1aeaca..131f631bc5 100644 --- a/mods/cnc/maps/gdi01/map.yaml +++ b/mods/cnc/maps/gdi01/map.yaml @@ -8,7 +8,7 @@ Description: Describe your map here Author: Westwood Studios -PlayerCount: 6 +PlayerCount: 9 Tileset: TEMPERAT @@ -327,7 +327,7 @@ Actors: Health: 1 Facing: 0 ActorStance: Guard - Actor87: boat + Gunboat: boat Location: 53,59 Owner: GoodGuy Health: 1 @@ -436,16 +436,21 @@ Waypoints: spawn27: 51,47 spawn26: 48,52 spawn3: 58,53 - spawn2: 52,55 spawn1: 38,55 spawn0: 37,46 + gunboatRight: 61,59 + gunboatLeft: 35,59 + lstStart: 54,61 + lstEnd: 54,56 Smudges: Rules: World: - LocalPlayerFromMap: -CreateMPPlayers: -SpawnMPUnits: -ConquestVictoryConditions: + -CrateSpawner: + LocalPlayerFromMap: Gdi01Script: + diff --git a/mods/cnc/vehicles.yaml b/mods/cnc/vehicles.yaml index 3eca65df0b..d3776c219b 100644 --- a/mods/cnc/vehicles.yaml +++ b/mods/cnc/vehicles.yaml @@ -549,7 +549,7 @@ LST: TerrainSpeeds: 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100% InitialFacing:0 ROT: 4 - Speed: 30 + Speed: 10 Health: HP: 400 Armor: light @@ -558,6 +558,7 @@ LST: RenderUnit: BelowUnits: RenderCargo: + -Selectable: Cargo: Types: Infantry, Vehicle Passengers: 5