-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.txt
More file actions
5093 lines (4325 loc) · 238 KB
/
Copy pathbuild.txt
File metadata and controls
5093 lines (4325 loc) · 238 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
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
// "Build Engine & Tools" Copyright (c) 1993-1997 Ken Silverman
// Ken Silverman's official web site: "http://www.advsys.net/ken"
// See the included license file "BUILDLIC.TXT" for license info.
BUILD engine Notes (8/14/95):
BUILD programmed by Ken Silverman
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ GAME KEYS: ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
ESC = Quit
Mouse = Movement
Arrows = Movement
Lt. Enter = Single-player: Play back game.
Multi-player: View from other player's eyes.
Rt. Enter = Switch between 3D / 2D modes
Lt. +/- = Zoom in 2D mode
A/Z = Move up and down
Left-Ctrl = Shoot
1/2 = Select weapon
Left-Shift = Run
T = Reset Timing (sets totalclock = 0)
V = Change visibility. In BUILD.H there is a visiblity variable.
It is initialized to 13. It can range from around 8 (darker)
to about 15 (lighter).
P = Change parallaxing sky mode. (0, 1, and 2 (Default = 2)
F12 = Screen capture (saves image as a *.BMP file, starting as file
name CAPTUR00.BMP and incrementing by 1 each time F12 is
pressed.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ BUILD EDITOR INTRODUCTION: ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
There are 2 modes in the BUILD editor:
3D EDIT MODE (Same as PLAY MODE but with a mouse cursor)
2D EDIT MODE (The overhead map of the board with an arrow showing your
position and angle and a mouse cursor)
It is essential that you use both editor modes:
Use the 3D EDIT MODE to change the attributes of a sector, wall, or sprite
such as:
Tile number - Tells which picture in the artwork file goes on the
object. Press V to change.
Shade - The shade of the object. Press -/+ to change.
Repeating - The "smooshiness" of a wall. Also for sprites. Press
keypad 2,4,6,8 to change.
Panning - The starting offset into the tile graphics. Press
Shift + keypad 2,4,6,8 to change.
Height - For ceilings, floors, and sprites. Press PGUP or PGDN
to change.
and there are a few other special attributes.
Use the 2D EDIT MODE to add, delete, or change the shape of sectors.
To switch between the two EDIT MODES, press the keypad enter key.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ 3D EDIT MODE KEYS: ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
ESC = Quit
keypad ENTER = Flip to the 2D overhead editor
Mouse = Move mouse cursor
Arrows = Move you in the appropriate directions
Caps Lock = There are 3 different Z coordinate modes in BUILD.
Mode 0: Game mode (default)
Mode 1: Height lock mode
Mode 2: Float mode
Press Caps Lock to switch between the 3 modes.
A and Z move up and down for all 3 modes.
Note: For the following keys, it is important to move the mouse cursor to
the right position before using them. Also, if you hold down the first mouse
button, then the item under the mouse cursor will be locked as the
highlighted object while the button is held down. This is useful for the
PGUP/DN keys, when different objects come into view even without moving your
coordinates or the mouse cursor.
There are 4 basic types of objects that can be worked with in this part
of the editor: WALLS, CEILINGS, FLOORS, and SPRITES.
PGUP/DN = Raise or Lower a ceiling or floor. (If a wall is selected,
the ceiling of that sector will move) Also, if you did a
sector highlight in 2D EDIT MODE, you can raise / lower
multiple sectors at a time.
Ctrl-PGUP/DN = For sprites only, puts sprites exactly on the floor or exactly
on the ceiling.
V = Tile selection - use arrow keys to move around. Press ENTER
to change the object to the highlighted piece of artwork, or
press ESC to cancel without changes made.
ALT-V = Height selection - works just like V, but this selects the
groudraw height map.
2,4,6,8 (keypad) = Repeat values (smooshiness of the sizes of pixels) -
think of these keys as arrow keys controlling the bottom
right corner of the bitmap. Normally, this is used for walls
and sprites. If you select a floor or ceiling, all the walls
in that sector will be affected. Perhaps this can be used
to make sprites grow and shrink as they get healthy or hurt.
Shift +
2,4,6,8 (keypad) = Panning values (offset into the tile) - These keys are
useful when the you want a long wall to look continuous when
they normally would not look continuous.
/ = Use this key to reset the panning values (if you're lost!)
5 (keypad) = If you hold down this key down in addition to the 2,4,6,8
keys (keypad),the values will align at multiples of 8.
.> = This key attempts to match up all the tiles along a wall. It
scans along the walls towards the right as long as the picture
number of the next wall is the same as the original picture
number. Note that some walls may not work right, especially
floor / ceiling steps.
F = Flip an object. For sprites and walls, this flips the object
x-wise. For ceilings and floors, the objects are flipped in
8 possible ways. Just keep pressing 'F' to go through
the 8 ways.
ALT-F = When you use relative alignment mode on ceiling and floor
textures, you can press Alt-F on the ceiling or floor to
choose a new wall to align to. It actually rotates the walls
of a sector by 1.
O = Wall orientation (whether it starts from the top or bottom)
Normally, walls are oriented from the top. For example, if
you hold down 2/8 on the keypad in 3D EDIT MODE, the wall
always starts from the top. Orientation works differently
for white lines and red lines, so if a wall doesn't look
right, just press 'O' anyway to see if it get fixed.
COPY & PASTE
TAB = COPY. Copy the attibutes of the highlighted objects into a
temporary place. The attributes it remembers are:
tile, shade, x-repeat, y-repeat, and cstat values.
Left ENTER = PASTE. Paste the stored attributes over the highlighted
object. Whenever you press ENTER, the y-repeat values stay
the same, and the x-repeat values are adjusted so the pixels
of the bitmaps have a square-aspect ratio.
Ctrl+L.ENTER = Left ENTER with the ctrl key will paste the attribtues to
every wall in a loop (if a wall is highlighted).
Shft+L.ENTER = Left ENTER with the shift key also pressed copies the shade
only.
Ctrl+Shft+L.ENTER = Auto-shade a sector. First make any wall of the loop
as light as the lightest shade you want. Then make any other
wall of the loop as dark as the darkest shade you want.
Finally press Ctrl-Shift Enter on the wall that should be
lightest. Now the loop should be smoothly shaded. If it
is not smoothly shaded, you may need to insert more points
on the walls.
SECTOR FLAGS:
P = Make the ceiling of the given sector have a Parallaxing sky
or just a normal ceiling.
G = Make the floor of the given sector have a Groudraw
(floor with height mapping). I do not recommend using this
attribute very extensively yet. (See the H key for selecting
the height map)
E = An option for ceilings and floors. If for some reason, you
want a tile to be smooshed into the normal 64*64 area, press
E to unExpand the tile. Press E again, and the tile will be
expanded, so the pixel size is the same as the normal 64*64
ceiling/floor.
R = Relative alignment - switch between relative alignment mode
and normal mode. Allows floor / ceiling textures to align
to the first 2 points of a sector. Textures will rotate/pan
with moving sectors properly. Notice that bit 6 of both
sector[].ceilingstat and sector[].floorstat are relative
alignment bits.
WALL FLAGS:
B = Make an invisible wall, such as a window, block you from
going through. Since the wall is invisible, you can also
highlight the ceiling right above the window or floor
right below the window. You can block either the front or
the back of the window. If you block the back only, you
will be able to go onto the window sill.
T = Press to make a maskable wall 50/50 transluscent. Press T
again to put the masked wall back to normal mode.
M = Make a maskable wall. Press in the same place you press 'B'.
The masking wall takes all its attributes from the front of
the wall, so it must have the same repeat, panning, and cstat
values as the walls above or below it (if you have a step).
The masking picture number is stored in overpicnum. Also,
the masking walls is also automatically added the the other
side of the wall, with the picture flipped. (see the 'F'
key descripte above)
Shift + M = Make a maskable wall just like 'M' described above, but only
on the front side.
1 = Make a 1-way wall.
2 = Some walls have two different sections. One step on the
ceiling and one step on the floor. Normally they always
have the same attributes. It is possible though, to give
both the top and bottom different attributes by pressing 2 on
that wall. 2 simply makes the bottom wall's attributes
separately editable. Press 2 on either the top or bottom
wall.
O = Wall orientation (whether it starts from the top or bottom)
Normally, walls are oriented from the top. For example, if
you hold down 2/8 on the keypad in 3D EDIT MODE, the wall
always starts from the top. Orientation works differently
for white lines and red lines, so if a wall doesn't look
right, just press 'O' anyway to see if it get fixed.
H = Toggle hitscan pass through bit. Default is pass through.
SPRITE FLAGS:
B = When the mouse cursor is on a sprite, this makes a sprite
block you from walking through. Also makes the sprite
sensitive to hitscan. Sprites with the 'B' attribute will
appear pink in 2D EDIT MODE
T = Press to make a sprite 50/50 transluscent. Press T again
to put sprite back to normal mode.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ 2D EDIT MODE KEYS: ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
ESC = Show a menu that says, "(N)ew, (L)oad, (S)ave, (Q)uit"
Press ESC again to cancel the menu.
keypad ENTER = Flip back to the 3D edit mode
Mouse = Move mouse cursor
Left mouse button = If you hold down the left mouse button, you can drag
existing points. To drag multiple points you can use
the right shift key to first select a rectangular
region of points to highlight, then just drag any of
the highlighted points and the rest move with it.
Right mouse button = Moves the player's positions to the mouse cursor.
This is useful when you accidently get stuck somewhere
in the board, or when you need to edit some part of
a sector that is hard to access.
Right Shift = Select a bunch of points for use with dragging around.
Selects all points inside a box. (Use the left mouse
button to drag)
Ctrl+Right Shift = Select a bunch of points for use with dragging around.
Selects all points on a loop. (Use the left mouse
button to drag)
Right Alt = Select a bunch of sectors for either duplication or
dragging around. (see left mouse button for
dragging and the insert key for duplication).
Arrows = Move player position in the appropriate directions.
The player will be clipped. To jump to a different part
of the board, use the right mouse button.
Space = Press the space bar when drawing new sectors. There
are several ways of drawing new sectors. The following
three ways of drawing sectors can all be done by only
using the space bar. The computer is smart enough to
decide which method you are using.
1. Drawing a FULL LOOP - that is, whenever the new
sector meets the old sector, draw over that line
again. In full loop mode the new sector must not
already be in another sector. The loop is done
when you press the space bar at the first point
again.
2. SPLITTING a sector - press space bar to draw points
at which you want to split a sector. The computer
knows you are done splitting when you end at
another point that's on the edge of the sector you
are splitting.
3. Drawing a sector COMPLETELY INSIDE another sector.
(for example, columns) To do this, just press space
bar at every point in the loop. The loop is done
when you press the space bar at the first point
again.
Backspace = When plotting points with the space bar, you can use
backspace to get rid of the last point plotted. You
can press the backspace to get rid of all the points
if you didn't want to start a sector at all.
Insert = Inserts a new point at the midpoint of the highlighted
line. Then you can drag the point to wherever you like.
(If you insert on a red line, the point will be inserted
on both sides of the sector line.)
If a bunch of sectors are selected (see right ALT) then
instead of inserted points, the selected sector bunch
will be duplicated (stamped). Don't forget to drag
the selected sectors after stamping.
Delete = Use this to delete sprites (blue circles). To delete
points of a sector border, don't press delete. Instead,
drag the point into one of its 2 neighbor points on the
sector. This is easist done if grid locking is on
(mouse cursor is pink). If 2 neighbor points are equal,
one will automatically be deleted.
Right Ctrl-Delete = This deletes the whole sector that the mouse cursor is
in. Note the right ctrl for protection.
(Note: to delete a point of a sector, just drag that point into the next
point and it will automatically be deleted. You should do this with
grid-locking on)
J = Use to join two neighboring sectors. Press J when mouse
cursor is over the first sector. Then press J again
when the mouse cursor is over the neighboring sector.
The attributes of the combined sector will be taken from
the first sector selected.
ALT-S = When you have a white loop inside a sector, you can
press ALT-S on it (highlight any of its lines) to turn
the whole loop red.
S = Places a sprite at the location under the mouse cursor.
A sprite looks like a blue circle in the overhead map.
B = Blocks / unblocks you from going through a wall or
sprites. A blocked wall or sprite will appear pink
in 2D EDIT MODE. See the description for 'B' in
the 3D EDIT MODE section for more details.
C = Turn a line into a circle defined by short line
segments. First press 'C' on a highlighted wall. Then
move the mouse to the right place and press '+' or '-'
if you want to change the number of points on the
circle. Press 'C' again to cancel the circle drawing or
press the Space bar to actually change the map.
+/- = Increase / Decrease the number of points on the circle.
T = Type in a LO-tag for a sector. Move the mouse cursor to
the inside of a sector that you want to tag first.
ALT-T = Just like 'T' but for walls and sprites.
H = Type in a HI-tag for a sector. Move the mouse cursor to
the inside of a sector that you want to tag first.
ALT-H = Just like 'H' but for walls and sprites.
E = Change a sprite's status list number.
< and > = Changes angle of sprite. Move the mouse cursor to a
sprite first. You can hold down shift with the < and >
to get more precise angles. If you did a sector
highlight, then the selected sector will be rotated
instead.
CTRL-T = Turn tag boxes on/off.
TAB = Move the mouse cursor to the inside of a sector that you
you want to see the attributes of. It will show them
at the bottom of the status bar. To clear it, press
TAB again at somewhere in the board that is not part
of any sector. This is a useful key for debugging.
ALT-TAB = Works just like TAB, but here, you can see the
attributes of highlighted walls or sprites. For red
lines, the side the mouse cursor is on the line affects
which line is highlighted, since red lines are actually
defined as 2 walls (1 wall for each sector).
Scroll Lock = Set starting position (brown arrow) to your current
position (white arrow).
A,Z = Zoom in and out. This is useful for choosing whether
you want to edit finely or not.
G = Change grid resolution. The grid resolution cycles
through this sequence:
(off, 1x, 2x, 4x (default), 8x, 16x)
L = Turns grid locking on or off. If the mouse cursor is
pink then grid locking is on. If it is white then
grid locking is off. There is no grid locking
if the grid is turned off. Also, grid locking will
lock to nearby points.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ EDITART KEYS: ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
---- Keys you will need to know if you want to select from a section of
a 320*200*256 picture file (.BMP and .PCX only) and put it into the BUILD
engine.
U - Use this to import a section of a 320*200*256 .BMP, .PCX, or .GIF.
³ Enter - Convert the image that is inside the rectangular selection
³ rectangle to the BUILD palette.
³ Space - Convert the image that is inside the rectangular selection
³ rectangle without remapping the palette.
³ P - If in the picture selecting screen (after pressing U and loading
³ the picture), you press P, then the palette of BUILD can be
ÀÄÄ replaced by the palette of the displayed picture.
PGUP/PGDN - Select tile to edit (4096 tile maximum right now).
G - GOTO a tile by typing in the tile number.
S - Re-size tile. The X and Y sizes can be any unsigned short integer.
X ranges from 0 to 1024, and Y ranges from 0 to 240.
Delete - short cut key to set both the X and Y sizes to 0.
+,- Change the animation setting. (Default: NoAnm = 0.)
To change the animation type, press - when the value is 0.
Ex: If you want an object to have 4 tiles of animation, you can
animate it in 4 different sequences: (0 is the current tile)
NoAnm=4 sequence: 0,0,0,0,0,0,0,0,0,0,0,... (no animation)
Oscis=4 sequence: 0,1,2,3,2,1,0,1,2,3,2,... (oscillate)
AnmFD=4 sequence: 0,1,2,3,0,1,2,3,0,1,2,... (forwards)
AnmBK=4 sequence: 0,-1,-2,-3,0,-1,-2,-3,... (backwards)
A - Set the animation speed of the tile. Press + and - to change the
animation speed. There are 16 different animation speeds. The
animation speed set here set the speed for BUILD and your GAME also.
(Speed is proportional to (totalclock>>animspeed))
~' - This key (located just above the TAB key) allows you to center a
sprite. Simply use the arrow keys to get to the desired position.
N - Name a tile. Naming a tile simply changes the #define statement in
NAMES.H. You should include NAMES.H when compiling so you can easily
refer to sprites by name rather than by number.
O - Optimize the size of an individual piece of artwork. Use this for
tiles with invisible pixels on the sides.
V - View and select a tile to edit.
³ Space - To swap 2 tiles simply press space bar on the first tile,
³ then space bar on the second.
³ 1,2,3 - To swap a group of tiles, press 1 on the first tile,
³ press 2 to remember the region between where you pressed
³ 1 and 2. Press 3 at the place to where you want to swap
ÀÄÄ all the tiles.
ALT+U- Re-grab artwork from original pictures according to the CAPFIL.TXT
file. If you press ALT-U in the main screen, everything will be
re-grabbed. If you press ALT-U in 'V' mode, then you should first
select the range by pressing '1' and '2' on the range boundaries.
ALT+R- Generate a Tile frequency report by scanning all maps in directory.
Use in 'V' mode only.
F12 - Screen capture (saves image as a *.BMP file, starting as file
name CAPTUR00.BMP and incrementing by 1 each time F12 is
pressed.
ESC - Quit.
---- Extra features: (if you actually want to do the artwork in EDITART
or if you want to touch-up some imported art.)
C - Change all pixels on the tile having the same color under the
graphics cursor to to selected color.
Arrows / Mouse - Move graphics cursor.
Shift + Arrows - Select color. (on bottom right corner of screen)
Space - Plot a pixel with the selected color.
T - Turn drawing trail on / off.
Tab - Select the color under the graphics cursor.
BACKSPACE - Set the color to color 255 (transparent color).
F - Floodfill a region with the current color and with the current
color as a boundary.
M,P - Use M to back up a tile into a temporary buffer in memory and P
to restore it. It may be wise to press M before a floodfill (F)
(because sometimes you miss encapsulating the region by 1 pixel,
and the whole picture gets killed, etc...)
J - Randomly plots dots of current color over any pixels having the
same color as the color under the tile cursor.
[ - Random antialias of colors in color band under graphics cursor.
] - Non-random antialias of colors in color band under graphics cursor.
; - 3-Dimentionalize an image. Makes colors in different rows of the
color bar either appear to stick out or stick in to the wall.
' - 3-Dimentionalize the other way.
R - Rotate the tile in a specified direction.
1 - Mark the first corner of a rectangle for a copy/paste operation.
2 - Mark the other corner of a rectangle for a copy/paste operation.
3 - Paste the selected rectangle (Note: You must press 1 and 2 in that
order first before pressing 3. Pretty simple 1-2-3 for copy&paste)
4 - Flip the copied rectangular region x-wise.
5 - Flip the copied rectangular region y-wise.
6 - Swap the x and y coordinates of the copied rectangular region.
,.<> - Change the shade of the selected region.
\ - Move the cursor to the center or the tile.
| - Get the coordinates of the cursor.
ÉÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍËÍ»
ÌÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎ͹
ÌÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎ͹
ÌÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎ͹
ÌÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎ͹
ÌÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎ͹
ÌÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎ͹
ÌÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎ͹
ÌÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎÍÎ͹
ÈÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊÍÊͼ
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ IMPORTANT ENGINE FUNCTIONS: ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
initengine(char vidoption, long xdim, long ydim)
Sets up interrupt vectors for keyboard, and initializes many variables
for the BUILD engine. You should call this once before any other
functions of the BUILD engine are used.
vidoption can be anywhere from 0-6
xdim,ydim can be any mode x resolution if vidoption = 0
xdim,ydim can be any vesa resolution if vidoption = 1
xdim,ydim must be 320*200 for any other mode.
(see graphics mode selection in my setup program)
uninitengine();
Restores interrupt vectors for keyboard and timer, and frees
buffers. You should call this once at the end of the program
before quitting to dos.
loadboard(char *filename, long *posx, long *posy, long *posz, short *ang, short *cursectnum)
Loads the given board file into memory for the BUILD engine.
Returns -1 if file not found. If no extension is given, .MAP will
be appended to the filename.
saveboard(char *filename, long *posx, long *posy, long *posz, short *ang, short *cursectnum)
Saves the given board from memory inro the specified filename.
Returns -1 if unable to save. If no extension is given, .MAP will
be appended to the filename.
loadpics(char *filename);
Loads the given artwork file into memory for the BUILD engine.
Returns -1 if file not found. If no extension is given, .ART will
be appended to the filename.
setgamemode();
This function sets the video mode to 320*200*256color graphics.
Since BUILD supports several different modes including mode x,
mode 13h, and other special modes, I don't expect you to write
any graphics output functions. (Soon I have all the necessary
functions) If for some reason, you use your own graphics mode,
you must call this function again before using the BUILD drawing
functions.
drawrooms(long posx, long posy, long posz, short ang, long horiz, short cursectnum)
This function draws the 3D screen to the current drawing page,
which is not yet shown. This way, you can overwrite some things
over the 3D screen such as a gun. Be sure to call the drawmasks()
function soon after you call the drawrooms() function. To view
the screen, use the nextpage() function. The nextpage() function
should always be called sometime after each draw3dscreen()
function.
drawmasks();
This function draws all the sprites and masked walls to the current
drawing page which is not yet shown. The reason I have the drawing
split up into these 2 routines is so you can animate just the
sprites that are about to be drawn instead of having to animate
all the sprites on the whole board. Drawrooms() prepares these
variables: spritex[], spritey[], spritepicnum[], thesprite[],
and spritesortcnt. Spritesortcnt is the number of sprites about
to be drawn to the page. To change the sprite's picnum, simply
modify the spritepicnum array If you want to change other parts
of the sprite structure, then you can use the thesprite array to
get an index to the actual sprite number.
engineinput();
This function allows the engine to adjust your position depending
on the status of the arrow keys, and other control keys. It
handles timing and clipping.
nextpage();
After a screen is prepared, use this function to view the screen.
!!! NOTE: qsetmode320200() doesn't exist anymore. setgamemode(), when called
!!! with width and height of 320x200 appears to be equivalent anyhow.
!!! --ryan.
draw2dscreen(long posxe, long posye, short ange, long zoome,
short gride)
Draws the 2d screen - this function is a direct replacement
for the drawrooms() and drawmasks() functions. Be sure
to call either qsetmode640350() or qsetmode640480()
first. When switching back to 3d mode, be sure to call
qsetmode320200().
IMPORTANT NOTES:
1. The overwritesprite function should only be called in
3D mode. If you do this in 2D mode, junk will be
written to the 2D screen and a crash is possible.
2. When you switch back to 3D mode, you should call the
permanentwritesprite functions to draw the status bar,
or whatever else you have to draw.
3. You must call the nextpage() function in both 2D and
3D modes.
qsetmode320200();
Set to the game mode and load palette (320*200*256)
qsetmode640350();
Set to the 2D map mode #1 (640*350*16)
qsetmode640480();
Set to the 2D map mode #2 (640*480*16)
doanimations(long numtics);
This function animates anything you use setanimation for (like doors).
You should call it for every frame. Pass the number of tics (lockspeed)
as a parameter to it to tell how much everything should animate.
kenchaintimer(void (__interrupt __far *datimerchainaddress)(),
short dachainpersecond)
This function makes the engine's timerhandler chain to another timer
handler at any specified interrupt rate. This function forces IRQ0 to
point to my engine's timerhandler. Clockspeed and totalclock will
be fixed at counting 120 per second regardless of the chaining interrupt
rate. If you call this function with a NULL pointer, then the engine's
timerhandler will not chain anymore.
Here's how you should structure your code if you use this function:
main()
{
initengine();
musicon(); //Turn music on after engine
kenchaintimer(yourtimerhandleraddress,yourtimerrate);
//When IRQ0 goes off, it will now go to
//Ken's timer handler. Then, Ken's timer
(main loop) //handler will make yourtimerhandler
//interrupt yourtimerrate times per second
kenchaintimer(0,0); //Stop chaining BEFORE music handler dies!
musicoff();
uninitengine();
}
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ OTHER ENGINE FUNCTIONS: ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
overwritesprite (long thex, long they, short tilenum,
signed char shade, char orientation, char dapalnum)
Use this function to draw any sprites that must be drawn to the screen
for every single frame, such as a gun or a menu system.
If Bit 0 of orientation = 0: (thex, they) is top-left corner
If Bit 0 of orientation = 1: (thex, they) is middle
If Bit 1 of orientation = 0: no relation to viewing window
If Bit 1 of orientation = 1: scale and clip to viewing window
If Bit 2 of orientation = 0: normal
If Bit 2 of orientation = 1: 50/50 transluscent!
If Bit 3 of orientation = 0: normal
If Bit 3 of orientation = 1: x-flipped
If Bit 4 of orientation = 0: normal
If Bit 4 of orientation = 1: y-flipped
* If it works at full screen, simply set bit 1 of orientation
to 1, and it should automatically scale properly!
Use this function to write sprites over the 3d view. For example,
you can make a menu system with this function. Be sure
that you call this function for every single frame after the 3d
view is drawn or else it will be flashed on for only 1 frame.
If you want x and y to be the top left corner, set the orientation
to 0. If you want x and y to be the middle of the sprite, set the
orientation to 1. The reason I included the orienation = 1 option
is so that if you want a sprite centered and the size of the tile
changes, you don't need to recompile and guess where the new top
left corner is. Oh yeah, and I forget to mention that if shade is
greater than 32, than overwritesprite does transluscence. (Try it
out!) This function will clip the sprite to the startumost and
startdmost arrays. Dapalnum refers to a palette lookup list
(normally 0).
rotatesprite (long sx, long sy, long z, short a, short picnum,
signed char dashade, char dapalnum, char dastat,
long cx1, long cy1, long cx2, long cy2)
(sx, sy) is the center of the sprite to draw defined as
screen coordinates shifted up by 16.
(z) is the zoom. Normal zoom is 65536.
Ex: 131072 is zoomed in 2X and 32768 is zoomed out 2X.
(a) is the angle (0 is straight up)
(picnum) is the tile number
(dashade) is 0 normally but can be any standard shade up to 31 or 63.
(dapalnum) can be from 0-255.
if ((dastat&1) == 0) - no transluscence
if ((dastat&1) != 0) - transluscence
if ((dastat&2) == 0) - don't scale to setview's viewing window
if ((dastat&2) != 0) - scale to setview's viewing window (windowx1,etc.)
if ((dastat&4) == 0) - nuttin' special
if ((dastat&4) != 0) - y-flip image
if ((dastat&8) == 0) - clip to startumost/startdmost
if ((dastat&8) != 0) - don't clip to startumost/startdmost
if ((dastat&16) == 0) - use Editart center as point passed
if ((dastat&16) != 0) - force point passed to be top-left corner
if ((dastat&32) == 0) - nuttin' special
if ((dastat&32) != 0) - use reverse transluscence
if ((dastat&64) == 0) - masked drawing (check 255's) (slower)
if ((dastat&64) != 0) - draw everything (don't check 255's) (faster)
Note: As a special case, if both ((dastat&2) != 0) and ((dastat&8) != 0)
then rotatesprite will scale to the full screen (0,0,xdim-1,ydim-1)
rather than setview's viewing window. (windowx1,windowy1,etc.) This
case is useful for status bars, etc.
Ex: rotatesprite(160L<<16,100L<<16,65536,totalclock<<4,
DEMOSIGN,2,50L,50L,270L,150L);
This example will draw the DEMOSIGN tile in the center of the
screen and rotate about once per second. The sprite will only
get drawn inside the rectangle from (50,50) to (270,150)
permanentwritesprite (long thex, long they, short tilenum, signed char shade,
long cx1, long cy1, long cx2, long cy2, char dapalnum)
- Added permanentwritesprite function for status bars or other
sections of the screen that will not be overwritten by the
engine. The format of this function is like overwritesprite
except that the x and y are always top left corner, no
orientation variable, and no translucence.
The 4 last parameters (cx1, cy1) - (cx2, cy2) define a
rectangular clipping window of where permanentwritesprite
can draw to. Dapalnum refers to a palette lookup list
(normally 0).
printext(long x, long y, char buffer[42], short tilenum, char invisiblecol);
Use this function to print text anywhere on the screen from a font
that you can create in EDITART. Please see my example font in
TILES.ART to see how I lay out the user-defined font. X ranges
from 0-319. Y ranges from 0-199. The buffer is the string to
print. Tilenum specifies which font to use. Invisiblecol tells
printext what color to draw the transparent pixels. If
invisiblecol is 255 then the transpararent pixels are still
transparent.
printnum(long x, long y, long num, short tilenum, char invisiblecol);
Printnum is a function call that will print a long integer (num)
starting at top left corner x, y. Please look at the documentation
for printext, since internally, printnum simply prepares a buffer
and calls the printext function.
setvmode(long videomode);
If you look at the top of GAME.C, you will see something like this:
#pragma aux setvmode =\... This is how you do in-line assembler in
WATCOM C. All this function is doing is setting the video mode.
showengineinfo();
Use this function after setting to text mode to view some statics
about the engine, such as frame rate.
resettiming();
Resets timing, such as setting totalclock = 0. Also resets other
timers. This is for use with the showengineinfo function above.
ksqrt(long num); returns (long)square root
A square root function optimized for integers. Use this function
only if you want to.
krand()
This simply returns a random number. You can easily set the random
seed by externing the randomseed variable as a long. This is useful
for keeping the random seed the same on multiple computers when playing
multi-player mode.
getangle(long xvect,long yvect); returns (short)angle;
Use this function call to determine the angle between two points.
For example, if you want a monster to shoot a bullet towards you,
you would get the bullet's angle this way:
sprite[bullet].ang = getangle(posx-sprite[monst].x,posy-sprite[monst].y);
lastwall(short point);
Use this function as a reverse function of wall[].point2. In order
to save memory, my walls are only on a single linked list.
rotatepoint(long xpivot, long ypivot, long x, long y,
short daang, long *x2, long *y2);
This function is a very convenient and fast math helper function.
Rotate points easily with this function without having to juggle your
cosines and sines. Simply pass it:
Input: 1. Pivot point (xpivot,ypivot)
2. Original point (x,y)
3. Angle to rotate (0 = nothing, 512 = 90ø CW, etc.)
Output: 4. Rotated point (*x2,*y2)
clipmove(long *x, long *y, long *z, short *sectnum, long xvect, long yvect,
long walldist, long ceildist, long flordist, char cliptype)
Moves any object (x, y, z) in any direction at any velocity and will
make sure the object will stay a certain distance from walls (walldist)
Pass the pointers of the starting position (x, y, z). Then
pass the starting position's sector number as a pointer also.
Also these values will be modified accordingly. Pass the
direction and velocity by using a vector (xvect, yvect).
If you don't fully understand these equations, please call me.
xvect = velocity * cos(angle)
yvect = velocity * sin(angle)
Walldist tells how close the object can get to a wall. I use
128L as my default. If you increase walldist all of a sudden
for a certain object, the object might leak through a wall, so
don't do that!
If cliptype is 0, then the clipping is normal (Use 0 to clip you
and monsters). If the cliptype is 1, then the object is clipped to
the same things that hitscan is clipped to (use 1 for all bullets).
Clipmove can either return 0 (touched nothing)
32768+wallnum (wall first touched)
49152+spritenum (sprite first touched)
getzrange(long x, long y, long z, short sectnum,
long *ceilz, long *ceilhit,
long *florz, long *florhit,
long walldist, char cliptype)
Use this in conjunction with clipmove. This function will keep the
player from falling off cliffs when you're too close to the edge. This
function finds the highest and lowest z coordinates that your clipping
BOX can get to. It must search for all sectors (and sprites) that go
into your clipping box. This method is better than using
sector[cursectnum].ceilingz and sector[cursectnum].floorz because this
searches the whole clipping box for objects, not just 1 point.
Pass x, y, z, sector normally. Walldist can be 128. Cliptype can be
0, 1, or 2. (just like movesprite and clipmove) This function returns
the z extents in ceilz and florz. It will return the object hit in ceilhit
and florhit.
Ceilhit and florhit will also be either:
16384+sector (sector first touched) or
49152+spritenum (sprite first touched)
updatesector(long x, long y, §num);
This function updates the sector number according to the x and y values
passed to it. Be careful when you use this function with sprites because
remember that the sprite's sector number should not be modified directly.
If you want to update a sprite's sector, I recomment using the setsprite
function described below.
inside(long x, long y, short sectnum);
Tests to see whether the overhead point (x, y) is inside sector (sectnum)
Returns either 0 or 1, where 1 means it is inside, and 0 means it is not.
copytilepiece(long tilenume1, long sourcex1, long sourcey1,
long xsiz, long ysiz,
long tilenume2, long destx1, long desty1)
This function simply copies any section of a source tile
to any part of a destination tile. It will automatically
skip transparent pixels. It will wrap-around in the
source but not the destination. If for some reason
the destination tile gets removed from the cache, the
destination tile will be reset to original form. This
is why I had to add this second function:
allocatepermanenttile(short tilenume, long xsiz, long ysiz)
This function allocates a place on the cache as permanent.
Right now, I reset the cache every time you call this
function so I would recommend calling this function
right after loadpics.
makepalookup(long palnum, char *remapbuf,
signed char r, signed char g, signed char b,
char dastat)
This function allows different shirt colors for sprites. First prepare
remapbuf, which is a 256 byte buffer of chars which the colors to remap.
Palnum can be anywhere from 1-15. Since 0 is where the normal palette is
stored, it is a bad idea to call this function with palnum=0.
In BUILD.H notice I added a new variable, spritepal[MAXSPRITES].
Usually the value of this is 0 for the default palette. But if you
change it to the palnum in the code between drawrooms() and drawmasks
then the sprite will be drawn with that remapped palette. The last 3
parameters are the color that the palette fades to as you get further
away. This color is normally black (0,0,0). White would be (63,63,63).
if ((dastat&1) == 0) then makepalookup will allocate & deallocate
the memory block for use but will not waste the time creating a palookup
table (assuming you will create one yourself)
copytilepiece(long walnume1, long x1, long y1, long xsiz, long ysiz,
long walnume2, long x2, long y2, char shadeoffs);
Copies section of tile 1 (walnume1) with top-left corner (x1,y1) and
rectangular size (xsiz, ysiz) to top-left corner (x2, y2) of tile 2
(walnume). You can animate tiles with this function. For example, with
this function, you can make a slot machine like in Ken's Labyrinth or an
electronic sign with text sliding from right to left.
loadtile(short tilenume);
This function will load the tile, tilenum, into the artwork cache. A
tile is not in the cache if (waloff[tilenum] == -1). If
(waloff[tilenum] >= 0) then it is in the cache, and you don't need to call
this function.
precache();
This function will go through the tilenums of all sectors, walls, and
sprites and call loadtile() on them. This function will not cache in some
tiles of animations since their tilenums may not all be in the structures.
hitscan(long xstart, long ystart, long zstart, short startsectnum,
long vectorx, long vectory, long vectorz,
short *hitsect, short *hitwall, short *hitsprite,
long *hitx, long *hity, long *hitz);
Pass the starting 3D position:
(xstart, ystart, zstart, startsectnum)
Then pass the 3D angle to shoot (defined as a 3D vector):
(vectorx, vectory, vectorz)
Then set up the return values for the object hit:
(hitsect, hitwall, hitsprite)
and the exact 3D point where the ray hits:
(hitx, hity, hitz)
How to determine what was hit:
* Hitsect is always equal to the sector that was hit (always >= 0).
* If the ray hits a sprite then:
hitsect = thesectornumber
hitsprite = thespritenumber
hitwall = -1
* If the ray hits a wall then:
hitsect = thesectornumber
hitsprite = -1
hitwall = thewallnumber
* If the ray hits the ceiling of a sector then:
hitsect = thesectornumber
hitsprite = -1
hitwall = -1
vectorz < 0
(If vectorz < 0 then you're shooting upward which means
that you couldn't have hit a floor)
* If the ray hits the floor of a sector then:
hitsect = thesectornumber
hitsprite = -1
hitwall = -1
vectorz > 0
(If vectorz > 0 then you're shooting downard which means
that you couldn't have hit a ceiling)
neartag(long x, long y, long z, short sectnum, short ang, //Starting position & angle
short *neartagsector, //Returns near sector if sector[].tag != 0
short *neartagwall, //Returns near wall if wall[].tag != 0
short *neartagsprite, //Returns near sprite if sprite[].tag != 0
long *neartaghitdist, //Returns actual distance to object (scale: 1024=largest grid size)
long neartagrange, //Choose maximum distance to scan (scale: 1024=largest grid size)
char tagsearch) //1-lotag only, 2-hitag only, 3-lotag&hitag
Neartag works sort of like hitscan, but is optimized to
scan only close objects and scan only objects with
tags != 0. Neartag is perfect for the first line of your space bar code.
It will tell you what door you want to open or what switch you want to
flip.
cansee(long x1, long y1, long z1, short sectnum1,
long x2, long y2, long z2, short sectnum2); returns 0 or 1
This function determines whether or not two 3D points can "see" each
other or not. All you do is pass it the coordinates of a 3D line defined
by two 3D points (with their respective sectors) The function will return
a 1 if the points can see each other or a 0 if there is something blocking
the two points from seeing each other. This is how I determine whether a
monster can see you or not. Try playing DOOM1.DAT to fully enjoy this
great function!
setanimation(long *animptr, long thegoal, long thevel);
This is a function for your convenience that will animate a long
variable, such as sector[].floorz for platforms, or sector[].ceilingz
for doors. All you do is pass it the long pointer into memory, specifying
which long variable is to be animated; you also pass the goal (long value
to animate towards), and the velocity at which the variable is animated.
Velocity = 128 is a normal speed door. You may also modify the animation
arrays directly if you wish:
The animation arrays are as follows:
long *animateptr[MAXANIMATES], animategoal[MAXANIMATES];
long animatevel[MAXANIMATES], animatecnt;
getanimationgoal(long animptr);
Check to see if a certain variable in memory is already being animated
by the engine. If so, an index into the animation arrays is returned,
else -1 is returned. This is function is useful when you are press
space bar near a door, and it is already animating, you simply want
to reverse its direction.
dragpoint(short wallnum, long newx, long newy);
This function will drag a point in the exact same way a point is dragged
in 2D EDIT MODE using the left mouse button. Simply pass it which wall
to drag and then pass the new x and y coordinates for that point.
Please use this function because if you don't and try to drag points
yourself, I can guarantee that it won't work as well as mine and you
will get confused. Note: Every wall of course has 2 points. When you
pass a wall number to this function, you are actually passing 1 point,
the left side of the wall (given that you are in the sector of that wall)
Got it?
nextsectorneighborz(short sectnum, long thez, short topbottom, short direction);
This function searches z-coordinates of neighboring sectors to find the
closest (next) ceiling starting at the given z-coordinate (thez).
For example, if you want to find the goal z-coordinate when opening a
door, you might want the door to stop at the next closest neighboring
ceiling z-coordinate. You can get the z-coordinate this way:
newz = sector[nextsectorneighborz(sectnum,startz,-1,-1)].ceilingz
topbottom (3rd parameter) -1 = search ceilings
1 = search floors
direction (4th parameter) -1 = search upwards
1 = search downwards
screencapture(char *filename)
Capture the screen and save it as a .BMP file. I don't know why my
.BMP format isn't compatible with other programs.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ SPRITE FUNCTIONS: ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
insertsprite(short sectnum, short statnum); //returns (short)spritenum;
Whenever you insert a sprite, you must pass it the sector
number, and a status number (statnum). The status number can be any
number from 0 to MAXSTATUS-1. Insertsprite works like a memory
allocation function and returns the sprite number.
deletesprite(short spritenum);
Deletes the sprite.
changespritesect(short spritenum, short newsectnum);
Changes the sector of sprite (spritenum) to the
newsector (newsectnum). This function may become
internal to the engine in the movesprite function. But
this function is necessary since all the sectors have
their own doubly-linked lists of sprites.
changespritestat(short spritenum, short newstatnum);
Changes the status of sprite (spritenum) to status
(newstatus). Newstatus can be any number from 0 to MAXSTATUS-1.
You can use this function to put a monster on a list of active sprites
when it first sees you.
setsprite(short spritenum, long newx, long newy, long newz);
This function simply sets the sprite's position to a specified
coordinate (newx, newy, newz) without any checking to see
whether the position is valid or not. You could directly
modify the sprite[].x, sprite[].y, and sprite[].z values, but
if you use my function, the sprite is guaranteed to be in the
right sector.
movesprite(short spritenum, long xchange, long ychange, long zchange,