BF1942 console commands

Ask questions, discuss ideas, get answers
Post Reply
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

BF1942 console commands

Post by fo0k »

These have been replicated many times over the web but they should also be sat here somewhere for reference.
I tried the wireframe view just now.. have tried it in game before but it did not work.. tried in the init and it did.. it was.. wirey..

****************************************************************************
****************************************************************************




There are a range of useful commands which can be accessed through the game console, or entered into the .con files. To open the console, press the tilde (~) key. To close the console, press ~ again. You can bring up a full list of commands for each category (Console, Game, Chat, Renderer, Sound, Admin, Debug and Profiler) in the console by typing the group name (e.g. Game.) and then pressing the TAB key repeatedly to first see the group list, then the correct usage of the commands.

To use a console command, type the full name of the command and the value required, e.g:

game.setToolTip 1

will turn the Tool Tips on. Using the value 0 in front of the above command will turn the Tool Tips off. This is shown as 1/0 below (called a Boolean value – [bool]), which indicates that using 1 enables a function, 0 disables it. The use of # (or [float]) after a command below means a numeric value is required for the command.

A list of console commands is provided below, grouped into the various categories – although Debug and Profiler categories are not covered. Where known a description of the command is also provided.


Console
Console.showfps 1/0 (When enabled shows your current Frames Per Second (FPS) in the top left corner of the screen)
Console.showstats 1/0 (When enabled shows a range of system performance information)

Game
game.sayTeam (Team chat)
game.sayAll (Global chat)
game.listPlayers (Lists players and their id numbers)
game.listMaps (Lists the maps and number assignments in server rotation)
game.voteMap # (Votes to change the map to the number specified)
game.TKPunish (Punish a TK - works only in Forgive Mode)
game.TKForgive (Forgive a TK - works only in Punish Mode)
game.addPlayerToBuddyList [ID] (Add a user to the buddy list)
game.removePlayerFromBuddyList [ID] (Removes a user from the buddy list)
game.buddyList (Prints a list of your current buddies)
game.voteKickPlayer [ID] (Calls a vote to kick a player. To vote enter this command with the same number)
game.voteKickTeamPlayer [ID] (Same as above but only teammates are allowed to vote)
game.changePlayerName [Name] (Renames your player in-game)
game.dumpNetworkDebugStats 1/0
game.debugCallBackDisabled 1/0 (Allows use of callbacks to get game info)
game.useHUD 1/0 (Toggles the the Head Up Display (HUD))
game.setShadows 1/0 (Toggles shadows on/off)
game.setEnvironmentMapping 1/0 (Toggles Environment Mapping on/off)
game.setToolTip 1/0 (Toggles tool tips on/off)
game.setRadioToolTip 1/0 (Toggles Radio button text on/off)
game.setCrossHairColor # # # (Adjusts crosshair color based on Red Green & Blue values entered)
game.setStaticMiniMap 1/0 (When set to 0 the minimap rotates as you rotate )
game.setMiniMapTransparency # (The higher the number the more transparent)
game.RadioToolTipColor # # # (Adjusts the color of the Radio button text (if on))
game.getIp (Displays IP in the message window)
game.getLevelName (Displays the name of the level)
game.enableFreeCamera 1/0 (Enable/disable the ability to look around while waiting to spawn)
game.killPlayer [ID] (Kills player with the id number - Admin only)
game.disconnect (Disconnects from the server)
game.suicide (Kills your character)
game.setCommonMouseSensitivity # (Sets Common mouse sensitivity)

Air Controls
game.setAirKeyboardSensitivity # (Sets keyboard sensitivity when flying planes)
game.setAirMouseSensitivity # (Sets mouse sensitivity when flying planes)
game.setAirMouseInvert 1/0 (1 for inverted, 0 for default (non-inverted) when flying planes)

Infantry Controls
game.setInfMouseSensitivity # (Sets mouse sensitivity as a soldier)
game.setInfMouseInvert 1/0 (1 for inverted, 0 for default (non-inverted) when a soldier)

Vehicle Controls
game.setLandSeaKeyboardSensitivity # (Sets keyboard sensitivity when using a vehicle)
game.setLandSeaMouseSensitivity # (Sets mouse sensitivity when using a vehicle)
game.setLandSeaMouseInvert 1/0 (1 for inverted, 0 for default (non-inverted) when using a vehicle)

The Following Game Settings are explained in the In-Game Settings section above and perform the same function. Note they cannot be changed in-game in the console. You can edit/insert these settings in the relevant .con files.

