From 5e69a753aded0cd6207d7bae9f447cca8b10ceaf Mon Sep 17 00:00:00 2001 From: Maikel de Vries Date: Mon, 8 Jan 2018 11:12:21 +0100 Subject: [PATCH] improve tutorial 08 end sequence checks and dialogue --- planet/Tutorials.ocf/Tutorial08.ocs/Script.c | 8 +++++--- .../Tutorial08.ocs/System.ocg/DlgChief.c | 19 +++++++++++++++++-- .../Tutorial08.ocs/System.ocg/StringTblDE.txt | 1 + .../Tutorial08.ocs/System.ocg/StringTblUS.txt | 1 + 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/planet/Tutorials.ocf/Tutorial08.ocs/Script.c b/planet/Tutorials.ocf/Tutorial08.ocs/Script.c index 468dea52d..2fc381a7e 100644 --- a/planet/Tutorials.ocf/Tutorial08.ocs/Script.c +++ b/planet/Tutorials.ocf/Tutorial08.ocs/Script.c @@ -101,6 +101,7 @@ private func InitMines() lantern->TurnOn(); var lorry = CreateObjectAbove(Lorry, 596, 886); lorry->CreateContents(Metal, 32); + lorry.is_metal_lorry = true; // Another lorry with coal and ore in the lower part of the mines. var lorry = CreateObjectAbove(Lorry, 517, 974); @@ -410,11 +411,12 @@ protected func OnGuideMessageShown(int plr, int index) { if (index == 0) { - TutArrowShowTarget(FindObject(Find_ID(Clonk), Find_AtPoint(218, 182))); + TutArrowShowTarget(FindObject(Find_ID(Clonk), Find_AtPoint(218, 182), Find_Not(Find_Owner(plr)))); } if (index == 2) { TutArrowShowPos(302, 270, 180); + TutArrowShowTarget(FindObject(Find_ID(Lorry), Find_Property("is_metal_lorry"))); } if (index == 3) { @@ -424,7 +426,7 @@ protected func OnGuideMessageShown(int plr, int index) if (index == 4) { TutArrowShowPos(292, 850, 180); - TutArrowShowTarget(FindObject(Find_ID(Clonk), Find_AtPoint(604, 806))); + TutArrowShowTarget(FindObject(Find_ID(Clonk), Find_AtPoint(604, 806), Find_Not(Find_Owner(plr)))); } if (index == 6) { @@ -437,7 +439,7 @@ protected func OnGuideMessageShown(int plr, int index) } if (index == 9) { - TutArrowShowTarget(FindObject(Find_ID(Clonk), Find_AtPoint(218, 182))); + TutArrowShowTarget(FindObject(Find_ID(Clonk), Find_AtPoint(218, 182), Find_Not(Find_Owner(plr)))); } return; } diff --git a/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/DlgChief.c b/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/DlgChief.c index fac267215..ad670973b 100644 --- a/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/DlgChief.c +++ b/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/DlgChief.c @@ -11,15 +11,30 @@ public func Dlg_Chief_Init(object clonk) public func Dlg_Chief_1(object clonk) { var found_lorry = false; - for (var lorry in FindObjects(Find_ID(Lorry), Find_InRect(AbsX(0), AbsY(160), 280, 40))) - if (ObjectCount(Find_ID(Metal), Find_Container(lorry)) >= 32) + for (var lorry in FindObjects(Find_ID(Lorry), Find_InRect(AbsX(0), AbsY(120), 320, 72))) + if (lorry.is_metal_lorry) found_lorry = true; + var made_lorry_progress = false; + var elevator_case = FindObject(Find_ID(ElevatorCase), Find_AtRect(AbsX(282), AbsY(160), 20, 720)); + if (elevator_case) + { + for (var lorry in elevator_case->FindObjects(Find_ID(Lorry), Find_AtPoint())) + if (lorry.is_metal_lorry) + made_lorry_progress = true; + } + if (found_lorry) { MessageBox("$DlgChiefLorry$", clonk, clonk); SetDialogueProgress(8); } + else if (made_lorry_progress) + { + MessageBox("$DlgChiefLorryUp$", clonk, dlg_target); + StopDialogue(); + SetDialogueProgress(1); + } else { MessageBox("$DlgChiefHello$", clonk, dlg_target); diff --git a/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/StringTblDE.txt b/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/StringTblDE.txt index 3fe27cadb..d3d9aa9df 100644 --- a/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/StringTblDE.txt +++ b/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/StringTblDE.txt @@ -9,6 +9,7 @@ DlgChiefMetal=Ja, natürlich. Du darfst alles Metall behalten, wenn du nach hier DlgChiefLorry=Hier ist die Lore mit dem Metall! DlgChiefKeepLorry=Klasse gemacht. Wir können jetzt die gleiche Methode anwenden, um die Mine weiter auszubeuten. Du kannst alles Metall behalten. DlgChiefReally=Du kannst wirklich die Lore und das Metall behalten. +DlgChiefLorryUp=Fast geschafft! Rufe den Fahrstuhl um die Lore hier hoch zu kriegen. # Dialogue: Miner DlgMinerGreeting=Hallo, ich bin %s. Bist du einer der Minenleute hier? diff --git a/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/StringTblUS.txt b/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/StringTblUS.txt index 04bcc107c..1c1ab688f 100644 --- a/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/StringTblUS.txt +++ b/planet/Tutorials.ocf/Tutorial08.ocs/System.ocg/StringTblUS.txt @@ -9,6 +9,7 @@ DlgChiefMetal=Yes, of course. The metal you can get to the surface you may keep, DlgChiefLorry=I got the lorry with metal up to the surface! DlgChiefKeepLorry=That's great, now we can use your method to keep excavating the mine! You may keep the lorry and its contents. DlgChiefReally=You can really keep the lorry and the metal. +DlgChiefLorryUp=Almost there! Get the lorry up to the surface by calling the elevator. # Dialogue: Miner DlgMinerGreeting=Hi, I am %s, are you one of the miners?