1 +----------------------------------+
\r
2 Ý VergeC 2.0 Reference File Ý
\r
3 Ý Language Specification Ý
\r
4 Ý VC Built-ins reference Ý
\r
5 +----------------------------------+
\r
9 =============================================================================
\r
11 I. Language Specification
\r
15 Just as in VC1, both C and C++ style comment conventions are supported.
\r
17 1. Comments: Comments are not required in your VergeC code, but smart
\r
18 event coders will use them to help organize and make their event
\r
19 scripts readable for future reference. They are ignored by the
\r
20 compiler. There are two ways to use comments:
\r
22 a. If you type a double slash (//) in your code, everything on that
\r
23 line after the slashes will be ignored.
\r
25 Event // #75: When Dexter joins
\r
30 b. The second method is to use /* and */. When the compiler encounters
\r
31 a /*, everything will be ignored until it sees a */. Example:
\r
35 /* This is the part where Dexter joins after
\r
36 being seen on the path of Jujube mountains.
\r
37 The event below is number 75. */
\r
41 The // is preferred for simple phrases that you wish commented, while
\r
42 the /* */ method is best for large areas of text to be left commented.
\r
44 NOTE: Try using commenting if you have a problematic area of your
\r
45 event script that refuses to compile. Use // before the lines
\r
46 that create errors and try recompiling until you can isolate
\r
49 B. Code control structures
\r
50 ---------------------------
\r
51 VergeC 2.0 supports most of the code control structures that genuine ANSI C
\r
52 does, with some differences that are explained below:
\r
54 1. IFs: if statements are the most basic form of code execution control.
\r
55 They have been much improved since VC1, primarily from the addition
\r
56 of OR conditionals as well as the ELSE branching statement.
\r
57 The basic format of an IF is:
\r
59 if (condition <list>)
\r
61 (code to be executed if condition is true)
\r
65 (code to be executed if condition is false)
\r
68 2. SWITCHs: switch/case statements basically replace a series of IF
\r
69 statements. Cases are yet another method of simplifying and
\r
70 empowering your VC code's flexibility. They are most useful in
\r
71 situations where you wish to provide multiple results based on the
\r
72 condition of some variable. Here's how they're used:
\r
74 Switch(<variable to be tested>)
\r
76 Case <result 1>: <command>;
\r
77 Case <result 2>: <command>;
\r
78 Case <result 3>: <command>;
\r
81 When the interpreter encounters this construct, it will test the value
\r
82 of what is given in the Switch parentheses, then run the Case statement
\r
83 that matches it, if any. Note that unlike C, no break; statements are
\r
84 in the below example; break statement in VC are not only unnecessary but
\r
85 will cause an error if they are present. Example:
\r
87 switch (PartyIndex(1))
\r
89 case 1: Text(1,"My name's Darin and I'm leading this party!","","");
\r
90 case 2: Text(2,"I'm Sara and I'm here to pump you up!","","");
\r
91 case 3: Text(3,"Dexter is leading this party.","","");
\r
95 It works much the same as a FOR loop, but can use nearly any condition
\r
96 to control how long it executes. The syntax is such:
\r
103 The condition inside the parentheses after WHILE can be anything you can
\r
104 stuff in an IF statement. When the engine encounters a WHILE loop, it will
\r
105 repeatedly execute the commands inside the curly braces until the condition
\r
106 inside the parentheses is NOT true. Therefore, your WHILE loop should
\r
107 contain some commands that affect that condition, or else your loop will
\r
111 FOR loops are perhaps more commonly used than WHILE, altho I personally
\r
112 dig WHILE loops greatly. Anyhow, FOR loops in VergeC 2.0 are much closer
\r
113 to their true C counterparts than they were in VC1. The syntax now is:
\r
115 for (init; condition; post)
\r
120 To clarify, an example would be:
\r
122 for (i=0; i<5; i++)
\r
124 printstring(i,"This is font "+str(i)+".");
\r
127 C. system.vc, map-based VC, and the relationship thereof
\r
128 --------------------------------------------------------
\r
129 There are two distinct types of VC in V2, and that is the system.vc, and
\r
130 everything else, which are MAP-based VC files. MAP based VC is very similar
\r
131 to how VC was in V1. You cannot declare your own functions or variables in
\r
132 a MAP vc. They use the familiar event { } style scripts. When they are
\r
133 compiled their pcode is attached directly into the MAPfile itself.
\r
135 The other type is system.vc, which is compiled into the files system.vcs and
\r
136 system.idx, respectively. system.vc allows you to declare your own functions
\r
137 and variables - the trick comes in that any of your map VC can access any
\r
138 and all of the functions and variables set up in system.vc.
\r
140 The only real problem arises that, because of the new relationship between
\r
141 system.vc and map-based VC, it's conceivable (quite likely, actually) that
\r
142 if you modify system.vc you'll break MAPs that you've already compiled. As
\r
143 such, VCC now has a 'vcc all' option, that will compile system.vc, and then
\r
144 recompile all maps it can find in the given directory. ME2 has a shortcut
\r
145 to do this right from inside MapEd - Just hit F6 and it'll rebuild all of
\r
146 your VC files. (of course, this means you can't have an ALL.MAP. Oh well,
\r
149 There is nothing like startup.vc or startup.scr in V2. When you execute
\r
150 verge.exe, it always starts execution at a MAP file. Which mapfile it starts
\r
151 at is determined in user.cfg, by the 'startmap' command. Additionally, you can
\r
152 start verge.exe at a specific map by specifying the mapfile on the command
\r
153 line, which MapEd makes use of to directly test out the mapfile you're
\r
154 currently working on.
\r
156 D. Syntax for user-declared variables and functions
\r
157 ---------------------------------------------------
\r
160 There are two types of user declared functions, ones that return a
\r
161 value and those that don't. The simplist declaration for a function
\r
167 You can add passed parameters like so:
\r
169 void MyFunc(int a, string b)
\r
172 These parameters would be accessed inside this function as any other
\r
173 variable would be, but it only exists inside the function. You would
\r
174 call this function from map or other system.vc code with something
\r
175 like this: MyFunc(5, "Hello.");
\r
177 To make your function return a value, you'd declare it like so:
\r
179 int MyAdd(int a, int b)
\r
184 You cannot currently have a function return a string type. This may
\r
185 change in a future version of V2/VC.
\r
188 There are only two variable types in VC, int (integer) and string.
\r
189 Both are declared the same basic way:
\r
194 You can define multiple variables of the same type onto a single line:
\r
196 int x1, y1, x2, y2;
\r
198 You can also declare arrays of variables:
\r
202 You can declare arrays of both ints and strings. You can only declare
\r
203 them in SYSTEM.VC (and any #included sub-files). Variables declared
\r
204 outside of any function are global and can be accessed by any system.vc
\r
205 OR map-based VC event at all. Variables declared inside a given
\r
206 system.vc function are local variables, which only exist during the
\r
207 duration of that function's execution, and can't be accessed outside
\r
210 Limits of passed parameters and local variables: For any given system.vc
\r
211 function, the total number of passed parameters and local variables
\r
212 cannot exceed 20, and the total number of passed and locally declared
\r
213 strings cannot exceed 10. However, if you have 10 strings, you can only
\r
214 have 10 ints, otherwise the total limit of 20 variables
\r
215 (int and otherwise) would be exceeded.
\r
217 If there is a global variable and local variable of the same name,
\r
218 inside the function the local variable will be used instead. But in
\r
219 a function where that local var isn't declared, or a map-vc event,
\r
220 the global variable will be used instead.
\r
222 We may add the ability to declare local variables in map-vc events in
\r
225 E. Special string operators
\r
226 ---------------------------
\r
228 We strived to make VC2 closer to "real" C in most aspects, but strings is not
\r
229 one of them. In real C, string manipulation is fairly clunky, and not very
\r
230 easy for beginners to pick up. So, we have created a string system that's
\r
231 somewhat like a mix of Pascal and BASIC.
\r
233 Any string can be combined any number of times, altho the total length of
\r
234 any one string cannot exceed 255 characters. For instance, if you had a string
\r
235 variable named OurHero, and it contained the main character's name, you
\r
236 could do something like:
\r
238 Text(0,"Greetings, "+OurHero+". We",
\r
239 "have been expecting you.", "");
\r
241 Additionally, there are 4 other commands which can be used during string
\r
242 combination: str(), left(), right(), and mid():
\r
244 str(int) - converts a numerical value into string form.
\r
245 left(string, n) - returns the leftmost n characters of string.
\r
246 right(string, n) - returns the rightmost n characters of string.
\r
247 mid(string, start, run) - returns a section of string, starting at the
\r
248 start character, run characters long.
\r
250 And lastly, the val(string) attempts to convert a string back to an
\r
251 interger value. If the string has too many non-numerical characters in it,
\r
252 however, it may not be able to.
\r
254 F. Preprocessor directives
\r
255 --------------------------
\r
257 As in the original VC, VC2 emulates two primary C preprocessor directives,
\r
258 #include and #define. #include has been expanded, while #define has been
\r
261 #include is more stable than before, and you can have nested #includes without
\r
262 any problems. The primary purpose of #includes in VC2 is to allow you to break
\r
263 up your system.vc into sub-files such as menu.vc, battle.vc, or similar
\r
264 divisions, and just #include those units into your main system.vc.
\r
266 Since VC2 now has proper functions, the macro-like behavior of #define in the
\r
267 VC1 preprocessor is no longer necessary, and since it was rather highly
\r
268 unstable, it was taken out. The primary purpose of #defines in VC2 is to
\r
269 allow an unlimited number of simple symbolic constants. An example would be:
\r
272 if (key[k_ESC]) Text(0,"ESC has been pressed.","","");
\r
274 We may also later add conditional compilaton if there is a request for it.
\r
276 G. Pointers and direct memory access
\r
277 ------------------------------------
\r
279 If you are not a native C programmer, you are more than welcome to skip over
\r
280 this section. I would not dare attempt to teach the principals of pointers
\r
281 to those who aren't programmers in their own right, and you don't really need
\r
282 to understand VC2's implementation using pointers for direct memory access for
\r
283 the vast majority of things you could ever want to do in VergeC.
\r
285 Since VC deals with all numeric variables as integers (signed, 32-bit values),
\r
286 it would not really make sense for us to implement the standard * and &
\r
287 operators, since you'd only be able to operate on data of type int.
\r
289 So, we have 6 builtins which aren't quite functions, and they aren't quite
\r
290 variables, but whatever they are, they're there. They are:
\r
292 (unsigned) byte[ptr]
\r
293 (unsigned) word[ptr]
\r
294 (unsigned) quad[ptr]
\r
295 (signed) sbyte[ptr]
\r
296 (signed) sword[ptr]
\r
297 (signed) squad[ptr]
\r
299 Note: signed allows for negative numbers.
\r
301 Using the convention:
\r
306 The main reason these don't quite qualify as C functions is that you can also
\r
307 assign them values. Ie:
\r
310 if (byte[myptr] != 5)
\r
311 Exit("Your computer is smoking crack, my friend.");
\r
315 1. Alternate ways of expressing numbers
\r
316 VC has three ways that it recognizes an immediate numerical value.
\r
318 a. Standard/Decimal
\r
319 The first is a standard, base-10 number. Just 65 or something. ex:
\r
323 Exit("Woe to thee, for thine computer smoketh crack, verily.");
\r
326 VC uses Pascal's convention for handling hexademinal numbers, which
\r
327 is to preceed a hexadecimal numerical delcaration with a $ sign. ex:
\r
331 Exit("For thus sayeth the Lord, that thine processor was created by"+
\r
332 "those darwinists who would believe that a CPU can be created"+
\r
333 "by putting silicon in a frying pan and shaking it around a lot."+
\r
334 "Well, either that, or you're running a Microsoft OS.");
\r
336 c. ASCII character conversions
\r
337 You can use C style single tick marks to denote an ASCII char conversion.
\r
338 However, it does not support C's \ codes. Whats in between the tick
\r
339 marks is taken directly. ex:
\r
343 Exit("A stroke from the brush does not guarantee art from the bristles.");
\r
345 2. Order of Operations
\r
346 Does not exist. Use parentheses gratuitously.
\r
347 Oftentimes you will want to do something like this: putpixel(x+y*320
\r
348 This will not work! V2 will add x and y, then multiply the result by 320.
\r
349 As always, any order of operations expression can be rewritten with
\r
350 parentheses. In the example: putpixel(x+(y*320)
\r
352 =============================================================================
\r
354 II. Builtin Functions
\r
356 ---------------------------
\r
357 void AllowConsole(int flag)
\r
358 ---------------------------
\r
359 Controls whether or not the ` key will summon the console or not. 0 will
\r
360 disallow the console, 1 will activate it. Disabling the console is a good
\r
361 way to prevent cheating, however having it enabled will make developing
\r
362 and testing the game easier.
\r
367 -------------------------------
\r
368 int CacheSound(string filename)
\r
369 -------------------------------
\r
370 Loads a specified sound effect (8-bit, mono, un-compressed WAV file), and
\r
371 returns the slot number that you'll access this sound with for PlaySound.
\r
373 See also: FreeAllSounds(), PlaySound()
\r
376 snd_shriek = CacheSound("SHRIEK.WAV");
\r
378 -----------------------
\r
379 void CD_Play(int track)
\r
380 -----------------------
\r
381 Begins playing CD audio at the specified track number.
\r
389 Stops all CD audio playing.
\r
394 ------------------------------------------------
\r
395 void Circle(int x, int y, int radius, int color)
\r
396 ------------------------------------------------
\r
397 Draws a circle (outline only) of the given radius, centered at the given
\r
398 coordinates, in the given color.
\r
400 See also: CircleFill()
\r
403 Circle(screenx/2, screeny/2, 50, 128);
\r
405 ----------------------------------------------------
\r
406 void CircleFill(int x, int y, int radius, int color)
\r
407 ----------------------------------------------------
\r
408 Draws a filled circle of the given radius, centered at the given
\r
409 coordinates, in the given color.
\r
414 CircleFill(screenx/2, screeny/2, 50, 128);
\r
416 ---------------------------------------------------------------
\r
417 void CopySprite(int x, int y, int width, int height, int image)
\r
418 ---------------------------------------------------------------
\r
419 Blits the image pointed to by image with the given dimensions at the
\r
420 given location on screen. No transparency, clipping is performed.
\r
422 See also: TCopySprite
\r
425 im = LoadImage("VECNA.PCX");
\r
426 CopySprite(0, 0, image_width, image_height, im);
\r
429 -------------------
\r
430 int cos(int degree)
\r
431 -------------------
\r
432 Returns the cosine of the given degree of measure (0-360) in 16.16 fixed
\r
435 See also: sin(), tan()
\r
440 ----------------------------------------------
\r
441 void EntityMove(int entity, string movescript)
\r
442 ----------------------------------------------
\r
443 Sets the given entity to the specified movement script. As in V1,
\r
444 you cannot use 'B', the loop command, in an EntityMove given script.. But
\r
445 I should be able to work around that so that it will work eventually.
\r
448 ent = EntitySpawn(0, 1, "VECNA.CHR");
\r
449 EntityMove(ent, "D2R2");
\r
451 ---------------------------------------------
\r
452 int EntitySpawn(int x, int y, string chrname)
\r
453 ---------------------------------------------
\r
454 Allocates a new entity at the given coordinates, using the specified CHR file.
\r
455 The entity index of the new entity is returned.
\r
457 See also: SetPlayer()
\r
460 ent = EntitySpawn(0, 1, "VECNA.CHR");
\r
462 -------------------------
\r
463 void Exit(string message)
\r
464 -------------------------
\r
465 Completely exits out of the engine leaving the user with the specified
\r
469 Exit("Thank you for playing!");
\r
471 ---------------------------
\r
472 void fclose(int filehandle)
\r
473 ---------------------------
\r
474 Closes the file given by the specified file handle.
\r
479 file = fopen("EXAMPLE.DAT");
\r
480 // ** use file here **
\r
483 ----------------------------
\r
484 int fgetbyte(int filehandle)
\r
485 ----------------------------
\r
486 Gets a single byte from the specified file and returns it's value.
\r
489 file = fopen("TEST.DAT");
\r
490 Message("First byte in TEST.DAT is: "+str(fgetbyte(file)), 200);
\r
493 ----------------------------
\r
494 int fgetword(int filehandle)
\r
495 ----------------------------
\r
496 Gets a single word (2 bytes) from the specified file and returns it's value.
\r
499 file = fopen("TEST.DAT");
\r
500 Message("First word in TEST.DAT is: "+str(fgetword(file)), 200);
\r
503 ----------------------------
\r
504 int fgetquad(int filehandle)
\r
505 ----------------------------
\r
506 Gets a single quad (4 bytes) from the specified file and returns it's value.
\r
509 file = fopen("TEST.DAT");
\r
510 Message("First quad in TEST.DAT is: "+str(fgetquad(file)), 200);
\r
513 ----------------------------------------------
\r
514 void fgetline(string variable, int filehandle)
\r
515 ----------------------------------------------
\r
516 Grabs the next line from the specified text file handle and returns it in the
\r
517 string variable passed.
\r
520 file = fopen("EXAMPLE.TXT");
\r
521 fgetline(my_string, file);
\r
522 Message("First line in EXAMPLE.TXT is: "+my_string, 200);
\r
525 Note: String support is a bit sketchy in V2 at the moment, and this command,
\r
526 along with fgettoken(), only accept global strings as valid parameters.
\r
527 It also will not read correctly into string arrays.
\r
529 -----------------------------------------------
\r
530 void fgettoken(string variable, int filehandle)
\r
531 -----------------------------------------------
\r
532 Grabs the next token (space delimited) from the specified text file handle
\r
533 and returns it in the string variable passed.
\r
536 file = fopen("EXAMPLE.TXT");
\r
537 fgettoken(my_string, file);
\r
538 Message("First token in EXAMPLE.TXT is: "+my_string, 200);
\r
541 ---------------------------
\r
542 int FontHeight(int fontidx)
\r
543 ---------------------------
\r
544 Returns the height of the font at the given font index.
\r
546 See also: FontWidth()
\r
549 height = FontHeight(0);
\r
551 --------------------------
\r
552 int FontWidth(int fontidx)
\r
553 --------------------------
\r
554 Returns the width of the font at the given font index.
\r
556 See also: FontHeight()
\r
559 width = FontWidth(0);
\r
561 --------------------------
\r
562 int fopen(string filename)
\r
563 --------------------------
\r
564 Opens the given file and returns a unique file handle integer.
\r
569 file = fopen("EXAMPLE.TXT");
\r
572 --------------------------------------------------
\r
573 void fread(int buffer, int length, int filehandle)
\r
574 --------------------------------------------------
\r
575 Reads in a given amount of data from the specified file into the given buffer.
\r
576 Thus buffer must be pre-allocated by the user.
\r
579 file = fopen("TEST.DAT");
\r
580 buffer = malloc(100);
\r
581 fread(buffer, 100, file);
\r
584 ----------------------
\r
585 void free(int pointer)
\r
586 ----------------------
\r
587 Frees the memory space pointed to by the given pointer. (ie, you would pass
\r
588 the same value returned by malloc for a memory segment)
\r
591 buffer = malloc(100);
\r
592 // ** use buffer here **
\r
595 --------------------
\r
596 void FreeAllSounds()
\r
597 --------------------
\r
598 Frees all sound effect slots.
\r
600 See also: CacheSound(), PlaySound()
\r
605 -----------------------------
\r
606 void fdelete(string filename)
\r
607 -----------------------------
\r
608 Deletes the specified file. (uhm.. obviously, be careful with this command.
\r
609 This doesn't send it to the recycle bin or anything, the file is GONE after
\r
610 this command is executed. Like all the other file I/O vc commands, this
\r
611 will ONLY work on files in the main directory VERGE is being run from)
\r
614 fdelete("EXAMPLE.TXT");
\r
616 ---------------------------------------------
\r
617 void frename(string filename, string newname)
\r
618 ---------------------------------------------
\r
619 Renames the specified file to the new name.
\r
622 frename("EXAMPLE.TXT", "TEST.TXT");
\r
624 ----------------------------------------
\r
625 void fseekline(int line, int filehandle)
\r
626 ----------------------------------------
\r
627 Moves the file pointer to the given line number in a pre-opened text file.
\r
630 file = fopen("EXAMPLE.TXT");
\r
631 fseekline(3, file);
\r
632 fgetline(my_string, file);
\r
633 Message("Line #3 in EXAMPLE.TXT is: "+my_string, 200);
\r
636 --------------------------------------
\r
637 void fseekpos(int pos, int filehandle)
\r
638 --------------------------------------
\r
639 Moves the file pointer to the given byte position in a pre-opened binary file.
\r
642 file = fopen("TEST.DAT");
\r
643 fseekpos(20, file);
\r
644 Message("Byte #20 in TEST.DAT is: "+str(fgetbyte(file)), 200);
\r
647 ----------------------------
\r
648 void fwclose(int filehandle)
\r
649 ----------------------------
\r
650 Closes the given file that was open for writing. Be *sure* not to mix
\r
651 file handles that were opened for reading and those that were opened
\r
657 file = fwopen("EXAMPLE.TXT");
\r
658 // ** use file here **
\r
661 ------------------------
\r
662 int fwopen(string fname)
\r
663 ------------------------
\r
664 Opens the specified filename for writing.
\r
666 See also: fwclose(), fwrite(), fwritestring()
\r
669 file = fwopen("EXAMPLE.TXT");
\r
670 // ** use file here **
\r
673 ------------------------------------------------
\r
674 void fwrite(int ptr, int length, int filehandle)
\r
675 ------------------------------------------------
\r
676 Writes the data at the given data pointer to the specified file.
\r
679 file = fwopen("EXAMPLE.TXT");
\r
680 buffer = malloc(screenx * screeny);
\r
681 GrabRegion(0,0, screenx-1,screeny-1, buffer);
\r
682 fwrite(buffer, screenx * screeny, file);
\r
686 ----------------------------------------------
\r
687 void fwritestring(string text, int filehandle)
\r
688 ----------------------------------------------
\r
689 Writes the passed string to the specified file. The string is written in
\r
690 text mode format, with a CR/LF pair at the end.
\r
693 file = fwopen("EXAMPLE.TXT");
\r
694 my_string = "VERGE 2";
\r
695 fwritestring(my_string, file);
\r
698 --------------------------
\r
699 int GetPixel(int x, int y)
\r
700 --------------------------
\r
701 Returns the color of the specified pixel coordinate.
\r
703 See also: SetPixel();
\r
706 color = GetPixel(screenx/2, screeny/2);
\r
708 ------------------------------------
\r
709 int GetTile(int x, int y, int layer)
\r
710 -----------------------------------
\r
711 Returns the value of the given map layer at the given coordinates. For
\r
712 layer, 0 through 5 are the first 6 possible map layers, a value of 6
\r
713 will always denote the obstruction field, and 7 denotes zone information.
\r
715 See also: SetTile()
\r
718 tile = GetTile(0, 0, 0);
\r
720 -------------------------
\r
721 void GotoXY(int x, int y)
\r
722 -------------------------
\r
723 Sets the current text output "cursor" to the given location. This is where
\r
724 calls to PrintString will be displayed at.
\r
726 See also: PrintString()
\r
729 GotoXY(screenx/2, screeny/2);
\r
730 PrintString(0, "Hyuck.");
\r
732 -----------------------------------------------------------
\r
733 void GrabRegion(int x1, int y1, int x2, int y2, int buffer)
\r
734 -----------------------------------------------------------
\r
735 This routine captures a region of the screen and copies it into
\r
736 a bitmap buffer. The main trick with using this routine is that you are
\r
737 responsible for creating and destroying this buffer with the malloc/free
\r
738 commands, and to be sure that you allocate enough memory in your malloc call
\r
739 to contain the image. For instance, if you capture the region from (0,0) to
\r
740 (49,49), this is a 50x50 square, and you will need to allocate 2500 bytes.
\r
743 save_screen = malloc(screenx * screeny);
\r
744 GrabRegion(0, 0, screenx-1, screeny-1, save_screen);
\r
745 // ** use save_screen here **
\r
748 -------------------------------------------
\r
749 void HLine(int x, int y, int x2, int color)
\r
750 -------------------------------------------
\r
751 Draws a horizontal line using the specified coordinates in the given color.
\r
753 See also: VLine(), Line()
\r
756 HLine(0, screeny/2, screenx-1, 128);
\r
758 -----------------------------------------
\r
759 void HookKey(int scancode, system script)
\r
760 -----------------------------------------
\r
761 Binds an event to a specified keypress. This allows you to create menus and
\r
762 other types of key-based events easily.
\r
764 ex: HookKey(1, Menu);
\r
765 When Escape is pressed (key scancode 1), the function Menu() in system.vc
\r
768 See also: HookTimer(), HookRetrace()
\r
771 HookKey(1, menu_script);
\r
773 -------------------------------
\r
774 void HookRetrace(system script)
\r
775 -------------------------------
\r
776 Given a non-zero event number, it will execute the given VergeC event (from the
\r
777 Map VC) each time a frame is rendered. Note that it will be called at the 'R'
\r
778 position in the Renderstring, so if there *is* no 'R' position, then it will
\r
779 never be executed. As in verge 1, HookRetrace is quite stable, and should be
\r
780 used instead of HookTimer whenever possible. You can pass zero to this event
\r
781 to turn off the HookRetrace.
\r
783 See also: HookTimer(), HookKey()
\r
786 HookRetrace(my_script); // hook script
\r
787 HookRetrace(1); // hook event
\r
789 -----------------------------
\r
790 void HookTimer(system script)
\r
791 -----------------------------
\r
792 Given a non-zero event number, it will execute the given VergeC event (from the
\r
793 Map VC) each timer tick (ie, 100 times per second). Note that, like verge 1,
\r
794 this is the more volatile of the Hook* family of functions, and HookRetrace
\r
795 should be used in place of HookTimer whenever possible. When using HookTimer,
\r
796 you should never call any rendering functions, and in general you should do as
\r
797 little as possible inside the hooked event as you can. As with HookRetrace,
\r
798 passing 0 to this function will turn off the HookTimer.
\r
800 See also: HookRetrace(), HookKey()
\r
803 HookTimer(my_script); // hook script
\r
804 HookTimer(1); // hook event
\r
806 ---------------------
\r
807 int InitMosaicTable()
\r
808 ---------------------
\r
809 If you wish to use the Mosaic() routine, you must call this function to
\r
810 generate a mosaic palette-matching table (store the value returned by this
\r
811 function and pass it to Mosaic each time you call it). We would precompute
\r
812 this table, however, it depends on the palette. The table calculations can
\r
813 take a while, it takes about 12 seconds on my P200. It is possible, of course,
\r
814 to precompute the table in VC and load it at runtime for people that want
\r
815 to use this feature and wish to avoid the long table computation time.
\r
820 table = InitMosaicTable();
\r
822 --------------------------------------------------
\r
823 void Line(int x, int y, int x2, int y2, int color)
\r
824 --------------------------------------------------
\r
825 Draws an arbitary-angled line from any two sets of coordinates in the
\r
828 See also: HLine(), VLine()
\r
831 Line(0,0, screenx-1,screeny-1, 128);
\r
833 -----------------------------
\r
834 int LoadFont(string filename)
\r
835 -----------------------------
\r
836 Loads the specified font file and returns the font slot which is used by
\r
839 See also: GotoXY(), PrintString()
\r
842 my_font = LoadFont("MYFONT.FNT");
\r
844 ----------------------------
\r
845 int LoadRaw(string filename)
\r
846 ----------------------------
\r
847 Loads the specied file as raw data into an allocated buffer and returns
\r
848 a pointer to that buffer.
\r
851 raw = LoadRaw("SPEECH.SPC");
\r
852 // ** use raw here **
\r
855 ------------------------------
\r
856 int LoadImage(string filename)
\r
857 ------------------------------
\r
858 Loads the specified image, allocating enough memory for it, and returns
\r
859 a pointer to the image. If you no longer need the image, you should
\r
860 free() it. The image can be any of the supported V2 image types, which
\r
861 are currently PCX, BMP, and GIF.
\r
864 im = LoadImage("CHEESE.GIF");
\r
865 // ** use im here **
\r
868 ---------------------
\r
869 void Log(string text)
\r
870 ---------------------
\r
871 Outputs a message to VERGE.LOG, assuming verge.log is enabled by the user.
\r
872 This can be useful for debugging.
\r
877 ----------------------
\r
878 int malloc(int amount)
\r
879 ----------------------
\r
880 Allocates the given amount of memory and returns a pointer to the memory
\r
884 buffer = malloc(100);
\r
887 ------------------------
\r
888 void Map(string mapname)
\r
889 ------------------------
\r
890 Loads the specified MAP file as the current map. Upon encountering this
\r
891 command, VC execution is immediately terminated completely and resumed at
\r
892 the new map's Autoexec event.
\r
897 ------------------------------------------
\r
898 void Message(string message, int duration)
\r
899 ------------------------------------------
\r
900 Issues the specified system message, lasting the given duration in hundreths
\r
901 of a second. This message is displayed in the upper left corner of the screen
\r
902 for the given duration, and noted in the verge.log file.
\r
905 Message("VERGE 2", 200);
\r
907 -------------------------------------------------------------------------
\r
908 void Mosaic(int xfocus, int yfocus, int tablepointer, int x1, y1, x2, y2)
\r
909 -------------------------------------------------------------------------
\r
910 "Mosaics" the screen so far; The best way to describe it is as the mode7
\r
911 effect used in FF2 and such to make the screen "blur out" during screen
\r
912 transitions. xfocus and yfocus control the "granularity" of this blurring,
\r
913 tablepointer must be the value returned by InitMosaicTable or a pointer
\r
914 to a precomputed table loaded in memory. The x1,y1,x2,y2 values specify
\r
915 the section of the screen to apply the mosaic effect to.
\r
917 So, to apply the mosaic effect with a 3-to-1 pixel ratio to the whole screen,
\r
918 you'd use Mosaic(3, 3, MyMosaicTable, 0, 0, ScreenX, ScreenY);
\r
920 See also: InitMosaicTable()
\r
923 table = InitMosaicTable();
\r
924 Mosaic(4,4, table, 0,0, screenx-1, screeny-1);
\r
926 -------------------------------------------------------------
\r
927 void PaletteMorph(int r, int g, int b, int mix, int lighting)
\r
928 -------------------------------------------------------------
\r
929 This command alters the entire game palette, which will effect the entire
\r
930 screen. It changes the 'tint' of the screen; the RGB values are the color
\r
931 you want to tint the screen with, and range from 0 to 63. So, 63,0,0 would
\r
932 be red, 0,63,0 is green, and 0,0,63 is blue. 0,0,0 is black and 63,63,63
\r
933 is white. The mix value controls how 'thickly' the screen is tinted
\r
934 with this color. 0 would mean no mix whatsoever, while 100 would change
\r
935 the screen to be the color you specified solidly. The lighting value simply
\r
936 controls how light or dark the screen will be as a whole; 63 is normal
\r
937 brightness, 0 is black.
\r
940 PaletteMorph(0,0,0,0, 63);
\r
942 ---------------------------------
\r
943 void PartyMove(string movescript)
\r
944 ---------------------------------
\r
945 This command will have the party follow the specified movement script; player
\r
946 control will resume after the script is completed.
\r
949 PartyMove("U1R1D1L1");
\r
951 -----------------------------
\r
952 void PlayFLI(string filename)
\r
953 -----------------------------
\r
954 Plays the specified FLI or FLC file. Does not loop. The timing in the V2
\r
955 playback may be slightly off, but it should be so slight as to be completely
\r
956 unnoticable in the vast majority of cases. Also, it would be a good idea to
\r
957 set the video mode beforehand to something appropriate to fit the resolution of
\r
960 SeeAlso: SetResolution()
\r
963 PlayFLI("INTRO.FLC");
\r
965 -------------------------------
\r
966 void PlayMusic(string filename)
\r
967 -------------------------------
\r
968 Plays the specified music file. In this version of V2, only MODs, MTMs, S3Ms,
\r
969 and XMs are supported.
\r
971 See also: StopMusic();
\r
974 PlayMusic("AURORA.MOD");
\r
976 --------------------------------------------------
\r
977 void PlaySound(int soundslot, int volume, int pan)
\r
978 --------------------------------------------------
\r
979 Plays the specified sound effect at the given slot index; volume is a value
\r
980 from 0 to 64 indicating the volume the sound file will be played at, and pan
\r
981 is a value from 0 to 255; 0 is all the way left, and 255 is all the way right,
\r
982 128 is in the center.
\r
984 See also: CacheSound(), FreeAllSounds()
\r
987 shriek = CacheSound("SHRIEK.WAV");
\r
988 PlaySound(shriek, 64, 128);
\r
990 --------------------------
\r
991 int pow(int base, int exp)
\r
992 --------------------------
\r
993 Raises base to the exp power and returns that value.
\r
996 result = pow(16, 3); // 4096
\r
998 ----------------------
\r
999 void ProcessEntities()
\r
1000 ----------------------
\r
1001 Processes one tick worth of entity movement. If you call this 100 times a
\r
1002 second it will keep the game moving as normal. For example, the following code
\r
1003 could be used to draw something on top of the normal map view:
\r
1011 ProcessEntities();
\r
1014 // Put additional things to be drawn per frame here
\r
1018 ---------------------------------------
\r
1019 void PrintString(int font, string text)
\r
1020 ---------------------------------------
\r
1021 Displays the given string in the specified font index, at the location
\r
1022 last given by GotoXY.
\r
1024 See also: LoadFont(), GotoXY()
\r
1027 PrintString(0, "VERGE 2");
\r
1029 ---------------------
\r
1030 int Random(int range)
\r
1031 ---------------------
\r
1032 Returns a random number between 0 and the range given.
\r
1035 if (Random(100) < 50)
\r
1036 PrintString(0, "Heads!");
\r
1037 else PrintString(0, "Tails!");
\r
1042 Updates the mouse status variables mx, my, and mb.
\r
1044 See also: SetMousePos()
\r
1049 ------------------------------
\r
1050 void ReadVars(int filepointer)
\r
1051 ------------------------------
\r
1052 Reads all the global variables that have been written to a file by WriteVars().
\r
1053 You're responsible for opening and closing the file for reading, mainly used
\r
1056 See also: WriteVars(), fopen(), fclose()
\r
1059 file = fopen("SAVE.DAT");
\r
1063 ----------------------------------------------
\r
1064 void Rect(int x, int y, int x2, int y2, int c)
\r
1065 ----------------------------------------------
\r
1066 Draws an outlined rectangle of the given coordinate set in the specified
\r
1069 See also: RectFill()
\r
1072 Rect(0, 0, screenx-1, screeny-1, 128);
\r
1074 --------------------------------------------------
\r
1075 void RectFill(int x, int y, int x2, int y2, int c)
\r
1076 --------------------------------------------------
\r
1077 Draws a filled rectangle of the given coordinate set in the specified
\r
1083 RectFill(0, 0, screenx-1, screeny-1, 128);
\r
1088 Performs a render, per the render string, but does not copy the screen
\r
1089 buffer to the visible screen, allowing you to draw additional items on top
\r
1090 of the game screen.
\r
1092 See also: ShowPage()
\r
1097 ----------------------------
\r
1098 void RestoreRenderSettings()
\r
1099 ----------------------------
\r
1100 Restores the default clipping window for the given video mode, and restores
\r
1101 the render destination to the video buffer.
\r
1103 See also: SetClipRect(), SetRenderDest()
\r
1106 RestoreRenderSettings();
\r
1108 ----------------------------------------------------------------------------
\r
1109 void ScaleSprite(int x, int y, int iw, int ih, int dw, int dh, int imageptr)
\r
1110 ----------------------------------------------------------------------------
\r
1111 Draws a scaled image. A bit more complex than the other blitters to use.
\r
1112 The x,y values give the upper-left corner of where the blit will start.
\r
1113 iw,ih are the width and height of the *source* image. dw, dh are the width
\r
1114 and height that the image should appear on screen. (ie, the end result
\r
1115 bounding box of the image would be, x, y, x+dw, y+dh) Imageptr is, as with
\r
1116 the other blit routines, a pointer to the image graphic.
\r
1118 See also: TScaleSprite()
\r
1121 im = LoadImage("VECNA.PCX");
\r
1122 ScaleSprite(0,0, image_width,image_height, image_width*2,image_height*2, im);
\r
1125 ----------------------
\r
1126 void SetClip(int clip)
\r
1127 ----------------------
\r
1128 Determines whether clipping versions of general VC graphics routines are
\r
1129 used. Defaults to 1; You will never need to turn this off, turn it offers
\r
1130 no functional difference, except faster blitting routines, however, great care
\r
1131 must be used when turning it off that no part of any blit or graphics call
\r
1132 draws off screen boundaries.
\r
1137 ------------------------------------------------
\r
1138 void SetClipRect(int x1, int y1, int x2, int y2)
\r
1139 ------------------------------------------------
\r
1140 Sets the rectangle that image drawing will be clipped to.
\r
1142 See also: RestoreRenderSettings()
\r
1145 im = LoadImage("PATTERN.PCX");
\r
1146 SetClipRect(screenx/4, screeny/4, screenx-(screenx/4), screeny-(screeny/4));
\r
1147 WrapBlit(0, 0, image_width, image_height, im);
\r
1148 RestoreRenderSettings();
\r
1151 -----------------------------------------------------
\r
1152 void SetRenderDest(int width, int height, int buffer)
\r
1153 -----------------------------------------------------
\r
1154 This sets the video buffer that all VC video functions will draw into.
\r
1156 See also: RestoreRenderSettings()
\r
1159 buffer = malloc(32 * 32);
\r
1160 SetRenderDest(32, 32, buffer);
\r
1161 Line(0,0, 15,15, 128);
\r
1162 Line(0,15, 15,0, 128);
\r
1163 Rect(0,0, 15,15, 128);
\r
1164 RestoreRenderSettings();
\r
1165 CopySprite(0, 0, 32, 32, buffer);
\r
1168 --------------------------
\r
1169 void SetLucent(int lucent)
\r
1170 --------------------------
\r
1171 Determines whether translucent versions of general VC graphics routines are
\r
1172 used. Defaults to 0.
\r
1177 ------------------------------
\r
1178 void SetMousePos(int x, int y)
\r
1179 ------------------------------
\r
1180 Sets the current mouse position to the given x and y coordinates. Does no
\r
1181 checking to make sure the coordinates are valid, so check that yourself, they
\r
1182 should between 0 and screenx and 0 and screeny, respectively.
\r
1184 See also: ReadMouse()
\r
1187 SetMousePos(screenx/2, screeny/2);
\r
1189 ----------------------------------
\r
1190 void SetPixel(int x, int y, int c)
\r
1191 ----------------------------------
\r
1192 Sets the specified pixel coordinate to the given color.
\r
1194 See also: GetPixel();
\r
1197 SetPixel(screenx/2, screeny/2, 128);
\r
1199 -------------------------------
\r
1200 void SetPlayer(int entityindex)
\r
1201 -------------------------------
\r
1202 Sets the specified entity index as the active player.
\r
1204 See also: EntitySpawn()
\r
1207 ent = EntitySpawn(0, 1, "VECNA.CHR");
\r
1210 -------------------------------------
\r
1211 int SetResolution(int xres, int yres)
\r
1212 -------------------------------------
\r
1213 Sets the video mode to the specified resolution. Returns 1 if successful, 0
\r
1214 if the mode set failed.
\r
1216 Common video modes:
\r
1217 -------------------
\r
1228 SetResolution(320, 240);
\r
1230 -------------------------------
\r
1231 void SetRString(string rstring)
\r
1232 -------------------------------
\r
1233 Updates the RenderString to the specified string.
\r
1236 SetRString("1E2");
\r
1238 ------------------------------------------------
\r
1239 void SetTile(int x, int y, int layer, int value)
\r
1240 ------------------------------------------------
\r
1241 Sets a new value to the given map layer at the given coordinates. For
\r
1242 layer, 0 through 5 are the first 6 possible map layers, a value of 6
\r
1243 will always denote the obstruction field, and 7 denotes zone information.
\r
1245 See also: GetTile()
\r
1248 SetTile(0, 0, 0, 2);
\r
1253 Copys the screen buffer to the visible screen.
\r
1255 See also: Render(), CopySprite(), TCopySprite()
\r
1260 --------------------------------------------------------------------------
\r
1261 void Silhouette(int x, int y, int width, int height, int color, int image)
\r
1262 --------------------------------------------------------------------------
\r
1263 Renders a silhouette of the specified image. The silhouette is generated
\r
1264 by looking for all non-zero pixels in the image and replacing them with
\r
1265 the specified color.
\r
1268 im = LoadImage("GOAT.PCX");
\r
1269 Silhouette(0, 0, image_width, image_height, 128, im);
\r
1272 -------------------
\r
1273 int sin(int degree)
\r
1274 -------------------
\r
1275 Returns the sine of the given degree of measure (0-360) in 16.16 fixed
\r
1278 See also: cos(), tan()
\r
1281 result = sin(180);
\r
1286 Stops currently playing music.
\r
1288 See also: PlayMusic()
\r
1293 ------------------------------------
\r
1294 int strcmp(string str1, string str2)
\r
1295 ------------------------------------
\r
1296 Compares the two passed strings. Returns 0 if they're identical, or
\r
1297 a nonzero number porportional to the difference between the strings.
\r
1300 string_a = "alpha";
\r
1301 string_b = "zeta";
\r
1302 result = strcmp(string_a, string_b);
\r
1304 PrintString(0, "Strings are equal");
\r
1305 else if (result < 0)
\r
1306 PrintString(0, string_a+" comes before "+string_b);
\r
1308 PrintString(0, string_b+" comes before "+string_a);
\r
1310 ----------------------
\r
1311 int strlen(string str)
\r
1312 ----------------------
\r
1313 Returns the length of the passed string.
\r
1316 my_string = "VERGE 2";
\r
1317 length = strlen(my_string);
\r
1319 -------------------
\r
1320 int tan(int degree)
\r
1321 -------------------
\r
1322 Returns the tangent of the given degree of measure (0-360) in 16.16 fixed
\r
1325 See also: sin(), cos()
\r
1328 result = tan(270);
\r
1330 ----------------------------------------------------------------
\r
1331 void TCopySprite(int x, int y, int width, int height, int image)
\r
1332 ----------------------------------------------------------------
\r
1333 Blits the image pointed to by image with the given dimensions at the
\r
1334 given location on screen. Transparency and clipping are performed.
\r
1336 See also: CopySprite
\r
1339 im = LoadImage("SLIME.PCX");
\r
1340 TCopySprite(0, 0, image_width, image_height, im);
\r
1343 -----------------------------------------------------------------------------
\r
1344 void TScaleSprite(int x, int y, int iw, int ih, int dw, int dh, int imageptr)
\r
1345 -----------------------------------------------------------------------------
\r
1346 Draws a scaled image. A bit more complex than the other blitters to use.
\r
1347 The x,y values give the upper-left corner of where the blit will start.
\r
1348 iw,ih are the width and height of the *source* image. dw, dh are the width
\r
1349 and height that the image should appear on screen. (ie, the end result
\r
1350 bounding box of the image would be, x, y, x+dw, y+dh) Imageptr is, as with
\r
1351 the other blit routines, a pointer to the image graphic. This routines draws
\r
1352 the image with transparency, unlike ScaleSprite().
\r
1354 See also: ScaleSprite()
\r
1357 im = LoadImage("SLIME.PCX");
\r
1358 TScaleSprite(0,0, image_width,image_height, image_width*2,image_height*2, im);
\r
1361 --------------------------------------------------------------------
\r
1362 void TWrapBlit(int xofs, int yofs, int width, int height, int image)
\r
1363 --------------------------------------------------------------------
\r
1364 Blits an image of any size repeatedly so that it fills the entire screen;
\r
1365 This version is color-0 transparent unlike the normal WrapBlit version.
\r
1367 See also: WrapBlit();
\r
1370 im = LoadImage("PATTERN.PCX");
\r
1371 TWrapBlit(0, 0, image_width, image_height, im);
\r
1374 -------------------------
\r
1375 void UnPress(int control)
\r
1376 -------------------------
\r
1377 This will read a control currently being pressed as not pressed until it
\r
1378 is released and then pressed again. The values of control are:
\r
1379 0: All buttons, not directionals
\r
1388 ---------------------
\r
1389 void UpdateControls()
\r
1390 ---------------------
\r
1391 Updates the control variables up, down, left, right, b1, b2, b3, and b4.
\r
1396 -------------------------------------------
\r
1397 void VLine(int x, int y, int y2, int color)
\r
1398 -------------------------------------------
\r
1399 Draws a vertical line from the specified coordinates in the given color.
\r
1401 See also: HLine(), Line()
\r
1404 VLine(screenx/2, 0, screeny-1, 128);
\r
1406 -------------------------------------------------------------------
\r
1407 void WrapBlit(int xofs, int yofs, int width, int height, int image)
\r
1408 -------------------------------------------------------------------
\r
1409 Blits an image of any size repeatedly so that it fills the entire screen;
\r
1411 See also: TWrapBlit();
\r
1414 im = LoadImage("PATTERN.PCX");
\r
1415 WrapBlit(0, 0, image_width, image_height, im);
\r
1418 -------------------------------
\r
1419 void WriteVars(int filepointer)
\r
1420 -------------------------------
\r
1421 Writes all global variables (ints and strings) to the specified file. You
\r
1422 must take care of opening and closing the file for writing. Mostly used
\r
1425 See also: ReadVars(), fwopen(), fwclose()
\r
1428 file = fwopen("SAVE.DAT");
\r
1432 =============================================================================
\r
1434 III. Builtin Variables
\r
1438 These represent four primary control buttons. They are updated by the
\r
1439 UpdateControls() function. [read-only]
\r
1443 if (b1) Message("Button 1!", 100);
\r
1444 if (b2) Message("Button 2!", 100);
\r
1445 if (b3) Message("Button 3!", 100);
\r
1446 if (b4) Message("Button 4!", 100);
\r
1448 cameratracking, tracker
\r
1449 -----------------------
\r
1450 If cameratracking is 0, the camera is free to be altered by the xwin/ywin
\r
1451 variables. If cameratracking is 1, the camera will always follow the player.
\r
1452 If cameratracking is 2, the camera will always follow the entity specified in
\r
1453 tracker. [read/write]
\r
1456 ent = EntitySpawn(0, 1, "VECNA.CHR");
\r
1457 cameratracking = 2;
\r
1459 EntityMove("R2D2L2U2");
\r
1461 entity.x, entity.y
\r
1462 ------------------
\r
1463 x/y coordinates of the specified entity in world-coordinates (pixel-accurate).
\r
1467 Log("Player X="+str(entity.x[player])+", Y="+str(entity.y[player]));
\r
1469 entity.tx, entity.ty
\r
1470 --------------------
\r
1471 x/y coordinates of the specified entity in tile coordinate. [read/write]
\r
1474 Log("Player TX="+str(entity.tx[player])+", TY="+str(entity.ty[player]));
\r
1476 entity.facing, entity.moving, entity.specframe, entity.speed, entity.movecode
\r
1477 -----------------------------------------------------------------------------
\r
1478 Various variables effecting the specified stats of the given entity.
\r
1482 Log("Player info");
\r
1483 Log(" Facing: "+str(entity.facing[player]));
\r
1484 Log(" Moving: "+str(entity.moving[player]));
\r
1485 Log("SpecFrame: "+str(entity.specframe[player]));
\r
1486 Log(" Speed: "+str(entity.speed[player]));
\r
1487 Log(" MoveCode: "+str(entity.movecode[player]));
\r
1491 Array of entity indexes which are currently onscreen.
\r
1494 // log all tile coordinates of entities onscreen
\r
1495 for (i=0; i<numentsonscreen; i++)
\r
1496 Log("X="+str(entity.tx[entsonscreen[i]])+", Y="+str(entity.ty[entsonscreen[i]]));
\r
1500 Returns or set the on/off flag of the specified key scancode.
\r
1504 Message("ESC is pressed", 200);
\r
1505 else Message("ESC is not pressed", 200);
\r
1509 The last entity that called a VC event, either via movement script or
\r
1513 Message("Last entity: "+str(lastent), 200);
\r
1515 Note: Untested currently.
\r
1519 mx and my are the x and y coordinates of the mouse pointer. mb returns the
\r
1520 mouse button status.
\r
1523 Message("Mouse info: X="+str(mx)+", Y="+str(my)+", B="+str(mb), 200);
\r
1527 Number of entities currently on screen, number of values in entsonscreen array
\r
1531 Message("Number of entities onscreen: "+str(numentsonscreen), 200);
\r
1535 Active palette array (256 RGB entries; 768 bytes). Changes made will only
\r
1536 be enforced when PaletteMorph() is next called.
\r
1539 // greyscale the active palette
\r
1540 for (i=0; i<256; i++)
\r
1545 average=(r+g+b)/3;
\r
1546 pal[i*3+0]=average;
\r
1547 pal[i*3+1]=average;
\r
1548 pal[i*3+2]=average;
\r
1550 PaletteMorph(0,0,0,0, 63);
\r
1554 Returns which entity index number is currently the active player. [read-only]
\r
1557 ent = EntitySpawn(0, 1, "VECNA.CHR");
\r
1559 Message("Active entity index is #"+str(player));
\r
1563 Single-dimensional array access to the video virtual buffer. [read/write]
\r
1566 SetResolution(320, 240);
\r
1567 screen[(120*320)+160]=128;
\r
1571 Return the x and y dimensions of the current video mode. [read-only]
\r
1574 Message("Current resolution is "+str(screenx)+"x"+str(screeny));
\r
1578 This variable is incremented 100 times per second. It can be used to for
\r
1579 timing purposes. [read/write]
\r
1585 ProcessEntities();
\r
1588 up, down, left, right
\r
1589 ---------------------
\r
1590 These represent the four directional controls. Also updated by
\r
1591 UpdateControls(). [read-only]
\r
1595 if (up) Message("UP!", 100);
\r
1596 if (down) Message("DOWN!", 100);
\r
1597 if (left) Message("LEFT!", 100);
\r
1598 if (right) Message("RIGHT!", 100);
\r
1602 This is a 0/1, off/on variable that defaults to 0; when it is turned on,
\r
1603 VERGE.LOG will contain dumps tracing the code flow of system.vc function
\r
1604 calls. However, this log can get very big very quickly, so it's recommended
\r
1605 that you turn it on to track and debug a particular section of code and then
\r
1606 turn it off afterwards.
\r
1613 Array of tile image data. Sequential ordering of 256 byte (16*16) blocks.
\r
1616 TCopySprite(screenx/2,screeny/2, 16,16, vsp+(slot*256));
\r
1620 These control the camera, if cameratracking is 0. Otherwise, the camera will
\r
1621 follow the player. [read/write]
\r