ASA: Improve displaying of mission panels all over the place
authorWuzzy <almikes@aol.com>
Thu, 28 Sep 2017 17:26:54 +0200
changeset 12575 0c5ce463949b
parent 12574 2a7cc304c8be
child 12576 1fb961480b3c
ASA: Improve displaying of mission panels all over the place Also fix mission panel often not shown when watching full intro sequence.
ChangeLog.txt
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death02.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua
--- a/ChangeLog.txt	Thu Sep 28 08:55:10 2017 +0200
+++ b/ChangeLog.txt	Thu Sep 28 17:26:54 2017 +0200
@@ -200,10 +200,11 @@
 
 A Space Adventure:
  + Side missions save and show your personal best successes (e.g. fastest finish in Hard Flying)
+ + Spacetrip: Show 2 flowers over fully completed planets (with side missions)
  + All missions: Add skip where it doesn't hurt
- + Spacetrip: Show 2 flowers over fully completed planets (with side missions)
  + All missions: Clarify mine timers
- + Change team colors
+ + All missions: Improve displaying behaviour of mission panel
+ + All missions: Change team colors
  * Spacetrip: Fix various bugs and logic flaws in the initial mission
  * A frozen adventure: Fix bazooka and excess freezers (>6) not retained over checkpoints
  * A frozen adventure: Fix and improve poorly written messages
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -20,10 +20,6 @@
 local ropeDestroyed = false -- for detecting if player roped to the moon
 local ropedToMoon = 0
 local checkPointReached = 1 -- 1 is start of the game
-local objectives = loc("Go to the moon by using the flying saucer and complete the main mission").."|"..
-loc("Come back to this mission and visit the other planets to collect the crates").."|"..
-loc("Visit the Death Planet after completing all the other planets' main missions").."|"..
-loc("Come back to this mission after collecting all the device parts")
 -- dialogs
 local dialog01 = {}
 local dialog02 = {}
@@ -36,11 +32,19 @@
 local dialog09 = {}
 -- mission objectives
 local goals = {
+	["init"] = {missionName, loc("Getting ready"), loc("Help Hog Solo to find all the parts of the anti-gravity device.")..
+	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), 1, 0},
 	[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate").."|"..loc("Try not to get spotted by the guards!"), 1, 4500},
 	[dialog02] = {missionName, loc("The adventure begins!"), loc("Use the saucer and fly to the moon").."|"..loc("Travel carefully as your fuel is limited"), 1, 4500},
 	[dialog03] = {missionName, loc("An unexpected event!"), loc("Use the saucer and fly away").."|"..loc("Beware, any damage taken will stay until you complete the moon's main mission"), 1, 7000},
 	[dialog07] = {missionName, loc("Searching the stars!"), loc("Use the saucer and fly away").."|"..loc("Visit the planets of Ice, Desert and Fruit before you proceed to the Death Planet"), 1, 6000},
-	[dialog08] = {missionName, loc("Saving Hogera"), loc("Fly to the meteorite and detonate the explosives"), 1, 7000}
+	[dialog08] = {missionName, loc("Saving Hogera"), loc("Fly to the meteorite and detonate the explosives"), 1, 7000},
+	["open_side_missions"] = {missionName, loc("Conquering the galaxy"),
+		loc("Use the flying saucer to fly the other planets.").."|"..
+		loc("Complete the remaining side missions to complete this mission.").."|"..
+		loc("One flower: Incomplete side missions").."|"..
+		loc("Two flowers: All missions complete"), 1, 8000},
+	["free"] = {missionName, loc("Spacetrip"), loc("Use the flying saucer to fly to the other planets."), 1, 5000}
 }
 -- crates
 local saucerX = 3270
@@ -179,8 +183,15 @@
 	AnimWait(hero.gear, 3000)
 
 	FollowGear(hero.gear)
-	ShowMission(loc("Spacetrip"), loc("Getting ready"), loc("Help Hog Solo to find all the parts of the anti-gravity device.")..
-	"|"..loc("Travel to all the neighbor planets and collect all the pieces"), -amSkip, 0)
+	if GetCampaignVar("Won") == "true" then
+		if GetCampaignVar("Mission1Won") == "true" then
+			ShowMission(unpack(goals["free"]))
+		else
+			ShowMission(unpack(goals["open_side_missions"]))
+		end
+	else
+		ShowMission(unpack(goals["init"]))
+	end
 
 	-- do checkpoint stuff needed after game starts
 	if checkPointReached == 1 then
