Using a tmp.con File To Preserve Map Settings

Information and tutorials related to modding BF2.
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Using a tmp.con File To Preserve Map Settings

Post by Rabbit »

This is a simple, basic tutorial over the tmp.con, a file that will help you with lines of code that you wish to load or lines that disappear any time you edit that section of the level, ie when you set

Code: Select all

terrainCuller.setUseStitchedLods 0
into your terrain.con and you edit the terrain, you need to place it back in the file.

Setting up the tmp

First copy your init.con in your level folder, it should copy as "Init - Copy"
Image

Now rename it to "tmp" with out the "". You now have your tmp.con file.

Now this is how my tmp looks for Shikotan Island...

Code: Select all

terrainCuller.setUseStitchedLods 0

windmanager.globalWindSpeed 11
windmanager.globalWinddirection 0/0/1
First you can see I added

Code: Select all

terrainCuller.setUseStitchedLods 0
This usually goes in the terrain.con for a 4km level, the problem you can encounter, is if you place that code in your terrain.con, and you edit your level in the terrain editor, you lose this line. But by placing it in the tmp.con, it will never go away, and will always load.

A few other terrainCuller's that you can add that are not naturally in the terrain.con, thus will be removed anytime you make changes in the terrain editor are....

Code: Select all

terrainCuller.lodSwitchDistance 
terrainCuller.baseCellSize 
terrainCuller.detailCullMaxLevel 
Two of these can pretty much be set values, but others should be based on what your average VD is in the game.

Code: Select all

terrainCuller.lodSwitchDistance 0
terrainCuller.baseCellSize 128
terrainCuller.detailCullMaxLevel VD Based
If you have a level like fallujah, which is pretty much flat and urban, you can get away with lower numbers based around 100-250, if not, no ingame and see at what distance you see your "fog" begin to start to have an effect, and work off that value.

These are my values.

Code: Select all

terrainCuller.lodSwitchDistance 0
terrainCuller.baseCellSize 128
terrainCuller.detailCullMaxLevel 100
Before
Image
After
Image

Another line of code I like to add is

Code: Select all

windmanager.globalWindSpeed 11
windmanager.globalWinddirection 0/0/1
(NOTE) This does not effect projectiles. Now, what this does change is effects. What I did was bumped it up to speed 80 to show you. Here I threw a smoke grenade in the left along the hesco's and you can see the smoke trailing off to the right.
Image

Here we have black smoke coming from the mid factory building, as you can see because wind is set to "80" in this picture, it's stretched out to the right. Generally settings from 1-11 are best. (1 calm, 11 storm rolling in)
Image

Wind speed 0
Image

Wind speed 6
Image

Code: Select all

windmanager.globalWinddirection 0/0/1
1/0/0 East
-1/0/0 West
0/0/1 North
0/0/-1 South
This works the direction of the wind, play around with the numbers to find what best suits you and make sure water and clouds are going with it. ;-)

Along with direction you want to make sure cloud speed, water speed, and undergrowth speed fit with what you have.

That's it for the tmp.con Have fun and see you on the battlefield!
Last edited by Rabbit on 2013-01-31 19:14, edited 9 times in total.
Image

AfSoccer "I just don't see the natural talent."
Image
Durkie
Posts: 264
Joined: 2009-01-12 08:10

re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Durkie »

Thanx for this tut I wish I had know this earlier
Last edited by Durkie on 2013-01-13 09:45, edited 1 time in total.
"Goddam it, you'll never get the Purple Heart hiding in a foxhole! Follow me!"
Captain Henry P. Jim Crowe
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Rhino »

Nice tut, didn't know the windmanager worked in BF2. I saw it in BFH when it was released and pretty sure I did try it in BF2 back then but it didn't work, they must have added it in BF2 v1.5 or something.

Its not a good idea to put the kit loading bit in the tmp.con however since as you said, it will load the ones out of the init.con before any other, personally I just make my init.con read only so the editor doesn't save over it.
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Mineral »

Question, are mappers allowed to use the Wind modifier? As I told gx it was not due to it influencing the gameplay element of smoke.just confirming if I told gx the right thing or not :)
Image
Rhino
Retired PR Developer
Posts: 47909
Joined: 2005-12-13 20:00

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Rhino »

effects are very much a client side thing so they shouldn't be used in such a way that affects gameplay, as we had one map in PR ages ago that had a massive sand storm over the map, and while in your view, the area in front of you was totally blocked by sand, for another player standing right next to you, or looking back at you from the other ridge, there might be a gap in the sand storm for them that they can see perfectly well though. But having it just affect chimney smoke etc a little is fine :)
Image
rodrigoma
Posts: 1537
Joined: 2012-03-22 21:21

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by rodrigoma »

