Author Topic: MOD support´, real mod support  (Read 6851 times)

0 Members and 2 Guests are viewing this topic.

Offline DTP

  • ImPortant Coder
  • 28
    • http://www.c4-group.dk
MOD support´, real mod support
it seems i just managed to get real mod support into the fs2source,

preliminary tests show it to work well and so far no bugs.

so how did i do it.

Well, i have added yet another commandline arguement.

if you start my exe that is in fs2dtpmod.exe like this

fs2dtpmod.exe -mod mymod

then the game will look for additional files in

Freespace2/mymod/data
Freespace2/mymod/data/tables
Freespace2/mymod/data/models/

and all files found there will be used

any files not found there will be looked for

in

freespace2/
freespace2/data/
freespace2/data/tables.

I´m pretty sure it works, but further testing is needed before i will go ahead and commit it.

this will solve several problems, like when people play with the same pilot in different mods

I´m not sure however if it will accept VP files in
the mod root that in this case would be freespace2/mymod/

but here is what i did
----------------
in cfile/cfile.h around line 392

#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

-----------------
in cfile / cfile.cpp at the very start of function 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);
      strcpy(Pathtypes[2].path,cf_add_modname(Cmdline_mod,"Data"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[3].path,cf_add_modname(Cmdline_mod,"Data\\Maps"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[4].path,cf_add_modname(Cmdline_mod,"Data\\Text"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[5].path,cf_add_modname(Cmdline_mod,"Data\\Missions"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[6].path,cf_add_modname(Cmdline_mod,"Data\\Models"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[7].path,cf_add_modname(Cmdline_mod,"Data\\Tables"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[8].path,cf_add_modname(Cmdline_mod,"Data\\Sounds"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[9].path,cf_add_modname(Cmdline_mod,"Data\\Sounds\\8b22k"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[10].path,cf_add_modname(Cmdline_mod,"Data\\Sounds\\16b11k"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[11].path,cf_add_modname(Cmdline_mod,"Data\\Voice"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[12].path,cf_add_modname(Cmdline_mod,"Data\\Voice\\Briefing"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[13].path,cf_add_modname(Cmdline_mod,"Data\\Voice\\Command_briefings"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[14].path,cf_add_modname(Cmdline_mod,"Data\\Voice\\Debriefing"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[15].path,cf_add_modname(Cmdline_mod,"Data\\Voice\\Personas"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[16].path,cf_add_modname(Cmdline_mod,"Data\\Voice\\Special"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[17].path,cf_add_modname(Cmdline_mod,"Data\\Voice\\Training"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[18].path,cf_add_modname(Cmdline_mod,"Data\\Music"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[19].path,cf_add_modname(Cmdline_mod,"Data\\Movies"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[20].path,cf_add_modname(Cmdline_mod,"Data\\Interface"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[21].path,cf_add_modname(Cmdline_mod,"Data\\Fonts"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[22].path,cf_add_modname(Cmdline_mod,"Data\\Effects"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[23].path,cf_add_modname(Cmdline_mod,"Data\\Hud"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[24].path,cf_add_modname(Cmdline_mod,"Data\\Players"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[25].path,cf_add_modname(Cmdline_mod,"Data\\Players\\Images"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[26].path,cf_add_modname(Cmdline_mod,"Data\\Data\\Cache"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[27].path,cf_add_modname(Cmdline_mod,"Data\\Players"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[28].path,cf_add_modname(Cmdline_mod,"Data\\Players\\Single"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[29].path,cf_add_modname(Cmdline_mod,"Data\\Players\\Multi"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[30].path,cf_add_modname(Cmdline_mod,"Data\\Players\\MultiData"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[31].path,cf_add_modname(Cmdline_mod,"Data\\Config"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[32].path,cf_add_modname(Cmdline_mod,"Data\\Players\\Squads"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[33].path,cf_add_modname(Cmdline_mod,"Data\\Demos"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[34].path,cf_add_modname(Cmdline_mod,"Data\\CBAnims"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[35].path,cf_add_modname(Cmdline_mod,"Data\\IntelAnims"));
      Cmdline_mod = modname;
      strcpy(Pathtypes[36].path,cf_add_modname(Cmdline_mod,""));
      Cmdline_mod = modname;

      Hold_mod = Pathtypes[7].path; //DTP debugthing
   }

i know that above could be done with a loop like for(i =2;I<37;I++), but im still learning, and believe me, I learned quite a bit about conversions when speaking c++.

and in the same file i added this function that is very similar to *cf_add_ext(*x,*x)

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);
   }

   return path;
}

I will download some VP files and start checking it out, but so far it looks soooo sweet :D.
« Last Edit: October 14, 2002, 03:37:36 pm by 508 »
VBB member; reg aug 1999; total posts 600.
War is a lion, on whos back you fall, never to get up.
Think big. Invade Space.

 

Offline Zarax

  • 210
MOD support´, real mod support
wow, would be very cool...
Is this feature going to be added to the "official" fs2 open exe?
The Best is Yet to Come

 

Offline Inquisitor

MOD support´, real mod support
I think it might be safe to say yes :)
No signature.

 

Offline RandomTiger

  • Senior Member
  • 211
MOD support´, real mod support
If it does what I think it does, great stuff.

Does the work for total conversions like TBP having different hall graphics? What would be fantastic is if you could change between MOD's in the campaign chooser.

Great work. :yes:

 

Offline RandomTiger

  • Senior Member
  • 211
MOD support´, real mod support
If it does what I think it does, great stuff.

Does the work for total conversions like TBP having different hall graphics? What would be fantastic is if you could change between MOD's in the campaign chooser.

Great work. :yes:

 

Offline Solatar

  • 211
MOD support´, real mod support
We heard you the first time.:D :D ;)

 

Offline Solatar

  • 211
MOD support´, real mod support
I've heard of double posts, but I've never gotten a triple one.
« Last Edit: October 14, 2002, 04:59:01 pm by 691 »

 

Offline Solatar

  • 211
MOD support´, real mod support
Oops, I guess my modem is acting up also.
« Last Edit: October 14, 2002, 04:58:31 pm by 691 »

 

Offline RandomTiger

  • Senior Member
  • 211
MOD support´, real mod support
:rolleyes:

Very mature Hades.
Looks like this thread has an echo.

 

Offline Solatar

  • 211
MOD support´, real mod support
I must have pressed the button to many times. My connection has been acting up.

And back on topic. Will the player be able to run MOD specific .exe's by running fs2_open, and having it automatically run them?

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
MOD support´, real mod support
cool

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
MOD support´, real mod support
yay!!!!1
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
MOD support´, real mod support
call me stupid, but I didn't get what it was supposed to do :p
SCREW CANON!

 

Offline DTP

  • ImPortant Coder
  • 28
    • http://www.c4-group.dk
MOD support´, real mod support
Quote
Originally posted by venom2506
call me stupid, but I didn't get what it was supposed to do :p


Instead of copying Table files in and out of the default directories, you will be able to have several table files in directories like freespace2/mymod/data/tables/ and to active them you simply add a commandline switch to the exe like

fs2_open.exe -mymod

and the table file will be used instead of the ones found in the root or in VP files.

this goes for all graphics, sound files aswell.

seems VP files will still have to be in the root dir freespace2/
or it will chrash, but i beleive i have indentified the place where to take action in order for it to accept VP files in other places.

working on that.

for now, only plain files in the mod directory is working.
VBB member; reg aug 1999; total posts 600.
War is a lion, on whos back you fall, never to get up.
Think big. Invade Space.

 

Offline DTP

  • ImPortant Coder
  • 28
    • http://www.c4-group.dk
MOD support´, real mod support
Quote
Originally posted by Hades
I must have pressed the button to many times. My connection has been acting up.

And back on topic. Will the player be able to run MOD specific .exe's by running fs2_open, and having it automatically run them?


no not mod specific exes, this is built inside fs2_open. and fs2_open.exe dont call any other exe files. read my post above.

it is almost like if you run halflife.exe -game mymod, except it does not call in dll files.

this simply reads all files found in the mod directory and uses them instead of using identical ones found ín the default directories.
VBB member; reg aug 1999; total posts 600.
War is a lion, on whos back you fall, never to get up.
Think big. Invade Space.

 

Offline LAW ENFORCER

  • Turret Fiend
  • 210
    • http://www.armouredstar.com
MOD support´, real mod support
ok... how would a mod specific .exe work and can you get that to do the same thing inside FS2 with some interface like the pilot one?
Conflict GRDLA:
Operation Return To Riker
www.ARMOUREDSTAR.com - the latest site is not finished yet!
[What we have here is the source to the Freespace ENGINE, not the Freespace GAME. By allowing the ENGINE to support all kinds of cool stuff, we're allowing the creation of all new GAMES] - TurboNed

 

Offline Inquisitor

MOD support´, real mod support
A mod specific exe would work the same way, just be compiled with different options of or have different command line flags indicating different options should be enabled.

fs2_open.exe -gf4fix -mod blah blah for instance.

As for doing it thru a menu: One thing at a time man :)
No signature.

  

Offline RandomTiger

  • Senior Member
  • 211
MOD support´, real mod support
Oh... please we dont want to have MOD specific exe do we?

 

Offline Stunaep

  • Thread Necrotech.... we bring the dead to life!
  • 210
MOD support´, real mod support
this would be a gift from heaven!!


BTW, when are we gonna get our hands on the next fs2_open version?
"Post-counts are like digital penises. That's why I don't like Shrike playing with mine." - an0n
Bah. You're an admin, you've had practice at this spanking business. - Odyssey

 

Offline Inquisitor

MOD support´, real mod support
RT: not us, but, if say they downloaded the source, changed some things (like Robotech is doing), then, they would effectively have their own exe. We might inlcude options that are flagged on or off though, like the beam tiling, that would be a runtime choice.

So "we" are not making a mod exe, but we are including options for modders to use, and obviously any mod team with a competent coder could make a custom exe ;)
No signature.