Merge lp:~widelands-dev/widelands/bug-1426465-scenario-timings into lp:widelands
- bug-1426465-scenario-timings
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 8213 |
Proposed branch: | lp:~widelands-dev/widelands/bug-1426465-scenario-timings |
Merge into: | lp:widelands |
Diff against target: |
1086 lines (+193/-170) 13 files modified
data/campaigns/atl01.wmf/scripting/mission_thread.lua (+43/-30) data/campaigns/bar01.wmf/scripting/mission_thread.lua (+30/-34) data/campaigns/bar01.wmf/scripting/starting_conditions.lua (+1/-1) data/campaigns/bar01.wmf/scripting/texts.lua (+12/-8) data/campaigns/bar02.wmf/scripting/mission_thread.lua (+13/-13) data/campaigns/emp01.wmf/scripting/mission_thread.lua (+5/-5) data/campaigns/emp02.wmf/scripting/mission_thread.lua (+8/-8) data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua (+14/-26) data/campaigns/tutorial02_warfare.wmf/scripting/mission_thread.lua (+22/-16) data/campaigns/tutorial02_warfare.wmf/scripting/texts.lua (+4/-1) data/campaigns/tutorial03_seafaring.wmf/scripting/mission_thread.lua (+5/-5) data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua (+17/-23) data/scripting/messages.lua (+19/-0) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/bug-1426465-scenario-timings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
TiborB | Approve | ||
Review via email: mp+311119@code.launchpad.net |
Commit message
Tweaked timings in tutorials and scenarios:
- New function set_objective_done that adds a configurable sleep time
when marking an objective as done
- Barbarian scenario 1: Shifted story messages back to reduce the barrage
at the start of the scenario.
Also, more felling axes to make clearing the trees easier.
- Atlantean scenario : Trigger warehouse objective earlier, so we can
expand faster and have some horses ready when racing for the lake.
- Warfare Tutorial: Build trainingsites concurrently in order to save time.
- Economy tutorial: Sleep longer for the stock window.
Description of the change
bunnybot (widelandsofficial) wrote : | # |
bunnybot (widelandsofficial) wrote : | # |
Bunnybot encountered an error while working on this merge proposal:
('The read operation timed out',)
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 1621. State: passed. Details: https:/
Appveyor build 1459. State: success. Details: https:/
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 1672. State: failed. Details: https:/
Appveyor build 1512. State: success. Details: https:/
bunnybot (widelandsofficial) wrote : | # |
Bunnybot encountered an error while working on this merge proposal:
('The read operation timed out',)
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 1672. State: failed. Details: https:/
Appveyor build 1512. State: success. Details: https:/
bunnybot (widelandsofficial) wrote : | # |
Bunnybot encountered an error while working on this merge proposal:
('The read operation timed out',)
bunnybot (widelandsofficial) wrote : | # |
Continuous integration builds have changed state:
Travis build 1672. State: failed. Details: https:/
Appveyor build 1512. State: success. Details: https:/
TiborB (tiborb95) wrote : | # |
Code looks good to me. Of course the NOCOM should be removed, it even does not relate to the changes in the branch.
Not tested.
GunChleoc (gunchleoc) wrote : | # |
Thanks!
This was tested on the forum before I added the last tweaks, so since the crash is not caused by this branch, let's get this in.
@bunnybot merge
Preview Diff
1 | === modified file 'data/campaigns/atl01.wmf/scripting/mission_thread.lua' | |||
2 | --- data/campaigns/atl01.wmf/scripting/mission_thread.lua 2015-11-03 18:52:00 +0000 | |||
3 | +++ data/campaigns/atl01.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
4 | @@ -18,38 +18,51 @@ | |||
5 | 18 | end | 18 | end |
6 | 19 | 19 | ||
7 | 20 | function build_warehouse_and_horsefarm() | 20 | function build_warehouse_and_horsefarm() |
9 | 21 | local fields = { | 21 | -- Make sure that we can feed the horses at all. |
10 | 22 | while not check_for_buildings(p1, { | ||
11 | 23 | atlanteans_farm = 1, | ||
12 | 24 | atlanteans_well = 1, | ||
13 | 25 | }) do sleep(2500) end | ||
14 | 26 | |||
15 | 27 | -- Sleeps until one of the given fields is owned by p1. | ||
16 | 28 | local function wait_for_owns_a_field(fields) | ||
17 | 29 | local fowned = nil | ||
18 | 30 | while not fowned do | ||
19 | 31 | for idx, f in ipairs(fields) do | ||
20 | 32 | if f.owner == p1 then | ||
21 | 33 | fowned = f | ||
22 | 34 | break | ||
23 | 35 | end | ||
24 | 36 | end | ||
25 | 37 | sleep(5000) | ||
26 | 38 | end | ||
27 | 39 | end | ||
28 | 40 | |||
29 | 41 | wait_for_owns_a_field({ | ||
30 | 42 | map:get_field(60, 139), | ||
31 | 43 | map:get_field(98, 128), | ||
32 | 44 | map:get_field(120, 126) | ||
33 | 45 | }) | ||
34 | 46 | |||
35 | 47 | msg_boxes(horsefarm_and_warehouse_story) | ||
36 | 48 | local o = add_campaign_objective(obj_horsefarm_and_warehouse) | ||
37 | 49 | while not check_for_buildings(p1, { | ||
38 | 50 | atlanteans_horsefarm = 1, | ||
39 | 51 | atlanteans_warehouse = 1, | ||
40 | 52 | }) do sleep(2384) end | ||
41 | 53 | set_objective_done(o) | ||
42 | 54 | |||
43 | 55 | -- Now check if the water should rise | ||
44 | 56 | wait_for_owns_a_field({ | ||
45 | 22 | map:get_field(42, 88), | 57 | map:get_field(42, 88), |
46 | 23 | map:get_field(64, 105), | 58 | map:get_field(64, 105), |
47 | 24 | map:get_field(93, 89), | 59 | map:get_field(93, 89), |
48 | 25 | map:get_field(90, 66), | 60 | map:get_field(90, 66), |
50 | 26 | } | 61 | }) |
51 | 27 | 62 | ||
52 | 28 | local fowned = nil | ||
53 | 29 | while not fowned do | ||
54 | 30 | for idx, f in ipairs(fields) do | ||
55 | 31 | if f.owner == p1 then | ||
56 | 32 | fowned = f | ||
57 | 33 | break | ||
58 | 34 | end | ||
59 | 35 | end | ||
60 | 36 | sleep(3213) | ||
61 | 37 | end | ||
62 | 38 | -- Has been started from the very beginning | 63 | -- Has been started from the very beginning |
64 | 39 | expand_objective.done = true | 64 | set_objective_done(expand_objective) |
65 | 40 | let_the_water_rise = true | 65 | let_the_water_rise = true |
66 | 41 | |||
67 | 42 | local pts = wait_for_roadbuilding_and_scroll(fowned) | ||
68 | 43 | msg_boxes(horsefarm_and_warehouse_story) | ||
69 | 44 | -- Go back to where we were | ||
70 | 45 | timed_scroll(array_reverse(pts)) | ||
71 | 46 | |||
72 | 47 | local o = add_campaign_objective(obj_horsefarm_and_warehouse) | ||
73 | 48 | while not check_for_buildings(p1, { | ||
74 | 49 | atlanteans_horsefarm = 1, | ||
75 | 50 | atlanteans_warehouse = 1, | ||
76 | 51 | }) do sleep(2384) end | ||
77 | 52 | o.done = true | ||
78 | 53 | end | 66 | end |
79 | 54 | 67 | ||
80 | 55 | function build_training() | 68 | function build_training() |
81 | @@ -60,7 +73,7 @@ | |||
82 | 60 | atlanteans_dungeon = 1, | 73 | atlanteans_dungeon = 1, |
83 | 61 | atlanteans_labyrinth = 1 | 74 | atlanteans_labyrinth = 1 |
84 | 62 | }) do sleep(3874) end | 75 | }) do sleep(3874) end |
86 | 63 | o.done = true | 76 | set_objective_done(o) |
87 | 64 | 77 | ||
88 | 65 | msg_boxes(training_story_end) | 78 | msg_boxes(training_story_end) |
89 | 66 | end | 79 | end |
90 | @@ -79,7 +92,7 @@ | |||
91 | 79 | atlanteans_armorsmithy = 1, | 92 | atlanteans_armorsmithy = 1, |
92 | 80 | atlanteans_toolsmithy = 1, | 93 | atlanteans_toolsmithy = 1, |
93 | 81 | }) do sleep(3478) end | 94 | }) do sleep(3478) end |
95 | 82 | o.done = true | 95 | set_objective_done(o) |
96 | 83 | 96 | ||
97 | 84 | sleep(15 * 60 * 1000) -- sleep a while | 97 | sleep(15 * 60 * 1000) -- sleep a while |
98 | 85 | run(build_training) | 98 | run(build_training) |
99 | @@ -105,7 +118,7 @@ | |||
100 | 105 | atlanteans_fishbreeders_house = 1, | 118 | atlanteans_fishbreeders_house = 1, |
101 | 106 | atlanteans_smokery = 2, | 119 | atlanteans_smokery = 2, |
102 | 107 | }) do sleep(2789) end | 120 | }) do sleep(2789) end |
104 | 108 | o.done = true | 121 | set_objective_done(o) |
105 | 109 | 122 | ||
106 | 110 | msg_boxes(food_story_ended_messages) | 123 | msg_boxes(food_story_ended_messages) |
107 | 111 | end | 124 | end |
108 | @@ -122,7 +135,7 @@ | |||
109 | 122 | atlanteans_gold_spinning_mill = 1, | 135 | atlanteans_gold_spinning_mill = 1, |
110 | 123 | atlanteans_weaving_mill = 1 | 136 | atlanteans_weaving_mill = 1 |
111 | 124 | }) do sleep(6273) end | 137 | }) do sleep(6273) end |
113 | 125 | o.done = true | 138 | set_objective_done(o) |
114 | 126 | 139 | ||
115 | 127 | msg_boxes(spidercloth_story_ended_messages) | 140 | msg_boxes(spidercloth_story_ended_messages) |
116 | 128 | 141 | ||
117 | @@ -140,7 +153,7 @@ | |||
118 | 140 | atlanteans_quarry = 1, | 153 | atlanteans_quarry = 1, |
119 | 141 | atlanteans_sawmill = 1, | 154 | atlanteans_sawmill = 1, |
120 | 142 | }) do sleep(3731) end | 155 | }) do sleep(3731) end |
122 | 143 | o.done = true | 156 | set_objective_done(o) |
123 | 144 | 157 | ||
124 | 145 | run(make_spidercloth_production) | 158 | run(make_spidercloth_production) |
125 | 146 | 159 | ||
126 | 147 | 160 | ||
127 | === modified file 'data/campaigns/bar01.wmf/scripting/mission_thread.lua' | |||
128 | --- data/campaigns/bar01.wmf/scripting/mission_thread.lua 2016-01-28 05:24:34 +0000 | |||
129 | +++ data/campaigns/bar01.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
130 | @@ -24,26 +24,31 @@ | |||
131 | 24 | plr:reveal_fields(al_thunran:region(8)) | 24 | plr:reveal_fields(al_thunran:region(8)) |
132 | 25 | message_box_objective(plr, briefing_msg_02) -- Al'thunran | 25 | message_box_objective(plr, briefing_msg_02) -- Al'thunran |
133 | 26 | plr:reveal_fields(grave:region(4)) | 26 | plr:reveal_fields(grave:region(4)) |
141 | 27 | message_box_objective(plr, briefing_msg_03) -- grave | 27 | message_box_objective(plr, briefing_msg_03) -- grave, Boldreth |
142 | 28 | message_box_objective(plr, briefing_msg_04) | 28 | message_box_objective(plr, briefing_msg_04) -- wait |
136 | 29 | |||
137 | 30 | message_box_objective(plr, briefing_msg_05) | ||
138 | 31 | message_box_objective(plr, briefing_msg_06) | ||
139 | 32 | message_box_objective(plr, briefing_msg_07) | ||
140 | 33 | |||
143 | 34 | -- introduction of Khantrukh | 29 | -- introduction of Khantrukh |
144 | 35 | message_box_objective(plr, briefing_msg_08) | 30 | message_box_objective(plr, briefing_msg_08) |
145 | 36 | 31 | ||
146 | 37 | message_box_objective(plr, order_msg_ranger) | 32 | message_box_objective(plr, order_msg_ranger) |
147 | 38 | local obj = add_campaign_objective(obj_build_rangers) | 33 | local obj = add_campaign_objective(obj_build_rangers) |
148 | 39 | 34 | ||
149 | 35 | -- Try not to interrupt the player actions with a message, so we wait generously | ||
150 | 36 | sleep(50000) | ||
151 | 37 | message_box_objective(plr, briefing_msg_05) -- war goes on | ||
152 | 38 | message_box_objective(plr, briefing_msg_06) -- brothers brought men | ||
153 | 39 | sleep(50000) | ||
154 | 40 | message_box_objective(plr, briefing_msg_07) -- still living in huts and barracks | ||
155 | 41 | sleep(50000) | ||
156 | 42 | message_box_objective(plr, msg_story_2) -- winter is upon us | ||
157 | 43 | sleep(10000) | ||
158 | 44 | |||
159 | 40 | while not check_for_buildings(plr, {barbarians_rangers_hut = 2}) do sleep(500) end | 45 | while not check_for_buildings(plr, {barbarians_rangers_hut = 2}) do sleep(500) end |
161 | 41 | obj.done = true | 46 | set_objective_done(obj) |
162 | 42 | 47 | ||
163 | 43 | plr:allow_buildings{"barbarians_sentry", "barbarians_barrier"} | 48 | plr:allow_buildings{"barbarians_sentry", "barbarians_barrier"} |
164 | 44 | 49 | ||
167 | 45 | message_box_objective(plr, order_msg_1) | 50 | message_box_objective(plr, order_msg_1) -- Boldreth, swords rusty |
168 | 46 | message_box_objective(plr, order_msg_2) | 51 | message_box_objective(plr, order_msg_2) -- Kantrukh, rocks |
169 | 47 | 52 | ||
170 | 48 | -- Reveal the rocks | 53 | -- Reveal the rocks |
171 | 49 | local rocks = wl.Game().map:get_field(27, 48) | 54 | local rocks = wl.Game().map:get_field(27, 48) |
172 | @@ -57,12 +62,15 @@ | |||
173 | 57 | -- Move back | 62 | -- Move back |
174 | 58 | timed_scroll(array_reverse(way), 10) | 63 | timed_scroll(array_reverse(way), 10) |
175 | 59 | 64 | ||
176 | 65 | sleep(50000) | ||
177 | 66 | message_box_objective(plr, msg_story_1) | ||
178 | 67 | |||
179 | 60 | -- Now, wait till the quarry comes up | 68 | -- Now, wait till the quarry comes up |
180 | 61 | local f = wl.Game().map:get_field(27,48):region(6) | 69 | local f = wl.Game().map:get_field(27,48):region(6) |
181 | 62 | while not check_for_buildings(plr, { barbarians_quarry = 1 }, f) do | 70 | while not check_for_buildings(plr, { barbarians_quarry = 1 }, f) do |
182 | 63 | sleep(5000) | 71 | sleep(5000) |
183 | 64 | end | 72 | end |
185 | 65 | obj.done = true | 73 | set_objective_done(obj) |
186 | 66 | 74 | ||
187 | 67 | message_box_objective(plr, order_msg_5_quarry) | 75 | message_box_objective(plr, order_msg_5_quarry) |
188 | 68 | 76 | ||
189 | @@ -98,7 +106,7 @@ | |||
190 | 98 | while not check_for_buildings(plr, {barbarians_coalmine = 1, barbarians_ironmine = 1}) do | 106 | while not check_for_buildings(plr, {barbarians_coalmine = 1, barbarians_ironmine = 1}) do |
191 | 99 | sleep(5000) | 107 | sleep(5000) |
192 | 100 | end | 108 | end |
194 | 101 | o.done = true | 109 | set_objective_done(o) |
195 | 102 | message_box_objective(plr, order_msg_7_mines_up) | 110 | message_box_objective(plr, order_msg_7_mines_up) |
196 | 103 | message_box_objective(plr, order_msg_8_mines_up) | 111 | message_box_objective(plr, order_msg_8_mines_up) |
197 | 104 | message_box_objective(plr, order_msg_9_hunter) | 112 | message_box_objective(plr, order_msg_9_hunter) |
198 | @@ -127,8 +135,7 @@ | |||
199 | 127 | and #rv.barbarians_tavern >= 1 then break end | 135 | and #rv.barbarians_tavern >= 1 then break end |
200 | 128 | sleep(5331) | 136 | sleep(5331) |
201 | 129 | end | 137 | end |
204 | 130 | obj_bf.done = true | 138 | set_objective_done(obj_bf) |
203 | 131 | sleep(5000) | ||
205 | 132 | message_box_objective(plr, story_msg4) | 139 | message_box_objective(plr, story_msg4) |
206 | 133 | end) | 140 | end) |
207 | 134 | 141 | ||
208 | @@ -146,7 +153,7 @@ | |||
209 | 146 | sleep(4234) | 153 | sleep(4234) |
210 | 147 | end | 154 | end |
211 | 148 | message_box_objective(plr, order_msg_12_farming_began) | 155 | message_box_objective(plr, order_msg_12_farming_began) |
213 | 149 | obj_farming.done = true | 156 | set_objective_done(obj_farming) |
214 | 150 | end) | 157 | end) |
215 | 151 | 158 | ||
216 | 152 | -- Enable food production | 159 | -- Enable food production |
217 | @@ -171,7 +178,7 @@ | |||
218 | 171 | while #plr:get_buildings("barbarians_smelting_works") < 1 do | 178 | while #plr:get_buildings("barbarians_smelting_works") < 1 do |
219 | 172 | sleep(6223) | 179 | sleep(6223) |
220 | 173 | end | 180 | end |
222 | 174 | o.done = true | 181 | set_objective_done(o) |
223 | 175 | 182 | ||
224 | 176 | -- Information about making mines deeper | 183 | -- Information about making mines deeper |
225 | 177 | -- Wait until the player has an experienced worker. | 184 | -- Wait until the player has an experienced worker. |
226 | @@ -218,7 +225,7 @@ | |||
227 | 218 | end | 225 | end |
228 | 219 | sleep(5421) | 226 | sleep(5421) |
229 | 220 | end | 227 | end |
231 | 221 | obj.done = true | 228 | set_objective_done(obj) |
232 | 222 | enhance_buildings_done = true | 229 | enhance_buildings_done = true |
233 | 223 | end) | 230 | end) |
234 | 224 | 231 | ||
235 | @@ -238,6 +245,7 @@ | |||
236 | 238 | end | 245 | end |
237 | 239 | sleep(5421) | 246 | sleep(5421) |
238 | 240 | end | 247 | end |
239 | 248 | sleep(5000) | ||
240 | 241 | 249 | ||
241 | 242 | message_box_objective(plr, order_msg_16_blackwood) | 250 | message_box_objective(plr, order_msg_16_blackwood) |
242 | 243 | plr:allow_buildings{"barbarians_wood_hardener"} | 251 | plr:allow_buildings{"barbarians_wood_hardener"} |
243 | @@ -245,10 +253,10 @@ | |||
244 | 245 | -- So that player has really little, but still enough to expand a bit | 253 | -- So that player has really little, but still enough to expand a bit |
245 | 246 | local o = add_campaign_objective(obj_better_material_1) | 254 | local o = add_campaign_objective(obj_better_material_1) |
246 | 247 | 255 | ||
248 | 248 | sleep(30*1000) | 256 | sleep(50000) |
249 | 249 | message_box_objective(plr, story_msg1) | 257 | message_box_objective(plr, story_msg1) |
250 | 250 | while #plr:get_buildings("barbarians_wood_hardener") < 1 do sleep(5421) end | 258 | while #plr:get_buildings("barbarians_wood_hardener") < 1 do sleep(5421) end |
252 | 251 | o.done = true | 259 | set_objective_done(o) |
253 | 252 | 260 | ||
254 | 253 | message_box_objective(plr, order_msg_17_grout) | 261 | message_box_objective(plr, order_msg_17_grout) |
255 | 254 | plr:allow_buildings{"barbarians_lime_kiln", "barbarians_well", "barbarians_charcoal_kiln"} | 262 | plr:allow_buildings{"barbarians_lime_kiln", "barbarians_well", "barbarians_charcoal_kiln"} |
256 | @@ -267,7 +275,7 @@ | |||
257 | 267 | end | 275 | end |
258 | 268 | sleep(5421) | 276 | sleep(5421) |
259 | 269 | end | 277 | end |
261 | 270 | o.done = true | 278 | set_objective_done(o) |
262 | 271 | 279 | ||
263 | 272 | message_box_objective(plr, order_msg_18_reed) | 280 | message_box_objective(plr, order_msg_18_reed) |
264 | 273 | plr:allow_buildings{"barbarians_reed_yard"} | 281 | plr:allow_buildings{"barbarians_reed_yard"} |
265 | @@ -275,7 +283,7 @@ | |||
266 | 275 | while #plr:get_buildings("barbarians_reed_yard") < 1 do sleep(5421) end | 283 | while #plr:get_buildings("barbarians_reed_yard") < 1 do sleep(5421) end |
267 | 276 | 284 | ||
268 | 277 | message_box_objective(plr, order_msg_19_all_material) | 285 | message_box_objective(plr, order_msg_19_all_material) |
270 | 278 | o.done = true | 286 | set_objective_done(o) |
271 | 279 | 287 | ||
272 | 280 | build_materials_done = true | 288 | build_materials_done = true |
273 | 281 | end | 289 | end |
274 | @@ -299,23 +307,12 @@ | |||
275 | 299 | while not check_for_buildings(plr, { barbarians_cattlefarm = 1 }) do | 307 | while not check_for_buildings(plr, { barbarians_cattlefarm = 1 }) do |
276 | 300 | sleep(2323) | 308 | sleep(2323) |
277 | 301 | end | 309 | end |
279 | 302 | o.done = true | 310 | set_objective_done(o) |
280 | 303 | 311 | ||
281 | 304 | cattle_farm_done = true | 312 | cattle_farm_done = true |
282 | 305 | end | 313 | end |
283 | 306 | 314 | ||
284 | 307 | 315 | ||
285 | 308 | -- ====================== | ||
286 | 309 | -- Throns story messages | ||
287 | 310 | -- ====================== | ||
288 | 311 | function story_messages_thread() | ||
289 | 312 | wake_me(180 * 1000) | ||
290 | 313 | message_box_objective(plr, msg_story_2) | ||
291 | 314 | |||
292 | 315 | wake_me(600 * 1000) | ||
293 | 316 | message_box_objective(plr, msg_story_1) | ||
294 | 317 | end | ||
295 | 318 | |||
296 | 319 | -- ================= | 316 | -- ================= |
297 | 320 | -- Mission complete | 317 | -- Mission complete |
298 | 321 | -- ================= | 318 | -- ================= |
299 | @@ -333,7 +330,6 @@ | |||
300 | 333 | run(introduction_thread) | 330 | run(introduction_thread) |
301 | 334 | run(mines_and_food_thread) | 331 | run(mines_and_food_thread) |
302 | 335 | run(build_materials_thread) | 332 | run(build_materials_thread) |
303 | 336 | run(story_messages_thread) | ||
304 | 337 | 333 | ||
305 | 338 | include "map:scripting/secret_village.lua" -- starts the thread | 334 | include "map:scripting/secret_village.lua" -- starts the thread |
306 | 339 | 335 | ||
307 | 340 | 336 | ||
308 | === modified file 'data/campaigns/bar01.wmf/scripting/starting_conditions.lua' | |||
309 | --- data/campaigns/bar01.wmf/scripting/starting_conditions.lua 2015-10-31 12:11:44 +0000 | |||
310 | +++ data/campaigns/bar01.wmf/scripting/starting_conditions.lua 2016-12-10 09:41:21 +0000 | |||
311 | @@ -46,7 +46,7 @@ | |||
312 | 46 | barbarians_gardener = 1, | 46 | barbarians_gardener = 1, |
313 | 47 | barbarians_geologist = 4, | 47 | barbarians_geologist = 4, |
314 | 48 | barbarians_lime_burner = 1, | 48 | barbarians_lime_burner = 1, |
316 | 49 | barbarians_lumberjack = 3, | 49 | barbarians_lumberjack = 6, |
317 | 50 | barbarians_miner = 4, | 50 | barbarians_miner = 4, |
318 | 51 | barbarians_ranger = 2, | 51 | barbarians_ranger = 2, |
319 | 52 | barbarians_stonemason = 2 | 52 | barbarians_stonemason = 2 |
320 | 53 | 53 | ||
321 | === modified file 'data/campaigns/bar01.wmf/scripting/texts.lua' | |||
322 | --- data/campaigns/bar01.wmf/scripting/texts.lua 2016-10-05 05:26:40 +0000 | |||
323 | +++ data/campaigns/bar01.wmf/scripting/texts.lua 2016-12-10 09:41:21 +0000 | |||
324 | @@ -187,7 +187,7 @@ | |||
325 | 187 | -- TRANSLATORS: Thron | 187 | -- TRANSLATORS: Thron |
326 | 188 | _[[Boldreth, my loyal companion and friend is a source of peace and comfort to me in these dark times. He keeps my spirits high and those of my warriors awake, preventing greed or despair from destroying the bonds between us as well.]]), | 188 | _[[Boldreth, my loyal companion and friend is a source of peace and comfort to me in these dark times. He keeps my spirits high and those of my warriors awake, preventing greed or despair from destroying the bonds between us as well.]]), |
327 | 189 | field = grave, | 189 | field = grave, |
329 | 190 | position = "topleft" | 190 | position = "topleft", |
330 | 191 | } | 191 | } |
331 | 192 | 192 | ||
332 | 193 | 193 | ||
333 | @@ -195,35 +195,38 @@ | |||
334 | 195 | title = _"The Story Begins", | 195 | title = _"The Story Begins", |
335 | 196 | body = thron( | 196 | body = thron( |
336 | 197 | -- TRANSLATORS: Thron | 197 | -- TRANSLATORS: Thron |
338 | 198 | _[[As father told me, there are times to fight and times to lie and wait, trying not to fall asleep or die before the right time comes. And so I do wait.]]) | 198 | _[[As father told me, there are times to fight and times to lie and wait, trying not to fall asleep or die before the right time comes. And so I do wait.]]), |
339 | 199 | position = "topleft", | ||
340 | 199 | } | 200 | } |
341 | 200 | 201 | ||
342 | 201 | 202 | ||
343 | 202 | briefing_msg_05 = { | 203 | briefing_msg_05 = { |
345 | 203 | title = _"The Story Begins", | 204 | title = _"Thron is Contemplating the War", |
346 | 204 | body = thron(_"Thron is shaking his head…", | 205 | body = thron(_"Thron is shaking his head…", |
347 | 205 | -- TRANSLATORS: Thron | 206 | -- TRANSLATORS: Thron |
348 | 206 | _([[Yet the war goes on. More and more of our brothers and sisters flee the brutal war raging in the capital beneath the trees.]]) | 207 | _([[Yet the war goes on. More and more of our brothers and sisters flee the brutal war raging in the capital beneath the trees.]]) |
349 | 207 | .. paragraphdivider() .. | 208 | .. paragraphdivider() .. |
350 | 208 | -- TRANSLATORS: Thron | 209 | -- TRANSLATORS: Thron |
351 | 209 | _([[The stories they tell about the deeds of our kin are sad to hear. I’ve spent nights lying awake, restless, more tired than I ever believed one could be. Yet whenever I close my eyes, I see the fortress my father built consumed by flames. The Throne Among the Trees, the symbol of unity and peace among our kin, became the wedge that drives us apart.]])), | 210 | _([[The stories they tell about the deeds of our kin are sad to hear. I’ve spent nights lying awake, restless, more tired than I ever believed one could be. Yet whenever I close my eyes, I see the fortress my father built consumed by flames. The Throne Among the Trees, the symbol of unity and peace among our kin, became the wedge that drives us apart.]])), |
353 | 210 | field = sf -- scroll back when showing this and the next few message boxes | 211 | field = al_thunran, |
354 | 212 | position = "topleft", | ||
355 | 211 | } | 213 | } |
356 | 212 | 214 | ||
357 | 213 | 215 | ||
358 | 214 | briefing_msg_06 = { | 216 | briefing_msg_06 = { |
360 | 215 | title = _"The Story Begins", | 217 | title = _"Thron is Contemplating the War", |
361 | 216 | body = thron( | 218 | body = thron( |
362 | 217 | -- TRANSLATORS: Thron | 219 | -- TRANSLATORS: Thron |
363 | 218 | _([[Today my hunters brought men, women and little children before me who had hidden out in the forests, trying to escape the war, hate and revenge that rage among the tribes fighting each other like in olden times, when we were no more but wild beasts driven and controlled by instincts. None of my brothers will ever gain and hold control over the wooden throne, none of the tribes will be strong enough to subdue the other. There will be no end to this slaughter, unless… is this it? As father told me?]]) | 220 | _([[Today my hunters brought men, women and little children before me who had hidden out in the forests, trying to escape the war, hate and revenge that rage among the tribes fighting each other like in olden times, when we were no more but wild beasts driven and controlled by instincts. None of my brothers will ever gain and hold control over the wooden throne, none of the tribes will be strong enough to subdue the other. There will be no end to this slaughter, unless… is this it? As father told me?]]) |
364 | 219 | .. paragraphdivider() .. | 221 | .. paragraphdivider() .. |
365 | 220 | -- TRANSLATORS: Thron | 222 | -- TRANSLATORS: Thron |
367 | 221 | _([[To rise against whoever threatens our very existence, even though it may be one of your own blood or mind?]])) | 223 | _([[To rise against whoever threatens our very existence, even though it may be one of your own blood or mind?]])), |
368 | 224 | field = sf, | ||
369 | 222 | } | 225 | } |
370 | 223 | 226 | ||
371 | 224 | 227 | ||
372 | 225 | briefing_msg_07 = { | 228 | briefing_msg_07 = { |
374 | 226 | title = _"The Story Begins", | 229 | title = _"Thron is Considering the Future", |
375 | 227 | body = thron( | 230 | body = thron( |
376 | 228 | -- TRANSLATORS: Thron | 231 | -- TRANSLATORS: Thron |
377 | 229 | _([[Boldreth seems more and more torn as the days go by. The spirits of my fellows sink as the cold season approaches, and we are still living in no more than huts and barracks. I never intended to stay out here in the wilderness for so long – but I never thought my brothers would engage in this senseless battle for so long either.]]) | 232 | _([[Boldreth seems more and more torn as the days go by. The spirits of my fellows sink as the cold season approaches, and we are still living in no more than huts and barracks. I never intended to stay out here in the wilderness for so long – but I never thought my brothers would engage in this senseless battle for so long either.]]) |
378 | @@ -240,7 +243,8 @@ | |||
379 | 240 | _[[Hail, chieftain. I am Khantrukh and have seen many winters pass. Please allow me to aid you with my counsel through these darkened days.]] | 243 | _[[Hail, chieftain. I am Khantrukh and have seen many winters pass. Please allow me to aid you with my counsel through these darkened days.]] |
380 | 241 | .. paragraphdivider() .. | 244 | .. paragraphdivider() .. |
381 | 242 | -- TRANSLATORS: Khantrukh | 245 | -- TRANSLATORS: Khantrukh |
383 | 243 | _[[Only the gods know for how long we have to remain hidden here. The warriors hope we may march back gloriously any day now, but I strongly doubt that will happen soon. And the days are short and cold…]]) | 246 | _[[Only the gods know for how long we have to remain hidden here. The warriors hope we may march back gloriously any day now, but I strongly doubt that will happen soon. And the days are short and cold…]]), |
384 | 247 | field = sf -- scroll back when showing this and the next few message boxes | ||
385 | 244 | } | 248 | } |
386 | 245 | 249 | ||
387 | 246 | 250 | ||
388 | 247 | 251 | ||
389 | === modified file 'data/campaigns/bar02.wmf/scripting/mission_thread.lua' | |||
390 | --- data/campaigns/bar02.wmf/scripting/mission_thread.lua 2016-05-06 09:44:37 +0000 | |||
391 | +++ data/campaigns/bar02.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
392 | @@ -30,7 +30,7 @@ | |||
393 | 30 | local o = add_campaign_objective(obj_build_cattlefarm) | 30 | local o = add_campaign_objective(obj_build_cattlefarm) |
394 | 31 | while not check_for_buildings(p1, {barbarians_cattlefarm = 1}) do | 31 | while not check_for_buildings(p1, {barbarians_cattlefarm = 1}) do |
395 | 32 | sleep(1223) end | 32 | sleep(1223) end |
397 | 33 | o.done = true | 33 | set_objective_done(o) |
398 | 34 | 34 | ||
399 | 35 | end | 35 | end |
400 | 36 | 36 | ||
401 | @@ -48,7 +48,7 @@ | |||
402 | 48 | while not check_for_buildings(p1, {barbarians_sentry=1}, game.map:get_field(57,36):region(6)) do | 48 | while not check_for_buildings(p1, {barbarians_sentry=1}, game.map:get_field(57,36):region(6)) do |
403 | 49 | sleep(1500) | 49 | sleep(1500) |
404 | 50 | end | 50 | end |
406 | 51 | o.done = true | 51 | set_objective_done(o) |
407 | 52 | sleep(3000) | 52 | sleep(3000) |
408 | 53 | 53 | ||
409 | 54 | campaign_message_box(briefing_msg_1) | 54 | campaign_message_box(briefing_msg_1) |
410 | @@ -73,7 +73,7 @@ | |||
411 | 73 | barbarians_farm = 1, | 73 | barbarians_farm = 1, |
412 | 74 | barbarians_bakery = 1, | 74 | barbarians_bakery = 1, |
413 | 75 | }) do sleep(3413) end | 75 | }) do sleep(3413) end |
415 | 76 | o.done = true | 76 | set_objective_done(o) |
416 | 77 | campaign_message_box(story_note_1) | 77 | campaign_message_box(story_note_1) |
417 | 78 | 78 | ||
418 | 79 | sleep(600000) -- 10 minutes | 79 | sleep(600000) -- 10 minutes |
419 | @@ -111,7 +111,7 @@ | |||
420 | 111 | p1:hide_fields(fields) | 111 | p1:hide_fields(fields) |
421 | 112 | 112 | ||
422 | 113 | while not check_for_buildings(p1, {barbarians_tower=1}) do sleep(2341) end | 113 | while not check_for_buildings(p1, {barbarians_tower=1}) do sleep(2341) end |
424 | 114 | o.done = true | 114 | set_objective_done(o) |
425 | 115 | campaign_message_box(order_msg_3_explore_further) | 115 | campaign_message_box(order_msg_3_explore_further) |
426 | 116 | -- "explore further" is active untill "Boldreth shout out", so the player always has one open objectve. | 116 | -- "explore further" is active untill "Boldreth shout out", so the player always has one open objectve. |
427 | 117 | exploration_objective = add_campaign_objective(obj_explore_further) | 117 | exploration_objective = add_campaign_objective(obj_explore_further) |
428 | @@ -178,7 +178,7 @@ | |||
429 | 178 | end | 178 | end |
430 | 179 | sleep(4139) | 179 | sleep(4139) |
431 | 180 | end | 180 | end |
433 | 181 | o.done = true | 181 | set_objective_done(o) |
434 | 182 | campaign_message_box(story_note_2) | 182 | campaign_message_box(story_note_2) |
435 | 183 | 183 | ||
436 | 184 | sleep(100000) | 184 | sleep(100000) |
437 | @@ -211,7 +211,7 @@ | |||
438 | 211 | while not check_for_buildings(p1, {barbarians_trainingcamp = 1, barbarians_battlearena = 1}) do | 211 | while not check_for_buildings(p1, {barbarians_trainingcamp = 1, barbarians_battlearena = 1}) do |
439 | 212 | sleep(6523) | 212 | sleep(6523) |
440 | 213 | end | 213 | end |
442 | 214 | o.done = true | 214 | set_objective_done(o) |
443 | 215 | end | 215 | end |
444 | 216 | function check_weapon_productions_obj(o) | 216 | function check_weapon_productions_obj(o) |
445 | 217 | while true do | 217 | while true do |
446 | @@ -225,15 +225,15 @@ | |||
447 | 225 | end | 225 | end |
448 | 226 | sleep(6523) | 226 | sleep(6523) |
449 | 227 | end | 227 | end |
451 | 228 | o.done = true | 228 | set_objective_done(o) |
452 | 229 | end | 229 | end |
453 | 230 | function check_warehouse_obj(o) | 230 | function check_warehouse_obj(o) |
454 | 231 | while not check_for_buildings(p1, {barbarians_warehouse = 1}) do sleep(3827) end | 231 | while not check_for_buildings(p1, {barbarians_warehouse = 1}) do sleep(3827) end |
456 | 232 | o.done = true | 232 | set_objective_done(o) |
457 | 233 | end | 233 | end |
458 | 234 | function check_helmsmithy_obj(o) | 234 | function check_helmsmithy_obj(o) |
459 | 235 | while not check_for_buildings(p1, {barbarians_helmsmithy = 1}) do sleep(3827) end | 235 | while not check_for_buildings(p1, {barbarians_helmsmithy = 1}) do sleep(3827) end |
461 | 236 | o.done = true | 236 | set_objective_done(o) |
462 | 237 | end | 237 | end |
463 | 238 | 238 | ||
464 | 239 | function fortress() | 239 | function fortress() |
465 | @@ -247,7 +247,7 @@ | |||
466 | 247 | 247 | ||
467 | 248 | while #p1:get_buildings("barbarians_fortress") == 0 do sleep(6523) end | 248 | while #p1:get_buildings("barbarians_fortress") == 0 do sleep(6523) end |
468 | 249 | 249 | ||
470 | 250 | o.done = true | 250 | set_objective_done(o) |
471 | 251 | campaign_message_box(story_note_3) | 251 | campaign_message_box(story_note_3) |
472 | 252 | end | 252 | end |
473 | 253 | 253 | ||
474 | @@ -294,7 +294,7 @@ | |||
475 | 294 | ) | 294 | ) |
476 | 295 | do sleep(7829) end | 295 | do sleep(7829) end |
477 | 296 | -- "explore further" is done | 296 | -- "explore further" is done |
479 | 297 | exploration_objective.done = true | 297 | set_objective_done(exploration_objective) |
480 | 298 | 298 | ||
481 | 299 | campaign_message_box(order_msg_7_destroy_kalitaths_army) | 299 | campaign_message_box(order_msg_7_destroy_kalitaths_army) |
482 | 300 | local o = add_campaign_objective(obj_destroy_kalitaths_army) | 300 | local o = add_campaign_objective(obj_destroy_kalitaths_army) |
483 | @@ -302,7 +302,7 @@ | |||
484 | 302 | while not check_player_completely_defeated(p2) do | 302 | while not check_player_completely_defeated(p2) do |
485 | 303 | sleep(7837) | 303 | sleep(7837) |
486 | 304 | end | 304 | end |
488 | 305 | o.done = true | 305 | set_objective_done(o) |
489 | 306 | end | 306 | end |
490 | 307 | 307 | ||
491 | 308 | function renegade_fortresses() | 308 | function renegade_fortresses() |
492 | @@ -345,7 +345,7 @@ | |||
493 | 345 | sleep(6733) | 345 | sleep(6733) |
494 | 346 | end | 346 | end |
495 | 347 | 347 | ||
497 | 348 | o.done = true | 348 | set_objective_done(o) |
498 | 349 | end | 349 | end |
499 | 350 | 350 | ||
500 | 351 | function mission_complete() | 351 | function mission_complete() |
501 | 352 | 352 | ||
502 | === modified file 'data/campaigns/emp01.wmf/scripting/mission_thread.lua' | |||
503 | --- data/campaigns/emp01.wmf/scripting/mission_thread.lua 2016-01-28 05:24:34 +0000 | |||
504 | +++ data/campaigns/emp01.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
505 | @@ -30,7 +30,7 @@ | |||
506 | 30 | p1:allow_buildings{"empire_blockhouse"} | 30 | p1:allow_buildings{"empire_blockhouse"} |
507 | 31 | local o = add_campaign_objective(obj_build_blockhouse) | 31 | local o = add_campaign_objective(obj_build_blockhouse) |
508 | 32 | while #p1:get_buildings("empire_blockhouse") < 1 do sleep(3249) end | 32 | while #p1:get_buildings("empire_blockhouse") < 1 do sleep(3249) end |
510 | 33 | o.done = true | 33 | set_objective_done(o) |
511 | 34 | 34 | ||
512 | 35 | -- Blockhouse is completed now | 35 | -- Blockhouse is completed now |
513 | 36 | campaign_message_box(saledus_2) | 36 | campaign_message_box(saledus_2) |
514 | @@ -38,7 +38,7 @@ | |||
515 | 38 | o = add_campaign_objective(obj_build_lumberjack) | 38 | o = add_campaign_objective(obj_build_lumberjack) |
516 | 39 | campaign_message_box(amalea_1) | 39 | campaign_message_box(amalea_1) |
517 | 40 | while #p1:get_buildings("empire_lumberjacks_house") < 1 do sleep(3249) end | 40 | while #p1:get_buildings("empire_lumberjacks_house") < 1 do sleep(3249) end |
519 | 41 | o.done = true | 41 | set_objective_done(o) |
520 | 42 | 42 | ||
521 | 43 | -- Lumberjack is now build | 43 | -- Lumberjack is now build |
522 | 44 | campaign_message_box(amalea_2) | 44 | campaign_message_box(amalea_2) |
523 | @@ -46,14 +46,14 @@ | |||
524 | 46 | o = add_campaign_objective(obj_build_sawmill_and_lumberjacks) | 46 | o = add_campaign_objective(obj_build_sawmill_and_lumberjacks) |
525 | 47 | while not check_for_buildings(p1, { empire_lumberjacks_house = 3, empire_sawmill = 1}) | 47 | while not check_for_buildings(p1, { empire_lumberjacks_house = 3, empire_sawmill = 1}) |
526 | 48 | do sleep(2343) end | 48 | do sleep(2343) end |
528 | 49 | o.done = true | 49 | set_objective_done(o) |
529 | 50 | 50 | ||
530 | 51 | -- Now the lady demands a forester after having us cut down the whole forest. | 51 | -- Now the lady demands a forester after having us cut down the whole forest. |
531 | 52 | campaign_message_box(amalea_3) | 52 | campaign_message_box(amalea_3) |
532 | 53 | o = add_campaign_objective(obj_build_forester) | 53 | o = add_campaign_objective(obj_build_forester) |
533 | 54 | p1:allow_buildings{"empire_foresters_house"} | 54 | p1:allow_buildings{"empire_foresters_house"} |
534 | 55 | while not check_for_buildings(p1, { empire_foresters_house = 1 }) do sleep(2434) end | 55 | while not check_for_buildings(p1, { empire_foresters_house = 1 }) do sleep(2434) end |
536 | 56 | o.done = true | 56 | set_objective_done(o) |
537 | 57 | 57 | ||
538 | 58 | 58 | ||
539 | 59 | -- Now a quarry | 59 | -- Now a quarry |
540 | @@ -61,7 +61,7 @@ | |||
541 | 61 | o = add_campaign_objective(obj_build_quarry) | 61 | o = add_campaign_objective(obj_build_quarry) |
542 | 62 | p1:allow_buildings{"empire_quarry"} | 62 | p1:allow_buildings{"empire_quarry"} |
543 | 63 | while not check_for_buildings(p1, { empire_quarry = 1 }) do sleep(2434) end | 63 | while not check_for_buildings(p1, { empire_quarry = 1 }) do sleep(2434) end |
545 | 64 | o.done = true | 64 | set_objective_done(o) |
546 | 65 | 65 | ||
547 | 66 | -- All buildings done. Got home | 66 | -- All buildings done. Got home |
548 | 67 | campaign_message_box(saledus_4) | 67 | campaign_message_box(saledus_4) |
549 | 68 | 68 | ||
550 | === modified file 'data/campaigns/emp02.wmf/scripting/mission_thread.lua' | |||
551 | --- data/campaigns/emp02.wmf/scripting/mission_thread.lua 2016-01-28 05:24:34 +0000 | |||
552 | +++ data/campaigns/emp02.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
553 | @@ -28,7 +28,7 @@ | |||
554 | 28 | }) do sleep(2342) end | 28 | }) do sleep(2342) end |
555 | 29 | 29 | ||
556 | 30 | campaign_message_box(diary_page_6) | 30 | campaign_message_box(diary_page_6) |
558 | 31 | o_woodeconomy.done = true | 31 | set_objective_done(o_woodeconomy) |
559 | 32 | end) | 32 | end) |
560 | 33 | 33 | ||
561 | 34 | 34 | ||
562 | @@ -39,7 +39,7 @@ | |||
563 | 39 | -- Check for completeness of the quarry | 39 | -- Check for completeness of the quarry |
564 | 40 | run(function() | 40 | run(function() |
565 | 41 | while not check_for_buildings(p1, {empire_quarry=1}) do sleep(3423) end | 41 | while not check_for_buildings(p1, {empire_quarry=1}) do sleep(3423) end |
567 | 42 | o_quarry.done = true | 42 | set_objective_done(o_quarry) |
568 | 43 | 43 | ||
569 | 44 | campaign_message_box(diary_page_7) | 44 | campaign_message_box(diary_page_7) |
570 | 45 | end) | 45 | end) |
571 | @@ -100,7 +100,7 @@ | |||
572 | 100 | #rv.empire_piggery + #rv.empire_bakery) > 0 then break end | 100 | #rv.empire_piggery + #rv.empire_bakery) > 0 then break end |
573 | 101 | sleep(4857) | 101 | sleep(4857) |
574 | 102 | end | 102 | end |
576 | 103 | o.done = true | 103 | set_objective_done(o) |
577 | 104 | end | 104 | end |
578 | 105 | 105 | ||
579 | 106 | function mining_infrastructure() | 106 | function mining_infrastructure() |
580 | @@ -159,7 +159,7 @@ | |||
581 | 159 | #rv.empire_weaponsmithy > 0 then break end | 159 | #rv.empire_weaponsmithy > 0 then break end |
582 | 160 | sleep(4948) | 160 | sleep(4948) |
583 | 161 | end | 161 | end |
585 | 162 | o.done = true | 162 | set_objective_done(o) |
586 | 163 | mining_infrastructure_done = true | 163 | mining_infrastructure_done = true |
587 | 164 | end | 164 | end |
588 | 165 | 165 | ||
589 | @@ -182,7 +182,7 @@ | |||
590 | 182 | 182 | ||
591 | 183 | -- sleep while not owning 26, 21 | 183 | -- sleep while not owning 26, 21 |
592 | 184 | while wl.Game().map:get_field(26,21).owner ~= p1 do sleep(3243) end | 184 | while wl.Game().map:get_field(26,21).owner ~= p1 do sleep(3243) end |
594 | 185 | o.done = true | 185 | set_objective_done(o) |
595 | 186 | 186 | ||
596 | 187 | -- Marble Mountains | 187 | -- Marble Mountains |
597 | 188 | local marblemountains = wl.Game().map:get_field(35,19) | 188 | local marblemountains = wl.Game().map:get_field(35,19) |
598 | @@ -195,7 +195,7 @@ | |||
599 | 195 | p1:allow_buildings{"empire_marblemine", "empire_marblemine_deep"} | 195 | p1:allow_buildings{"empire_marblemine", "empire_marblemine_deep"} |
600 | 196 | o = add_campaign_objective(obj_build_marblemine) | 196 | o = add_campaign_objective(obj_build_marblemine) |
601 | 197 | run(function() while not check_for_buildings(p1, {empire_marblemine = 1}) | 197 | run(function() while not check_for_buildings(p1, {empire_marblemine = 1}) |
603 | 198 | do sleep(2133) end o.done = true end) | 198 | do sleep(2133) end set_objective_done(o, 0) end) |
604 | 199 | 199 | ||
605 | 200 | -- Go back to where we were | 200 | -- Go back to where we were |
606 | 201 | timed_scroll(array_reverse(pts)) | 201 | timed_scroll(array_reverse(pts)) |
607 | @@ -239,7 +239,7 @@ | |||
608 | 239 | end | 239 | end |
609 | 240 | sleep(2342) | 240 | sleep(2342) |
610 | 241 | end | 241 | end |
612 | 242 | o.done = true | 242 | set_objective_done(o) |
613 | 243 | 243 | ||
614 | 244 | -- Wait till the mining infrastructure is also up | 244 | -- Wait till the mining infrastructure is also up |
615 | 245 | while not mining_infrastructure_done do | 245 | while not mining_infrastructure_done do |
616 | @@ -254,7 +254,7 @@ | |||
617 | 254 | wl.Game().map:get_field(60,65):region(6)) | 254 | wl.Game().map:get_field(60,65):region(6)) |
618 | 255 | do sleep(2435) end | 255 | do sleep(2435) end |
619 | 256 | 256 | ||
621 | 257 | o.done = true | 257 | set_objective_done(o) |
622 | 258 | 258 | ||
623 | 259 | -- Show victory message | 259 | -- Show victory message |
624 | 260 | campaign_message_box(diary_page_10) | 260 | campaign_message_box(diary_page_10) |
625 | 261 | 261 | ||
626 | === modified file 'data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua' | |||
627 | --- data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua 2016-05-14 16:18:25 +0000 | |||
628 | +++ data/campaigns/tutorial01_basic_control.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
629 | @@ -17,11 +17,9 @@ | |||
630 | 17 | while not wl.ui.MapView().buildhelp do | 17 | while not wl.ui.MapView().buildhelp do |
631 | 18 | sleep(200) | 18 | sleep(200) |
632 | 19 | end | 19 | end |
634 | 20 | o.done = true | 20 | set_objective_done(o, 500) |
635 | 21 | wl.ui.MapView():abort_road_building() | 21 | wl.ui.MapView():abort_road_building() |
636 | 22 | 22 | ||
637 | 23 | sleep(500) | ||
638 | 24 | |||
639 | 25 | build_lumberjack() | 23 | build_lumberjack() |
640 | 26 | end | 24 | end |
641 | 27 | 25 | ||
642 | @@ -69,7 +67,7 @@ | |||
643 | 69 | 67 | ||
644 | 70 | blocker:lift_blocks() | 68 | blocker:lift_blocks() |
645 | 71 | 69 | ||
647 | 72 | sleep(15000) | 70 | sleep(30000) |
648 | 73 | 71 | ||
649 | 74 | if not (f.immovable and f.immovable.descr.type_name == "flag") then | 72 | if not (f.immovable and f.immovable.descr.type_name == "flag") then |
650 | 75 | -- only show this if the user has not already built a flag | 73 | -- only show this if the user has not already built a flag |
651 | @@ -86,9 +84,7 @@ | |||
652 | 86 | 84 | ||
653 | 87 | -- Wait for flag | 85 | -- Wait for flag |
654 | 88 | while not (f.immovable and f.immovable.descr.type_name == "flag") do sleep(300) end | 86 | while not (f.immovable and f.immovable.descr.type_name == "flag") do sleep(300) end |
658 | 89 | o.done = true | 87 | set_objective_done(o, 300) |
656 | 90 | |||
657 | 91 | sleep(300) | ||
659 | 92 | 88 | ||
660 | 93 | message_box_objective(plr, lumberjack_message_06) | 89 | message_box_objective(plr, lumberjack_message_06) |
661 | 94 | else | 90 | else |
662 | @@ -120,14 +116,12 @@ | |||
663 | 120 | end | 116 | end |
664 | 121 | 117 | ||
665 | 122 | _wait_for_move() | 118 | _wait_for_move() |
668 | 123 | o.done = true | 119 | set_objective_done(o) |
667 | 124 | sleep(3000) -- Give the player a chance to try this some more | ||
669 | 125 | 120 | ||
670 | 126 | o = message_box_objective(plr, tell_about_right_drag_move) | 121 | o = message_box_objective(plr, tell_about_right_drag_move) |
671 | 127 | 122 | ||
672 | 128 | _wait_for_move() | 123 | _wait_for_move() |
675 | 129 | o.done = true | 124 | set_objective_done(o) |
674 | 130 | sleep(3000) -- Give the player a chance to try this some more | ||
676 | 131 | 125 | ||
677 | 132 | o = message_box_objective(plr, tell_about_minimap) | 126 | o = message_box_objective(plr, tell_about_minimap) |
678 | 133 | 127 | ||
679 | @@ -135,8 +129,7 @@ | |||
680 | 135 | while not wl.ui.MapView().windows.minimap do sleep(100) end | 129 | while not wl.ui.MapView().windows.minimap do sleep(100) end |
681 | 136 | while wl.ui.MapView().windows.minimap do sleep(100) end | 130 | while wl.ui.MapView().windows.minimap do sleep(100) end |
682 | 137 | 131 | ||
685 | 138 | o.done = true | 132 | set_objective_done(o, 500) |
684 | 139 | sleep(500) | ||
686 | 140 | 133 | ||
687 | 141 | message_box_objective(plr, congratulate_and_on_to_quarry) | 134 | message_box_objective(plr, congratulate_and_on_to_quarry) |
688 | 142 | 135 | ||
689 | @@ -161,7 +154,7 @@ | |||
690 | 161 | -- Wait for the constructionsite to be placed | 154 | -- Wait for the constructionsite to be placed |
691 | 162 | while not cs do sleep(200) end | 155 | while not cs do sleep(200) end |
692 | 163 | 156 | ||
694 | 164 | o.done = true | 157 | set_objective_done(o, 0) |
695 | 165 | register_immovable_as_allowed(cs) | 158 | register_immovable_as_allowed(cs) |
696 | 166 | 159 | ||
697 | 167 | local function _rip_road() | 160 | local function _rip_road() |
698 | @@ -238,7 +231,7 @@ | |||
699 | 238 | census_and_statistics() | 231 | census_and_statistics() |
700 | 239 | 232 | ||
701 | 240 | while #plr:get_buildings("barbarians_quarry") < 2 do sleep(1400) end | 233 | while #plr:get_buildings("barbarians_quarry") < 2 do sleep(1400) end |
703 | 241 | o.done = true | 234 | set_objective_done(o, 0) |
704 | 242 | 235 | ||
705 | 243 | messages() | 236 | messages() |
706 | 244 | end | 237 | end |
707 | @@ -271,7 +264,7 @@ | |||
708 | 271 | if not second_quarry_field.immovable then message_box_objective(plr,quarry_illegally_destroyed) return end | 264 | if not second_quarry_field.immovable then message_box_objective(plr,quarry_illegally_destroyed) return end |
709 | 272 | end | 265 | end |
710 | 273 | 266 | ||
712 | 274 | o.done = true | 267 | set_objective_done(o, 0) |
713 | 275 | register_immovable_as_allowed(cs) | 268 | register_immovable_as_allowed(cs) |
714 | 276 | end | 269 | end |
715 | 277 | 270 | ||
716 | @@ -310,15 +303,13 @@ | |||
717 | 310 | local o = add_campaign_objective(teaching_about_messages) | 303 | local o = add_campaign_objective(teaching_about_messages) |
718 | 311 | 304 | ||
719 | 312 | while #plr.inbox > 0 do sleep(200) end | 305 | while #plr.inbox > 0 do sleep(200) end |
723 | 313 | o.done = true | 306 | set_objective_done(o, 500) |
721 | 314 | |||
722 | 315 | sleep(500) | ||
724 | 316 | 307 | ||
725 | 317 | local o = message_box_objective(plr, closing_msg_window_00) | 308 | local o = message_box_objective(plr, closing_msg_window_00) |
726 | 318 | 309 | ||
727 | 319 | -- Wait for messages window to close | 310 | -- Wait for messages window to close |
728 | 320 | while wl.ui.MapView().windows.messages do sleep(300) end | 311 | while wl.ui.MapView().windows.messages do sleep(300) end |
730 | 321 | o.done = true | 312 | set_objective_done(o, 0) |
731 | 322 | 313 | ||
732 | 323 | message_box_objective(plr, closing_msg_window_01) | 314 | message_box_objective(plr, closing_msg_window_01) |
733 | 324 | 315 | ||
734 | @@ -351,9 +342,7 @@ | |||
735 | 351 | terminate_bad_boy_sentinel = true | 342 | terminate_bad_boy_sentinel = true |
736 | 352 | 343 | ||
737 | 353 | while #plr:get_buildings("barbarians_quarry") > 0 do sleep(200) end | 344 | while #plr:get_buildings("barbarians_quarry") > 0 do sleep(200) end |
741 | 354 | o.done = true | 345 | set_objective_done(o) |
739 | 355 | |||
740 | 356 | sleep(3000) | ||
742 | 357 | 346 | ||
743 | 358 | expansion() | 347 | expansion() |
744 | 359 | end | 348 | end |
745 | @@ -382,15 +371,14 @@ | |||
746 | 382 | sleep(500) | 371 | sleep(500) |
747 | 383 | end | 372 | end |
748 | 384 | 373 | ||
751 | 385 | o.done = true | 374 | set_objective_done(o) |
750 | 386 | sleep(4000) | ||
752 | 387 | message_box_objective(plr, military_building_finished) | 375 | message_box_objective(plr, military_building_finished) |
753 | 388 | 376 | ||
754 | 389 | conclusion() | 377 | conclusion() |
755 | 390 | end | 378 | end |
756 | 391 | 379 | ||
757 | 392 | function conclusion() | 380 | function conclusion() |
759 | 393 | sleep(10000) -- to give the player time to see his expanded area | 381 | sleep(5000) -- to give the player time to see his expanded area |
760 | 394 | 382 | ||
761 | 395 | -- Conclude the tutorial with final words and information | 383 | -- Conclude the tutorial with final words and information |
762 | 396 | -- on how to quit | 384 | -- on how to quit |
763 | 397 | 385 | ||
764 | === modified file 'data/campaigns/tutorial02_warfare.wmf/scripting/mission_thread.lua' | |||
765 | --- data/campaigns/tutorial02_warfare.wmf/scripting/mission_thread.lua 2015-10-31 12:11:44 +0000 | |||
766 | +++ data/campaigns/tutorial02_warfare.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
767 | @@ -9,35 +9,41 @@ | |||
768 | 9 | training() | 9 | training() |
769 | 10 | end | 10 | end |
770 | 11 | 11 | ||
771 | 12 | local trainingcamp_done = false | ||
772 | 13 | local battlearena_done = false | ||
773 | 14 | |||
774 | 15 | function training2() | ||
775 | 16 | -- Teach about trainingsites and soldiers' abilities - concurrent part 2 | ||
776 | 17 | sleep(2*60*1000) | ||
777 | 18 | o = message_box_objective(plr, trainingcamp1) | ||
778 | 19 | while #plr:get_buildings("barbarians_trainingcamp") == 0 do sleep(500) end | ||
779 | 20 | set_objective_done(o) | ||
780 | 21 | message_box_objective(plr, trainingcamp2) | ||
781 | 22 | trainingcamp_done = true | ||
782 | 23 | end | ||
783 | 24 | |||
784 | 12 | function training() | 25 | function training() |
785 | 13 | -- Teach about trainingsites and soldiers' abilities | 26 | -- Teach about trainingsites and soldiers' abilities |
786 | 14 | sleep(5000) -- to let soldiers walk | 27 | sleep(5000) -- to let soldiers walk |
787 | 15 | 28 | ||
788 | 16 | message_box_objective(plr, abilities) | 29 | message_box_objective(plr, abilities) |
789 | 17 | local o = message_box_objective(plr, battlearena1) | 30 | local o = message_box_objective(plr, battlearena1) |
790 | 31 | run(training2) | ||
791 | 32 | |||
792 | 18 | while #plr:get_buildings("barbarians_battlearena") == 0 do sleep(500) end | 33 | while #plr:get_buildings("barbarians_battlearena") == 0 do sleep(500) end |
794 | 19 | o.done = true | 34 | set_objective_done(o, 0) |
795 | 20 | message_box_objective(plr, battlearena2) | 35 | message_box_objective(plr, battlearena2) |
805 | 21 | 36 | battlearena_done = true | |
797 | 22 | o = message_box_objective(plr, trainingcamp1) | ||
798 | 23 | while #plr:get_buildings("barbarians_trainingcamp") == 0 do sleep(500) end | ||
799 | 24 | o.done = true | ||
800 | 25 | message_box_objective(plr, trainingcamp2) | ||
801 | 26 | |||
802 | 27 | sleep(300) | ||
803 | 28 | |||
804 | 29 | military_buildings() | ||
806 | 30 | end | 37 | end |
807 | 31 | 38 | ||
808 | 32 | function military_buildings() | 39 | function military_buildings() |
809 | 40 | while not trainingcamp_done or not battlearena_done do sleep(3000) end | ||
810 | 33 | message_box_objective(plr, heroes_rookies) | 41 | message_box_objective(plr, heroes_rookies) |
811 | 34 | message_box_objective(plr, soldier_capacity) | 42 | message_box_objective(plr, soldier_capacity) |
812 | 35 | local o = message_box_objective(plr, dismantle) | 43 | local o = message_box_objective(plr, dismantle) |
813 | 36 | 44 | ||
814 | 37 | while #plr:get_buildings("barbarians_sentry") > 1 do sleep(200) end | 45 | while #plr:get_buildings("barbarians_sentry") > 1 do sleep(200) end |
818 | 38 | o.done = true | 46 | set_objective_done(o) |
816 | 39 | |||
817 | 40 | sleep(2000) | ||
819 | 41 | 47 | ||
820 | 42 | enhance_fortress() | 48 | enhance_fortress() |
821 | 43 | end | 49 | end |
822 | @@ -49,7 +55,7 @@ | |||
823 | 49 | local o = message_box_objective(plr, fortress_enhancement) | 55 | local o = message_box_objective(plr, fortress_enhancement) |
824 | 50 | while not (citadel_field.immovable and | 56 | while not (citadel_field.immovable and |
825 | 51 | citadel_field.immovable.descr.name == "barbarians_citadel") do sleep(800) end | 57 | citadel_field.immovable.descr.name == "barbarians_citadel") do sleep(800) end |
827 | 52 | o.done = true | 58 | set_objective_done(o, 0) |
828 | 53 | 59 | ||
829 | 54 | create_enemy() | 60 | create_enemy() |
830 | 55 | 61 | ||
831 | @@ -91,14 +97,14 @@ | |||
832 | 91 | while #plr2:get_buildings("empire_headquarters") > 0 do | 97 | while #plr2:get_buildings("empire_headquarters") > 0 do |
833 | 92 | sleep(3000) | 98 | sleep(3000) |
834 | 93 | end | 99 | end |
836 | 94 | o.done = true | 100 | set_objective_done(o) |
837 | 95 | 101 | ||
838 | 96 | conclusion() | 102 | conclusion() |
839 | 97 | end | 103 | end |
840 | 98 | 104 | ||
841 | 99 | function conclusion() | 105 | function conclusion() |
842 | 100 | sleep(4000) | ||
843 | 101 | message_box_objective(plr, conclude_tutorial) | 106 | message_box_objective(plr, conclude_tutorial) |
844 | 102 | end | 107 | end |
845 | 103 | 108 | ||
846 | 104 | run(intro) | 109 | run(intro) |
847 | 110 | run (military_buildings) | ||
848 | 105 | 111 | ||
849 | === modified file 'data/campaigns/tutorial02_warfare.wmf/scripting/texts.lua' | |||
850 | --- data/campaigns/tutorial02_warfare.wmf/scripting/texts.lua 2016-09-14 10:54:05 +0000 | |||
851 | +++ data/campaigns/tutorial02_warfare.wmf/scripting/texts.lua 2016-12-10 09:41:21 +0000 | |||
852 | @@ -13,6 +13,9 @@ | |||
853 | 13 | local tribe = wl.Game():get_tribe_description("barbarians") | 13 | local tribe = wl.Game():get_tribe_description("barbarians") |
854 | 14 | local soldier = wl.Game():get_worker_description(tribe.soldier) | 14 | local soldier = wl.Game():get_worker_description(tribe.soldier) |
855 | 15 | 15 | ||
856 | 16 | local empire_tribe = wl.Game():get_tribe_description("empire") | ||
857 | 17 | local empire_soldier = wl.Game():get_worker_description(empire_tribe.soldier) | ||
858 | 18 | |||
859 | 16 | -- ============= | 19 | -- ============= |
860 | 17 | -- Texts below | 20 | -- Texts below |
861 | 18 | -- ============= | 21 | -- ============= |
862 | @@ -118,7 +121,7 @@ | |||
863 | 118 | p(_[[Great, our training camp has now been finished, too. Now nothing will hinder us from getting the strongest warriors the world has ever seen.]]) .. | 121 | p(_[[Great, our training camp has now been finished, too. Now nothing will hinder us from getting the strongest warriors the world has ever seen.]]) .. |
864 | 119 | p(_[[To train in the training camp, our soldiers need food like in the battle arena, but no strong beer. Instead, they need different axes for attack training and helmets for health training.]]) .. | 122 | p(_[[To train in the training camp, our soldiers need food like in the battle arena, but no strong beer. Instead, they need different axes for attack training and helmets for health training.]]) .. |
865 | 120 | p(_[[This equipment is produced in smithies out of coal, iron, and sometimes gold. You will learn more about this in the second scenario of the Barbarian campaign.]]) .. | 123 | p(_[[This equipment is produced in smithies out of coal, iron, and sometimes gold. You will learn more about this in the second scenario of the Barbarian campaign.]]) .. |
867 | 121 | p(_[[You should also keep in mind that each of the three tribes in Widelands has its own way of training, so the buildings and wares are different. Also, the ability levels cannot be compared: an Imperial soldier with evade level 0 has a 30% chance of evading, while a Barbarian soldier at the same level only has a 25% chance.]]) | 124 | p(_[[You should also keep in mind that each of the three tribes in Widelands has its own way of training, so the buildings and wares are different. Also, the ability levels cannot be compared: an Imperial soldier has a base attack of %1% at level 0, while a Barbarian soldier at the same level only has a base attack of %2%.]]:bformat(empire_soldier.base_min_attack, soldier.base_min_attack)) |
868 | 122 | ) | 125 | ) |
869 | 123 | } | 126 | } |
870 | 124 | 127 | ||
871 | 125 | 128 | ||
872 | === modified file 'data/campaigns/tutorial03_seafaring.wmf/scripting/mission_thread.lua' | |||
873 | --- data/campaigns/tutorial03_seafaring.wmf/scripting/mission_thread.lua 2016-08-03 10:20:20 +0000 | |||
874 | +++ data/campaigns/tutorial03_seafaring.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
875 | @@ -21,7 +21,7 @@ | |||
876 | 21 | local o = message_box_objective(plr, tell_about_port_building) | 21 | local o = message_box_objective(plr, tell_about_port_building) |
877 | 22 | 22 | ||
878 | 23 | while #plr:get_buildings("atlanteans_port") < 2 do sleep(200) end | 23 | while #plr:get_buildings("atlanteans_port") < 2 do sleep(200) end |
880 | 24 | o.done = true | 24 | set_objective_done(o) |
881 | 25 | 25 | ||
882 | 26 | build_ships() | 26 | build_ships() |
883 | 27 | end | 27 | end |
884 | @@ -32,7 +32,7 @@ | |||
885 | 32 | plr:allow_buildings{"atlanteans_shipyard"} | 32 | plr:allow_buildings{"atlanteans_shipyard"} |
886 | 33 | 33 | ||
887 | 34 | while #plr:get_buildings("atlanteans_shipyard") < 1 do sleep(200) end | 34 | while #plr:get_buildings("atlanteans_shipyard") < 1 do sleep(200) end |
889 | 35 | o.done = true | 35 | set_objective_done(o) |
890 | 36 | 36 | ||
891 | 37 | local o = message_box_objective(plr, tell_about_ships) | 37 | local o = message_box_objective(plr, tell_about_ships) |
892 | 38 | 38 | ||
893 | @@ -40,7 +40,7 @@ | |||
894 | 40 | while #plr:get_ships() < 1 do sleep(30*1000) end | 40 | while #plr:get_ships() < 1 do sleep(30*1000) end |
895 | 41 | sleep(5*60*1000) | 41 | sleep(5*60*1000) |
896 | 42 | 42 | ||
898 | 43 | o.done = true | 43 | set_objective_done(o) |
899 | 44 | 44 | ||
900 | 45 | expedition() | 45 | expedition() |
901 | 46 | end | 46 | end |
902 | @@ -58,12 +58,12 @@ | |||
903 | 58 | end | 58 | end |
904 | 59 | 59 | ||
905 | 60 | while not _ship_ready_for_expedition() do sleep(1000) end | 60 | while not _ship_ready_for_expedition() do sleep(1000) end |
907 | 61 | o.done = true | 61 | set_objective_done(o) |
908 | 62 | 62 | ||
909 | 63 | o = message_box_objective(plr, expedition3) | 63 | o = message_box_objective(plr, expedition3) |
910 | 64 | 64 | ||
911 | 65 | while #plr:get_buildings("atlanteans_port") < 3 do sleep(200) end | 65 | while #plr:get_buildings("atlanteans_port") < 3 do sleep(200) end |
913 | 66 | o.done = true | 66 | set_objective_done(o) |
914 | 67 | 67 | ||
915 | 68 | -- places 5 signs with iron to show the player he really found some iron ore | 68 | -- places 5 signs with iron to show the player he really found some iron ore |
916 | 69 | local fields = map:get_field(97,35):region(3) | 69 | local fields = map:get_field(97,35):region(3) |
917 | 70 | 70 | ||
918 | === modified file 'data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua' | |||
919 | --- data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua 2015-10-31 12:11:44 +0000 | |||
920 | +++ data/campaigns/tutorial04_economy.wmf/scripting/mission_thread.lua 2016-12-10 09:41:21 +0000 | |||
921 | @@ -13,16 +13,15 @@ | |||
922 | 13 | function burn_tavern_down() | 13 | function burn_tavern_down() |
923 | 14 | sleep(500) | 14 | sleep(500) |
924 | 15 | scroll_smoothly_to(tavern_field) | 15 | scroll_smoothly_to(tavern_field) |
926 | 16 | sleep(250) | 16 | sleep(1000) |
927 | 17 | tavern_field.immovable:destroy() | 17 | tavern_field.immovable:destroy() |
929 | 18 | sleep(50) | 18 | sleep(1000) |
930 | 19 | message_box_objective(plr, tavern_burnt_down) | 19 | message_box_objective(plr, tavern_burnt_down) |
932 | 20 | sleep(2000) | 20 | sleep(500) |
933 | 21 | local o = message_box_objective(plr, building_stat) | 21 | local o = message_box_objective(plr, building_stat) |
934 | 22 | while not mv.windows.building_statistics do sleep(100) end | 22 | while not mv.windows.building_statistics do sleep(100) end |
936 | 23 | o.done = true | 23 | set_objective_done(o, wl.Game().real_speed) |
937 | 24 | 24 | ||
938 | 25 | sleep(wl.Game().real_speed) -- The building statistics window needs some time to build up | ||
939 | 26 | o = message_box_objective(plr,explain_building_stat) | 25 | o = message_box_objective(plr,explain_building_stat) |
940 | 27 | -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility | 26 | -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility |
941 | 28 | local o2 = add_campaign_objective(reopen_building_stat_obj) | 27 | local o2 = add_campaign_objective(reopen_building_stat_obj) |
942 | @@ -39,28 +38,26 @@ | |||
943 | 39 | sleep(200) | 38 | sleep(200) |
944 | 40 | end | 39 | end |
945 | 41 | while mv.windows.building_statistics do sleep(100) end | 40 | while mv.windows.building_statistics do sleep(100) end |
947 | 42 | o.done = true | 41 | set_objective_done(o, 0) |
948 | 43 | 42 | ||
949 | 44 | sleep(2000) | ||
950 | 45 | o = message_box_objective(plr, inventory1) | 43 | o = message_box_objective(plr, inventory1) |
951 | 46 | while not mv.windows.stock_menu do sleep(200) end | 44 | while not mv.windows.stock_menu do sleep(200) end |
953 | 47 | o.done = true | 45 | set_objective_done(o, wl.Game().real_speed) |
954 | 48 | 46 | ||
955 | 49 | o = message_box_objective(plr, inventory2) | 47 | o = message_box_objective(plr, inventory2) |
956 | 50 | -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility | 48 | -- We cannot create several objectives with the same name. Therefore, we create o2 here once and change its visibility |
957 | 51 | o2 = add_campaign_objective(reopen_stock_menu_obj) | 49 | o2 = add_campaign_objective(reopen_stock_menu_obj) |
958 | 52 | o2.visible = false | 50 | o2.visible = false |
960 | 53 | while not o.done do | 51 | while not mv.windows.stock_menu.tabs["wares_in_warehouses"].active do |
961 | 54 | if not mv.windows.stock_menu then | 52 | if not mv.windows.stock_menu then |
962 | 55 | o2.visible = true | 53 | o2.visible = true |
963 | 56 | message_box_objective(plr, reopen_stock_menu) | 54 | message_box_objective(plr, reopen_stock_menu) |
964 | 57 | while not mv.windows.stock_menu do sleep(200) end | 55 | while not mv.windows.stock_menu do sleep(200) end |
965 | 58 | o2.visible = false | 56 | o2.visible = false |
966 | 59 | end | 57 | end |
967 | 60 | if mv.windows.stock_menu.tabs["wares_in_warehouses"].active then o.done = true end | ||
968 | 61 | sleep(200) | 58 | sleep(200) |
969 | 62 | end | 59 | end |
971 | 63 | 60 | set_objective_done(o, 0) | |
972 | 64 | message_box_objective(plr, inventory3) | 61 | message_box_objective(plr, inventory3) |
973 | 65 | 62 | ||
974 | 66 | sleep(2000) | 63 | sleep(2000) |
975 | @@ -70,57 +67,54 @@ | |||
976 | 70 | message_box_objective(plr, ware_encyclopedia) -- a small insert | 67 | message_box_objective(plr, ware_encyclopedia) -- a small insert |
977 | 71 | 68 | ||
978 | 72 | while #plr:get_buildings("empire_tavern") < 2 do sleep(500) end | 69 | while #plr:get_buildings("empire_tavern") < 2 do sleep(500) end |
980 | 73 | o.done = true | 70 | set_objective_done(o, 0) |
981 | 74 | 71 | ||
982 | 75 | plan_the_future() | 72 | plan_the_future() |
983 | 76 | end | 73 | end |
984 | 77 | 74 | ||
985 | 78 | function plan_the_future() | 75 | function plan_the_future() |
986 | 79 | sleep(2000) | ||
987 | 80 | message_box_objective(plr, building_priority_settings) | 76 | message_box_objective(plr, building_priority_settings) |
988 | 81 | sleep(30*1000) -- give the user time to try it out | 77 | sleep(30*1000) -- give the user time to try it out |
989 | 82 | 78 | ||
990 | 83 | local o = message_box_objective(plr, ware_stats1) | 79 | local o = message_box_objective(plr, ware_stats1) |
991 | 84 | while not mv.windows.ware_statistics do sleep(200) end | 80 | while not mv.windows.ware_statistics do sleep(200) end |
993 | 85 | o.done = true | 81 | set_objective_done(o, 0) |
994 | 86 | 82 | ||
995 | 87 | o = message_box_objective(plr, ware_stats2) | 83 | o = message_box_objective(plr, ware_stats2) |
996 | 88 | local o2 = add_campaign_objective(reopen_ware_stats1_obj) | 84 | local o2 = add_campaign_objective(reopen_ware_stats1_obj) |
997 | 89 | o2.visible = false | 85 | o2.visible = false |
999 | 90 | while not o.done do | 86 | while not mv.windows.ware_statistics.tabs["economy_health"].active do |
1000 | 91 | if not mv.windows.ware_statistics then | 87 | if not mv.windows.ware_statistics then |
1001 | 92 | o2.visible = true | 88 | o2.visible = true |
1002 | 93 | message_box_objective(plr, reopen_ware_stats1) | 89 | message_box_objective(plr, reopen_ware_stats1) |
1003 | 94 | while not mv.windows.ware_statistics do sleep(200) end | 90 | while not mv.windows.ware_statistics do sleep(200) end |
1004 | 95 | o2.visible = false | 91 | o2.visible = false |
1005 | 96 | end | 92 | end |
1006 | 97 | if mv.windows.ware_statistics.tabs["economy_health"].active then o.done = true end | ||
1007 | 98 | sleep(200) | 93 | sleep(200) |
1008 | 99 | end | 94 | end |
1009 | 95 | set_objective_done(o, 0) | ||
1010 | 100 | 96 | ||
1011 | 101 | o = message_box_objective(plr, ware_stats3) | 97 | o = message_box_objective(plr, ware_stats3) |
1012 | 102 | o2 = add_campaign_objective(reopen_ware_stats2_obj) | 98 | o2 = add_campaign_objective(reopen_ware_stats2_obj) |
1013 | 103 | o2.visible = false | 99 | o2.visible = false |
1015 | 104 | while not o.done do | 100 | while not mv.windows.ware_statistics.tabs["stock"].active do |
1016 | 105 | if not mv.windows.ware_statistics then | 101 | if not mv.windows.ware_statistics then |
1017 | 106 | o2.visible = true | 102 | o2.visible = true |
1018 | 107 | message_box_objective(plr, reopen_ware_stats2) | 103 | message_box_objective(plr, reopen_ware_stats2) |
1019 | 108 | while not mv.windows.ware_statistics do sleep(200) end | 104 | while not mv.windows.ware_statistics do sleep(200) end |
1020 | 109 | o2.visible = false | 105 | o2.visible = false |
1021 | 110 | end | 106 | end |
1022 | 111 | if mv.windows.ware_statistics.tabs["stock"].active then o.done = true end | ||
1023 | 112 | sleep(200) | 107 | sleep(200) |
1024 | 113 | end | 108 | end |
1025 | 109 | set_objective_done(o, 0) | ||
1026 | 114 | 110 | ||
1027 | 115 | o = message_box_objective(plr, ware_stats4) | 111 | o = message_box_objective(plr, ware_stats4) |
1028 | 116 | while mv.windows.ware_statistics do sleep(500) end | 112 | while mv.windows.ware_statistics do sleep(500) end |
1032 | 117 | o.done = true | 113 | set_objective_done(o) |
1030 | 118 | |||
1031 | 119 | sleep(2000) | ||
1033 | 120 | 114 | ||
1034 | 121 | o = message_box_objective(plr, economy_settings1) | 115 | o = message_box_objective(plr, economy_settings1) |
1035 | 122 | while not mv.windows.economy_options do sleep(200) end | 116 | while not mv.windows.economy_options do sleep(200) end |
1037 | 123 | o.done = true | 117 | set_objective_done(o, 0) |
1038 | 124 | message_box_objective(plr, economy_settings2) | 118 | message_box_objective(plr, economy_settings2) |
1039 | 125 | o = message_box_objective(plr, economy_settings3) | 119 | o = message_box_objective(plr, economy_settings3) |
1040 | 126 | 120 | ||
1041 | @@ -141,7 +135,7 @@ | |||
1042 | 141 | end | 135 | end |
1043 | 142 | sleep(500) | 136 | sleep(500) |
1044 | 143 | end | 137 | end |
1046 | 144 | o.done = true | 138 | set_objective_done(o) |
1047 | 145 | 139 | ||
1048 | 146 | -- if the minimum_storage_per_warehouse feature is introduced, use the gold mountain to the northeast for explanation | 140 | -- if the minimum_storage_per_warehouse feature is introduced, use the gold mountain to the northeast for explanation |
1049 | 147 | conclude() | 141 | conclude() |
1050 | 148 | 142 | ||
1051 | === modified file 'data/scripting/messages.lua' | |||
1052 | --- data/scripting/messages.lua 2016-01-28 05:24:34 +0000 | |||
1053 | +++ data/scripting/messages.lua 2016-12-10 09:41:21 +0000 | |||
1054 | @@ -69,6 +69,7 @@ | |||
1055 | 69 | message_box(wl.Game().players[1], message.title, message.body, message) | 69 | message_box(wl.Game().players[1], message.title, message.body, message) |
1056 | 70 | end | 70 | end |
1057 | 71 | 71 | ||
1058 | 72 | |||
1059 | 72 | -- RST | 73 | -- RST |
1060 | 73 | -- .. function:: add_campaign_objective(objective) | 74 | -- .. function:: add_campaign_objective(objective) |
1061 | 74 | -- | 75 | -- |
1062 | @@ -87,6 +88,24 @@ | |||
1063 | 87 | end | 88 | end |
1064 | 88 | 89 | ||
1065 | 89 | -- RST | 90 | -- RST |
1066 | 91 | -- .. function:: set_objective_done(objective[, sleeptime]) | ||
1067 | 92 | -- | ||
1068 | 93 | -- Sets an objectve as done and sleeps for a bit. | ||
1069 | 94 | -- | ||
1070 | 95 | -- :arg objective: The objective to be marked as done. | ||
1071 | 96 | -- :arg sleeptime: The milliseconds to sleep. Defaults to 3000. | ||
1072 | 97 | -- | ||
1073 | 98 | function set_objective_done(objective, sleeptime) | ||
1074 | 99 | if not sleeptime then | ||
1075 | 100 | sleep(3000) | ||
1076 | 101 | else | ||
1077 | 102 | sleep(sleeptime) | ||
1078 | 103 | end | ||
1079 | 104 | objective.done = true | ||
1080 | 105 | end | ||
1081 | 106 | |||
1082 | 107 | |||
1083 | 108 | -- RST | ||
1084 | 90 | -- .. function:: message_box_objective(player, message) | 109 | -- .. function:: message_box_objective(player, message) |
1085 | 91 | -- | 110 | -- |
1086 | 92 | -- Calls message_box(player, message.title, message.body, message). Also adds an objective defined in obj_name, obj_title and obj_body. | 111 | -- Calls message_box(player, message.title, message.body, message). Also adds an objective defined in obj_name, obj_title and obj_body. |
Continuous integration builds have changed state:
Travis build 1621. State: passed. Details: https:/ /travis- ci.org/ widelands/ widelands/ builds/ 176654850. /ci.appveyor. com/project/ widelands- dev/widelands/ build/_ widelands_ dev_widelands_ bug_1426465_ scenario_ timings- 1459.
Appveyor build 1459. State: success. Details: https:/