Quake 4 News header
Quake 4 News ButtonQuake 4 Articles buttonQuake 4 Forums buttonAugust 28 2008 22:44:26
bulletNavigation
Submit Article
Submit News
Articles
Contact Me
Forums
News
Privacy Policy
Search
Site Map
Terms and Conditions
Pickup Channel
General Rules
Quake 4 CTF League
Rules
CTF Guide
CTF League Archive
Season 2 Div 1 Schedule
Season 2 Div 2 Schedule
Season 2 Standings
Season 1 Standings
Season 1 Schedule
Quake 4 News
Q4Max News
Quake 4 News
Quake 4 Config Tips
_impulse List for MP
Ascii Symbols
Basic Scripting
Color Chart
Name Tricks
USB Rate Change
Quake 4 Common Errors
Quake 4 Movement Tips
Crouch Sliding
Ramp Jumping
Rocket Jumping
Strafe Jumping
Quake 4 Gameplay Tips
Power Up Timing Guide
Weapon Definitions
Quake 4 Server Guide
Chicago Server Config
Setting Up Autodownload
Server Cvars
bulletAffiliates
Q4Max
id Software
ES Reality
Quake 4 Files
Spontan Games
GGL
Link to us!

tc-button
bulletTotal Downloads
Our files have
been downloaded
150366 times!
Quake 4 Basic Scripting Tutorial
One of the nicest things about Q3 was the ability to create complicated custom config files that would allow a player to control many features of the game without having to resort to the menu. You could also execute strings of commands with one key stroke or toggle features on and off quickly and easily with a properly designed config.

In the original release of Q4 the game designers took away the ability to stack game variables starting with _ (ie: _zoom, _impulse01 etc). The reason they did this was to take away scripts that they felt altered the balance of the game such as rocket jump scripts etc. For those new to Quake, in Quake 3 a Rocket Jump script allowed a player to execute a rocket jump by hitting one key and boom! they were flying. Back in the early days of Q3 there was debate in the competitive community as to whether rocket jump scripts should be allowed or not. There were even some leagues that attempted to ban the use of this type of script with varying degrees of success but there were still a fair number of people using them all the way to the bitter end.

Fortunately, with the release of the 1.2 patch there were new commands (doButton and doImpulse) released that allowed the use of impulses and buttons in multiplayer scripts again.

If you google there are literally dozens of scripts for you to download without have to know anything about scripting other than how to plug them into your config and set them to bind to a key. This article is about more than just providing you with a script...you should get the basics of learning how to create your own.

Basic Scripting Components

  • vstr variable string
  • exec executable command
  • alias user definded variable
  • bind assign a key to a string

Basic Name scroll script

bind key1 vstr ua_namecycleup
bind key2 vstr ua_namecycledn
bind key3 vstr ua_nameset

set ua_namecycleup vstr ua_name_1
set ua_namecycledn vstr ua_name_1

set ua_name_1 "addChatLine 'n00bicide';set ua_nameset ui_name n00bicide;set ua_namecycleup vstr ua_name_2;set ua_namecycledn vstr ua_name_3"
set ua_name_2 "addChatLine 'tinkerbell';set ua_nameset ui_name tinkerbell;set ua_namecycleup vstr ua_name_3;set ua_namecycledn vstr ua_name_1"
set ua_name_3 "addChatLine 'Leroy Jenkins';set ua_nameset ui_name 'Leroy Jenkins';set ua_namecycleup vstr ua_name_1;set ua_namecycledn vstr ua_name_2"


This script allows you to scroll through a list of names before selecting one. This style of script is useful for callvoting of maps, changing names if you play under multiple names etc .

The way it works is pretty simple. You simply bind the vstr user aliases to whichever keys are appropriate to your config. The cycle up and the cycle down alias both start on the first option. That binds the keys up and down away from the first alias. With each keystroke in either direction it resets to the next option creating a "scrolling list". The third key sets the option you select via the scroll. Each option announces itself in the chat box so you know what you are selecting.


Basic settings 'slider'

bind key1 "vstr ua_vdn"
bind key2 "vstr ua_vup"
set ua_vdn vstr ua_vol09
set ua_vup vstr ua_vol09

