Added soviet mission 1 script, expanded _global with more vehicle types and CreateVehicle/CreateInfrantry now support coordinate input.

This commit is contained in:
Justin Marshall
2020-07-14 15:05:25 -07:00
parent e5544d2fc2
commit 5d441ca39e
4 changed files with 74 additions and 14 deletions
+6 -5
View File
@@ -432,6 +432,7 @@ Height=66
13=Greece,2TNK,256,6320,0,Area Guard,None 13=Greece,2TNK,256,6320,0,Area Guard,None
14=Greece,2TNK,256,6449,0,Area Guard,None 14=Greece,2TNK,256,6449,0,Area Guard,None
[INFANTRY] [INFANTRY]
0=Greece,C1,256,5821,4,Area Guard,0,None 0=Greece,C1,256,5821,4,Area Guard,0,None
1=Greece,C2,256,5692,0,Guard,0,None 1=Greece,C2,256,5692,0,Guard,0,None
@@ -541,10 +542,10 @@ Player=USSR
Count=0 Count=0
[OverlayPack] [OverlayPack]
1=bQAAIIH//osZ/4EL/ncA/4EOAAL+egD/cPaBCv75AP+BDP99AIsagQwRhIEJ/nwA/4EMAA 1=bQAAIIH//osZ/4EK/ncA/4EOAAL+egD/gQtgCoEM/vkA/4MM/wn+ewD/gQkQfnGH/nMA/4
2=L+gwD//3oAiByEC/8LDP9+AIgcgQsCBP94AIwZIAGECf8KDP99AA0ehQsMCv8L/3wACRwA 2=EK/30Ahxv/gwCDGoQJ/wwL/34AiByBCwD9/30Aix2BDACD/30AjBqBCgB/gQz/fAAJHAYA
3=fAII/m4A/4BZAAAggf9wAYkKCv8K/wn/DAv+eAD/hAoJCwsABYIKCf58AP+BCSAB/nkA/4 3=gQr/cAAMHYBWAAAggf9wAYMKCv8gAoEJ/ngA/4IJCgB8gwoLDP95ABMAIIUgAf55AP+BCS
4=EJIIH+egD/AHz/gACSARB//3kAFgL/fAAVAsiJAf5+AP//gAARA/+CABED/uka/4A= 4=CB/noA/wB8/4AAkgEQf/96ABMA/30AlABiA/5+AP//gAARA/+CABED/uka/4A=
[Briefing] [Briefing]
1=A pitiful excuse for resistance has blockaded itself in this village. 1=A pitiful excuse for resistance has blockaded itself in this village.
@@ -553,5 +554,5 @@ Count=0
4=lesson. 4=lesson.
[Digest] [Digest]
1=jiauD6TJir2zlXrSMfXgYYUtq7g= 1=9QVKWgKK7MJHlaf+Cp3h7V2cWSk=
+30 -8
View File
@@ -5431,8 +5431,19 @@ static int Script_CreateVehicle(lua_State* L) {
int objectIndex = lua_tointeger(L, 1); int objectIndex = lua_tointeger(L, 1);
int houseType = lua_tointeger(L, 2); int houseType = lua_tointeger(L, 2);
int in_x = lua_tointeger(L, 3); int in_x = 0;
int in_y = lua_tointeger(L, 4); int in_y = 0;
COORDINATE coord;
if (lua_gettop(L) == 3) {
CELL cell = lua_tointeger(L, 3);
coord = Cell_Coord(cell);
}
else {
in_x = lua_tointeger(L, 3);
in_y = lua_tointeger(L, 4);
coord = Cell_Coord(XY_Cell(in_x, in_y));
}
HouseClass* this_house = Houses.Ptr(houseType); HouseClass* this_house = Houses.Ptr(houseType);
@@ -5444,7 +5455,7 @@ static int Script_CreateVehicle(lua_State* L) {
bool new_unit_placed = false; bool new_unit_placed = false;
if (new_unit->Unlimbo(Cell_Coord(XY_Cell(in_x, in_y)))) { if (new_unit->Unlimbo(coord)) {
new_unit_placed = true; new_unit_placed = true;
} }
@@ -5454,7 +5465,7 @@ static int Script_CreateVehicle(lua_State* L) {
** placement at the given location. ** placement at the given location.
*/ */
if (!new_unit_placed) { if (!new_unit_placed) {
CELL cell = Map.Nearby_Location(Cell_Coord(XY_Cell(in_x, in_y)), new_unit->Class->Speed); CELL cell = Map.Nearby_Location(coord, new_unit->Class->Speed);
if (new_unit->Unlimbo(::Cell_Coord(cell))) { if (new_unit->Unlimbo(::Cell_Coord(cell))) {
new_unit_placed = true; new_unit_placed = true;
} }
@@ -5508,8 +5519,19 @@ static int Script_CreateInfantry(lua_State* L) {
int objectIndex = lua_tointeger(L, 1); int objectIndex = lua_tointeger(L, 1);
int houseType = lua_tointeger(L, 2); int houseType = lua_tointeger(L, 2);
int in_x = lua_tointeger(L, 3); int in_x = 0;
int in_y = lua_tointeger(L, 4); int in_y = 0;
COORDINATE coord;
if (lua_gettop(L) == 3) {
CELL cell = lua_tointeger(L, 3);
coord = Cell_Coord(cell);
}
else {
in_x = lua_tointeger(L, 3);
in_y = lua_tointeger(L, 4);
coord = Cell_Coord(XY_Cell(in_x, in_y));
}
HouseClass* this_house = Houses.Ptr(houseType); HouseClass* this_house = Houses.Ptr(houseType);
@@ -5521,7 +5543,7 @@ static int Script_CreateInfantry(lua_State* L) {
bool new_unit_placed = false; bool new_unit_placed = false;
if (new_unit->Unlimbo(Cell_Coord(XY_Cell(in_x, in_y)), DIR_S)) { if (new_unit->Unlimbo(coord, DIR_S)) {
new_unit_placed = true; new_unit_placed = true;
} }
@@ -5531,7 +5553,7 @@ static int Script_CreateInfantry(lua_State* L) {
** placement at the given location. ** placement at the given location.
*/ */
if (!new_unit_placed) { if (!new_unit_placed) {
CELL cell = Map.Nearby_Location(Cell_Coord(XY_Cell(in_x, in_y)), new_unit->Class->Speed); CELL cell = Map.Nearby_Location(coord, new_unit->Class->Speed);
if (new_unit->Unlimbo(::Cell_Coord(cell), DIR_S)) { if (new_unit->Unlimbo(::Cell_Coord(cell), DIR_S)) {
new_unit_placed = true; new_unit_placed = true;
} }
+31
View File
@@ -0,0 +1,31 @@
require("_Global")
function map_briefing()
SetBriefingText("Welcome Comrade General! Here in Alaska we will be begin our glorous conquest!")
end
function map_start()
end
function map_frame()
local numTeslaTanks = 0
local numRadarDomes = 0
numRadarDomes = CountBuildings(BuildingTypes.DOME)
if numRadarDomes == 0 then
Lose(Houses.USSR)
end
if numRadarDomes == 2 then
Win(Houses.USSR)
end
numTaslaTanks = CountUnits(VehicleTypes.TESLATANK)
if numTaslaTanks == 0 then
PlaySpeech(11) -- Reinforcements have arrived
CreateVehicle(VehicleTypes.TESLATANK,Houses.USSR,5833)
CreateVehicle(VehicleTypes.TESLATANK,Houses.USSR,5577)
CreateVehicle(VehicleTypes.TESLATANK,Houses.USSR,5706)
end
end
+7 -1
View File
@@ -144,7 +144,13 @@
-- Counterstrike only: -- Counterstrike only:
ANT1=14, -- First ant type ANT1=14, -- First ant type
ANT2=15, -- Second ant type ANT2=15, -- Second ant type
ANT3=16 -- Third ant type ANT3=16, -- Third ant type
-- Aftermath
CHRONOTANK=17, -- Chrono shifting tank
TESLATANK=18, -- Tesla Tank
MAD=19,
DEMOTRUNK
} }
-- ********************************************************* -- *********************************************************