Settings CON files?

Ask questions, discuss ideas, get answers
Post Reply
User avatar
Summer
Posts: 16
Joined: Thu Nov 14, 2013 7:35 am

Settings CON files?

Post by Summer »

I'm trying to add custom game start delays. I found in the ServerSettings.con file where the delays are set.

game.serverSpawnTime 1
game.serverSpawnDelay 1
game.serverGameStartDelay 1
game.serverGameRoundStartDelay 1
(I've set them all to 1)

My question, can we use these settings within our own con files. I found that setting them in my init file did nothing.. This leads me to believe that the setting con files are loaded internally within the engine (I also couldnt find how the settings con files are loaded (To be honest I have no idea how CON files are loaded, I think init files are the entry point and then everything magically loads from there???)).

Is there any information on this "game" object, I've found references to it outside of settings con files and within my own init files

bf1942/init.con
game.setCustomGameVersion 1.61
game.setCustomGameUrl "http://www.battlefield1942.com"

mymod/init.con
game.addModPath Mods/BF1942/
game.addModPath Mods/MyMod/
game.setCustomGameVersion 1.0
Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Settings CON files?

Post by Apache Thunder »

There is a command that can have a mod load a custom settings path but it's unused and probably not what your looking for.

If you must know it's this command:

Code: Select all

game.settingsPath Mods/bf1942/Settings
. Something along those lines. I haven't used this command my self as I have no use for it, so the way you path to the folder might be different then how I posted it. This command appears to be intended for the init.con file of your mod folder.



As for serverSettings.con, this file isn't called from any perticular location. It's hard coded entry in the exe that calls up that file. The above settingsPath command may or may not allow you to override this. Most third party server managers are hardcoded to expect this to be in the bf1942 mod folder location. Using the command would also override profile setting location as well and potentially cause unexpected problems for end users. Thus why I don't recommend you try using that settingsPath command.

I think the serversettings.con file gets loaded after everything else, thus setting the server spawn delay commands in a map or objects.rfa will just get overwritten by what's in the serverSettings.con file.


However I've noticed with this command it tends to override the server spawn times. I had gotten bots running in Conquest mode in a map I'm working on and noticed this command seems to override the normal server spawn delay: (you don't need to have bots to have this working. I just mentioned that because that's how I discovered this since I was trying to alter the spawn time for the bots)

Code: Select all

Game.timeToNextWave 0
This command is mostly found in the singleplayer/coop game mode con files in some maps. But can be used in other game modes as well. Place this in your map's conquest.con file or the con file that matches the game mode you are adding this to. (also make sure that it's also in the duplicate version of this con file in the GameTypes folder in your Map)
ImageImageImage
I have cameras in your head!
User avatar
Summer
Posts: 16
Joined: Thu Nov 14, 2013 7:35 am

Re: Settings CON files?

Post by Summer »

Apache Thunder wrote: As for serverSettings.con, this file isn't called from any perticular location. It's hard coded entry in the exe that calls up that file.
Is this the case for all of the RFAs? and how does one go about adding an archive, say for example I made an Objects.rfa in my own Archives folder, how can I ensure that it is loaded? It seems all too magical =\
Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Settings CON files?

Post by Apache Thunder »

Your init.con file of the main mod defines the path for your mod's rfas.

I noticed you have the paths defined in the wrong order. You need to have the line pointing to your custom mod first before the line pointing to vanilla BF1942. Otherwise vanilla BF1942 files will overwrite files in your mod if they happen to have the same file names/locations in the RFAs. (if you edit a existing con file in the objects.rfa and add that to your mod, the unedited vanilla version would overwrite what you tried to do based on how you have your mod's init.con file setup)

Generally you always want your mod to load first, then load any other mod if needed after that (if you want to set up your mod to share content from other mods without copying their files over). The vanilla BF1942 mod folder should always be loaded last.


Example on how yours should look:

Code: Select all

game.setCustomGameName MyMod
game.addModPath Mods/MyMod/
game.addModPath Mods/BF1942/
game.customGameFlushArchives 0

game.setCustomGameVersion 1.0
game.setCustomGameUrl "URL To Your Website"
game.setCustomGameInfo "Description of your mod"

Game.setMenuMusicFilename "music/slaughter4.bik"
Game.setWinMusicFilename "music/vehicle3.bik"
Game.setLoseMusicFilename "music/menu.bik"
Game.setCampaignLoseMusicFilename "music/theme2.bik"
Game.setDebriefingMusicFilename "music/briefing.bik"
Game.setLoadMusicFilename "music/vehicle4.bik"
The commands game.setCustomGameVersion, game.setCustomGameUrl, and game.setCustomGameInfo are optional.
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Settings CON files?

Post by Swaffy »

The "setCustomGameVersion" can also be text, not just a floating point number. So I can put Underpants as the verion number and it still work.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
User avatar
Summer
Posts: 16
Joined: Thu Nov 14, 2013 7:35 am

Re: Settings CON files?

Post by Summer »

Are the RFA files predetermined by BF1942 executable? or is there a place that the engine is being told to load x,y and z RFAs?
Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Settings CON files?

Post by Apache Thunder »

Yes pretty much. The EXE is hardcoded to load a menu.rfa, objects.rfa, standardMesh.rfa, etc. Look at existing mods as an example. The mod's archive path in the mod's init.con file only really tells it what location it should expect to find these RFAs.

Only a couple of the main rfas can have "patch" rfas. Aka StandardMesh_001.rfa and Texture_001.rfa etc. But doesn't load patch files for Objects.rfa and the others. So had you tried to, it wouldn't work.

As for level RFAs, that's a bit more dynamic and it "searches" the bf1942/levels folder of your mod for any level RFAs it can find so there's no specific RFA it's looking for in the levels folder. It loads any RFA it finds there assuming the RFA's base path was set correctly when they were packed.
ImageImageImage
I have cameras in your head!
Denny
Posts: 6
Joined: Fri Apr 25, 2014 9:34 pm

Re: Settings CON files?

Post by Denny »

Apache Thunder wrote: Tue Dec 17, 2013 7:50 am

Code: Select all

Game.timeToNextWave 0
This command is mostly found in the singleplayer/coop game mode con files in some maps. But can be used in other game modes as well. Place this in your map's conquest.con file or the con file that matches the game mode you are adding this to. (also make sure that it's also in the duplicate version of this con file in the GameTypes folder in your Map)
Hi, i have a question about this command, is this for the immidiate spawn in coop mode?
ive been runnning some maps in coop with 64 players and i can never spawn right away in map start, 3 spawn periods pass by(10 bots spawn) and i spawn at the end. I tried using this command both in coop and gametypes/coop, not working
Post Reply