![]() |
Show all 14 posts from this thread on one page |
VWBB (https://volitionwatch.game-warden.com/vwbb/index.php)
- The Babylon Project (https://volitionwatch.game-warden.com/vwbb/forumdisplay.php?forumid=16)
-- to bobboau (https://volitionwatch.game-warden.com/vwbb/showthread.php?threadid=7567)
to bobboau
this is current full code of how i got it to support mods.
so that you can avoid the pilot problem.
it still works with VP files in the root. but pilot files are saved in the mod directory
so if you start fs2modname.exe -tbp
Then pilot files will be saved in freespace2/tbp/data/pilots/single/
instead of the default directories, but you have the create the directories first, or you will get an error.
btw all files searched for and put in the mod dir e.g. fs2/tbp/data/
/effects
/maps
/models
/missions
and so on, will be used.
but here are the code starting with the commandline switch
in cmdline/cmdline.h add
code
-----
extern char *Cmdline_mod;
/end code
in cmdline/cmdline.cpp add
- code
char *Cmdline_mod = NULL;
cmdline_parm mod_arg("-mod", NULL);
/code
go to around line 610 in cmdline/cmdline.cpp and add
code
----
if(mod_arg.found()){
Cmdline_mod = mod_arg.str();
Hold_mod = "";
}
/code
That was the commandline switch
Now in cfile/cfile.h add the following, where it should be, you will know where when you see it, it is in the start of the file
code
-----
#define CF_TYPE_MOD_ROOT 36
#define CF_TYPE_MOD_DATA 37
#define CF_TYPE_MOD_MAPS 38
#define CF_TYPE_MOD_TEXT 39
#define CF_TYPE_MOD_MISSIONS 40
#define CF_TYPE_MOD_MODELS 41
#define CF_TYPE_MOD_TABLES 42
#define CF_TYPE_MOD_SOUNDS 43
#define CF_TYPE_MOD_SOUNDS_8B22K 44
#define CF_TYPE_MOD_SOUNDS_16B11K 45
#define CF_TYPE_MOD_VOICE 46
#define CF_TYPE_MOD_VOICE_BRIEFINGS 47
#define CF_TYPE_MOD_VOICE_CMD_BRIEF 48
#define CF_TYPE_MOD_VOICE_DEBREIFINGS 49
#define CF_TYPE_MOD_VOICE_PERSONAS 50
#define CF_TYPE_MOD_VOICE_SPECIAL 51
#define CF_TYPE_MOD_VOICE_TRAINING 52
#define CF_TYPE_MOD_MUSIC 53
#define CF_TYPE_MOD_MOVIES 54
#define CF_TYPE_MOD_INTERFACE 55
#define CF_TYPE_MOD_FONT 56
#define CF_TYPE_MOD_EFFECTS 57
#define CF_TYPE_MOD_HUD 58
#define CF_TYPE_MOD_PLAYER_MAIN 59
#define CF_TYPE_MOD_PLAYER_IMAGES_MAIN 60
#define CF_TYPE_MOD_CACHE 61
#define CF_TYPE_MOD_PLAYERS 62
#define CF_TYPE_MOD_SINGLE_PLAYERS 63
#define CF_TYPE_MOD_MULTI_PLAYERS 64
#define CF_TYPE_MOD_MULTI_CACHE 65
#define CF_TYPE_MOD_CONFIG 66
#define CF_TYPE_MOD_SQUAD_IMAGES_MAIN 67
#define CF_TYPE_MOD_DEMOS 68
#define CF_TYPE_MOD_CBANIMS 69
#define CF_TYPE_MOD_INTEL_ANIMS 70
#define CF_MAX_PATH_TYPES 71
/code
remember to alter CF_MAX_PATH_TYPES to 71
now in cfile/cfile.cpp add where it should be. but make sure it is below what is already there and is identical to everything, but the _MOD_
code
----
{ CF_TYPE_MOD_ROOT, "", ".mve", CF_TYPE_ROOT },
{ CF_TYPE_MOD_DATA, "Data", ".cfg .log .txt", CF_TYPE_ROOT },
{ CF_TYPE_MOD_MAPS, "Data\\Maps", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_MOD_TEXT, "Data\\Text", ".txt .net", CF_TYPE_DATA },
{ CF_TYPE_MOD_MISSIONS, "Data\\Missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
{ CF_TYPE_MOD_MODELS, "Data\\Models", ".pof", CF_TYPE_DATA },
{ CF_TYPE_MOD_TABLES, "Data\\Tables", ".tbl", CF_TYPE_DATA },
{ CF_TYPE_MOD_SOUNDS, "Data\\Sounds", ".wav", CF_TYPE_DATA },
{ CF_TYPE_MOD_SOUNDS_8B22K, "Data\\Sounds\\8b22k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_MOD_SOUNDS_16B11K, "Data\\Sounds\\16b11k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_MOD_VOICE, "Data\\Voice", "", CF_TYPE_DATA },
{ CF_TYPE_MOD_VOICE_BRIEFINGS, "Data\\Voice\\Briefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_CMD_BRIEF, "Data\\Voice\\Command_briefings",".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_DEBREIFINGS, "Data\\Voice\\Debriefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_PERSONAS, "Data\\Voice\\Personas", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_SPECIAL, "Data\\Voice\\Special", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_TRAINING, "Data\\Voice\\Training", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_MUSIC, "Data\\Music", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_MOVIES, "Data\\Movies", ".mve .msb", CF_TYPE_DATA },
{ CF_TYPE_MOD_INTERFACE, "Data\\Interface", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_MOD_FONT, "Data\\Fonts", ".vf", CF_TYPE_DATA },
{ CF_TYPE_MOD_EFFECTS, "Data\\Effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
{ CF_TYPE_MOD_HUD, "Data\\Hud", ".ani .pcx .tga", CF_TYPE_DATA },
{ CF_TYPE_MOD_PLAYER_MAIN, "Data\\Players", "", CF_TYPE_DATA },
{ CF_TYPE_MOD_PLAYER_IMAGES_MAIN, "Data\\Players\\Images", ".pcx", CF_TYPE_PLAYER_MAIN },
{ CF_TYPE_MOD_CACHE, "Data\\Cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_MOD_PLAYERS, "Data\\Players", ".hcf", CF_TYPE_DATA },
{ CF_TYPE_MOD_SINGLE_PLAYERS, "Data\\Players\\Single", ".plr .csg .css", CF_TYPE_PLAYERS },
{ CF_TYPE_MOD_MULTI_PLAYERS, "Data\\Players\\Multi", ".plr", CF_TYPE_DATA },
{ CF_TYPE_MOD_MULTI_CACHE, "Data\\MultiData", ".pcx .fs2", CF_TYPE_DATA },
{ CF_TYPE_MOD_CONFIG, "Data\\Config", ".cfg", CF_TYPE_DATA },
{ CF_TYPE_MOD_SQUAD_IMAGES_MAIN, "Data\\Players\\Squads", ".pcx", CF_TYPE_DATA },
{ CF_TYPE_MOD_DEMOS, "Data\\Demos", ".fsd", CF_TYPE_DATA },
{ CF_TYPE_MOD_CBANIMS, "Data\\CBAnims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_MOD_INTEL_ANIMS, "Data\\IntelAnims", ".ani", CF_TYPE_DATA },
/code
Now in cfile/cfile.cpp locate this function; int cfile_init(char *exe_dir, char *cdrom_dir), it should be around line 334.
and make the start of the function look like this
code
----
int cfile_init(char *exe_dir, char *cdrom_dir)
{
if(Cmdline_mod) {
char modname[256];
Cmdline_mod = cf_add_modname(Cmdline_mod, "\\");
strcpy(modname,Cmdline_mod);
char pathname[256];
int i;
for(i=2;i<37;i++) {
strcpy(pathname,Pathtypes[i].path);
strcpy(Pathtypes[i].path,cf_add_modname(Cmdline_mod,Pathtypes[i].path));
Cmdline_mod = modname;
}
now add this new function in cfile.cpp.
code
----
char *cf_add_modname(char *filename, char *ext)
{
int flen, elen;
static char path[MAX_PATH_LEN];
flen = strlen(filename);
elen = strlen(ext);
Assert(flen < MAX_PATH_LEN);
strcpy(path, filename);
if ((flen < MAX_PATH_LEN) || stricmp(path + flen - elen, ext)) {
Assert(flen + elen < MAX_PATH_LEN);
strcat(path, ext);
}
/code
edit: i forgot to mention that the mission files including campaign file .fc2 files has to be in tbp/data/missions/
edit;working on getting .VP files that are in the mod directory to be read. for now only plain files in the mod directory works. but it will still be a releif for modders, not to have to copy tbl files in and out of directory
You are welcome to ask me anything regarding this at DTP@mail.tele.dk since i take it that VBB email notification still dont work
__________________
Think Big
Invade Space
---------
Staff modeller on FS1 port
http://www.3dap.com/hlp/hosted/fsport/
to bobboau
this is current full code of how i got it to support mods.
so that you can avoid the pilot problem.
it still works with VP files in the root. but pilot files are saved in the mod directory
so if you start fs2modname.exe -tbp
Then pilot files will be saved in freespace2/tbp/data/pilots/single/
instead of the default directories, but you have the create the directories first, or you will get an error.
btw all files searched for and put in the mod dir e.g. fs2/tbp/data/
/effects
/maps
/models
/missions
and so on, will be used.
but here are the code starting with the commandline switch
in cmdline/cmdline.h add
code
-----
extern char *Cmdline_mod;
/end code
in cmdline/cmdline.cpp add
- code
char *Cmdline_mod = NULL;
cmdline_parm mod_arg("-mod", NULL);
/code
go to around line 610 in cmdline/cmdline.cpp and add
code
----
if(mod_arg.found()){
Cmdline_mod = mod_arg.str();
Hold_mod = "";
}
/code
That was the commandline switch
Now in cfile/cfile.h add the following, where it should be, you will know where when you see it, it is in the start of the file
code
-----
#define CF_TYPE_MOD_ROOT 36
#define CF_TYPE_MOD_DATA 37
#define CF_TYPE_MOD_MAPS 38
#define CF_TYPE_MOD_TEXT 39
#define CF_TYPE_MOD_MISSIONS 40
#define CF_TYPE_MOD_MODELS 41
#define CF_TYPE_MOD_TABLES 42
#define CF_TYPE_MOD_SOUNDS 43
#define CF_TYPE_MOD_SOUNDS_8B22K 44
#define CF_TYPE_MOD_SOUNDS_16B11K 45
#define CF_TYPE_MOD_VOICE 46
#define CF_TYPE_MOD_VOICE_BRIEFINGS 47
#define CF_TYPE_MOD_VOICE_CMD_BRIEF 48
#define CF_TYPE_MOD_VOICE_DEBREIFINGS 49
#define CF_TYPE_MOD_VOICE_PERSONAS 50
#define CF_TYPE_MOD_VOICE_SPECIAL 51
#define CF_TYPE_MOD_VOICE_TRAINING 52
#define CF_TYPE_MOD_MUSIC 53
#define CF_TYPE_MOD_MOVIES 54
#define CF_TYPE_MOD_INTERFACE 55
#define CF_TYPE_MOD_FONT 56
#define CF_TYPE_MOD_EFFECTS 57
#define CF_TYPE_MOD_HUD 58
#define CF_TYPE_MOD_PLAYER_MAIN 59
#define CF_TYPE_MOD_PLAYER_IMAGES_MAIN 60
#define CF_TYPE_MOD_CACHE 61
#define CF_TYPE_MOD_PLAYERS 62
#define CF_TYPE_MOD_SINGLE_PLAYERS 63
#define CF_TYPE_MOD_MULTI_PLAYERS 64
#define CF_TYPE_MOD_MULTI_CACHE 65
#define CF_TYPE_MOD_CONFIG 66
#define CF_TYPE_MOD_SQUAD_IMAGES_MAIN 67
#define CF_TYPE_MOD_DEMOS 68
#define CF_TYPE_MOD_CBANIMS 69
#define CF_TYPE_MOD_INTEL_ANIMS 70
#define CF_MAX_PATH_TYPES 71
/code
remember to alter CF_MAX_PATH_TYPES to 71
now in cfile/cfile.cpp add where it should be. but make sure it is below what is already there and is identical to everything, but the _MOD_
code
----
{ CF_TYPE_MOD_ROOT, "", ".mve", CF_TYPE_ROOT },
{ CF_TYPE_MOD_DATA, "Data", ".cfg .log .txt", CF_TYPE_ROOT },
{ CF_TYPE_MOD_MAPS, "Data\\Maps", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_MOD_TEXT, "Data\\Text", ".txt .net", CF_TYPE_DATA },
{ CF_TYPE_MOD_MISSIONS, "Data\\Missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
{ CF_TYPE_MOD_MODELS, "Data\\Models", ".pof", CF_TYPE_DATA },
{ CF_TYPE_MOD_TABLES, "Data\\Tables", ".tbl", CF_TYPE_DATA },
{ CF_TYPE_MOD_SOUNDS, "Data\\Sounds", ".wav", CF_TYPE_DATA },
{ CF_TYPE_MOD_SOUNDS_8B22K, "Data\\Sounds\\8b22k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_MOD_SOUNDS_16B11K, "Data\\Sounds\\16b11k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_MOD_VOICE, "Data\\Voice", "", CF_TYPE_DATA },
{ CF_TYPE_MOD_VOICE_BRIEFINGS, "Data\\Voice\\Briefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_CMD_BRIEF, "Data\\Voice\\Command_briefings",".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_DEBREIFINGS, "Data\\Voice\\Debriefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_PERSONAS, "Data\\Voice\\Personas", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_SPECIAL, "Data\\Voice\\Special", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_VOICE_TRAINING, "Data\\Voice\\Training", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_MUSIC, "Data\\Music", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOD_MOVIES, "Data\\Movies", ".mve .msb", CF_TYPE_DATA },
{ CF_TYPE_MOD_INTERFACE, "Data\\Interface", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_MOD_FONT, "Data\\Fonts", ".vf", CF_TYPE_DATA },
{ CF_TYPE_MOD_EFFECTS, "Data\\Effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
{ CF_TYPE_MOD_HUD, "Data\\Hud", ".ani .pcx .tga", CF_TYPE_DATA },
{ CF_TYPE_MOD_PLAYER_MAIN, "Data\\Players", "", CF_TYPE_DATA },
{ CF_TYPE_MOD_PLAYER_IMAGES_MAIN, "Data\\Players\\Images", ".pcx", CF_TYPE_PLAYER_MAIN },
{ CF_TYPE_MOD_CACHE, "Data\\Cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_MOD_PLAYERS, "Data\\Players", ".hcf", CF_TYPE_DATA },
{ CF_TYPE_MOD_SINGLE_PLAYERS, "Data\\Players\\Single", ".plr .csg .css", CF_TYPE_PLAYERS },
{ CF_TYPE_MOD_MULTI_PLAYERS, "Data\\Players\\Multi", ".plr", CF_TYPE_DATA },
{ CF_TYPE_MOD_MULTI_CACHE, "Data\\MultiData", ".pcx .fs2", CF_TYPE_DATA },
{ CF_TYPE_MOD_CONFIG, "Data\\Config", ".cfg", CF_TYPE_DATA },
{ CF_TYPE_MOD_SQUAD_IMAGES_MAIN, "Data\\Players\\Squads", ".pcx", CF_TYPE_DATA },
{ CF_TYPE_MOD_DEMOS, "Data\\Demos", ".fsd", CF_TYPE_DATA },
{ CF_TYPE_MOD_CBANIMS, "Data\\CBAnims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_MOD_INTEL_ANIMS, "Data\\IntelAnims", ".ani", CF_TYPE_DATA },
/code
Now in cfile/cfile.cpp locate this function; int cfile_init(char *exe_dir, char *cdrom_dir), it should be around line 334.
and make the start of the function look like this
code
----
int cfile_init(char *exe_dir, char *cdrom_dir)
{
if(Cmdline_mod) {
char modname[256];
Cmdline_mod = cf_add_modname(Cmdline_mod, "\\");
strcpy(modname,Cmdline_mod);
char pathname[256];
int i;
for(i=2;i<37;i++) {
strcpy(pathname,Pathtypes[i].path);
strcpy(Pathtypes[i].path,cf_add_modname(Cmdline_mod,Pathtypes[i].path));
Cmdline_mod = modname;
}
now add this new function in cfile.cpp.
code
----
char *cf_add_modname(char *filename, char *ext)
{
int flen, elen;
static char path[MAX_PATH_LEN];
flen = strlen(filename);
elen = strlen(ext);
Assert(flen < MAX_PATH_LEN);
strcpy(path, filename);
if ((flen < MAX_PATH_LEN) || stricmp(path + flen - elen, ext)) {
Assert(flen + elen < MAX_PATH_LEN);
strcat(path, ext);
}
/code
edit: i forgot to mention that the mission files including campaign file .fc2 files has to be in tbp/data/missions/
edit;working on getting .VP files that are in the mod directory to be read. for now only plain files in the mod directory works. but it will still be a releif for modders, not to have to copy tbl files in and out of directory
You are welcome to ask me anything regarding this at DTP@mail.tele.dk since i take it that VBB email notification still dont work
__________________
Think Big
Invade Space
---------
Staff modeller on FS1 port
http://www.3dap.com/hlp/hosted/fsport/
I've seen this, but I didn't want to include it yet becase
A) I was trying to get this to work with the exsisting mod with as little change as posable
B) It's you're work and I wouldn't want to use it in a non-offical SCP build (that I generaly imply as beeing entirely mine)
C) Didn't want to confuse anybody
although in future versions of the mod I'm sure this will be used, in fact I'm certan it will be, I'll include it in my stuff if people would rather have this set up like this
__________________
Bobboau, bringing you products that work ......... In theory
I've seen this, but I didn't want to include it yet becase
A) I was trying to get this to work with the exsisting mod with as little change as posable
B) It's you're work and I wouldn't want to use it in a non-offical SCP build (that I generaly imply as beeing entirely mine)
C) Didn't want to confuse anybody
although in future versions of the mod I'm sure this will be used, in fact I'm certan it will be, I'll include it in my stuff if people would rather have this set up like this
__________________
Bobboau, bringing you products that work ......... In theory
DTP, guess twice what I have already posted yesterday at out internal forum... 
__________________
[URL=http://freespace.volitionwatch.com/babylon/]The Babylon Project homepage[/URL] <> [URL=http://freespace.volitionwatch.com/babylon/faq.php]The Babylon Project FAQ[/URL] <> [URL=http://freespace.volitionwatch.com/fsscp/]Please support FreeSpace Source Code Project[/URL]
well the problem might be that TBP exe will be different than the other fs2 mods (due to diferent needed changes to source code) ..so bassicly we will need to have a different exe placed in fs2 dir with a diferent directory tree
__________________
eng Horatiu Popovici
we don't need a diferent EXE, if worse comes to worse an optional string could be placed at the top of the ships table, or something, that says "babylon project" and anything specific could be handeled by a global flag, actualy the comand line it'self (-mod babyalon) should be enough,
mod specific code changes, we probly won't be the only people to use them
__________________
Bobboau, bringing you products that work ......... In theory
we don't need a diferent EXE, if worse comes to worse an optional string could be placed at the top of the ships table, or something, that says "babylon project" and anything specific could be handeled by a global flag, actualy the comand line it'self (-mod babyalon) should be enough,
mod specific code changes, we probly won't be the only people to use them
__________________
Bobboau, bringing you products that work ......... In theory
yes that is also a option...but ..let say that we will change the warpin' effect or hyperjump mode...that is the ugly way to add conditionals in every needed file only for this mod..but it might suit all the community
__________________
eng Horatiu Popovici
yes that is also a option...but ..let say that we will change the warpin' effect or hyperjump mode...that is the ugly way to add conditionals in every needed file only for this mod..but it might suit all the community
__________________
eng Horatiu Popovici
I can't wait to see these animated textures Bobboau, what a great thing that's going to be for TBP.
I can't wait to see these animated textures Bobboau, what a great thing that's going to be for TBP.
Yes!!!!! We can finally have fully-functioning Vorlon cookies!!!!
But sreiously. This would be good as the Vorlon ships would be more life-like.
__________________
"If you go to Z'ha'dum you will die"
-Kosh
(natives of Z'ha'dum may ignore this)
For all the rest of you.... don't come here.
Yes!!!!! We can finally have fully-functioning Vorlon cookies!!!!
But sreiously. This would be good as the Vorlon ships would be more life-like.
__________________
"If you go to Z'ha'dum you will die"
-Kosh
(natives of Z'ha'dum may ignore this)
For all the rest of you.... don't come here.
| All times are EST. The time now is 09:12 AM. | Show all 14 posts from this thread on one page |
Powered by: vBulletin Version 2.2.6
Copyright © Jelsoft Enterprises Limited 2000, 2001.