but if it does affect smoke grenades as well ;/
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Mineral »

yeah, I meant smoke grenades.
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Rabbit »

[quote="[R-DEV]
Its not a good idea to put the kit loading bit in the tmp.con however since as you said, it will load the ones out of the init.con before any other, personally I just make my init.con read only so the editor doesn't save over it.[/quote]

You are correct, but even if your init. says

Code: Select all

gameLogic.setTeamName 1 "CHinsurgent"
gameLogic.setTeamName 2 "RU"

gameLogic.setTeamLanguage 1 "rebels"
gameLogic.setTeamLanguage 2 "RU"

gameLogic.setTeamFlag 0 "flag_neutral"
gameLogic.setTeamFlag 1 "flag_re"
gameLogic.setTeamFlag 2 "flag_ru"

gameLogic.setKit 1 0 "chinsurgent_officer" "pr_chinsurgent_soldier4"
gameLogic.setKit 2 0 "ru_officer" "pr_ru_soldier4"

gameLogic.setKit 1 1 "chinsurgent_officer_alt" "pr_chinsurgent_soldier5"
gameLogic.setKit 2 1 "ru_officer_alt" "pr_ru_soldier1"

gameLogic.setKit 1 2 "chinsurgent_rifleman" "pr_chinsurgent_soldier2"
gameLogic.setKit 2 2 "ru_rifleman" "pr_ru_soldier3"

gameLogic.setKit 1 3 "chinsurgent_rifleman_alt" "pr_chinsurgent_soldier3"
gameLogic.setKit 2 3 "ru_rifleman_alt" "pr_ru_soldier2"

gameLogic.setKit 1 4 "chinsurgent_specialist" "pr_chinsurgent_soldier1"
gameLogic.setKit 2 4 "ru_specialist" "pr_ru_soldier1"

gameLogic.setKit 1 5 "chinsurgent_medic" "pr_chinsurgent_soldier3"
gameLogic.setKit 2 5 "ru_medic" "pr_ru_soldier2"

gameLogic.setKit 1 6 "chinsurgent_support" "pr_chinsurgent_soldier6"
gameLogic.setKit 2 6 "ru_support" "pr_ru_soldier3"
But your tmp says.

Code: Select all

run ../../Factions/faction_init.con 1 "chinsurgent"
run ../../Factions/faction_init.con 2 "ru"
Everything will load correctly, and because I'm already putting in info to my tmp.con I just do it anyway.
'[R-CON wrote:rodrigoma"]but if it does affect smoke grenades as well ;/
It does, for example

Wind speed 0
Image

Wind speed 6
Image

It effects it, but from the testing I have done, it's still very much usable. It's also nice to see the dust from a grenade fired from a grenade launcher wash away in the wind, looks awesome. :-P
Last edited by Rabbit on 2013-01-13 16:19, edited 1 time in total.
Image

AfSoccer "I just don't see the natural talent."
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Mineral »

therefore my concern, although it indeed maybe look visually better, PR players are used to the way PR smoke grenades work and know exactly how much it covers up in terms of volume. With a wind modifier this changes. So each player needs to get used of their smoke grenades being different on multiple maps. I don't think there is anything wrong with that, just asking for confirmation from the DEV-team on this :) Therefore my question.
Image
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Amok@ndy »

gx wrote:You are correct, but even if your init. says

Code: Select all

gameLogic.setTeamName 1 "CHinsurgent"
gameLogic.setTeamName 2 "RU"

gameLogic.setTeamLanguage 1 "rebels"
gameLogic.setTeamLanguage 2 "RU"

gameLogic.setTeamFlag 0 "flag_neutral"
gameLogic.setTeamFlag 1 "flag_re"
gameLogic.setTeamFlag 2 "flag_ru"

gameLogic.setKit 1 0 "chinsurgent_officer" "pr_chinsurgent_soldier4"
gameLogic.setKit 2 0 "ru_officer" "pr_ru_soldier4"

gameLogic.setKit 1 1 "chinsurgent_officer_alt" "pr_chinsurgent_soldier5"
gameLogic.setKit 2 1 "ru_officer_alt" "pr_ru_soldier1"

gameLogic.setKit 1 2 "chinsurgent_rifleman" "pr_chinsurgent_soldier2"
gameLogic.setKit 2 2 "ru_rifleman" "pr_ru_soldier3"

gameLogic.setKit 1 3 "chinsurgent_rifleman_alt" "pr_chinsurgent_soldier3"
gameLogic.setKit 2 3 "ru_rifleman_alt" "pr_ru_soldier2"

gameLogic.setKit 1 4 "chinsurgent_specialist" "pr_chinsurgent_soldier1"
gameLogic.setKit 2 4 "ru_specialist" "pr_ru_soldier1"

gameLogic.setKit 1 5 "chinsurgent_medic" "pr_chinsurgent_soldier3"
gameLogic.setKit 2 5 "ru_medic" "pr_ru_soldier2"

gameLogic.setKit 1 6 "chinsurgent_support" "pr_chinsurgent_soldier6"
gameLogic.setKit 2 6 "ru_support" "pr_ru_soldier3"

if your init.con is looking like that, you havent set your init.con to read-only,

only place the 4km Fix in the tmp.con nothin more
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Rabbit »

Added a bit more info.
Image

AfSoccer "I just don't see the natural talent."
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Mineral »

terrainCuller.lodSwitchDistance 725
terrainCuller.baseCellSize 128
terrainCuller.detailCullMaxLevel 700

pretty sure that messing around with those can cause some serious performance issues for certain players :)
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Rabbit »

