-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscenario.nut
More file actions
813 lines (690 loc) · 21.9 KB
/
scenario.nut
File metadata and controls
813 lines (690 loc) · 21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
/*
* Tutorial Scenario
*
* Can NOT be used in network game !
*/
const version = 1670
map.file = "tutorial192.sve"
scenario_name <- "Tutorial Scenario"
scenario.short_description = scenario_name
scenario.author = "Yona-TYT"
scenario.version = (version / 1000) + "." + ((version % 1000) / 100) + "." + ((version % 100) / 10) + (version % 10)
scenario.translation <- ttext("Translator")
resul_version <- {pak= false , st = false}
const nut_path = "class/" // path to folder with *.nut files
persistent.version <- version // stores version of script
persistent.select <- null // stores user selection
persistent.chapter <- 1 // stores chapter number
persistent.step <- 1 // stores step number of chapter
persistent.status <- {chapter=1, step=1} // save step y chapter
script_test <- true
persistent.st_nr <- array(30) //Numero de estaciones/paradas
scr_jump <- false
gl_percentage <- 0
persistent.gl_percentage <- 0
persistent.r_way_list <- {} //Save way list in fullway
persistent.r_way_c <- coord3d(0, 0, 0)
//----------------------------------------------------------------
cov_save <- array(100) //Guarda los convoys en lista
id_save <- array(100) //Guarda id de los convoys en lista
ignore_save <- array(600) //Marca convoys ingnorados
persistent.ignore_save <- array(600)
persistent.id_save <- array(100)
//-------------Guarda el estado del script------------------------
persistent.pot <- [0,0,0,0,0,0,0,0,0,0,0]
persistent.glsw <- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
pglsw <- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
pot0 <- 0
pot1 <- 0
pot2 <- 0
pot3 <- 0
pot4 <- 0
pot5 <- 0
pot6 <- 0
pot7 <- 0
pot8 <- 0
pot9 <- 0
pot10 <- 0
glsw <- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
//---------------------Contador global de vehiculos----------------------------
persistent.gcov_nr <- 0
gcov_nr <- 0
persistent.gcov_id <- 1
gcov_id <- 0
persistent.gall_cov <- 0
gall_cov <-0
persistent.current_cov <- 0
current_cov <- 0
cov_sw <- true
correct_cov <- true
//----------------------------------------------------------------
tile_delay <- 2 //delay for mark tiles
tile_delay_list <- 2
gui_delay <- true //delay for open win
fail_num <- 20 //numr for the count of try
fail_count <- 1 //if tool fail more of 10 try
//Schedule activate
active_sch_check <- false
// placeholder for tools names in simutrans
tool_alias <- { inspe = "Abfrage", road= "ROADTOOLS", rail = "RAILTOOLS",
ship = "SHIPTOOLS", land = "SLOPETOOLS", spec = "SPECIALTOOLS"
}
good_alias <- { mail = "Post", passa= "Passagiere", goods = "goods_", grain = "grain", coal = "coal",
flour = "flour", deliv = "Crates Deliverables", oel = "oil", gas = "fuel", wood = "logs", plan = "boards"
}
// placeholder for some menus icon
t_icon <- {
road = 0x8003, rail = 0x8005, ship = 0x8007, plane = 0x8008, other = 0x800c, slope = 0x8002,
tram = 0x8004, narr = 0x8006, magl = 0x800a, wremo = 0x800d, exte = 0x800b, trkplus = 0x8011,
siga = 0x8012, sigb = 0x8013, sigc = 0x1017, sigd = 0x1014, gobj = 0x102c, rotobj = 0x1028
}
// table containing all system_types
all_systemtypes <- [st_flat, st_elevated, st_runway, st_tram]
// Complemento para obtener tiempo de espera
tick_wait <- 16
chapter <- null // used later for class
chapter_max <- 7 // amount of chapter
select_option <- { x = 0, y = 0, z = 1 } // place of station to control name
select_option_halt <- null // placeholder for halt_x
tutorial <- {} // placeholder for all chapter CLASS
//returns pakset name (lower case)
function get_set_name(name)
{
local s = name.find(" ")
name = name.slice(0, s)
name = name.tolower()
return name
}
simu_version <- "124.2.3"
pak_name <- "pak192.comic"
current_st <- "0"
current_pak <- "pak"
function string_analyzer()
{
local result = {pak= false , st = false}
//Check version and pakset name
current_pak = get_set_name(get_pakset_name())
current_st = get_version_number()
local p_siz = {a = pak_name.len(), b = current_pak.len()}
//Pak name analyzer ----------------------------------------------------------------------------------------------------------
local siz_a = max(p_siz.a, p_siz.a)
local count_a = 0
local tx_a = ""
for(local j=0;j<siz_a;j++){
try {
pak_name[count_a]
}
catch(ev) {
break
}
if(count_a>0 && current_pak[j]!=pak_name[count_a]){
break
}
if(current_pak[j]==pak_name[count_a]){
tx_a += format("%c",current_pak[j])
count_a++
continue
}
}
if(pak_name == tx_a) result.pak = true
//gui.add_message("Current: "+current_pak+" Tx: "+tx_a+" Pak: "+pak_name+" result: "+result.pak)
//------------------------------------------------------------------------------------------------------------------------------
local s_siz = {a = simu_version.len(), b = current_st.len()}
local val_a = []
local val_b = []
// Analyzer scenario simutrans version -----------------------------------------------------------------------------------------
local value_a = ""
for(local j=0;j<s_siz.a;j++){
local tx = format("%c",simu_version[j])
local result = get_integral(tx)
if(result.res){
value_a += tx
if(j == s_siz.a-1) {
val_a.push(value_a.tointeger())
continue
}
}
else {
if(j == s_siz.a-1) {
val_a.push(value_a.tointeger())
continue
}
if(result.val == "."){
val_a.push(value_a.tointeger())
value_a = ""
continue
}
}
}
//-------Debug ====================================
/*
local txta = ""
for(local j=0; j<val_a.len() ;j++){
txta += (val_a[j] +" :: ")
}
gui.add_message("list A: "+txta +" -- val_a siz: "+val_a.len())
*/
//-------Debug ====================================
//------------------------------------------------------------------------------------------------------------------------------
// Analyzer current simutrans version -------------------------------------------------------------------------------------
local value_b = ""
for(local j=0;j<s_siz.b;j++){
local tx = format("%c",current_st[j])
local result = get_integral(tx)
if(result.res){
value_b += tx
if(j == s_siz.b-1) {
val_b.push(value_b.tointeger())
continue
}
}
else {
if(j == s_siz.b-1) {
val_b.push(value_b.tointeger())
continue
}
if(result.val == "."){
val_b.push(value_b.tointeger())
value_b = ""
continue
}
}
}
//-------Debug ====================================
/*
local txtb = ""
for(local j=0; j<val_b.len() ;j++){
txtb += (val_b[j] +" :: ")
}
gui.add_message("list B: "+txtb +" -- val_b siz: "+val_b.len())
*/
//-------Debug ====================================
//------------------------------------------------------------------------------------------------------------------------------
// Compare both simutrans versions -----------------------------------------------------------------------------------------
local siz_va = val_a.len()
local siz_vb = val_b.len()
local siz_min = min(siz_va, siz_vb)
for(local i = 0; i < siz_min; i++ ) {
local num_a = val_a[i]
local num_b = val_b[i]
//gui.add_message("Array test -- val_a "+num_a+" val_b "+num_b+" -- siz_A "+siz_va+" siz_B "+siz_vb)
//gui.add_message("Val type -- val_a "+type(num_a)+" val_b "+type(num_b)+"")
if(num_a < num_b) {
result.st = true
return result
}
else if(num_a > num_b) {
result.st = false
return result
}
if (i == (siz_min-1)) {
if(siz_va <= siz_vb) {
result.st = true
return result
}
else {
result.st = false
return result
}
}
}
//-------------------------------------------------------------------------------------------------------------------------------
//gui.add_message("result st: "+result.st+" result pak:" +result.pak)
return result
}
function get_integral(tx)
{
local result = {val = null, res = false}
local evet = false
try {
tx.tointeger()
}
catch(ev) {
evet = true
}
if(evet){
result.val = tx
result.res = false
}
else{
result.val = tx.tointeger()
result.res = true
}
return result
}
{
//Check version and pakset name
resul_version = string_analyzer()
include(nut_path+"class_basic_convoys") // include class for detect eliminated convoys
include(nut_path+"class_basic_chapter") // include class for basic chapter structure
}
include(nut_path+"class_basic_chapter") // include class for basic chapter structure
for (local i = 0; i <= chapter_max; i++) // include amount of chapter classes
include(nut_path+"class_chapter_"+(i < 10 ? "0"+i:i) )
chapter <- tutorial.chapter_02 // must be placed here !!!
function script_text()
{
if(!correct_cov){
gui.add_message(""+translate("Advance not allowed"))
return null
}
if(persistent.chapter<7){
scr_jump = true
local result = null
result = chapter.script_text()
if(result == 0) gui.add_message(""+translate("Advance not allowed")+"")
scr_jump = false
return result
}
return null
}
function sum(a,b)
{
return a+b
}
function my_chapter()
{
return "chapter_"+(chapter.chap_nr < 10 ? "0":"")+chapter.chap_nr+"/"
}
function scenario_percentage(percentage)
{
return min( ((persistent.chapter == 0? 1-1 : persistent.chapter -1) * 100 + percentage) / tutorial.len(), 100 )
}
function load_chapter(number,pl)
{
rules.clear()
if (!resul_version.pak || !resul_version.st){
number = 0
chapter = tutorial["chapter_"+(number < 10 ? "0":"")+number](pl)
chapter.chap_nr = number
}
else{
if (number <= tutorial.len() ) // replace the class
chapter = tutorial["chapter_"+(number < 10 ? "0":"")+number](pl)
else persistent.chapter--
if ( (number == persistent.chapter) && (chapter.startcash > 0) ) // set cash money here
player_x(0).book_cash( (chapter.startcash - player_x(0).get_cash()[0]) * 100)
chapter.chap_nr = persistent.chapter
persistent.step = persistent.status.step
}
}
function load_conv_ch(number, step, pl)
{
rules.clear()
if (!resul_version.pak || !resul_version.st){
number = 0
chapter = tutorial["chapter_"+(number < 10 ? "0":"")+number](pl)
chapter.chap_nr = number
}
else{
chapter = tutorial["chapter_"+(number < 10 ? "0":"")+number](pl)
if ( (number == persistent.chapter) && (chapter.startcash > 0) ) // set cash money here
player_x(0).book_cash( (chapter.startcash - player_x(0).get_cash()[0]) * 100)
chapter.step_nr(step)
persistent.chapter = number
chapter.chap_nr = number
chapter.start_chapter()
}
}
function set_city_names()
{
foreach ( city in city_list_x() )
{
local name = ttext( city.get_name() )
if (name.tostring() != "") city.set_name( name.tostring() )
}
}
function get_info_text(pl)
{
local info = ttextfile("info.txt")
local help = ""
local i = 0
//foreach (chap in tutorial)
for (i=1;i<=chapter_max;i++)
help+= "<em>"+translate("Chapter")+" "+(i)+"</em> - "+translate(tutorial["chapter_"+(i<10?"0":"")+i].chapter_name)+"<br>"
info.list_of_chapters = help
info.first_link = "<a href=\"goal\">"+(chapter.chap_nr <= 1 ? translate("Let's start!"):translate("Let's go on!") )+" >></a>"
return info
}
function get_rule_text(pl)
{
/*
local cov_nr_debug = "All convoys-> "+gall_cov+":: Convoys count-> "+gcov_nr+":: current covoy-> "+current_cov+":: Correct cov-> "+correct_cov+":: Convoy id-> "+gcov_id+"<br><br>"
local tx = ""
local j=0
for(j;j<gcov_nr;j++){
local result = true
// cnv - convoy_x instance saved somewhat earlier
try {
cov_save[j].get_pos() // will fail if cnv is no longer existent
// do your checks
}
catch(ev) {
result = false
}
if (result){
if (cov_save[j].is_in_depot()){
result = false
}
}
if (result) {
tx += "<em>["+j+"]</em> id cov save: "+id_save[j]+" :: id conv: "+cov_save[j].id+" <a href=\"("+cov_save[j].get_pos().tostring()+")\"> ("+cov_save[j].get_pos().tostring()+")</a> "+cov_save[j].get_name()+"<br>"
}
else
tx += "<st>["+j+"]</st> "+id_save[j]+"::"+cov_save[j]+"<br>"
}
return cov_nr_debug + tx
*/
return chapter.give_title() + chapter.get_rule_text( pl, my_chapter() )
}
function get_goal_text(pl)
{
return chapter.give_title() + chapter.get_goal_text( pl, my_chapter() )
}
function get_result_text(pl)
{
local text = ttextfile("result.txt")
//local percentage = chapter.is_chapter_completed(pl)
text.ratio_chapter = gl_percentage
text.ratio_scenario = scenario_percentage(gl_percentage)
return chapter.give_title() + text.tostring()
}
function get_about_text(pl)
{
local about = ttextfile("about.txt")
about.short_description = scenario_name
about.version = scenario.version
about.author = scenario.author
about.translation = scenario.translation
return about
}
function get_debug_text(pl)
{
return null
}
function start()
{
gui_delay = false
set_city_names()
resume_game()
}
function labels_text_debug()
{
local t1 = tile_x(0, 0, -2)
local t2 = tile_x(1, 0, -2)
if(!t1.find_object(mo_label) || !t2.find_object(mo_label)){
label_x.create(t1, player_x(1), translate(""+persistent.chapter))
label_x.create(t2, player_x(1), translate(""+chapter.step))
}
else {
local l1 = label_x(t1.x, t1.y, t1.z)
local l2 = label_x(t2.x, t2.y, t2.z)
if(correct_cov){
local ch_nr = l1.get_text().tointeger()
local st_nr = l2.get_text().tointeger()
if(persistent.chapter == ch_nr){
l1.set_text(""+persistent.chapter)
if(chapter.step <= (st_nr+1)){
l2.set_text(""+chapter.step)
}
else {
gui.add_message("Error1 here: CH "+persistent.chapter +" : ST "+chapter.step)
//Se se regresa al valor anterior en caso de error
persistent.status.step = st_nr
persistent.step = st_nr
chapter.step = st_nr
}
}
else {
if(chapter.step != 1){
gui.add_message("Error2 here: CH "+persistent.chapter +" : ST "+chapter.step)
//Se restauran todos en caso de error
persistent.status.step = 1
persistent.step = 1
chapter.step = 1
}
l1.set_text(""+persistent.chapter)
l2.set_text("1")
}
}
}
}
function is_scenario_completed(pl)
{
//labels_text_debug()
//gui.add_message(""+glsw[0]+"")
//gui.add_message("!!!!!"+persistent.step+" ch a "+st_nr[0]+" !!!!! "+persistent.status.step+" -- "+chapter.step+"")
if (pl != 0) return 0 // other player get only 0%
if (currt_pos){
local t = tile_x(currt_pos.x,currt_pos.y,currt_pos.z)
local build = t.find_object(mo_building)
if (!t.is_marked() && build){
local t_list = gl_buil_list
foreach(t in t_list){
t.find_object(mo_building).unmark()
}
gl_buil_list = {}
currt_pos = null
}
}
if(fail_count == null){
if (fail_num <= 0){
gui.open_info_win_at("goal")
fail_count = 1
fail_num = 20
}
else fail_num--
}
if(gui_delay){
gui.open_info_win_at("goal")
gui_delay = false
}
//gui.add_message(""+current_cov+" "+gall_cov+"")
//Para los convoys ---------------------
if (gall_cov != current_cov){
basic_convoys().checks_convoy_removed(pl)
}
gall_cov = basic_convoys().checks_all_convoys()
if(!correct_cov && gall_cov==gcov_nr){
load_conv_ch(persistent.status.chapter, persistent.status.step, pl)
}
correct_cov = basic_convoys().correct_cov_list()
persistent.gall_cov = gall_cov
//gui.add_message("gall_cov-> "+gall_cov+":: gcov_nr-> "+gcov_nr+":: current_cov-> "+current_cov+":: Step-> "+chapter.step+":: PersisStep-> "+persistent.step+":: Status->"+persistent.status.step+"")
if(!correct_cov) {
if (!resul_version.pak || !resul_version.st)
chapter.step = 1
else chapter.step = persistent.step
chapter.start_chapter()
return 1
}
chapter.step = persistent.step
local percentage = chapter.is_chapter_completed(pl)
gl_percentage = percentage
persistent.gl_percentage = gl_percentage
if (percentage >= 100){ // give message , be sure to have 100% or more
local text = ttext("Chapter {number} - {cname} complete, next Chapter {nextcname} start here: ({coord}).")
text.number = persistent.chapter
text.cname = translate(""+chapter.chapter_name+"")
persistent.chapter++
persistent.status.chapter++
load_chapter(persistent.chapter, pl)
chapter.chap_nr = persistent.chapter
percentage = chapter.is_chapter_completed(pl)
// ############## need update of scenario window
text.nextcname = translate(""+chapter.chapter_name+"")
text.coord = chapter.chapter_coord.tostring()
chapter.start_chapter() //Para iniciar variables en los capitulos
if (persistent.chapter >1) gui.add_message(text.tostring())
}
percentage = scenario_percentage(percentage)
if ( percentage >= 100 ) { // scenario complete
local text = translate("Tutorial Scenario complete.")
gui.add_message( text.tostring() )
}
return percentage
}
function is_work_allowed_here(pl, tool_id, name, pos, tool)
{
local pause = debug.is_paused()
//if (pause) return translate("Advance is not allowed with the game paused.")
//return tile_x(pos.x,pos.y,pos.z).find_object(mo_way).get_dirs()
if (pl != 0) return null
if(scr_jump){
return null
}
local result = translate("Action not allowed")
if (correct_cov){
result = chapter.is_work_allowed_here(pl, tool_id, name, pos, tool)
return fail_count_message(result, tool_id, tool)
}
else {
if (tool_id==4108 || tool_id==4096)
result = null
}
return fail_count_message(result, tool_id, name, pos, tool)
}
function fail_count_message(result, tool_id, tool)
{
//gui.add_message(result+" ")
if(result != "" && !tool.is_drag_tool){
//gui.add_message("fail_count: "+fail_count + "Tool: "+tool_id)
if (fail_count && result != null){
fail_count++
if (fail_count >= fail_num){
fail_count = null
return translate("Are you lost ?, see the instructions shown below.")
}
}
else if (result == null)
fail_count = 1
}
return result
}
function is_schedule_allowed(pl, schedule)
{
local pause = debug.is_paused()
if (pause) return translate("Advance is not allowed with the game paused.")
local result = null
if (pl != 0) return null
result = chapter.is_schedule_allowed(pl, schedule)
if (result != null)
active_sch_check = true
else
active_sch_check = false
return result
}
function is_convoy_allowed(pl, convoy, depot)
{
local pause = debug.is_paused()
if (pause) return translate("Advance is not allowed with the game paused.")
local result = null
basic_convoys().checks_convoy_removed(pl)
//gui.add_message("Run ->"+current_cov+","+correct_cov+" - "+gall_cov+"")
if (pl != 0) return null
result = chapter.is_convoy_allowed(pl, convoy, depot)
//gui.add_message(""+result+"")
return result
}
function is_tool_allowed(pl, tool_id, wt, name)
{
local result = true
if (tool_id == 0x2005) return false
else if (tool_id == 0x4006) return false
else if (tool_id == 0x4029) return false
else if (tool_id == 0x401c) return false
else if (tool_id == 0x401b) return false //Setting Map
else if (tool_id == 0x2007) return false //Acelerrate/decelerate Time
else if (tool_id == 0x8010) return false //Extender Terain tools
result = chapter.is_tool_allowed(pl, tool_id, wt)
return result
}
function is_tool_active(pl, tool_id, wt, name)
{
local result = true
if (pl != 0) return false
result = chapter.is_tool_active(pl, tool_id, wt)
return result
}
function jump_to_link_executed(pos)
{
chapter.jump_to_link_executed(pos)
return null
}
//--------------------------------------------------------
datasave <- {cov = cov_save}
class data_save {
// Convoys
function convoys_save() {return datasave.cov;}
function _save() { return "data_save()"; }
}
persistent.datasave <- datasave
convoy_x._save <- function()
{
return "convoy_x(" + id + ")"
}
//-----------------------------------------------------------
function resume_game()
{
basic_convoys().set_convoy_limit()
//Mark all text labels
foreach(label in world.get_label_list()){
if(label.get_owner().nr == 1)
label.mark()
}
//Check version and pakset name
resul_version = string_analyzer()
// Datos guardados
//-----------------------------------------------------
// copy it piece by piece otherwise the reference
foreach(key,value in persistent.datasave)
{
datasave.rawset(key,value)
}
persistent.datasave = datasave
// Se obtienen los datos guardados
cov_save = data_save().convoys_save()
//-------------------------------------------------------
gcov_nr = persistent.gcov_nr
gall_cov = persistent.gall_cov
current_cov = persistent.current_cov
gcov_id = persistent.gcov_id
sigcoord = persistent.sigcoord
id_save = persistent.id_save
ignore_save = persistent.ignore_save
pot0=persistent.pot[0]
pot1=persistent.pot[1]
pot2=persistent.pot[2]
pot3=persistent.pot[3]
pot4=persistent.pot[4]
pot5=persistent.pot[5]
pot6=persistent.pot[6]
pot7=persistent.pot[7]
pot8=persistent.pot[8]
pot9=persistent.pot[9]
gl_percentage = persistent.gl_percentage
for(local j=0;j<20;j++){
if (persistent.glsw[j]!=0)
glsw[j]=persistent.glsw[j]
persistent.glsw[j]=glsw[j]
}
r_way_list = persistent.r_way_list
r_way.c = persistent.r_way_c
load_chapter(persistent.chapter,0) // load correct chapter for player=0
chapter.step = persistent.step // set chapter step from persistent
select_option_halt = tile_x( 0, 0, select_option.z ).find_object(mo_label)
chapter.start_chapter()
}
function get_line_name(halt)
{
local lin_list = halt.get_line_list()
foreach(line in lin_list) {
return "<em>"+line.get_name()+"</em>"
}
return "<s>not line</s>"
}
function coord3d_to_key(c)
{
return ("coord3d_" + c.x + "_" + c.y + "_" + c.z).toalnum();
}
// END OF FILE