Difference between revisions of "Scripts"

From Fortress Forever Wiki
Jump to navigationJump to search
m
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=What's a Script?=
+
{{Infobox manual/Header}}
 +
{{Infobox manual}}
 
A script is a config file (usually for a specific class) that has key binds that make it easier for you to access class-specific functions.
 
A script is a config file (usually for a specific class) that has key binds that make it easier for you to access class-specific functions.
  
Line 17: Line 18:
 
[[Engineer Scripts]]<BR>
 
[[Engineer Scripts]]<BR>
  
==Making a Script==
+
=Making a Script=
 
Making a script is nothing more than stringing commands together to achieve a particular result.
 
Making a script is nothing more than stringing commands together to achieve a particular result.
 
To create a sequence of actions, list your commands followed by a semicolon (;) then a space ( ).
 
To create a sequence of actions, list your commands followed by a semicolon (;) then a space ( ).
 
When listing multiple commands, make sure you use quotation marks (") to enclose your script!
 
When listing multiple commands, make sure you use quotation marks (") to enclose your script!
  
=Aliases=
+
==Aliases==
 
An alias is another name used to define a list of commands, just as "driving a car" is a name for all the activities that make up driving.
 
An alias is another name used to define a list of commands, just as "driving a car" is a name for all the activities that make up driving.
  
 
+
===Example: How it should look===
 
+
<pre>alias example "command1; command2; command3"</pre>
=Example: How it should look=
 
[code]alias example "command1; command2; command3"[/code]
 
  
 
This code creates an alias named example. If we typed example into the console, or executed it in a cfg file, command 1, 2, and 3 would execute in the order listed in the alias.
 
This code creates an alias named example. If we typed example into the console, or executed it in a cfg file, command 1, 2, and 3 would execute in the order listed in the alias.
Line 34: Line 33:
 
An alias can also be used to shorten commands for use in scripts.
 
An alias can also be used to shorten commands for use in scripts.
  
[code]alias c4 "command4"[/code]
+
<pre>alias c4 "command4"</pre>
  
We can use our newly created commands, [b]example[/b] and [b]c4[/b], in further scripts.
+
We can use our newly created commands, '''example''' and '''c4''', in further scripts.
[code] alias example2 "example; c4"[/code]
+
<pre>alias example2 "example; c4"</pre>
 
    
 
    
This would be a good time to visit the [link to command list] to see what possibilities you can string together.
+
This would be a good time to visit the [[Script Reference]] to see what possibilities you can string together.
 +
 
 +
Now that you've got a list of commands in mind, or in best case, already written up, what do you do? You can copy and paste it into the console every time, or you can bind it to a key, using the '''bind''' command.
 +
 
 +
===Example: Detonate dispenser===
 +
<pre>bind x "detdispenser"</pre>
  
Now that you've got a list of commands in mind, or in best case, already written up, what do you do? You can copy and paste it into the console every time, or you can bind it to a key, using the [b]bind[/b] command.
+
===Example: Medic Shout + Text===
=Example: Detonate dispenser=
+
<pre>bind x "saveme; say Text here."</pre>
[Code] bind x "detdispenser"[/code]
 
=Example: Medic Shout + Text=
 
[code]bind x "saveme; say Text here."[/code]
 
  
==How to Use the class.cfg file system==
+
=How to Use the class.cfg file system=
  
 
Located in your FortressForever\cfg folder, you will see a .cfg file for each class.
 
Located in your FortressForever\cfg folder, you will see a .cfg file for each class.
[pic]
+
[example directory picture]
  
 
These files are executed when you spawn after dying. They are perfect for storing class-specific key bindings, as well as more advanced scripts. The Userconfig.cfg file is also loaded every time you spawn, because it is listed in the class.cfg. Userconfig.cfg is used for global scripts and aliases.
 
These files are executed when you spawn after dying. They are perfect for storing class-specific key bindings, as well as more advanced scripts. The Userconfig.cfg file is also loaded every time you spawn, because it is listed in the class.cfg. Userconfig.cfg is used for global scripts and aliases.
Line 73: Line 74:
  
 
[[Category:Scripts]]
 
[[Category:Scripts]]
 +
{{Infobox manual/Footer}}

Latest revision as of 22:19, 1 May 2010


Fortress Forever
NavMenu ScoutConc 300px.jpg
Scout Concing in Fortress Forever
Introduction
What is Fortress Forever?
Installation and Setup
System Requirements
DownloadsMain Menu
SetupBeginner's Guide
Scripts
Playing the Game
Team and ClassHUD
Map GuidesGame Goals
WeaponsGrenadesBuildables
AmmoArmorStatus Effects
Class Guides
ScoutSniperSoldier
DemomanMedicHWGuy
PyroSpyEngineerCivilian
Advanced Gameplay
Movement Skills
Jumping Skills
Technical Reference
Class Reference Guide
Weapons Reference Guide
Grenades Reference Guide
Ammo Reference
Armor Reference
Modding
Map Editing
FAQ
TF2 Player's Guide To FF
TFC Player's Guide To FF
Client commands and variables
Troubleshooting
Release Notes


A script is a config file (usually for a specific class) that has key binds that make it easier for you to access class-specific functions.

General Scripts

General Scripts
Cleanup Script Very useful!

List of Class-Specific Scripts

Scout Scripts
Sniper Scripts
Soldier Scripts
Demoman Scripts
Medic Scripts
HWGuy Scripts
Pyro Scripts
Spy Scripts
Engineer Scripts

Making a Script

Making a script is nothing more than stringing commands together to achieve a particular result. To create a sequence of actions, list your commands followed by a semicolon (;) then a space ( ). When listing multiple commands, make sure you use quotation marks (") to enclose your script!

Aliases

An alias is another name used to define a list of commands, just as "driving a car" is a name for all the activities that make up driving.

Example: How it should look

alias example "command1; command2; command3"

This code creates an alias named example. If we typed example into the console, or executed it in a cfg file, command 1, 2, and 3 would execute in the order listed in the alias.

An alias can also be used to shorten commands for use in scripts.

alias c4 "command4"

We can use our newly created commands, example and c4, in further scripts.

alias example2 "example; c4"

This would be a good time to visit the Script Reference to see what possibilities you can string together.

Now that you've got a list of commands in mind, or in best case, already written up, what do you do? You can copy and paste it into the console every time, or you can bind it to a key, using the bind command.

Example: Detonate dispenser

bind x "detdispenser"

Example: Medic Shout + Text

bind x "saveme; say Text here."

How to Use the class.cfg file system

Located in your FortressForever\cfg folder, you will see a .cfg file for each class. [example directory picture]

These files are executed when you spawn after dying. They are perfect for storing class-specific key bindings, as well as more advanced scripts. The Userconfig.cfg file is also loaded every time you spawn, because it is listed in the class.cfg. Userconfig.cfg is used for global scripts and aliases.

List of commands

A list of available commands can be found at the Script Reference page.

Uh oh! I screwed up one of my config files! What do I do?

Relax. Just find the default config listed below for whatever you screwed up and paste it into the config file.

Userconfig default
Scout default
Sniper default
Soldier default
Demoman default
Medic default
Hwguy default
Pyro default
Spy default
Engineer default
Civilian default