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


This section describes how to build scripts in Nightfire and what each part of a script does. For making scripts you will need the console enabled, windows notepad, a bit of patience and something to de-stress yourself when all you have just done, doesn't work lol.

A script is basically a list of commands in a file that the server reads when it starts or when a certain key is pressed. Use notepad to make the files and save them with a .cfg extension. See the Commands page for a list. If you are making your own scripts it is recommended that you first back up any .cfg files that you have in your ...\Nightfire\Bond folder and also have a copy of the default config.cfg file to hand, otherwise it may get a bit messy.


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


     
 
  Part One. The Basics  

Part one explains the main commands used in Nightfire for building a basic script.

Below is a list of the key elements that are included in a script. These will make up a command lines which make up a script. A command lines fall into two basic formats, an alias and a key bound to a command or alias.

alias "[alias_name]" "[command it is to represent]"
bind "[key]" "[command]" or bind "[key]" "[alias]"

  Alias  

Alias (also known as) is used to define a command as another name. To make building a script easier and more compact it is always a good idea to use aliases instead of the long command names.

E.g. to change the command to show the console (con_toggleconsole) to something smaller it would look like this.

Alias"1a" "con_toggleconsole"

  Bind  

Bind is used as it's names suggests to bind a key to a command(s) or an alias, so that when you press a key it will execute that command.

E.g. to bind the key F1 to the con_toggleconsole command it would look like this.

bind "F1" "con_toggleconsole"

  Command  

Commands are used to tell Nightfire to do certain things, these can range from changing your name to doing more complex things when you add more than one command together to form a command line.

  Configuration files .cfg  

Configuration files have the .cfg extension at the end of their names. These files hold the scripting language that Nightfire reads when the server starts or a key is pressed. The two main ones are config.cfg and autoexec.cfg. The default settings for Nightfire are kept in the config.cfg file found in ...\Application Data\Gearbox Software\Nightfire\bond folder. (The location differs with each O/S) The autoexec.cfg file is found or made in the ...\Nightfire\Bond folder. Configuration files are opened and made with windows notepad. What ever script you make in the bond folder it is automatically stored in the config.cfg file as a back up. This can cause problems which will be explained later.

  Developer & Echo  

Developer is used in a command line to display information on the top left of the Nightfire screen, often used to describe what the actual command did. To display the information that you want, the developer command has to be switched on, the information to be displayed is preceded by the Echo command, then the developer command switched off. Echo is similar to the DOS or PHP command, think of it as print or write.

E.g. to say 'my script' on the screen it would look like this.

"developer 1 ; echo my script ; developer 0"

  Error Messages  

If something does not work you will get an error message in the console. These are some common error messages and what they mean. "foobar" is an example word.

unknown command: foobar = This means that you have an error in your script where you have used a command that is not known to Nightfire, it is misspelled or the alias has been misspelled.

foobar is unbound. = This means that you have pressed a key or used the mouse to execute a command that has a blank bind, i.e. bind "F1" with nothing after it.

couldn't exec foobar.cfg = This means that Nightfire could not find the foobar.cfg file or that you have named the .cfg incorrectly for Nightfire to look for it.

  Exec  

Exec (execing) is used to call an external script in another configuration file, aka execute.

E.g. if you make a script in notepad and call it test1.cfg, then make a command line in the autoexec.cfg file to call test1.cfg it would look like this.

exec test1.cfg

  Key  

Key is not a command but they are important. To make scripts work they need something to execute them, this can be nearly any key on a standard keyboard, a joystick or the mouse buttons or wheel.

  Special Characters  

So that a script can work in Nightfire, it uses special characters to separate and highlight certain parts.

Quotation marks " are to tell Nightfire where the command contents starts and stops. Semicolons; splits up the command contents so that it may include other commands too. Forward slashes / used twice one after each other like so //, are used for hiding text for information purposes. By doing this Nightfire will ignore all the content after the // when it reads the script. You can use them inside aliases too by placing // at the beginning of a command to stop it from working.

E.g. to put a title at the top of the script to say 'This is my Script' and so that Nightfire will not try to read it as part of the code it would look like this.

//This is my script

  Unbind/all  

Unbind is used for freeing up individual keys so that you can use the bind command. Unbindall frees up all the keys at once.

  Wait  

The Wait command tells Nightfire to pause before continuing. The actual wait time is very short, 1/60th of a second.





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

 
     

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