Begin fleshing out mission scriping

This commit is contained in:
Paul Chote
2010-08-17 22:11:14 +12:00
parent c7e76cc26d
commit 5ce531f2d5
4 changed files with 58 additions and 13 deletions

View File

@@ -24,9 +24,10 @@ namespace OpenRA.Mods.RA
{ {
Dictionary<string, Actor> Actors; Dictionary<string, Actor> Actors;
Dictionary<string, Player> Players; Dictionary<string, Player> Players;
Map Map;
public void WorldLoaded(World w) public void WorldLoaded(World w)
{ {
Map = w.Map;
Players = w.WorldActor.Trait<CreateMapPlayers>().Players; Players = w.WorldActor.Trait<CreateMapPlayers>().Players;
Actors = w.WorldActor.Trait<SpawnMapActors>().Actors; Actors = w.WorldActor.Trait<SpawnMapActors>().Actors;
Game.MoveViewport((.5f * (w.Map.TopLeft + w.Map.BottomRight).ToFloat2()).ToInt2()); Game.MoveViewport((.5f * (w.Map.TopLeft + w.Map.BottomRight).ToFloat2()).ToInt2());
@@ -57,18 +58,56 @@ namespace OpenRA.Mods.RA
return; return;
if (ticks == 0) if (ticks == 0)
{ SetGunboatPath();
Actors["Actor87"].QueueActivity(new Move(new int2(50,59),1)); // Gunboat
}
ticks++;
if (ticks == 25*5) 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 => world.AddFrameEndTask(w =>
{ {

View File

@@ -1 +1 @@
da082330f1e6a33caa8b631dda4fab8d3f1c1839 8a67362f59ab8f4ecb9f92abd817304ab0692a52

View File

@@ -8,7 +8,7 @@ Description: Describe your map here
Author: Westwood Studios Author: Westwood Studios
PlayerCount: 6 PlayerCount: 9
Tileset: TEMPERAT Tileset: TEMPERAT
@@ -327,7 +327,7 @@ Actors:
Health: 1 Health: 1
Facing: 0 Facing: 0
ActorStance: Guard ActorStance: Guard
Actor87: boat Gunboat: boat
Location: 53,59 Location: 53,59
Owner: GoodGuy Owner: GoodGuy
Health: 1 Health: 1
@@ -436,16 +436,21 @@ Waypoints:
spawn27: 51,47 spawn27: 51,47
spawn26: 48,52 spawn26: 48,52
spawn3: 58,53 spawn3: 58,53
spawn2: 52,55
spawn1: 38,55 spawn1: 38,55
spawn0: 37,46 spawn0: 37,46
gunboatRight: 61,59
gunboatLeft: 35,59
lstStart: 54,61
lstEnd: 54,56
Smudges: Smudges:
Rules: Rules:
World: World:
LocalPlayerFromMap:
-CreateMPPlayers: -CreateMPPlayers:
-SpawnMPUnits: -SpawnMPUnits:
-ConquestVictoryConditions: -ConquestVictoryConditions:
-CrateSpawner:
LocalPlayerFromMap:
Gdi01Script: Gdi01Script:

View File

@@ -549,7 +549,7 @@ LST:
TerrainSpeeds: 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100% TerrainSpeeds: 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%, 100%
InitialFacing:0 InitialFacing:0
ROT: 4 ROT: 4
Speed: 30 Speed: 10
Health: Health:
HP: 400 HP: 400
Armor: light Armor: light
@@ -558,6 +558,7 @@ LST:
RenderUnit: RenderUnit:
BelowUnits: BelowUnits:
RenderCargo: RenderCargo:
-Selectable:
Cargo: Cargo:
Types: Infantry, Vehicle Types: Infantry, Vehicle
Passengers: 5 Passengers: 5