OO9 Fair Play | Nightfire Bond League (NFBL) | Nightfire Forum | NC NFBSP: Nightfire BSP Source
     
     
 Home
 
 Bookmark This Site
 Site Updates
 Site Help Site Help
 Site Polls
 Link To Us
 
 Nightfire Info:
 Commands
 Nightfire FAQ
 Nightfire 1.1 Patch FAQ
 Gadgets
 Maps
 Music
 Weapons
 FoC

 Nightfire Tutorials:
 Console
 Script building
 Skin creation



 [OO9] Server

 Walkthrough:
  Introduction

  (1) Rendezvous
  (2) Airfield Ambush
  (3) Uninvited Guests
  (4) Phoenix Rising
  (5) Hidden Agenda
  (6) High Treason
  (7) Island Getaway
  (8) Zero Minus
  (9) Re-Entry

 Downloads:
  [OO9] &
  `OS>007bond007
  Tools

  Patches And Fixes
  Mods
  DM Maps
  CTF Maps
  Gaming Tools




 Secret Services:
  MI6


 Links:
 Nightfire BSP Source
 Nightfire matches
 NFBSP Wiki
 Map/Mod Sites
 Fan Sites
 Resource Sites
 Servers & Hosting
 Clan Listing
 James Bond Sites
 Other Game Sites

 Forums:
 Nightfire Forum
 Gearbox Forum
 MI6 Forum
 Commander Bond.net







 
  Nightfire Script Building  


[NAU]North American Union: Server and File hosting for  N.American Nightfire Pla



1.)The Basics
2.)Putting It Together
3.)Making Scripts Work Together
4.)Starting & Stopping Commands
5.) Making Menu's
6.)Tech Bits


     
 
  Part Six Tech Bits  

Part Six explains some of the technical sides of script building.

Making scripts to do different things can be a lot of fun, but you should be aware of the following things.

1.) The host settings will always override the client settings when using commands to change the environment and changing environment settings on the host will effect everybody in the game, not just the host.
2.) Using movement key binds and aliases in games for the sole purpose of gaining an advantage over your opponent is cheating. They are no substitute for skill anyway, as when you are using a script to achieve an unfair advantage you vulnerable for 2 reasons. You are locked into the movement until it has been completed. Continually doing the script movement will become obvious to other players, make you very predictable and most likely get you kicked off the server.

  Script Sizes & Loosing Keys  

When building a script it is always a good idea to use aliases as much as you can. Firstly if you are using a lot of the same commands it makes it easier to write and secondly it keeps the script size down, which is important if you are building a big script. The config.cfg file in the ...\Application Data\Gearbox Software\Nightfire\bond folder can only store up to 16kb of data, so if your script size is too big it will cause problems.

When Nightfire starts it writes to the config.cfg all the commands from the autoexec.cfg file and any other commands when they are called for from other files. It will also load all the settings from the Nightfire GUI, like movement keys, audio settings, graphic settings etc., along with some basic commands like addbot. The GUI and the basic commands total 3kb in size. If all the other commands total more than 13kb in size this will exceed the 16kb limit. If you have for example a load of alias and commands that add up to 20kb, when you start Nightfire and play it for the first time the config.cfg file will grow in size to 23kb. As soon as you close down Nightfire the file will reduce in size to 16kb, which is the max allowed by Nightfire for storing. If you look at that file then you will see the majority of your own alias and commands and no GUI settings like movement keys. When you start Nightfire again the file will change in size to 20kb as it is storing all your alias and commands again. At this point Nightfire will try and store the GUI settings too, but there is no room for them, so when you look in options screen all the movement keys will be blank.

alias "casino" "rcon changelevel dm_casino"
alias "office" "rcon changelevel dm_office"
alias "maint" "rcon changelevel dm_maint"
alias "island" "rcon changelevel dm_island"
alias "istanbul" "rcon changelevel dm_istanbul"
alias "addbot" "Host_Addbot"
alias "autosave" "Host_AutoSave"
alias "changelevel" "Host_Changelevel"
alias "changelevel2" "Host_Changelevel2"
alias "god" "Host_God"

etc.
An autoexec.cfg totalling 11kb would look something like this in the config.cfg file. (The ones in green are the ones that Nightfire makes)


alias "casino" "rcon changelevel dm_casino"
alias "office" "rcon changelevel dm_office"
alias "maint" "rcon changelevel dm_maint"
alias "island" "rcon changelevel dm_island"
alias "Istanbul" "rcon changelevel dm_istanbul"
alias "changelevel2" "Host_Changelevel2"
alias "god" "Host_God"

etc.
Taking the problem again but having all the alias and commands add up to 14kb you will loose 1kb of Nightfire commands this time 14 + 3 = 17 (Max is 16). You have lost 3 lines of commands that Nightfire makes. The larger the amount in kb of your own binds the more that gets overwritten, that's how loosing all movement settings in the GUI can happen.

You can get away with overwriting some commands by having them listed in the config.cfg file, that will not stop them being available for use in the console, but as a guide keep your scripts to about 13kb. If they are bigger you will have to start to write things like movement key binds into the autoexec.cfg file.


  Some Helpful Information  

Using aliases for the bind and alias command is handy for writing a script, b = bind, a = alias, but when they write into the config.cfg file they will be written out in full, apart from bind when used inside a command line, so will not help in reducing file size in this way.

The .cfg extension is used to identify a configuration file, however using the exec command you can tell Nightfire to execute any file extension as long as it is written in a language that Nightfire understands like script language. This is useful if you have lots of files and name them with extensions that mean that they belong to a certain group.

When building a script and changing settings always have either the command line or a key bound, to reset the settings back to normal.




Previous | Pages 1, 2, 3, 4, 5, 6 ... | Next

 
     

 
  Legal Notices & Site Information
[OO9] Fair Play 2003 - 2010