|
|
- tutorials -
tutorials written by both strider and ekim. if you require more help with either the tutorials already posted here, or if you would like help with another subject, please feel free to contact us. comments appreciated :)
|
^ |
scripting tutorial |
|
- the basics - configuration files - binding - aliases - _special - variables - providing feedback -
the basics
scripting enhances tfc and other hl mods by allowing the player to simplify some aspects of play. some scripts do this to an extent that they provide an unfair advantage, but this tutorial isn't going to discuss that, just tell you the basics so you can make some scripts for yourself.
when you do anything in half life, you either press a key on the keyboard, a button on your mouse or you move your mouse. moving your mouse changes your aim, but anything else you do is done by invoking a console command. you could in theory play tfc just by moving the mouse and typing commands into the console. this would probably a little slow though, so to make it commands are bound to keys / buttons.
there are three types of console commands - settings, once off and "sticky".
settings are thing like "brightness" and "sensitivity" that affect how commands or data are processed . they hold the value given to them, or the default value if you have not changed them.
once off commands are commands such as discard or tf_weapon_supershotgun that do one thing when invoked.
"sticky" commands are commands such as +forward or +attack that when invoked start performing some action such as moving in a direction and stop performing that action when the opposite command such as -attack is invoked. if a key is bound to a sticky command, the + version is invoked when the key starts to be held down and the - version invoked when the key is released. put simply, if you bind w to +forward you'll walk forward while you hold down the w key and stop when you let it go.
some commands can have parameters. all settings and some one off commands have parameters. a parameter is something entered after the command to change what that command does. for example, the command sensitivity changes the setting that affects how sensitive the mouse is. it needs a number after it when used as a command to tell half life what to change sensitivity to. for settings, typing the command at the console without a parameter will usually tell you what the current value of that setting is.
configuration files
your configuration files are located in the /hl/tfc folder and contain saved commands and commands you can execute quickly by opening the file in half life.
to run a configuration file, type
exec 'cfg.cfg' at console
where 'cfg.cfg' is replaced by the path of the configuration file taking /tfc as the root.
config.cfg saves all your bindings and any settings changed from default. half life performs all commands and settings contained in here when you first load half-life. note that aliases are NOT saved in config.cfg. autoexec.cfg is a configuration file similar to config.cfg in that it is executed when the game state is first loaded, but different in that half-life will not edit this file. config files with names such as scout.cfg or soldier.cfg are class configs. these will be run by half life whenever you change class and are useful if you want to bind keys to different things for different classes. similarly, you can create map configs such as 2fort.cfg that are executed when the map changes. you can also create a mapdefault.cfg that executes on maps for which you do not have configs.
if you want to script, you should put the following commands in autoexec.cfg before continuing
console "1.0" {this enables you to use the console when you play tfc} bind ` toggleconsole {this binds the key to the left of the 1 key to toggling the console on/off in tfc. you can bind it to something else if you want. setinfo_ec 1 {this is needed if you want class config files to execute themselves when you change class} setinfo_em 1 {this is needed if you want map config files to execute themselves when the map is changed}
binding
the simplest thing you can do is execute a command. to do this, simply type it into the console in tfc.
if you want to bind a key to a command, type the following into the console: bind 'key' 'command'
where 'key' is the key you wish to bind and command is the command you want that key to be bound to. for example:
bind i flaginfo
if the command has spaces in it, you need to put it in quotation marks or tfc won't understand it properly. for example:
bind g "say_team Hello, team!"
you can bind more than one command to a key. the syntax for this is: bind 'key' "'command'; 'command'" for example:
bind v "dropitems; say_team Flag dropped!"
this would drop the flag and say "Flag dropped!" in messagemode2. you can bind as many commands as you like to a single key, just separate each command with a semicolon.
you can bind sticky commands in the same way and combine them with once off commands or settings.
bind c "+voicerecord; say_team I'm talking!"
when you hold down the c key, you would say "I'm talking" in messagemode2 once and then use voice comm until the key was released.
similarly you can bind keys to change settings
bind j "fov 120"
you can bind more than one setting or settings and non settings to one key
bind "3" "tf_weapon_supershotgun; fov 90; sensitivity 5" bind "5" "tf_weapon_rpg; fov 120; sensitivity 12"
aliases
aliases are like commands that you make ("declare") yourself. they can be either one-off or sticky. they can contain any number of commands of any type. be careful putting sticky commands inside aliases however.
you declare an alias like this:
alias 'aliasname' "'command'; 'command'; 'command'"
for example
alias dropflag "dropitems; say_team Dropped the flag!"
you can then invoke the alias like it were a predefined command by entering its name at the console. aliases can be bound and contained in other aliases like any normal command. aliases can declare other aliases.
bind g dropflag
and when I hit g I would drop the flag and say in messagemode2 "Dropped the flag!"
to make a sticky alias, you need to declare both the + and the - version
alias +zoom "fov 20" alias -zoom "fov 0"
you can use alias declaration within aliases to create things such as weapon switch scripts
alias shotgun "tf_weapon_supershotgun; fov 90; sensitivity 5; alias switch rocket" alias rocket "tf_weapon_rpg; fov 120; sensitivity 12; alias switch shotgun" alias switch shotgun bind mouse3 switch
now when mouse3 is pressed it switches between rocket launcher and shotgun.
you can use alias declaration within aliases to create toggles for commands that are normally sticky.
alias voiceon "+voicerecord; alias voice voiceoff" alias voiceoff "-voicerecord; alias voice voiceon" alias voice voiceon bind v voice
now when when v is pressed, voice recording starts and the alias bound to the key is redeclared so when it is pressed again voicerecording is stopped.
the wait command can be very important. when invoked it causes half life to wait one "tick" before doing anything else. if an alias or binding you are using contains lots of commands in short succession it may be necessary to break them up with ; wait; to allow half life to process them properly. if a script you made isn't working, experiment with this. beware however, the use of too manys waits will slow down the the processing of everything you do until the waits are resolved.
_special scripting
_special scripting allows you to create an infinite loop that performs a command every "tick" the engine moves through. only one can be used at once however. the actual way this works is a little hard to follow, so I'll just explain how to do it yourself.
alias start "+attack2; -attack2" alias terminate "slot10" alias +spec "alias _special ''command/alias''; start; slot10" alias -spec "alias _special terminate" alias son "+spec; alias spec soff" alias soff "-spec; alias spec son" spec
some examples of uses of this are the bunnyhop and chopping scripts
Use of _special is banned in ETAC and most european leagues
variables
%a %h and %i are variables you can use in tfc text communication. %h is your current health, %a is your current armour, %i is the name of the last person you moved your crosshair over.
bind q "saveme; say_team Heal me! I only have %h health left!" bind z "say_team I'm right behind you, %i!" bind x "say Good fight, %h health and %a armour remaining"
providing feedback
the speak command speaks words for you in the half life announcer voice. it is used as follows:
speak word.otherword.anotherword
a full list of words it can speak can be found here.
if the setting developer is set to 1, you can use the echo command to print messages to the console and top of the screen. for example,
bind k "disguise_enemy 1; echo Disugisng as scout"
the scr_connectmessage setting leaves text onscreen, in a black box at the bottom of the display. this stays until you change the setting back to "". this can be useful to remind yourself of comms bindings etc.
scr_connectmsg "F1 - Spiral | F2 - Lift | F3 - Outgoing | F4 - Resupping"
you still need to bind the commands, this is for information only. to clear it, use scr_connectmessage ""
that's all i can think of for now...
as usual drop us a line if there's anything wrong / could be added. check out the scripts page too, and contact me if you can't find what you need there and i should be able to help you out :) |
|
ekim - comments(0) |
|
^ |
cap sound creation |
|
1. download goldwave 2. open a. .mp3/.wav 3. drag the two lines from the left and right in order to create a selection of the part of the mp3 you wish to use 4. edit -> trim 5. select the last few seconds of the section 6. effect -> volume -> fade out 7. edit -> select all 8. file -> save as -> wave & pcm unsigned 8 bit mono 9. copy the .wav and paste into sounds/vox and /misc |
|
strider - comments(1) |
|
^ |
bunnyhopping |
|
well, cba to write a new tutorial atm, and I got good feedback from the old one, so, even if it probably does sound a bit newbie, here it is....
you may also want to check out ballz' visual and written bunnyhopping tutorial which can be found on our demos page.
how to bunny hopping, although nerfed in a previous hl patch, is still a part of the game and can be done to a lesser extent than before. bunnyhopping is a combination of two features of the hl engine. these are air acceleration and the fact that if you time a jump just right, you leave the ground the second you touch it and suffer no friction. bunny hopping is hard though and takes a lot of practice to master. bunny hopping requires no movement apart from strafing, jumping and the turning of your mouse - this means you must not press the forwards or backwards keys . to start with, you may wish to download mulch_bhop, as I will be explaining what to do with this map as reference, although any other map with lots of open room will suffice.
before you do anything, you will need either mwheelup or mwheeldown bound to +jump. to do this, open your config.cfg and insert the following:
bind mwheelup +jump
or type this at the console in game
now start a lan game on mulch_bhop. stand against one of the walls and face the the wall on the other side of the map. press forward, quickly scroll your mouse wheel so that you jump, then release forward. keep on looking straight, don't move your mouse, but just continue jumping by scrolling the mousewheel. with any luck you will make it at least half way across the map without pressing forward apart from to start you off. if you can do this, you are jumping in time enough to continue through this guide, if you cannot, keep trying, because if you can't do this bunny hopping will be much harder if not impossible.
now we will move on to actually bunnyhopping. to aid you in this, you may wish to download nemesis (or sparkies, though the figures in the table may not match). this includes a speedometer which should help you judge if you're gaining speed through bunnyhopping
setting it up is simple enough, just take the time to read the short readme so your not stuck on how to set it up in-game. start up a lan game again and setup nemesis to show your speed with "text" to save you from having to do it later. the following table indicates the max normal speeds, cap speed and a good bhop speed for every class - these numbers correspond with those used by nemesis.

normal = speed attained by just holding forward key good bhop = if you can get this speed constant, you can bhop cap = if you are moving faster than this when you land ANY jump, hl slows you down to your classes normal speed
to bunnyhop, you need to jump constantly like you did before then accelerate while in the air. air acceleration requires the lateral movement of the mouse in co-ordination with a strafe in the same direction. once you've mastered it, it will come automatically and you'll find yourself moving by bhopping 90% of the time without thinking. the basics:

because bunny hopping relies heavily on the movement of the mouse and the timing and co-ordination between that and strafing, you can learn by using a bunnyhop script.
once you've done this start another lan game on mulch_bhop. press space to start the script, and space again to stop it. face the other side of the map, press forward then tap space to start the script. then just practice the mouse/strafe movement, that is all that can be done. practice makes perfect.
and that's it. all it takes is a lot of patience and a lot of practice. remember to refer to the table of speeds to see if you are bhopping well or not. once you are confident that you've mastered bhopping with the above script, try it with a simple 'bind mwheelup +jump', and then you should be away. good luck :)
if you need any further help please feel free to contact me. you may also wan't to check out the demos section for specifics.
note: use of nemesis and the above script is illegal in etac and most leagues, and should therefore only be used for educational purposes. |
|
strider - comments(0) |
|
^ |
ramp gliding |
|
ramp gliding is one of the most useful and most commonly used of the "advanced techniques" in tfc. it is also one of the most easiest to grasp. you may notice that when you slide up a ramp, you 'bounce' at the top. to avoid this, simply tap or hold you duck key just before and as you pass over the top. this will enable you to slide over the top and retain your speed without getting stopped. the only way to learn the timing of this is to try it yourself. basically, practice makes perfect.
one of the best places to start/learn is shutdown2. try and conc into the ramp (not over it). as you slide up, do as said before and simply tap duck just as your about to go over the top. you can steer yourself in the air afterwards into the t or lift with the strafe key and mouse movement. and that's it :) i've uploaded some demos showing this in case your unsure of what to do. if you need any help, contact me, and good luck :)
shutdown2-1 shutdown2-2 |
|
strider - comments(0) |
|
^ |
strafe jumping/concing |
|
strafe jumping is extremely easy and very useful, especially when used in conjuction with concing. it involves what the name suggests - strafing and jumping, and a quick 'flick' of the mouse. run or bhop forward, and to go into a strafe jump, release forward, tap your jump key, holding your strafe right key (in this case) and move you mouse in a fashion shown in the diagram below..
this movement allows extra distance and speed to be gained, and because of this it can be used to clear distances which are not possible with a normal jump, or gain extra height and speed when going into a conc. in order to do a strafe conc, simply do the above but have a conc go off as you jump. you should notice a gain in height/speed.
as always, if you require any help please contact me. |
|
strider - comments(0) |
|
|