@@ -747,9 +758,8 @@
 	if ropedToMoon ~= 2 then
 		ropedToMoon = 2
 		SendStat(siGameResult, loc("You have violated PAotH regulations!"))
-		SendStat(siCustomAchievement, loc("You have triggered the secret Do-Not-Rope-to-the-Moon Defense System!"))
-		SendStat(siCustomAchievement, loc("Collect the crate with the flying saucer!"))
-		SendStat(siCustomAchievement, loc("Fly to the moon."))
+		SendStat(siCustomAchievement, loc("You have triggered the secret Do-Not-Rope-to-the-Moon Defense System."))
+		SendStat(siCustomAchievement, loc("Use the flying saucer from the crate to fly to the moon."))
 		sendSimpleTeamRankings({teamC.name})
 		EndGame()
 	end
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death02.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death02.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -22,7 +22,7 @@
 local dialog01 = {}
 -- mission objectives
 local goals = {
-	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 4500},
+	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 35000},
 }
 -- hogs
 local hero = {
@@ -53,6 +53,7 @@
 }
 -- After hero killed an enemy, his weapons will be reset in the next round
 local heroWeaponResetPending = false
+local battleStarted = false
 
 -------------- LuaAPI EVENT HANDLERS ------------------
 
@@ -90,7 +91,7 @@
 function onGameStart()
 	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
-	ShowMission(missionName, loc("Challenge Objectives"), challengeObjectives, -amSkip, 0)
+	ShowMission(unpack(goals["init"]))
 
 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
 	AddEvent(onHeroWin, {hero.gear}, heroWin, {hero.gear}, 0)
@@ -154,6 +155,25 @@
 	CheckEvents()
 end
 
+-- Hide mission panel when player does anything
+function hideMissionOnAction()
+	if battleStarted then
+		HideMission()
+	end
+end
+
+onHogAttack = hideMissionOnAction
+onAttack = hideMissionOnAction
+onLeft = hideMissionOnAction
+onRight = hideMissionOnAction
+onUp = hideMissionOnAction
+onDown = hideMissionOnAction
+onLJump = hideMissionOnAction
+onHJump = hideMissionOnAction
+onSlot = hideMissionOnAction
+onSetWeapon = hideMissionOnAction
+onTimer = hideMissionOnAction
+
 function onPrecise()
 	if GameTime > 3000 then
 		SetAnimSkip(true)
@@ -214,10 +234,7 @@
 -------------- ANIMATIONS ------------------
 
 function Skipanim(anim)
-	if goals[anim] ~= nil then
-		ShowMission(unpack(goals[anim]))
-    end
-    startBattle()
+	startBattle()
 end
 
 function AnimationSetup()
@@ -240,6 +257,7 @@
 ------------ Other Functions -------------------
 
 function startBattle()
+	battleStarted = true
 	AnimSwitchHog(hero.gear)
 	TurnTimeLeft = TurnTime
 end
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -25,7 +25,7 @@
 -- mission objectives
 local goals = {
 	[dialog01] = {missionName, loc("Getting ready"), loc("The device part is hidden in one of the crates! Go and get it!").."|"..
-			loc("Most of the destructible terrain in marked with blue color").."|"..loc("Mines time: 0 seconds"), 1, 4500},
+			loc("Most of the destructible terrain in marked with blue color").."|"..loc("Mines time: 0 seconds"), 1, 6000},
 }
 -- crates
 local btorch1Y = 60
@@ -421,8 +421,8 @@
 function Skipanim(anim)
 	if goals[anim] ~= nil then
 		ShowMission(unpack(goals[anim]))
-    end
-    AnimSwitchHog(hero.gear)
+	end
+	AnimSwitchHog(hero.gear)
 	if anim == dialog01 then
 		startMission()
 	end
@@ -450,6 +450,7 @@
 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("The tunnel entrance is over there."), SAY_SAY, 3000}})
 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}})
 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
+	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
 	table.insert(dialog01, {func = startMission, args = {hero.gear}})
 end
 
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -92,6 +92,9 @@
 	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
 
+	ShowMission(unpack(goals[dialog01]))
+	HideMission()
+
 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
 	AddEvent(onHeroSafe, {hero.gear}, heroSafe, {hero.gear}, 0)
 
@@ -115,6 +118,12 @@
 	CheckEvents()
 end
 
+function onGearAdd(gear)
+	if GetGearType(gear) == gtRope then
+		HideMission()
+	end
+end
+
 function onGearDelete(gear)
 	if gear == hero.gear then
 		hero.dead = true
@@ -179,7 +188,7 @@
 function Skipanim(anim)
 	if goals[anim] ~= nil then
 		ShowMission(unpack(goals[anim]))
