-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhh_demo.wdl
1454 lines (1341 loc) · 38.4 KB
/
hh_demo.wdl
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
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
path "models"; // Path to model subdirectory
path "bmaps"; // Path to graphics subdirectory
path "ents";
Path "d:\\A4BETA\\template"; // Path to WDL templates subdirectory
include <hh_ent.wdl>;
var video_mode = 7;
var video_depth = 16;
var compatibility=0; //old (buggy) way of displaying entity panels
//demo was created with older version
//so this setting is required
//definitions for commandline options
ifdef HICOLOR;
var VIDEO_DEPTH=32;
endif;
ifdef VIDEO1;
var VIDEO_MODE = 1; // V320x200
endif;
ifdef VIDEO2;
var VIDEO_MODE = 2; // V320x240
endif;
ifdef VIDEO3;
var VIDEO_MODE = 3; // V320x400
endif;
ifdef VIDEO4;
var VIDEO_MODE = 4; // V400x300
endif;
ifdef VIDEO5;
var VIDEO_MODE = 5; // V512x384
endif;
ifdef VIDEO6;
var VIDEO_MODE = 6; // V640x480
endif;
ifdef VIDEO7;
var VIDEO_MODE = 7; // V800x600
endif;
ifdef VIDEO8;
var VIDEO_MODE = 8; // V1024x768
endif;
ifdef VIDEO9;
var VIDEO_MODE = 9; // V1280x960
endif;
ifdef VIDEO10;
var VIDEO_MODE = 10; // V1600x1200
endif;
//start window definition
WINDOW WINSTART
{
TITLE "The Conflict";
SIZE 370,297;
MODE IMAGE;
BG_COLOR RGB(0,0,0);
BG_PATTERN <logo.pcx>,OPAQUE;
}
//bind external bitmaps to resource
bind <msg1.pcx>;
bind <msg2.pcx>;
bind <msg3.pcx>;
bind <msg4.pcx>;
bind <msg5.pcx>;
bind <msg6.pcx>;
bind <msg7.pcx>;
bind <msg8.pcx>;
bind <msg9.pcx>;
bind <msg10.pcx>;
bind <msg11.pcx>;
bind <msg12.pcx>;
bind <msg13.pcx>;
bind <msg14.pcx>;
bind <msg15.pcx>;
bind <msg16.pcx>;
bind <msg17.pcx>;
bind <msg18.pcx>;
bind <gchar1.pcx>;
bind <gchar2.pcx>;
bind <gchar3.pcx>;
bind <gchar4.pcx>;
bind <gchar5.pcx>;
bind <gchar6.pcx>;
bind <echar1.pcx>;
bind <echar2.pcx>;
bind <echar3.pcx>;
bind <echar4.pcx>;
bind <echar5.pcx>;
bind <echar6.pcx>;
bind <good1.pcx>;
bind <good2.pcx>;
bind <good3.pcx>;
bind <good4.pcx>;
bind <good5.pcx>;
bind <good6.pcx>;
bind <evil1.pcx>;
bind <evil2.pcx>;
bind <evil3.pcx>;
bind <evil4.pcx>;
bind <evil5.pcx>;
bind <evil6.pcx>;
bind <hell1.pcx>;
bind <hell2.pcx>;
bind <hell3.pcx>;
bind <hell4.pcx>;
bind <hell5.pcx>;
bind <hell6.pcx>;
bind <hell7.pcx>;
bind <hell8.pcx>;
bind <credits1.pcx>;
bind <credits2.pcx>;
bind <credits3.pcx>;
bind <credits4.pcx>;
bind <credits5.pcx>;
bind <credits6.pcx>;
bind <ackfont.pcx>; //font is never needed in the demo - bug?
var timer=0;
var helltimer=0;
var heaventimer=0;
//var fps_max=30; //fps were limited because of possible bad scripting
var scene=0;
var scenefade=0;
var sndhandle;
var clock_abs;
var clock;
var clock_setoff;
var warn_level=2;
var msgposx[20];
var msgposy[20];
var msgfx[20];
sound bg_music, <nb_clysm.wav>;
//additional views
view heavencam
{
arc 60;
layer 8;
fog=50;
}
view fadecam
{
arc 60;
layer 8;
fog=50;
}
///////////////////
function main()
{
if (video_depth<16)
{
//highcolor only, because of fading fx
wait (1);
exit;
}
//setting position and effect for messages
msgposx[2]=50; msgposy[2]=50; msgfx[2]=2;
msgposx[3]=70; msgposy[3]=30; msgfx[3]=1;
msgposx[4]=-10; msgposy[4]=-10; msgfx[4]=4;
msgposx[5]=-30; msgposy[5]=-30; msgfx[5]=3;
msgposx[6]=-50; msgposy[6]=-50;
msgposx[7]=-70; msgposy[7]=-70; msgfx[7]=2;
msgfx[8]=4;
msgfx[9]=2;
msgposx[10]=50; msgposy[10]=50; msgfx[10]=4;
msgposx[11]=70; msgposy[11]=30; msgfx[11]=1;
msgposx[12]=-10; msgposy[12]=-10; msgfx[12]=3;
msgposx[13]=-30; msgposy[13]=-30; msgfx[13]=4;
msgposx[14]=-50; msgposy[14]=-50;
msgfx[15]=3;
msgposx[16]=-70; msgposy[7]=-70; msgfx[7]=2;
msgfx[17]=4;
msgposx[18]=0; msgposy[18]=0; msgfx[18]=1;
//init views
camera.pos_x=0;
camera.pos_y=screen_size.y/6;
camera.size_x=screen_size.x;
camera.size_y=screen_size.y/3*2;
camera.aspect=0.67;
heavencam.pos_x=0;
heavencam.pos_y=screen_size.y/6;
heavencam.size_x=screen_size.x;
heavencam.size_y=screen_size.y/3*2;
heavencam.aspect=0.67;
tex_share = on;
wait(3);
play_sound (bg_music,10);
sndhandle=result;
wait (1);
stop_sound (sndhandle);
//dummy sfx playback to load sound into memory at startup
load_level(<hh_demo.wmb>);
while(1)
{
timer+=time;
helltimer+=time;
heaventimer+=time;
wait (1);
//timers used to start certain effects time corrected
//required to stay in touch with bgm
}
}
function clock_control() {
clock_abs=sys_hours*3600+sys_minutes*60+sys_seconds;
clock_setoff=clock_abs;
while(1)
{
clock_abs=sys_hours*3600+sys_minutes*60+sys_seconds;
clock=clock_abs-clock_setoff;
wait (1);
}
//calculate demo running time in seconds
}
var speed[3];
//defines for moving entities
define speedX,SKILL33;
define speedY,SKILL34;
define speedZ,SKILL35;
define targetX,SKILL43;
define targetY,SKILL44;
define targetZ,SKILL45;
define forceX,SKILL30;
define forceY,SKILL31;
define forceZ,SKILL32;
//animate layers on left side in hell part
function swap_layers()
{
while (scene<=2)
{
hell_ent.scale_y*=-1;
hell2_ent.scale_y*=-1;
hell3_ent.scale_y*=-1;
hell4_ent.scale_y*=-1;
waitt (4);
}
}
function anim_layer()
{
while (scene<2) {wait (1);}
hell_ent.visible=1;
hell2_ent.visible=1;
hell_ent.alpha=40;
hell2_ent.alpha=20;
hell3_ent.alpha=0;
hell4_ent.alpha=0;
swap_layers();
while (scene==2)
{
//fade out layers on left side of hell part
//when switching to next scene
hell_ent.alpha-=time+time+time;
hell2_ent.alpha-=time+time+time;
hell3_ent.alpha-=time+time+time;
hell4_ent.alpha-=time+time+time;
hell_ent.y=250+20*sin(timer*14+30);
hell2_ent.y=250+20*cos(timer*14+60);
hell3_ent.y=250+20*sin(timer*14+90);
hell4_ent.y=250+20*cos(timer*14+120);
if (hell_ent.alpha<=25 && hell2_ent.visible==0)
{
hell2_ent.alpha=40;
hell2_ent.visible=1;
}
if (hell2_ent.alpha<=25 && hell3_ent.visible==0)
{
hell3_ent.alpha=40;
hell3_ent.visible=1;
}
if (hell3_ent.alpha<=25 && hell4_ent.visible==0)
{
hell4_ent.alpha=40;
hell4_ent.visible=1;
}
if (hell4_ent.alpha<=25 && hell_ent.visible==0)
{
hell_ent.alpha=40;
hell_ent.visible=1;
}
if (hell_ent.alpha<=0) {hell_ent.visible=0;}
if (hell2_ent.alpha<=0) {hell2_ent.visible=0;}
if (hell3_ent.alpha<=0) {hell3_ent.visible=0;}
if (hell4_ent.alpha<=0) {hell3_ent.visible=0;}
wait (1);
}
hell_ent.visible=0;
hell2_ent.visible=0;
hell3_ent.visible=0;
hell4_ent.visible=0;
}
//hell part particle fountain
function vec_randomize(&vec,range)
{
vec[0] = random(2) - 1;
vec[1] = random(2) - 1;
vec[2] = random(20);
vec_normalize(vec,random(range));
}
function part_alphafade()
{
my.alpha -= time+time;
if (my.alpha <= 0) { my.lifespan = 0; }
}
function effect_explo()
{
vec_randomize(temp,50);
vec_add(my.vel_x,temp);
my.alpha = 25 + random(25);
my.red=150;
my.green=110;
my.blue=20;
my.flare = on;
my.bright = on;
my.streak = on; //pro version only
my.move = on;
my.function = part_alphafade;
}
function particle_emitter()
{
my.invisible=1;
my.passable=1;
my.z=-200;
wait (1);
while(scene<=2)
{
vec_scale(normal,10);
effect(effect_explo,300,my.x,normal);
waitt (48); //not very accurate, bad style
}
}
var count=0;
string file_str,"123456789012";
string hell_str,"hell";
string pcx_str, ".pcx";
string number_str," ";
function hell_msg()
{
while (scene<2) {wait (1);}
waitt (48);
while (scene==2 &&scenefade<3)
{
//create filenames and load pcx files
wait (1);
count+=1;
if (count>8)
{
count=1;
}
str_for_num(number_str,count);
str_cpy(file_str,hell_str);
str_cat(file_str,number_str);
str_cat(file_str,pcx_str);
wait (1);
ent_morph(hellmsg_ent,file_str);
hellmsg_ent.alpha=50;
hellmsg_ent.y=-40+(random(140)-70);
hellmsg_ent.z=(random(100)-50);
hellmsg_ent.visible=1;
while (hellmsg_ent.alpha>0)
{
wait (1);
hellmsg_ent.alpha-=time*7;
}
hellmsg_ent.visible=0;
ent_purge(hellmsg_ent);
}
hellmsg_ent.visible=0;
ent_purge(hellmsg_ent);
}
//applied to terrain for hell part
action terrain_center
{
while (scenefade!=2) {wait (1);}
my.invisible=1;
my.passable=1;
create <cube.wmb>,my.pos,particle_emitter(); //old style
while (scene<=2)
{
//make camera look to particle emitter
my.z=200*sin(timer*8);
temp.x = my.x - camera.x;
temp.y = my.y - camera.y;
temp.z = my.z - camera.z;
vec_to_angle(my_angle.pan,temp);
camera.pan += 0.1*ang(my_angle.pan-camera.pan)*min(1,time);
camera.tilt += 0.1*ang(my_angle.tilt-camera.tilt)*min(1,time);
wait (1);
}
}
function fade_in_border()
{
hellborder_ent.alpha=0;
hellborder_ent.visible=1;
hellborder_ent.transparent=1;
while(hellborder_ent.alpha<100)
{
wait (1);
hellborder_ent.alpha+=time+time;
}
hellborder_ent.alpha=50;
hellborder_ent.transparent=0;
}
//attached to dummy entity which is following a path
//camera is dragged along seperately because
//otherwise movement is too limited
action walk_path
{
while (scenefade!=2) {wait (1);}
//init basic functions (see above)
fade_in_hell();
hell_msg();
anim_layer();
fade_in_border();
helltimer=0; //reset timer
my.oriented=1;
my.invisible=1; //dummy entity only
my.forcex=12;
//scan nearest path
temp.pan = 360;
temp.tilt = 180;
temp.z = 1000;
result = scan_path(my.x,temp);
if (result == 0) { return; }
ent_waypoint(my.targetx,1);
while (scene<=2)
{
my.forcex=12+7*sin(helltimer*7);
temp.x = my.targetx - my.x;
temp.y = my.targety - my.y;
temp.z = my.targetz - my.z;
result = vec_to_angle(my_angle.pan,temp);
//waypoint reached?
if (result < 50) {
ent_nextpoint(my.targetx);
}
camera.roll=40*cos(helltimer*6);
my.pan=my_angle.pan;
my.tilt=my_angle.tilt;
//movement stuff taken from templates
temp = min(time*0.55,1);
my.speedx += (time * my.forcex) - (temp * my.speedx);
my.speedy += (time * my.forcey) - (temp * my.speedy);
my.speedz += (time * my.forcez) - (temp * my.speedz);
speed.x=my.speedx*time;
speed.y=my.speedy*time;
speed.z=my.speedz*time;
you=null;
move me,speed,nullvector; //old syntax
vec_set(temp.x,my.x);
vec_set(camera.x,temp.x);
temp.x=0.01*(my.x-camera.x);
temp.y=0.01*(my.y-camera.y);
temp.z=0.01*(my.z-camera.z);
move_view camera,nullvector,temp; //old syntax
wait(1);
}
//only visible on right side during hell part
hellborder_ent.visible=0;
}
//fade over to hell scene
function fade_in_hell()
{
//fade out heaven part view, pro version only
heavencam.transparent=1;
camera.visible=1; //make hell view visible behind heaven view
camera.fog=0;
//now we fade out heaven view
//hell part slowly gets visible
while(heavencam.alpha>0)
{
wait (1);
heavencam.alpha-=time+time;
if (heavencam.alpha<=50)
{
camera.fog+=time+time; //slowly add red hell fog
fog_color=1;
heavencam.fog=0;
}
else
{
heavencam.fog-=time+time;
}
}
camera.fog=50;
heavencam.alpha=0;
heavencam.transparent=0;
heavencam.visible=0;
scene=2; //fading done, change scene indicator variable
}
//applied to smoke sprites in hell part
action set_sprite
{
my.flare=1;
my.ambient=100;
my.scale_x=3;
my.scale_y=3;
temp=random(56);
my.frame=temp;
while (scenefade<2) {wait (1);}
while (scene<=2)
{
my.frame+=time*0.8;
if (my.frame>MY.SKILL1-1)
{
//last frame reached
my.invisible=1;
my.frame=0;
waitt (32);
//start again after a small pause
my.invisible=0;
}
wait (1);
}
my.invisible=1;
ent_purge(me);
}
//animate lava terrain
action set_lava
{
my.tex_scale=1.5;
my.transparent=0;
my.scale_z=5;
my.ambient=0;
my.albedo=0;
my.SKILL40=my.z;
while (scene<=2)
{
my.z=my.skill40+10*cos(helltimer*3);
my.frame+=time/2;
if(my.frame>=36)
{
my.frame-=36;
//loop
}
wait (1);
}
}
action deform_me
{
//adjust tex_scale of terrain
my.tex_scale=1.5;
}
//initalize heaven part
action set_heaven
{
while (scenefade!=1) {wait (1);}
heaventimer=0; //reset timer
create_flowers(); //randomly place flower models
fade_in_heaven(); //start fading
move_layers(); //init cloud layers
heaven_cam(); //camera movement
waitt (96);
scroll_text(); //start scrolling text on bottom and top
}
function fade_in_heaven()
{
heavencam.alpha=0;
heavencam.transparent=1;
heavencam.visible=1;
heavencam.fog=0;
while(heavencam.alpha<100)
{
wait (1);
heavencam.alpha+=time+time;
intro_ent.alpha-=time;
if (heavencam.alpha<=50)
{
camera.fog-=time+time;
}
else
{
fog_color=2;
heavencam.fog+=time+time;
camera.fog=0;
}
}
heavencam.fog=50;
heavencam.alpha=100;
heavencam.transparent=0;
camera.visible=0;
scene=1; //set scene indicator variable
}
var camera_dist;
function heaven_cam()
{
while (scene<=1)
{
camera_dist=400+250*sin(heaventimer*5);
heavencam.roll=15*cos(heaventimer*6);
heavencam.pan+=3*time*(0.2+abs(sin(heaventimer)));
heavencam.tilt=-15-5*sin(heaventimer*2);
temp.x=my.x-camera_dist*cos(heavencam.pan)*cos(heavencam.tilt)-heavencam.x;
temp.y=my.y-camera_dist*sin(heavencam.pan)*cos(heavencam.tilt)-heavencam.y;
temp.z=my.z-camera_dist*sin(heavencam.tilt)-heavencam.z+70;
move_view heavencam,nullskill,temp; //old style
wait (1);
}
}
function scroll_text()
{
heavenmsg1_ent.visible=1;
heavenmsg2_ent.visible=1;
heavenmsg1_ent.forcey=-6;
heavenmsg2_ent.forcey=6;
while(scene<=1)
{
//!!!DO NOT USE CODE BELOW!!!
//it does not work very well
//use direct position modification instead
//e.g.: my.y+=25*time;
wait (1);
speed.x=0;
speed.y=0;
speed.z=0;
//again code is taken from template movement
temp = min(time*0.55,1);
heavenmsg1_ent.speedY += (time * heavenmsg1_ent.forceY) - (temp * heavenmsg1_ent.speedY);
speed.y=heavenmsg1_ent.speedy*time;
move heavenmsg1_ent,nullvector,speed;
heavenmsg2_ent.speedY += (time * heavenmsg2_ent.forceY) - (temp * heavenmsg2_ent.speedY);
speed.y=heavenmsg2_ent.speedY*time;
move heavenmsg2_ent,nullvector,speed;
//reached outside of screen - now set new position
if (heavenmsg1_ent.y>340)
{
heavenmsg1_ent.speedY=0;
heavenmsg2_ent.speedY=0;
heavenmsg1_ent.y=340;
heavenmsg1_ent.z=-70;
heavenmsg1_ent.forceY*=-1;
heavenmsg1_ent.scale_x*=-1;
heavenmsg1_ent.scale_y*=-1;
heavenmsg2_ent.y=-340;
heavenmsg2_ent.z=70;
heavenmsg2_ent.forceY*=-1;
heavenmsg2_ent.scale_x*=-1;
heavenmsg2_ent.scale_y*=-1;
waitt (96);
}
if (heavenmsg1_ent.y<-340)
{
heavenmsg1_ent.speedY=0;
heavenmsg2_ent.speedY=0;
heavenmsg2_ent.y=340;
heavenmsg2_ent.z=-70;
heavenmsg2_ent.forceY*=-1;
heavenmsg2_ent.scale_x*=-1;
heavenmsg2_ent.scale_y*=-1;
heavenmsg1_ent.y=-340;
heavenmsg1_ent.z=70;
heavenmsg1_ent.forceY*=-1;
heavenmsg1_ent.scale_x*=-1;
heavenmsg1_ent.scale_y*=-1;
waitt (64);
}
}
heavenmsg1_ent.visible=0;
heavenmsg2_ent.visible=0;
ent_purge (heavenmsg1_ent);
ent_purge (heavenmsg2_ent);
}
function move_layers()
{
heaven_ent.visible=1;
heaven2_ent.visible=1;
heaven_ent.alpha=0;
heaven2_ent.alpha=0;
while(heaven_ent.alpha<20)
{
heaven_ent.alpha+=time;
heaven2_ent.alpha+=time;
wait (1);
}
//move panels as long as fading to hell part
//has NOT started
while (scenefade<2)
{
heaven_ent.y=300*sin(heaventimer);
heaven2_ent.y=300*cos(heaventimer*1.5);
heaven_ent.alpha=20+5*sin(heaventimer*4);
heaven2_ent.alpha=30+5*cos(heaventimer*6);
wait (1);
}
//fading in hell part has started, now fade out clouds
while (heaven_ent.alpha>0 || heaven2_ent.alpha>0)
{
wait (1);
heaven_ent.alpha-=time;
heaven_ent.alpha=max(0,heaven_ent.alpha);
heaven2_ent.alpha-=time;
heaven2_ent.alpha=max(0,heaven_ent.alpha);
}
//done, remove panels
heaven_ent.visible=0;
heaven2_ent.visible=0;
ent_purge (heaven_ent);
ent_purge (heaven2_ent);
}
var flowercount=0;
function create_flowers
{
// The version The Conflict was released with
// did not allow while without wait
// the code was changed to use goto
// this is not needed anymore
// NEVER use goto
while (flowercount<50)
{
// loop:
temp.x=2600+(random(1600)-800);
temp.y=-130+(random(1600)-800);
if (!(temp.y <170 && temp.y>-430 && temp.x <2900 && temp.x>2300))
{
temp.z=0;
create <flower01.mdl>,temp,place_flower; // old style
flowercount+=1;
}
// if (flowercount<50) {goto loop;}
}
}
function place_flower()
{
//place to floor and choose random angle
//why place flowers randomly?
//simple answer - less work ;-)
sonar me, 500;
my.z-=result;
my.pan=random(360);
}
var turb_speed=0.3; //default animation speed of turbulent
//surfaces is wayyy to fast
//particles for heaven part
function move_waterpart()
{
//decrease z speed, until it is negative
//-> particles are falling down again
my.vel_z-=0.1*time;
}
bmap blue_particle_map <part_blu.pcx>;
function Xparticle_event() {
my.red=62;
my.green=80;
my.blue=180;
my.bmap=blue_particle_map;
my.size=2;
//random speed
my.vel_Z=3.5+random(1.5);
my.vel_X=-1+random(2);
my.vel_Y=-1+random(2);
my.move=on;
my.beam=on; //pro version only
my.flare=on;
my.alpha=45;
my.lifespan=60;
my.function=move_waterpart;
}
// attached to water entity
action set_water
{
my.transparent=1;
my.alpha=95;
my.ambient=100;
while (scene<=1&& scenefade<=1)
{
temp=15;//*time;
vec_set(my_pos,my.x);
my_pos.z+=30;
effect(xparticle_event,temp,my_pos,nullvector);
waitt (5);
}
}
//"snowflakes" showing up in intro and extro
bmap white_particle_map, <part_whi.pcx>;
function effect_snow()
{
my.x += random(220) - 110;
my.y += random(1400) - 700;
my.vel_z=8+random(4);
my.alpha = 20 + random(10);
my.red=255;
my.green=255;
my.blue=255;
my.bmap=white_particle_map;
my.size=2;
my.flare = on;
my.bright = on;
my.beam = on;
my.move = on;
my.function = null;
}
//different direction for extro
//just copied function from above
//dirty and quick solution :-)
function effect_snow2()
{
my.x += random(220) - 110;
my.y += random(1400) - 700;
my.vel_z=-8-random(4);
my.alpha = 20 + random(10);
my.red=255;
my.green=255;
my.blue=255;
my.bmap=white_particle_map;
my.size=2;
my.flare = on;
my.bright = on;
my.beam = on;
my.move = on;
my.function = null;
}
//streak particles for intro
function effect_intro()
{
my_pos.x = random(2) - 1;
my_pos.y = random(2) - 1;
my_pos.z = random(2) - 1;
vec_normalize(my_pos.x,random(150));
vec_add(my.vel_x,my_pos.x);
my.alpha = 25 + random(25);
my.red=255;
my.green=255;
my.blue=255;
my.size=2;
my.flare = on;
my.bright = on;
my.streak=on;
my.function = part_alphafade;
}
var campos[3];
var particlepos[3];
action set_intro_coords
{
my.invisible=1;
my.passable=1;
vec_set (campos,my.x);
vec_set (camera.x,my.x);
vec_set(particlepos.x,my.x);
particlepos.z-=800;
while(clock<10) {wait (1);}
//create particles
//problems with time correction
while(scene==0)
{
temp=10;//*time;
vec_scale(normal,10);
effect(effect_intro,temp,particlepos,nullvector);
temp=6;//*time;
effect(effect_snow,temp,particlepos,nullvector);
waitt (3);
}
//let routine sleep until extro starts
//again dirty and quick solution
while (scene!=4) {wait (1);}
particlepos.z+=800;
while (scene==4)
{
particlepos.z-=800;
temp=10;//*time;
vec_scale(normal,10);
effect(effect_intro,temp,particlepos,nullvector);
particlepos.z+=800;
temp=6;//*time;
effect(effect_snow2,temp,particlepos,nullvector);
waitt (3);
}
}
action set_intro
{
wait (1);
fog_color=1;
intro_ent.visible=1;
timer=0; //reset timer
my.ambient=0;
camera.z=campos.z;
show_msg(); //show text messages
while(scene==0)
{
my.v+=18*time;
camera.x=campos.x+70*sin(3*timer);
camera.y=campos.y+70*cos(3*timer);
camera.pan=50*(sin(2*timer));
camera.tilt=-90+15*cos(3*timer);
wait (1);
}
intro_ent.visible=0;
set_extro();
//everything done here, start extro init
}
//create filename and load pcx file
var msgcount=0;
var msgbase=0;
var msgtotal=0;
string msgfile_str,"123456789012";
string msg_str,"msg";
string msgnumber_str," ";
function show_message(msgcount)
{
while(msgtotal<msgbase+msgcount)
{
msgtotal+=1;
str_for_num(msgnumber_str,msgtotal);
str_cpy(msgfile_str,msg_str);
str_cat(msgfile_str,msgnumber_str);
str_cat(msgfile_str,pcx_str);
wait (1);
ent_morph(msg_ent,msgfile_str);
msg_ent.alpha=0;
//remember that I defined positions
//and effect type in an array at the beginning?
msg_ent.y=msgposx[msgtotal];
msg_ent.z=msgposy[msgtotal];
msg_ent.x=533;
msg_ent.scale_x=1;
msg_ent.scale_y=1;
msg_ent.visible=1;
while(msg_ent.alpha<35)
{
wait (1);
msg_ent.alpha+=time+time;
}
msg_ent.alpha=35;
while(msg_ent.alpha>0)
{
wait (1);