View Full Version : No Waypoints Save
This game and its bot it's indeed wonderful. The only problem I encounter since now is that I'm not able to save my waypoints automatically generated: when I do wpsave from the console the game just quits. And even if I'm using the autpwp 1 option I see no waypoint file in my Cube directory.
Some help? Thanks in advance
Yep, I forgot in the archived file to create a folder called 'waypoints' in the bot folder. Just create it and it should work.
@$3.1415rin
24-01-2005, 18:53
boo, once again a demonstration what can happen when you forget to check one single pointer :P
just joking
boo, once again a demonstration what can happen when you forget to check one single pointer :P
just joking
Hehe yeah, forgot to check the file pointer in the code.... O well :|
Pierre-Marie Baty
24-01-2005, 20:23
I had some code, there, hold on where is it...
ah here
// make output directory
length = strlen (output_file);
for (index = 0; index < length; index++)
if ((output_file[index] == '/') || (output_file[index] == '\\'))
{
strncpy (dirname, output_file, index);
dirname[index] = 0;
POSIX_mkdir (dirname, 666); // build each subdirectory recursively if needed
}
output_file is a full pathname
dirname must be a writable string
POSIX_mkdir is #defined like this:
#ifdef WIN32
#define POSIX_mkdir(a,b) _mkdir(a)
#else
#define POSIX_mkdir(a,b) mkdir(a,b)
#endif
That code will parse the path and call mkdir on each subdirectory recursively. If the directory already exists, it will leave it as is and mkdir will return ; if it doesn't exist, it will be created. This ensures you always have a correct path.
I had some code, there, hold on where is it...
ah here
// make output directory
length = strlen (output_file);
for (index = 0; index < length; index++)
if ((output_file[index] == '/') || (output_file[index] == '\\'))
{
strncpy (dirname, output_file, index);
dirname[index] = 0;
POSIX_mkdir (dirname, 666); // build each subdirectory recursively if needed
}
output_file is a full pathname
dirname must be a writable string
POSIX_mkdir is #defined like this:
#ifdef WIN32
#define POSIX_mkdir(a,b) _mkdir(a)
#else
#define POSIX_mkdir(a,b) mkdir(a,b)
#endif
That code will parse the path and call mkdir on each subdirectory recursively. If the directory already exists, it will leave it as is and mkdir will return ; if it doesn't exist, it will be created. This ensures you always have a correct path.
Nice one :)
Meh I keep including pieces of code made by you :P
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.