-    end
+	end
 	challengeStart()
 end
 
@@ -191,6 +200,7 @@
 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("The tunnel is about to get flooded!"), SAY_THINK, 4000}})
 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I have to reach the surface as quickly as I can."), SAY_THINK, 4000}})
 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
+	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
 	table.insert(dialog01, {func = challengeStart, args = {hero.gear}})
 end
 
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -18,7 +18,7 @@
 local dialog01 = {}
 -- mission objectives
 local goals = {
-	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 4500},
+	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 60000},
 }
 -- hogs
 local hero = {
@@ -86,7 +86,7 @@
 function onGameStart()
 	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
-	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
+	ShowMission(unpack(goals["init"]))
 
 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
 	AddEvent(onLose, {hero.gear}, lose, {hero.gear}, 0)
@@ -130,6 +130,9 @@
 	if GetGearType(gear) == gtFlame then
 		flameCounter = flameCounter + 1
 	end
+	if GetGearType(gear) == gtRCPlane then
+		HideMission()
+	end
 end
 
 function onGearDelete(gear)
@@ -174,15 +177,8 @@
 
 -------------- ANIMATIONS ------------------
 
-function Skipanim(anim)
-	if goals[anim] ~= nil then
-		ShowMission(unpack(goals[anim]))
-    end
-end
-
 function AnimationSetup()
 	-- DIALOG 01 - Start, game instructions
-	AddSkipFunction(dialog01, Skipanim, {dialog01})
 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the Desert Planet, Hog Solo found some time to play with his RC plane"), 3000}})
 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Each time you destroy all the targets on your current level you'll get teleported to the next level"), 5000}})
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -32,9 +32,9 @@
 local dialog03 = {}
 -- mission objectives
 local goals = {
-	[dialog01] = {missionName, loc("Ready for Battle?"), loc("Walk left if you want to join Captain Lime or right if you want to decline his offer."), 1, 4000},
-	[dialog02] = {missionName, loc("Battle Starts Now!"), loc("You have chosen to fight! Lead the Green Bananas to battle and eliminate all the enemies!"), 1, 4000},
-	[dialog03] = {missionName, loc("Time to run!"), loc("You have chosen to flee ... Unfortunately, the only place where you can launch your saucer is the left-most place on the map."), 1, 4000},
+	[dialog01] = {missionName, loc("Ready for Battle?"), loc("Walk left if you want to join Captain Lime or right if you want to decline his offer."), 1, 7000},
+	[dialog02] = {missionName, loc("Battle Starts Now!"), loc("You have chosen to fight! Lead the Green Bananas to battle and eliminate all the enemies!"), 1, 7000},
+	[dialog03] = {missionName, loc("Time to run!"), loc("You have chosen to flee ... Unfortunately, the only place where you can launch your saucer is the left-most place on the map."), 1, 7000},
 }
 -- crates
 local crateWMX = 2170
@@ -373,12 +373,12 @@
 function Skipanim(anim)
 	if goals[anim] ~= nil then
 		ShowMission(unpack(goals[anim]))
-    end
-    if anim == dialog01 then
+	end
+	if anim == dialog01 then
 		AnimSwitchHog(hero.gear)
 	elseif anim == dialog02 or anim == dialog03 then
 		startBattle()
-    end
+	end
 end
 
 function AnimationSetup()
@@ -396,7 +396,7 @@
 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("I would gladly help you if we won this battle but under these circumstances I'll only help you if you fight for our side."), SAY_SAY, 6000}})
 	table.insert(dialog01, {func = AnimSay, args = {green1.gear, loc("What do you say? Will you fight for us?"), SAY_SAY, 3000}})
 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
-	table.insert(dialog01, {func = ShowMission, args = {missionName, loc("Ready for Battle?"), loc("Walk left if you want to join Captain Lime or right if you want to decline his offer."), 1, 7000}})
+	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
 	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
 	-- DIALOG 02 - Hero selects to fight
 	AddSkipFunction(dialog02, Skipanim, {dialog02})
@@ -412,6 +412,7 @@
 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("Don't be foolish, son, there will be more."), SAY_SAY, 2000}})
 	table.insert(dialog02, {func = AnimSay, args = {green1.gear, loc("Try to be smart and eliminate them quickly. This way you might scare off the rest!"), SAY_SAY, 5000}})
 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 5000}})
+	table.insert(dialog02, {func = ShowMission, args = goals[dialog02]})
 	table.insert(dialog02, {func = startBattle, args = {hero.gear}})
 	-- DIALOG 03 - Hero selects to flee
 	AddSkipFunction(dialog03, Skipanim, {dialog03})