[quote=""'[R-DEV"]Amok@ndy;1853836']if your init.con is looking like that, you havent set your init.con to read-only,

only place the 4km Fix in the tmp.con nothin more[/quote]

I don't know what happens to you, but If I make any files read-only and I go to save work later in the editor it makes me make it writable to save, then removing everything you but in.

[quote="GP_MineralWouter""]terrainCuller.lodSwitchDistance 725
terrainCuller.baseCellSize 128
terrainCuller.detailCullMaxLevel 700

pretty sure that messing around with those can cause some serious performance issues for certain players :) [/quote]
Try lower numbers for 425 and 400 then. That value was only posted to show what the picture was taken in.
Image

AfSoccer "I just don't see the natural talent."
Image
AFsoccer
Retired PR Developer
Posts: 4289
Joined: 2007-09-04 07:32

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by AFsoccer »

Personally I see no problem using the tmp.con to store your faction code lines while your map is WIP. However, the lines will need to removed and the init.con fixed prior to releasing a map.

There is a reason the file is called tmp.com (i.e. temporary).
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Rabbit »

'[R-DEV wrote:AFsoccer;1853878']Personally I see no problem using the tmp.con to store your faction code lines while your map is WIP. However, the lines will need to removed and the init.con fixed prior to releasing a map.

There is a reason the file is called tmp.com (i.e. temporary).
Actually there is no problem with keeping it in, infact even the vBF2 levels have a tmp.con, running

Code: Select all

rem -- Make sure muzzle flashes are visible at least one frame.
rem renderer.presentAsync 0
Also later on if you feel like running custom command lines to load certain changes (like FH2's fewer grande count) instead of having to make a complete new faction with less grenades.
Image

AfSoccer "I just don't see the natural talent."
Image
AFsoccer
Retired PR Developer
Posts: 4289
Joined: 2007-09-04 07:32

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by AFsoccer »

The tmp file is fine but not for faction settings. This isn't a problem vBF2 had so they must have used them for wind and other settings. But for PR I'm telling you that the init.con needs to be correct once the map is finalized.
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Rabbit »

[R-DEV]AFsoccer wrote:The tmp file is fine but not for faction settings. This isn't a problem vBF2 had so they must have used them for wind and other settings. But for PR I'm telling you that the init.con needs to be correct once the map is finalized.
Alright.
Image

AfSoccer "I just don't see the natural talent."
Image
Amok@ndy
Retired PR Developer
Posts: 5144
Joined: 2008-11-27 22:13

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Amok@ndy »

gx wrote:I don't know what happens to you, but If I make any files read-only and I go to save work later in the editor it makes me make it writable to save, then removing everything you but in.
then you should read more precise .....

if you have the init.con read-only and you save in the editor the editor asks you if you want to make it writeable, if you press YES here ofc it will change the init.con though this would be clear ... :roll:
Image
Rabbit
Posts: 7818
Joined: 2006-12-17 15:14

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Rabbit »

[R-DEV]Amok@ndy wrote:then you should read more precise .....

if you have the init.con read-only and you save in the editor the editor asks you if you want to make it writeable, if you press YES here ofc it will change the init.con though this would be clear ... :roll:
Was my way of pointing out that making a file read-only why working on a level does nothing, as you will probablymakedo changes thus making what you put in prior void, putting it in your tmp saves you this hassle. Insert elitist condescending smilies
Image

AfSoccer "I just don't see the natural talent."
Image
User avatar
Mineral
Retired PR Developer
Posts: 8534
Joined: 2012-01-02 12:37
Location: Belgium

Re: [Tutorial] Using a tmp.con file to preserve map settings

Post by Mineral »

Question, are mappers allowed to use the Wind modifier? As I told gx it was not due to it influencing the gameplay element of smoke.just confirming if I told gx the right thing or not. As it does influence smoke grenades? :)
Image
Post Reply

Return to “Modding Tutorials”