set ua_vol00 "set s_volume 0.0;set ua_vdn vstr ua_vol00;set ua_vup vstr ua_vol01;AddChatline '^7Volume ^c012==============='"
set ua_vol01 "set s_volume 0.1;set ua_vdn vstr ua_vol00;set ua_vup vstr ua_vol02;AddChatline '^7Volume ^2=^c012=============='"
set ua_vol02 "set s_volume 0.2;set ua_vdn vstr ua_vol01;set ua_vup vstr ua_vol03;AddChatline '^7Volume ^2==^c012============='"
set ua_vol03 "set s_volume 0.3;set ua_vdn vstr ua_vol02;set ua_vup vstr ua_vol04;AddChatline '^7Volume ^2===^c012============'"
set ua_vol04 "set s_volume 0.4;set ua_vdn vstr ua_vol03;set ua_vup vstr ua_vol05;AddChatline '^7Volume ^2====^c012==========='"
set ua_vol05 "set s_volume 0.5;set ua_vdn vstr ua_vol04;set ua_vup vstr ua_vol06;AddChatline '^7Volume ^2=====^c012=========='"
set ua_vol06 "set s_volume 0.6;set ua_vdn vstr ua_vol05;set ua_vup vstr ua_vol07;AddChatline '^7Volume ^2======^c012========='"
set ua_vol07 "set s_volume 0.7;set ua_vdn vstr ua_vol06;set ua_vup vstr ua_vol08;AddChatline '^7Volume ^2=======^c012========'"
set ua_vol08 "set s_volume 0.8;set ua_vdn vstr ua_vol07;set ua_vup vstr ua_vol09;AddChatline '^7Volume ^2========^c012======='"
set ua_vol09 "set s_volume 0.9;set ua_vdn vstr ua_vol08;set ua_vup vstr ua_vol10;AddChatline '^7Volume ^2=========^c012======'"
set ua_vol10 "set s_volume 1.0;set ua_vdn vstr ua_vol09;set ua_vup vstr ua_vol11;AddChatline '^7Volume ^2==========^c012====='"
set ua_vol11 "set s_volume 1.1;set ua_vdn vstr ua_vol10;set ua_vup vstr ua_vol12;AddChatline '^7Volume ^2===========^c012===='"
set ua_vol12 "set s_volume 1.2;set ua_vdn vstr ua_vol11;set ua_vup vstr ua_vol13;AddChatline '^7Volume ^2============^c012==='"
set ua_vol13 "set s_volume 1.3;set ua_vdn vstr ua_vol12;set ua_vup vstr ua_vol14;AddChatline '^7Volume ^2=============^c012=='"
set ua_vol14 "set s_volume 1.4;set ua_vdn vstr ua_vol13;set ua_vup vstr ua_vol15;AddChatline '^7Volume ^2==============^c012='"
set ua_vol15 "set s_volume 1.5;set ua_vdn vstr ua_vol14;set ua_vup vstr ua_vol15;AddChatline '^7Volume ^2==============='"


This script allows you to have a slider control of any setting. The one above is set to volume. It works the same as on your stereo. You hold the appropriate key to make it go up or down as you choose. This can be used for brightness, gamma, volume, lighting settings or whatever you feel you may need to adjust in game without tinkering in the menu. The example above is set up to change volume with a graphic showing the volume setting.


Templates

These templates can be used for whatever you wish. Please feel free to experiment and post comments on any successes or questions you may have.

Scrolling List with Option Select

bind key1 vstr ua_variablecycleup
bind key2 vstr ua_variablecycledn
bind key3 vstr ua_variableset

set ua_variablecycleup vstr ua_variable_1
set ua_variablecycledn vstr ua_variable_1


set ua_variable_1 "addChatLine 'announcement 1';set ua_variableset wtvrsetting;set ua_variablecycleup vstr ua_variable_2;set ua_variablecycledn vstr ua_variable_3"

set ua_variable_2 "addChatLine 'announcement 2';set ua_variableset wtvrsetting;set ua_variablecycleup vstr ua_variable_3;set ua_variablecycledn vstr ua_variable_1"