@@ -422,6 +423,7 @@
 	table.insert(dialog03, {func = AnimSay, args = {green1.gear, loc("All the other places are protected by our flight-inhibiting weapons."), SAY_SAY, 4000}})
 	table.insert(dialog03, {func = AnimSay, args = {green1.gear, loc("Now go and don't waste more of my time, you coward!"), SAY_SAY, 4000}})
 	table.insert(dialog03, {func = AnimWait, args = {hero.gear, 5000}})
+	table.insert(dialog03, {func = ShowMission, args = goals[dialog03]})
 	table.insert(dialog03, {func = startBattle, args = {hero.gear}})
 end
 
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit03.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -14,6 +14,7 @@
 local timeLeft = 0
 local lastWeaponUsed = amNothing
 local firstTurn = true
+local battleStarted = false
 local challengeObjectives = loc("Use your available weapons in order to eliminate the enemies.").."|"..
 	loc("You can only use the sniper rifle or the watermelon bomb.").."|"..
 	loc("You'll have only 2 watermelon bombs during the game.").."|"..
@@ -26,7 +27,7 @@
 local dialog01 = {}
 -- mission objectives
 local goals = {
-	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 4500},
+	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 30000},
 }
 -- hogs
 local hero = {
@@ -113,7 +114,7 @@
 function onGameStart()
 	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
-	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
+	ShowMission(unpack(goals["init"]))
 
 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
 	AddEvent(onHeroWin, {hero.gear}, heroWin, {hero.gear}, 0)
@@ -140,6 +141,7 @@
 	if CurrentHedgehog == hero.gear then
 		if firstTurn then
 			TurnTimeLeft = 25000
+			battleStarted = true
 		end
 		if lastWeaponUsed == amSkip then
 			TurnTimeLeft = TurnTime + timeLeft
@@ -177,6 +179,25 @@
 	end
 end
 
+-- Hide mission panel when player does anything
+function hideMissionOnAction()
+	if battleStarted then
+		HideMission()
+	end
+end
+
+onHogAttack = hideMissionOnAction
+onAttack = hideMissionOnAction
+onLeft = hideMissionOnAction
+onRight = hideMissionOnAction
+onUp = hideMissionOnAction
+onDown = hideMissionOnAction
+onLJump = hideMissionOnAction
+onHJump = hideMissionOnAction
+onSlot = hideMissionOnAction
+onSetWeapon = hideMissionOnAction
+onTimer = hideMissionOnAction
+
 function onPrecise()
 	if GameTime > 3000 then
 		SetAnimSkip(true)
@@ -241,10 +262,7 @@
 -------------- ANIMATIONS ------------------
 
 function Skipanim(anim)
-	if goals[anim] ~= nil then
-		ShowMission(unpack(goals[anim]))
-    end
-    startBattle()
+	startBattle()
 end
 
 function AnimationSetup()
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -27,7 +27,7 @@
 local dialog01 = {}
 -- mission objectives
 local goals = {
-	[dialog01] = {missionName, loc("Getting ready"), challengeObjectives, 1, 4500},
+	["init"] = {missionName, loc("Getting ready"), challengeObjectives, 1, 30000},
 }
 -- hogs
 local hero = {}
@@ -102,7 +102,7 @@
 function onGameStart()
 	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
-	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
+	ShowMission(unpack(goals["init"]))
 
 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
 
@@ -175,6 +175,12 @@
 	end
 end
 
+function onGearAdd(gear)
+	if GetGearType(gear) == gtJetpack then
+		HideMission()
+	end
+end
+
 function onPrecise()
 	if GameTime > 3000 then
 		SetAnimSkip(true)
@@ -199,10 +205,7 @@
 -------------- ANIMATIONS ------------------
 
 function Skipanim(anim)
-	if goals[anim] ~= nil then
-		ShowMission(unpack(goals[anim]))
-    end
-    startFlying()
+	startFlying()
 end
 
 function AnimationSetup()
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -428,10 +428,10 @@
 function Skipanim(anim)
 	if goals[anim] ~= nil then
 		ShowMission(unpack(goals[anim]))
-    end
-    if anim == dialog02 then
+	end
+	if anim == dialog02 then
 		setAfterDialog02()
-    elseif anim == dialog03 then
+	elseif anim == dialog03 then
 		startCombat()
 	else
 		AnimSwitchHog(hero.gear)
@@ -453,6 +453,7 @@
 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("Okay, then you have to go and take some of the weapons we have hidden in case of an emergency!"), SAY_SAY, 7000}})
 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("They are up there! Take this rope and hurry!"), SAY_SAY, 7000}})
 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Ehm, okay ..."), SAY_SAY, 2500}})
