Scripting Volume Control

    The default volume in FreeVector is 85% max volume. To set the volume through the menu script, this simple order is all that's required:

soundord[()
{
    FillDIKeyBuffer()
    if(ArrowUpKeyDown())
    {
        SetVolume(GetVolume() + 0.001);
    }

    if(ArrowDownKeyDown())
    {
        SetVolume(GetVolume() - 0.001);
    }
}]

    The above order is simple yet effective. It uses the up and down arrow keys to control the exisiting volume level. This can be added as an option to any game menu.

Copyright © 2008 Bookshock Publications.