Permalink
Browse files

Campaign videos handled in libcampaign.

- cam1-7: Make artifact group move at different times depending on difficulty.
- cam2-6: Add two VTOL rearming pads for the VTOL droids on map and use water triangle correction and move or remove overlapped objects. Remove truck management. Detecting the main base activates the scouts and defenders and enables the rest of the factories.

- Reduce repeated, and ugly, code relating to playing video sequences. Now it is all handled by the campaign library.
  • Loading branch information...
KJeff01 committed Nov 4, 2017
1 parent 3438382 commit 1dda9356f309ea04ccdda8b80e82638a657c271d
Showing with 139 additions and 464 deletions.
  1. +1 −1 data/base/script/campaign/cam1-1.js
  2. +2 −2 data/base/script/campaign/cam1-1s.js
  3. +1 −2 data/base/script/campaign/cam1-2.js
  4. +1 −1 data/base/script/campaign/cam1-2s.js
  5. +3 −3 data/base/script/campaign/cam1-3.js
  6. +1 −1 data/base/script/campaign/cam1-3s.js
  7. +2 −5 data/base/script/campaign/cam1-4a.js
  8. +1 −1 data/base/script/campaign/cam1-4as.js
  9. +2 −3 data/base/script/campaign/cam1-5s.js
  10. +2 −3 data/base/script/campaign/cam1-7.js
  11. +1 −18 data/base/script/campaign/cam1-7s.js
  12. +1 −19 data/base/script/campaign/cam1-ds.js
  13. +1 −17 data/base/script/campaign/cam1a-c.js
  14. +1 −1 data/base/script/campaign/cam1a.js
  15. +1 −1 data/base/script/campaign/cam1b.js
  16. +3 −13 data/base/script/campaign/cam1c.js
  17. +1 −1 data/base/script/campaign/cam1ca.js
  18. +1 −18 data/base/script/campaign/cam1end.js
  19. +1 −17 data/base/script/campaign/cam2-1s.js
  20. +1 −18 data/base/script/campaign/cam2-2s.js
  21. +1 −17 data/base/script/campaign/cam2-5s.js
  22. +14 −14 data/base/script/campaign/cam2-6.js
  23. +1 −17 data/base/script/campaign/cam2-6s.js
  24. +1 −17 data/base/script/campaign/cam2-7s.js
  25. +1 −17 data/base/script/campaign/cam2-8s.js
  26. +2 −2 data/base/script/campaign/cam2-a.js
  27. +1 −17 data/base/script/campaign/cam2-b.js
  28. +2 −2 data/base/script/campaign/cam2-c.js
  29. +1 −17 data/base/script/campaign/cam2-ds.js
  30. +2 −19 data/base/script/campaign/cam2-end.js
  31. +1 −18 data/base/script/campaign/cam3-1.js
  32. +1 −19 data/base/script/campaign/cam3-1s.js
  33. +6 −18 data/base/script/campaign/cam3-2.js
  34. +1 −18 data/base/script/campaign/cam3-2s.js
  35. +1 −18 data/base/script/campaign/cam3-a.js
  36. +1 −18 data/base/script/campaign/cam3-ab.js
  37. +2 −19 data/base/script/campaign/cam3-ad1.js
  38. +2 −24 data/base/script/campaign/cam3-b.js
  39. +1 −18 data/base/script/campaign/cam3-c.js
  40. +69 −10 data/base/script/campaign/libcampaign.js
  41. BIN data/base/wrf/cam2/sub2-6/dinit.bjo
  42. BIN data/base/wrf/cam2/sub2-6/feat.bjo
  43. BIN data/base/wrf/cam2/sub2-6/game.map
  44. BIN data/base/wrf/cam2/sub2-6/struct.bjo