+	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
 	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
 	-- DIALOG 02 - To the weapons platform
 	AddSkipFunction(dialog02, Skipanim, {dialog02})
@@ -460,6 +461,7 @@
 	table.insert(dialog02, {func = AnimSay, args = {hero.gear, loc("I've made it! Yeah!"), SAY_SHOUT, 4000}})
 	table.insert(dialog02, {func = AnimSay, args = {paoth1.gear, loc("Nice! Now hurry and get down! You have to rescue my friends!"), SAY_SHOUT, 7000}})
 	table.insert(dialog02, {func = setAfterDialog02, args = {}})
+	table.insert(dialog02, {func = ShowMission, args = goals[dialog02]})
 	table.insert(dialog02, {func = AnimSwitchHog, args = {hero.gear}})
 	-- DIALOG 03 - Hero spotted and has no weapons
 	AddSkipFunction(dialog03, Skipanim, {dialog03})
@@ -467,6 +469,7 @@
 	table.insert(dialog03, {func = AnimSay, args = {minion1.gear, loc("Look, boss! There is the target!"), SAY_SHOUT, 4000}})
 	table.insert(dialog03, {func = AnimSay, args = {professor.gear, loc("Prepare for battle!"), SAY_SHOUT, 4000}})
 	table.insert(dialog03, {func = AnimSay, args = {hero.gear, loc("Oops, I've been spotted and I have no weapons! I am doomed!"), SAY_THINK, 4000}})
+	table.insert(dialog03, {func = ShowMission, args = goals[dialog03]})
 	table.insert(dialog03, {func = startCombat, args = {hero.gear}})
 	-- DIALOG 04 - Hero spotted and *HAS* weapons
 	AddSkipFunction(dialog04, Skipanim, {dialog04})
@@ -474,6 +477,7 @@
 	table.insert(dialog04, {func = AnimSay, args = {minion1.gear, loc("Look, boss! There is the target!"), SAY_SHOUT, 4000}})
 	table.insert(dialog04, {func = AnimSay, args = {professor.gear, loc("Prepare for battle!"), SAY_SHOUT, 4000}})
 	table.insert(dialog04, {func = AnimSay, args = {hero.gear, loc("Here we go!"), SAY_THINK, 4000}})
+	table.insert(dialog04, {func = ShowMission, args = goals[dialog04]})
 	table.insert(dialog04, {func = startCombat, args = {hero.gear}})
 end
 
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua	Thu Sep 28 08:55:10 2017 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua	Thu Sep 28 17:26:54 2017 +0200
@@ -21,7 +21,7 @@
 local dialog02 = {}
 -- mission objectives
 local goals = {
-	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 4500},
+	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 0},
 }
 -- hogs
 local hero = {
@@ -56,7 +56,6 @@
 	TurnTime = 25000
 	CaseFreq = 0
 	MinesNum = 0
-	MinesTime = 1
 	Explosives = 0
 	Map = "moon02_map"
 	Theme = "Cheese"
@@ -83,7 +82,6 @@
 function onGameStart()
 	AnimWait(hero.gear, 3000)
 	FollowGear(hero.gear)
-	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
 
 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
 
@@ -94,6 +92,12 @@
 	AddAnim(dialog01)
 end
 
+function onGearAdd(gear)
+	if GetGearType(gear) == gtRope then
+		HideMission()
+	end
+end
+
 function onNewTurn()
 	if startChallenge and currentPosition < 5 then
 		if CurrentHedgehog ~= hero.gear then
@@ -150,12 +154,12 @@
 function Skipanim(anim)
 	if goals[anim] ~= nil then
 		ShowMission(unpack(goals[anim]))
-    end
-    if anim == dialog01 then
+	end
+    	if anim == dialog01 then
 		moveRunner()
 	elseif anim == dialog02 then
 		win()
-    end
+	end
 end
 
 function AnimationSetup()
@@ -167,6 +171,7 @@
 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("We'll play a game first."), SAY_SAY, 3000}})
 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("I'll let you know whatever I know about him if you manage to catch me 3 times."), SAY_SAY, 4000}})
 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("Let's go!"), SAY_SAY, 2000}})
+	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
 	table.insert(dialog01, {func = moveRunner, args = {}})
 	-- DIALOG 02 - Hog Solo story
 	AddSkipFunction(dialog02, Skipanim, {dialog02})