General Utility Functions

For the General System Variables, go [here].
  • CallFunction() Executes a function by the name it's given.
  • CopyArray() Copies data from one global int/string array to another, if they're of compatible size and type.
  • Exit() Quits the VERGE Engine with the supplied message.
  • FlushKeyBuffer() Clears the key buffer for future GetKeyBuffer() calls.
  • FunctionExists() Determines the existance of a given function based on its name.
  • GetInt() Returns the value of a global non-array integer variable.
  • GetIntArray() Returns the value of a global, one-dimensional integer array index.
  • GetKeyBuffer() Returns a buffer of recent keys pressed in string form.
  • GetString() Returns the value of a global non-array string variable.
  • GetStringArray() Returns the value of a global, one-dimensional string array index.
  • GetUserSystemVcFunctionByIndex() Returns a user-defined system-scope vc function name by int index
  • GetUserSystemVcFunctionCount() Returns the number of system-vc scope functions the current compiled game has.
  • HookButton() Calls the specified function on every discrete press of the specified button
  • HookKey() Calls the specified function on every discrete press of the specified key
  • HookRetrace() Calls the specified function everytime an R is hit in the renderstring.
  • HookTimer() Calls the specified function once every timer tick.
  • ListBuiltinDefines() Returns a list of all of v3's builtin defines.
  • ListBuiltinFunctions() Returns a list of all of v3's builtin functions.
  • ListBuiltinVariables() Returns a list of all of v3's builtin variables.
  • Log() Write a line of text to your logfile. Essential for debugging.
  • MessageBox() Pops up a windows Messagebox.
  • Random() Returns a random integer between min and max, inclusive.
  • SetAppName() Set the window's application name for your program.
  • SetButtonJB() Sets an internal VERGE button to a joystick button.
  • SetButtonKey() Binds an internal VERGE button to a key
  • SetInt() Sets the value of a global non-array integer variable.
  • SetIntArray() Sets the value of an index in a global one-dimensional integer array.
  • SetKeyDelay() Sets a delay for repeating key presses with GetKeyBuffer()
  • SetRandSeed() Initializes the random number generator
  • SetResolution() Sets the screen's resolution.
  • SetString() Sets the value of an index in a global one-dimensional string array.
  • SetStringArray() Sets the value of an index of a string array
  • Unpress() Causes a button to show as released until it is pressed again
  • UpdateControls() Updates all keyboard, joystick, and verge system input variables.
  • Talkback

    Post a new comment?

    Talkback #1 written by Zip on 2004-06-12.

    void Wait(int wait_delay)
    
    // Does nothing for set time period
    // Pass: how long to wait for in 100ths of a second
    // Credit to Shadow64 for ShadowClock here
    {
    int wait_till = timer + wait_delay + 1; // Sets when the delay will run till
    wait_delay = timer; // Record current timer value (see below)
    while(timer < wait_till) // Untill time is reached
    {
    UpdateControls(); // Check inputs
    }
    timer = wait_delay; // Reset timer to what it started as (optional)
    }
    Use to stop everything for a set unit of time. Good for a quick delay, but will prevent all processing, screen display and inputs during that time: so not good if any of those things still need to be going on.

    Example: Include code above
    void autoexec()
    
    {
    int i; // To increase over time
    for(i = 0; i < 10; i++) // Adds one each time until 10 is reached
    {
    // Prints the current number in the buffer
    PrintString(10 * i, 10, screen, 0, "..."+str(i));
    ShowPage(); // Puts the buffer on the screen
    Wait(100); // Waits 1 second
    }
    exit("10 seconds passed");
    }

    Post a new comment?

    Ben McGraw's lovingly crafted this website from scratch for years.
    It's a lot prettier this go around because of Jon Wofford.
    Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.