file_seek
Places the read pointer to a certain position in the file.
var_nsave file_handle;
string test_str;
text test_txt
{
layer = 25;
pos_x = 300;
pos_y = 275;
font = _a4font;
string = test_str;
flags = visible;
}
starter seek_data()
{
sleep (2);
file_handle = file_open_read("test.txt"); // test.txt
contains lines with these numbers: 0 1 2 3 4 5 6 7 8 9
file_seek (file_handle, 4, 0); // skip the first 4 bytes from the
beginning of the file
file_str_read (file_handle, test_str); // test_str contains "2" (without
the quotes) now
while (key_space == 0) {wait (1);} // wait until "space" is
pressed
while (key_space == 1) {wait (1);} // wait until "space" is
released
file_seek (file_handle, 8, 1); // skip 8 bytes from the current
position ("2")
file_str_read (file_handle, test_str); // test_str contains "6" (without
the quotes) now
file_close(file_handle);
}
add_buffer
Adds a buffer to the engine file system. If the engine attempts to open a buffered file it will read the data from the buffer instead of loading the file from the hard disk again.
patch
Some drivers display a wrong animation frame when several models with the same mesh, but different animations are visible at the same time. Set patch to 1 or update your nVidia video drivers to get rid of the problem.