game.setConnection 1-4 (Sets the type of connection)
game.setDisableSound 1/0 (Toggles sound on/off)
game.setChannels # (Sets number of sound channels)
game.setMasterVolume # (Sets master volume level)
game.setMenuMusicVolume # (Sets menu volume level)
game.setMusicOnOff 1/0 (Toggles music on/off)
game.setLocalizedDialog 0 (Toggles localized dialog on/off)
game.setQuality # (Sets sound quality)
game.setSoundDetail
game.setHardware #
game.setGameDisplayMode [Width] [Height] [Color Depth] [Refresh Rate] (e.g. 1280 960 32 85 = 1280x960, 32-bit color @ 85Hz )
game.setDetailTexture #
game.setGraphicsQuality #
game.setLightmaps 1/0
game.setRenderWhenSpawnMenu 1
game.setMenuViewdistance #
game.setEffectsQuality #
game.setPerformance #

Chat
chat.ChatMessageSize # (No. of lines for chat messages display)
chat.GameInfoMessageSize # (No. of lines for game info display)
chat.KillMessageSize # (No. of lines for kills info display)
chat.setChatHistory # # # (Sets the no of lines for all 3 message displays at once)
chat.chatInfo (Returns status on how many lines each message window in using)
chat.OldChatListStyle 1/0 (If set to 1, the old v1.2 message window model is used)
chat.OldChatListHistory # (No. of rows used if the old message window model is used)
chat.ignoreRadioText 1/0 (If 1, No radio text is printed)
chat.ignoreRadioAudio 1/0 (If 1, No radio sounds are played)
chat.setIgnoreRadioAudioAndText 1/0 (If 1, both radio sounds and radio text is supressed)
chat.getIgnoreRadioAudioAndText (Prints status for these settings)
chat.addToIgnoreList [ID] (Ignores a specific user's chatting)
chat.removeFromIgnoreList [ID] (Stop ignoring a specific user's chatting)
chat.ignoreList (Returns the list of ignored players)

Renderer
renderer.allowAllRefreshRates 1/0 (Similar to setting in Videodefault.con – see above)
renderer.extrapolateFrame 1/0
renderer.mipMapBias # (Determines how clear the textures appear. The lower the value, the sharper the textures ranging from -8 to 14.)
renderer.setVSyncEnabled 1/0 1/0 (Enables/Disables Vertical Sync. Both boolean values must match for this setting to work, e.g. 0 0 (off) or 1 1 (on))
renderer.getVSyncEnabled (Displays whether Vsync is enabled (1) or disabled (0))
renderer.lockfps # (Attempts to keep FPS at number entered)
renderer.vertexFogEnable 1/0
renderer.wireframe 1/0
renderer.forceSWSkinning 1/0

Sound
The Following settings can't be changed in-game. You can edit/insert these settings in the Sound.con file.

Sound.setDopplerFactor 1/0 (Turns on/off 3D Audio effects)
Sound.setRolloffFactor 1/0 (As above)
Sound.setDistanceFactor 1/0 (As above)
Sound.setPitchChangeRate #
Sound.showSoundInfo 1/0 (Toggles information display about the sound performance)
Sound.drawSoundObjects 1/0 (As above)

Admin
Note, if logged in as a remote admin, to run the following commands you need to use the admin.execremotecommand "command" console function to execute each command successfully.

admin.getRemoteConsoleEnabled (Displays whether remote console is enabled)
admin.enableRemoteConsole [username] [password] # (Enables remote access to a BF1942 Server)
admin.disableRemoteConsole (Disables remote access to a BF1942 Server)
admin.enableRemoteAdmin [password] (Allows a Remote Admin to log into a server)
admin.disableRemoteAdmin (Disables a Remote Admin logging into a server)
admin.execremotecommand "command" (Executes a command (such as those listed here) from remote Admin)
admin.maxAllowedConnectionType [type] (Sets the highest connection type (1-4) allowed to join the server)
admin.voteMapMajority # (Percentage of voters required to change a Map (0 – 1.0))
admin.voteKickPlayerMajority (As above for Votekicks)
admin.voteKickTeamPlayerMajority (As above for Team Votekicks)
admin.enableMapVote 1/0 (Enables/Disables Map voting)
admin.enableKickPlayerVote 1/0 (As above for Votekicks)
admin.enableKickTeamPlayerVote 1/0 (As above for Team Votekicks)
admin.votingTime # (Number of seconds during which players can vote)
admin.kickPlayer [ID] (Admin version of Votekick player)
admin.banPlayer [ID] (Admin permanent Votekick (ban) of player)
admin.changeMap [map name] (Admin changes map to name specified)
admin.addAddressToBanList [IP] (Adds a player's IP address to banned list)
admin.removeAddressFromBanList [IP] (Removes a player's IP address from banned list)
admin.listBannedAdresses (Lists all banned IPs)
admin.clearBanList (Clears all banned ips)
admin.banTime # (Length of time a banned player cannot join server)
admin.tagPlayer [ID]
admin.bandWidthChokeLimit #
admin.allownosecam 1/0 (Allows player to turn off HUD while flying)
admin.externalviews 1/0 (Allows/disallows external camera view and nose cam)
admin.togglegamepause (Enables/Disables pausing)
admin.setTicketRatio #
admin.autoBalanceTeam 1/0 (Enables/Disables Auto team-balancing when teams are uneven)
admin.delayBeforeStartingGame # (Time delay before a game starts)
admin.roundDelayBeforeStartingGame # (Time delay before a new round starts)
admin.soldierFFRatio # (The ratio of damage (e.g. 0.5=50%) done by Friendly Fire)
admin.vehicleFFratio # (As above for vehicle FF)
admin.soldierFFRatioOnSplash # (As above for weapon splash damage)
admin.vehcileFFRatioOnSplash #(As above for vehicle FF splash damage)
admin.kickBack # (How far player is kicked back when hit)
admin.kickBackOnSplash #(As above for splash damage)
admin.timeLimit # (Time limit for match)
admin.scoreLimit # (Score limit for match)
admin.restartMap (Restarts current map)
admin.setNextLevel [map] (Sets the next map to load after current map ends)
admin.timeBeforeRestartMap # (How much time until the map restarts)
admin.SetNrOfRounds # (Sets the number of rounds)
admin.timeToNextWave #
admin.spawnWaveTime #
admin.spawnDelayPenaltyForTK # (The number of extra spawn waves applied)
admin.banPlayerOnTKKick 1/0 (When set to 1, players are also banned when kicked for TK)
admin.nrOrTKToKick # (The number of punished TK's before being kicked)
admin.tkPunishMode 1/0 (0: Punish Mode - Players are punished by default, until the victim forgives the TK, 1: Forgive Mode - Players are forgiven by default, until the victim punishes the TK)
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: BF1942 console commands

Post by Apache Thunder »

Certain commands like the wireframe command can only be used in the console ingame via the debugger exe. Obviously to prevent someone from using console commands to cheat. So roughly 90% of the commands can't be used in the console if you are using the retail game. WIth the debugger however, any command you see in a con file can be used in the console.

You can even create new object templates and stuff in the console and create it midgame. ;)

The active command can also be used in the debugger if you want to modify something midgame as well.
ImageImageImage
I have cameras in your head!
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: BF1942 console commands

Post by Swaffy »

I simply have fun playing around with them.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

i think i have typed Console.showstats 1 like a thousand times by now :)

me to just recently tried the wireframe thing, only way i could get it to work was by planting it in the ini file then host a game (no debugger)

Waldek
Posts: 49
Joined: Thu Mar 08, 2012 12:09 pm

Re: BF1942 console commands

Post by Waldek »

Is there any command that draws curved ballistic trajectory of a projectile?
I found game.drawDebug doing this but in fact it just makes a straight line in between the originator and the target:
Image
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: BF1942 console commands

Post by Swaffy »

Waldek wrote:Is there any command that draws curved ballistic trajectory of a projectile?
I found game.drawDebug doing this but in fact it just makes a straight line in between the originator and the target:
Image
Yes. Bots do automatically make up for bullet drop, or so I've been told and I've seen. But I also add a bit of code to the guns to make the bots aim better:

rem *** Add BAR ***
weaponTemplate.create BarAI
weaponTemplate.burst 1
weaponTemplate.indirect 0
weaponTemplate.minRange 0.0
weaponTemplate.maxRange 500.0
weaponTemplate.weaponActivate PIMenuSelect3
weaponTemplate.weaponFire PIFire
weaponTemplate.setStrength Infantry 5.0
weaponTemplate.setStrength LightArmour 1.0
weaponTemplate.setStrength HeavyArmour 0.0
weaponTemplate.setStrength NavalArmour 0.0
weaponTemplate.setStrength Submarine 0.0
weaponTemplate.setStrength Air 2.0
weaponTemplate.setSoundSphereRadius 300.0
weaponTemplate.exitVelocity 605

In this case, my gun's muzzle velocity is 600. Because bots tend to overshoot (shoot too high) I made them think the muzzle velocity was higher so they will aim a bit lower. I might actually push it to (Velocity + 10) for bullets and leave it at +5 for cannons. Depends on how low/high the projectile velocity was in the first place, and cannon shells are usually slower.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Waldek
Posts: 49
Joined: Thu Mar 08, 2012 12:09 pm

Re: BF1942 console commands

Post by Waldek »

In fact I had something different in my mind. I just want to know if I can visualise actuall path that a projectile follows.
User avatar
one
Posts: 50
Joined: Thu Sep 15, 2011 4:14 pm

Re: BF1942 console commands

Post by one »

Waldek wrote:In fact I had something different in my mind. I just want to know if I can visualise actuall path that a projectile follows.
Well you can just add a colored trail effect with big TimeToLive to the projectile, like Bazooka
Diamondback
Posts: 589
Joined: Mon Oct 01, 2012 3:13 pm
Location: Canada
Contact:

Re: BF1942 console commands

Post by Diamondback »

Can this be made a sticky?
See my Strasbourg map project here.
Post Reply