@@ -65,7 +65,7 @@ function eventStartLevel()
"artifactLocation": { tech: "R-Wpn-MG3Mk1" }, //Heavy machine gun
});
hackAddMessage("FLIGHT", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("FLIGHT");
hackAddMessage("C1-1_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, true);
}
@@ -13,13 +13,13 @@ function eventChat(from, to, message)
//Video if player does not yet have power module built
function resPowModVideo()
{
hackAddMessage("MB1_B2_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("MB1_B2_MSG");
}
//Sector clear commander!
function secondVideo()
{
hackAddMessage("SB1_1_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("SB1_1_MSG");
}
//Has player built the power module?
@@ -5,7 +5,7 @@ include("script/campaign/templates.js");
function exposeNorthBase()
{
camDetectEnemyBase("NorthGroup"); // no problem if already detected
hackAddMessage("SB1_2_MSG2", MISS_MSG, CAM_HUMAN_PLAYER, true); // that's what it was for
camPlayVideos("SB1_2_MSG2");
}
function camArtifactPickup_ScavLab()
@@ -100,7 +100,6 @@ function eventStartLevel()
},
});
hackAddMessage("SB1_2_MSG", MISS_MSG, CAM_HUMAN_PLAYER, false);
camDetectEnemyBase("ScavLabGroup");
camSetArtifacts({
@@ -7,6 +7,6 @@ function eventStartLevel()
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(1800));
hackAddMessage("SB1_2_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("SB1_2_MSG");
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_2");
}
@@ -55,7 +55,7 @@ camAreaEvent("WestConvoyTrigger", function(droid)
function playYouAreInContraventionOfTheNewParadigm()
{
hackAddMessage("SB1_3_MSG4", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("SB1_3_MSG4");
camManageGroup(NPScoutGroup, CAM_ORDER_COMPROMISE, {
pos: camMakePos("RTLZ"),
repair: 66,
@@ -139,7 +139,7 @@ function camEnemyBaseEliminated_ScavBaseGroup()
function playNPWarningMessage()
{
hackAddMessage("SB1_3_MSG3", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("SB1_3_MSG3");
}
function playNPWarningSound()
@@ -202,7 +202,7 @@ function eventStartLevel()
},
});
hackAddMessage("SB1_3_MSG", MISS_MSG, CAM_HUMAN_PLAYER, false);
camPlayVideos("SB1_3_MSG");
hackAddMessage("C1-3_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false); // south-west beacon
camSetArtifacts({
@@ -7,6 +7,6 @@ function eventStartLevel()
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(3600));
hackAddMessage("SB1_3_UPDATE", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("SB1_3_UPDATE");
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_3");
}
@@ -73,7 +73,7 @@ camAreaEvent("LandingZoneTrigger", function()
function moreLandingZoneTrigger()
{
hackAddMessage("SB1_4_B", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("SB1_4_B");
// Give extra 30 minutes.
setMissionTime(camChangeOnDiff(1800) + getMissionTime());
camSetStandardWinLossConditions(CAM_VICTORY_OFFWORLD, "SUB_1_5S", {
@@ -153,11 +153,8 @@ function eventStartLevel()
},
});
// These seem to be in a different order this time,
// first PROX then MISS, not sure if matters.
hackAddMessage("C1-4_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false);
hackAddMessage("SB1_4_MSG", MISS_MSG, CAM_HUMAN_PLAYER, false);
camSetArtifacts({
"NPCommandCenter": { tech: "R-Vehicle-Metals01" },
"NPResearchFacility": { tech: "R-Vehicle-Body04" },
@@ -7,6 +7,6 @@ function eventStartLevel()
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(1800));
hackAddMessage("SB1_4_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("SB1_4_MSG");
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_4A");
}
@@ -2,11 +2,10 @@ include("script/campaign/libcampaign.js");
function eventStartLevel()
{
var ti = camChangeOnDiff(3600); //60 min
camSetupTransporter(11, 52, 100, 126);
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(ti);
hackAddMessage("SB1_5_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
setMissionTime(camChangeOnDiff(3600)); //60 min
camPlayVideos("SB1_5_MSG");
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_5");
}
@@ -67,7 +67,7 @@ camAreaEvent("artifactCheckNP", function()
var artifact = camGetArtifacts();
camSafeRemoveObject(artifact[0], false);
hackAddMessage("SB1_7_MSG3", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("SB1_7_MSG3");
hackAddMessage("C1-7_LZ2", PROX_MSG, CAM_HUMAN_PLAYER, true); //NPLZ blip
camCallOnce("removeCanyonBlip");
@@ -187,7 +187,6 @@ function eventStartLevel()
{
enemyHasArtifact = false;
enemyStoleArtifact = false;
var time = (difficulty === INSANE) ? 25000 : 50000;
var startpos = getObject("startPosition");
var lz = getObject("landingZone"); //player lz
var tent = getObject("transporterEntry");
@@ -283,5 +282,5 @@ function eventStartLevel()
hackAddMessage("C1-7_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, true); //Canyon
queue("enableReinforcements", 15000);
queue("getArtifact", time);
queue("getArtifact", camChangeOnDiff(90000));
}
@@ -1,28 +1,11 @@
include("script/campaign/libcampaign.js");
var index;
function eventVideoDone()
{
const VIDEOS = ["SB1_7_MSG", "SB1_7_MSG2"];
if (!camDef(index))
{
index = 0;
}
if (index < VIDEOS.length)
{
hackAddMessage(VIDEOS[index], MISS_MSG, CAM_HUMAN_PLAYER, true);
index = index + 1;
}
}
function eventStartLevel()
{
camSetupTransporter(11, 52, 55, 1);
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(1800)); //30 min
eventVideoDone();
camPlayVideos(["SB1_7_MSG", "SB1_7_MSG2"]);
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_7");
}
@@ -1,29 +1,11 @@
include("script/campaign/libcampaign.js");
var index;
function eventVideoDone()
{
const VIDEOS = ["MB1D_MSG", "MB1D_MSG2"];
if (!camDef(index))
{
index = 0;
}
if (index < VIDEOS.length)
{
hackAddMessage(VIDEOS[index], MISS_MSG, CAM_HUMAN_PLAYER, true);
index = index + 1;
}
}
function eventStartLevel()
{
camSetupTransporter(11, 52, 126, 112);
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(camChangeOnDiff(7200)); //2 hours
eventVideoDone();
camPlayVideos(["MB1D_MSG", "MB1D_MSG2"]);
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "SUB_1_D");
}
@@ -23,22 +23,6 @@ const NEW_PARADIGM_RES = [
];
var index; //Current LZ (SE, N, canyon, south hill, road north of base)
var switchLZ; //Counter for incrementing index every third landing
var videoIndex;
function eventVideoDone()
{
const VIDEOS = ["MB1A-C_MSG", "MB1A-C_MSG2"];
if (!camDef(videoIndex))
{
videoIndex = 0;
}
if (videoIndex < VIDEOS.length)
{
hackAddMessage(VIDEOS[videoIndex], MISS_MSG, CAM_HUMAN_PLAYER, true);
videoIndex = videoIndex + 1;
}
}
//Check if all enemies are gone and win after 15 transports
function extraVictoryCondition()
@@ -160,7 +144,7 @@ function eventStartLevel()
}
camCompleteRequiredResearch(NEW_PARADIGM_RES, NEW_PARADIGM);
eventVideoDone();
camPlayVideos(["MB1A-C_MSG", "MB1A-C_MSG2"]);
index = 0;
switchLZ = 0;
@@ -11,7 +11,7 @@ camAreaEvent("LaunchScavAttack", function(droid)
var spos = getObject("scav1soundpos");
playSound("pcv375.ogg", spos.x, spos.y, 0);
playSound("pcv456.ogg");
hackAddMessage("MB1A_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("MB1A_MSG");
hackAddMessage("C1A_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false);
// send scavengers on war path if triggered above
camManageGroup(
@@ -117,7 +117,7 @@ function eventStartLevel()
},
});
hackAddMessage("MB1B_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("MB1B_MSG");
camDetectEnemyBase("base4group"); // power surge detected
with (camTemplates) camSetFactories({
@@ -142,7 +142,7 @@ camAreaEvent("NPLZ1Trigger", function()
{
// Message4 here, Message3 for the second LZ, and
// please don't ask me why they did it this way
hackAddMessage("MB1C4_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("MB1C4_MSG");
camDetectEnemyBase("NPLZ1Group");
camSetBaseReinforcements("NPLZ1Group", camChangeOnDiff(300000), "getDroidsForNPLZ",
@@ -155,7 +155,7 @@ camAreaEvent("NPLZ1Trigger", function()
camAreaEvent("NPLZ2Trigger", function()
{
hackAddMessage("MB1C3_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("MB1C3_MSG");
camDetectEnemyBase("NPLZ2Group");
camSetBaseReinforcements("NPLZ2Group", camChangeOnDiff(300000), "getDroidsForNPLZ",
@@ -166,16 +166,6 @@ camAreaEvent("NPLZ2Trigger", function()
);
});
function playSecondVideo()
{
hackAddMessage("MB1C2_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
}
function eventVideoDone()
{
camCallOnce("playSecondVideo");
}
function eventStartLevel()
{
camSetStandardWinLossConditions(CAM_VICTORY_STANDARD, "CAM_1CA");
@@ -274,7 +264,7 @@ function eventStartLevel()
});
hackAddMessage("C1C_OBJ1", PROX_MSG, CAM_HUMAN_PLAYER, false); // initial beacon
hackAddMessage("MB1C_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos(["MB1C_MSG", "MB1C2_MSG"]);
camSetArtifacts({
"ScavSouthFactory": { tech: "R-Wpn-Rocket05-MiniPod" },
@@ -136,7 +136,7 @@ function eventStartLevel()
}
setMissionTime(camChangeOnDiff(1800));
hackAddMessage("MB1CA_MSG", MISS_MSG, CAM_HUMAN_PLAYER, true);
camPlayVideos("MB1CA_MSG");
// first transport after 10 seconds; will re-queue itself
queue('sendTransport', 10000);
@@ -1,28 +1,11 @@
include("script/campaign/libcampaign.js");
var index;
function eventVideoDone()
{
const VIDEOS = ["CAM1_OUT", "CAM1_OUT2", "CAM2_BRIEF"];
if (!camDef(index))
{
index = 0;
}
if (index < VIDEOS.length)
{
hackAddMessage(VIDEOS[index], MISS_MSG, CAM_HUMAN_PLAYER, true);
index = index + 1;
}
}
function eventStartLevel()
{
camSetupTransporter(11, 52, 40, 1);
centreView(13, 52);
setNoGoArea(10, 51, 12, 53, CAM_HUMAN_PLAYER);
setMissionTime(900); //15 min
eventVideoDone();
camPlayVideos(["CAM1_OUT", "CAM1_OUT2", "CAM2_BRIEF"]);
camSetStandardWinLossConditions(CAM_VICTORY_PRE_OFFWORLD, "CAM_2A");
}
@@ -3,22 +3,6 @@ SUB_2_1S campaign script
Authors: Cristian Odorico (Alpha93) / KJeff01
*/
include("script/campaign/libcampaign.js");
var index;
function eventVideoDone()
{
const VIDEOS = ["MB2_1_MSG", "MB2_1_MSG2"];
if (!camDef(index))
{
index = 0;
}
if (index < VIDEOS.length)
{
hackAddMessage(VIDEOS[index], MISS_MSG, CAM_HUMAN_PLAYER, true);
index = index + 1;
}
}
function eventStartLevel()
{
@@ -33,5 +17,5 @@ function eventStartLevel()
//Set Mission Time
setMissionTime(camChangeOnDiff(1800));
//Give player briefings
eventVideoDone();
camPlayVideos(["MB2_1_MSG", "MB2_1_MSG2"]);
}
Oops, something went wrong.

0 comments on commit 1dda935

Please sign in to comment.