set ua_variable_3 "addChatLine 'announcement 3';set ua_variableset wtvrsetting;set ua_variablecycleup vstr ua_variable_1;set ua_variablecycledn vstr ua_variable_2"



Slider Settings Change

bind key1 vstr ua_settingscrollup
bind key2 vstr ua_settingscrolldn
set ua_settingscrollup vstr ua_setting_1
set ua_settingscrolldn vstr ua_setting_1
set ua_setting_1 "addChatLine 'announcement 1';set wtvrsetting;set ua_settingscrollup vstr ua_setting_2;set ua_settingscrolldn vstr ua_setting_5"
set ua_setting_2 "addChatLine 'announcement 2';set wtvrsetting;set ua_settingscrollup vstr ua_setting_3;set ua_settingscrolldn vstr ua_setting_1"
set ua_setting_3 "addChatLine 'announcement 3';set wtvrsetting;set ua_settingscrollup vstr ua_setting_4;set ua_settingscrolldn vstr ua_setting_2"
set ua_setting_4 "addChatLine 'announcement 4';set wtvrsetting;set ua_settingscrollup vstr ua_setting_5;set ua_settingscrolldn vstr ua_setting_3"
set ua_setting_5 "addChatLine 'announcement 5';set wtvrsetting;set ua_settingscrollup vstr ua_setting_1;set ua_settingscrolldn vstr ua_setting_4"

flag Comments
madmark on July 26 2006 09:40:35
//Timeout-Timein
set time "timeout;bind F5 vstr time1"
set time1 "timein;bind F5 vstr time"

//Ambientlight on/off
bind "o" toggle r_ambientLightOnly 0 1 1.5 2;addchatline 'AmbientLight';addchatline $r_AmbientLightOnly

//Gamma toggle
bind n "toggle r_gamma 1.0 1.2 1.4 1.6 1.8 2.0;addchatline 'Gamma';addchatline $r_gamma"

//Brightness toggle
bind m "toggle r_brightness 1.0 1.2 1.4 1.6 1.8 2.0;addchatline 'Brightness';addchatline $r_brightness"

//Lightdetail
bind h "toggle r_lightDetailLevel 0 3 5 7 9;addChatLine 'LightDetailLevel';addChatLine $r_lightDetailLevel"

//Demo on/off Toggle Script
set netdemo "recordNetdemo;bind F11 vstr stoprecord;addchatline '^2Recording'"
set stoprecord "stopNetdemo;bind F11 vstr netdemo;addchatline '^3Stopped Recording'"

//Alle Anzeigen an
bind "t" "toggle com_showfps;toggle hud_showjumps;toggle hud_showspeed"
set logFile 1

//Autoaction (demo-screen or off)
bind "-" "toggle cl_autoaction 0 6;addchatline 'autoAction';addchatline $cl_autoaction"

//Enemysounds
bind "," "toggle s_altEnemySounds 0 1 2;addchatline 'Enemysounds';addchatline $s_altEnemySounds"

//Hitsounds
bind "." "toggle s_althitsounds 0 1;addchatline 'Hitsounds';addchatline $s_althitsounds"

//Enemycolors
bind ö "toggle cl_enemyColorArms 00ff00 ffff00 ff0000 0000ff 00ffff;toggle cl_enemyColorTorso 00ff00 ffff00 ff0000 0000ff 00ffff;toggle cl_enemyColorLegs 00ff00 ffff00 ff0000 0000ff 00ffff"

//Volume up-down
bind "kp_plus" "incrementCvar s_volume 0.05 1; addchatline '^3Volume up'"
bind "kp_minus" "decrementCvar s_volume 0.05 0; addchatline '^2Volume down'"
trexx on February 15 2007 01:24:05
Sup, ive been playing quake games for about 3 years, but im jsut beginning to learn about scripting with Quake code, atm im playing call of duty and im gettin pretty sick at making configs, but i was looking for a way to toggle vars in increments and a google search pointed to the vstr command and this site...ill mess around over the weekend and see what i can come up with, should be fun.
flag Post Comment
Please Login to Post a Comment.
flag Ratings
Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Copyright © 2006