PDA

View Full Version : Aliases - IN DEPTH


Nautilian
29 Mar 2005, 16:31
Before we can enter into the realm of aliases I need to explain first what Unreal Tournament Key Bindings are.

I found a nice article that sums this up (thanks to Planet Unreal)

Unreal Tournament Key Bindings
In the Unreal Tournament key bindings (type PREFERENCES to bring up Advanced Options / Advanced / Raw Key Bindings), you can associate console commands and other special input commands with key presses and releases. In the text box next to a key name, you can type in one or more console commands, separated by the "|" character. For example, to bind the "S" key to the "Jump" alias, type this:

Jump
That causes the "Jump" alias to be executed when th user presses the "S" key. For another example, if you want to bind a chat message to a key, use this:

Say "Come get some!"
In addition, you can bind multiple actions to a keypress like this, to make the "S" key both jump and say a message.

Jump | Say "Come get some!"
You can also bind an action to the release of a key by using the OnRelease keyword. For example, you can make the "S" key fire when it's released:

OnRelease Fire
Or you can make the key jump when pressed, and fire when released:

Jump | OnRelease Fire
Keys can be bound to any of the following kinds of things:

Any console command in the above lists.
Any key alias (explained below).
Any special input command.

"Special input command" refers to console commands which only make sense in conjunction with the press or release of a key, or the movement of the mouse or joystick along an axis. The special input commands are:

BUTTON <UnrealScript boolean variable name>, for example "BUTTON bFire": Maps a button to an UnrealScript variable stored in the Pawn class or any subclass. This tells the input system to automatically set the variable to True when the key is held down, and False when it's not pressed. For example, the Pawn script looks at bFire to tell whether the fire button is being held. The setting of bFire is not some hardcoded behavior of the engine, rather it is propagated into UnrealScript code by the input system, as a result of binding a key to "BUTTON bFire".
TOGGLE <UnrealScript boolean variable name>, for example "TOGGLE bLook": Like the BUTTON command, but simply tells the input system to toggle the boolean variable's value when the key is pressed.
AXIS <UnrealScript floating point variable name> <SPEED=some number>, for example "Axis aStrafe Speed=-300.0". Maps an analog input axis movement to an UnrealScript variable, scaling it by some factor. The current axis keys listed in the Advanced Options menu are: MouseX, MouseY, MouseW (Intellimouse wheel), JoyX, JoyY, JoyZ, JoyR (joystick rudder), JoyU, JoyV (joystick alternate axis for example the Panther XL trackball). Supported PlayerPawn axes are aBaseX, aBaseY (base movements which are translated to rotating, strafing, looking, and forward movement based on context), aMouseX, aMouseY, aForward, aTurn, aStrafe, aUp (not used), aLookUp, aExtra0-aExtra4 (not used).
You can also bind keys from the console using the following command:

SET INPUT <keyname> <binding>
For example:

SET INPUT X Fire
SET INPUT Enter Fire
Unreal Tournament Key Aliases

Aliases provide a convenient way to map one word (for example, "Jump") to a complex series of console commands that carry out a particular action. For example, the "Fire" alias is defined as: "Fire | Button bFire". This has the effect of calling the UnrealScript "PlayerPawn.Fire" function (aliases are not recursive), and then causing the input button bJump to be set to True as long as the key is held.

(Thanks to Planet Unreal for additional material added)

You cant have more than 39 alias, fortunately the majority of existing alias are redundant or pointless and can be removed/replaced.
note: there is a defuser.ini in your system dir so any changes you make can be rectified.
The quick list of safely removeable alias are:
10,11,12,13,14,15,16,18,19,20,21,23,24

I have broken the full list down for more specific information to allow you to make your own choices:
[0] to [9] are movement alias and shouldn't be messed with.
[10] and [11] are LOOK alias, if you use a mouse and freelook like all normal players these are not needed.
[12], [13] and [14] are all INVENTORY alias, since no default gametypes in UT2004 use inventory these are pointless too (although future mods make make use of them)
[15] and [16] are two more LOOK alias, again if you use the mouse exclusively for looking these are of no use to you.
[17] is the centerview alias, personally i got no use for it but i know some people do, make up your own mind.
[18] is a walk alias, when walking you cannot fall off ledges (same as crouching which is a better way of doing it and thus renders walk pointless).
[19] strafe button, another joypad firendly alias: hold this button and left right turning become left right strafe, useless to most of us.
[20] erm wtf ?! i really dont see the point in this alias at all.
[21] a freelook button is pointless for us mouse users, we have it turned on permanently anyway.
[22] I'm guessing this was like the old ut99 ability to view through a team mates eyes during a match, however it doesnt appear to work in UT2004, i've left this alias in for now.
[23] and [24] turntonearest/turn180 is a part of the unreal engine that ONLY enabled in console games, go ahead and get rid of them.
[25] [26] and [27] (typically bound to F1 F2 and F3) are server information alias, leave these alone.
[28] is the VOIP alias that serves [29] [30] and [31] leave these as is for now.
[32] [33] [34] and [35] are specifically for the spacefighter vehicle (AS-mothership) and are best left alone.
[36] to [39] are empty by default.

__________________________________________________ _____

alias toggling, ie binding a button from within an alias.

set input
basic usage example

Aliases[36]=(Command="speech ACK 0|set input W yes2",Alias="yes1")
Aliases[37]=(Command="speech ACK 3|set input W yes1",Alias="yes2")

W=yes1

pressing W makes player say "affirmative" and changes the bind for W
pressing W a second time makes player say "roger" and reverts back

For those who want to bind speech commands I will provide the full list at the end of this.

__________________________________________________ __________

If you are using custom name.ini files or plan to this will be of interest.
use of the command: exec filename
Where (filename) is a name of a file and its extension in you UT2004 system dir that contains all you new bindings/commands can be very handy to keep things seperate.

Basic example in user.ini:

Aliases[35]=(Command="teamsay New vehicle available at...|exec onsloc.gou",Alias="newcar")
Aliases[36]=(Command="teamsay help needed at...|exec onsloc.gou",Alias="helpme")
Aliases[37]=(Command="teamsay Flag carrier went...|exec ctfloc.gou",Alias="flaggone")
Aliases[38]=(Command="teamsay I got the flag, going...|exec ctfloc.gou",Alias="gotflag")
Aliases[39]=(Command="exec revert.gou",Alias="revert")

up=helpme
down=newcar
left=flaggone
right=gotflag
end=revert
contents of onsloc.gou:

set input up teamsay enemy base
set input down teamsay our base
set input left teamsay my location
set input right teamsay our node

contents of ctfloc.gou:

set input up teamsay high route
set input down teamsay low route
set input left teamsay left route
set input right teamsay right route

contents of revert.gou:

set input up helpme
set input down newcar
set input left flaggone
set input right gotflag

pressing the "end" key in this example sets the arrow keys back to the original bindings so they can be used again.

You will have noticed the use of the | in the alias, this just basically allows a further command to be set. You cannot use an | inside an external file. If you do you will find it gives you complications or creates odd binds.

(Thanks to Lauke for the article - Netherlands WCG player)

Creating a key/bind for weapon switching so pressing E for Link Gun and pressing again to get the Minigun. This is the way you do it:
E=pipedswitchweapon 5 | pipedswitchweapon 6

The Weapons are as follows:
switchweapon 0 = Super Weapons. Ion Painter, Target Painter and the Redeemer.
switchweapon 1 = Shield Gun.
switchweapon 2 = Assault Rifle.
switchweapon 3 = Bio Rifle and the Mine Layer.
switchweapon 4 = Shock Rifle.
switchweapon 5 = Link Gun.
switchweapon 6 = Minigun.
switchweapon 7 = Flak Cannon and the Grenade Launcher.
switchweapon 8 = Rocket Launcer and the Avril.
switchweapon 9 = Lightning Gun and the Sniper Rifle.
switchweapon 10 = Translocator.

Note that on weapons 0, 2, 7, 8 and 9 there is more than one weapon in that group and if you are carrying both then pressing the key again will switch between them.
So when you do a bind like E=pipedswitchweapon 5 | pipedswitchweapon 7 you need to think that really what you are going to get is slightly more complex as I will quickly explain.
The whole principal will work on what you have set in your weapon prioraty listing. if your Flak Cannon is higher than the Grenade Launcher you will get Link Gun -> Flak Cannon -> Link Gun.
However if the Grenade Launcher is higher than the Flak Cannon you will get Link Gun -> Grenade Launcher -> Link Gun.
Obviously if you are only carrying one of the two weapons it will choose that weapon.

Unfortunately there is not a way round this I know of. However you can bind exact weapons to keys by using the following:
E=getweapon XWeapons.FlakCannon

The Weapons are as follows:
XWeapons.Redeemer
XWeapons.Painter (Ion Painter)
OnslaughtFull.ONSPainter (Target Painter)
XWeapons.RocketLauncher
XWeapons.FlakCannon
XWeapons.SniperRifle
Onslaught.ONSGrenadeLauncher
XWeapons.Minigun
UTClassic.ClassicSniperRifle
Onslaught.ONSAVRiL
XWeapons.LinkGun
XWeapons.ShockRifle
Onslaught.ONSMineLayer
XWeapons.BioRifle
XWeapons.AssaultRifle
XWeapons.ShieldGun
XWeapons.Translauncher

There is a use for both of the weapon select commands. For eg the following:

Enter=getweapon Onslaught.ONSGrenadeLauncher | altfire | onrelease switchtolastweapon

This is a clever binding (alias39) I use. As you are aware you need to explode the grenades using the alternate fire after you have shot them. OK so you are thinking so what. I use the grenades on vehicles that are on their spawn spots and walk off. The common sense would be not to destroy the vehicle but cripple it or place it in a state where you will destroy it with players inside it. Destroying a vehicle on its spawn is silly as seconds later it will respawn with full health and not give you an advantage. Ok so now I have my grenades attached to a Goliath and have been off fighting. There is two things that could happen now, you could be killed in which the grenades explode anyway. The clever way is you see the vehicle in motion you press your clever alias key.
So why is it clever? Well as you have been off fighting you will not be on the Grenade Launcher. You have to switch to it before pressing the alternate fire. Then switch back to another weapon to carry on fighting. My alias does all that for me.

This is how it is used and what it does if it is not already obvious.
Pressing and holding Enter Switches direct to the Grenade Launcher, explodes the grenades and then when u release the key it goes back to using whatever weapon was last in use.

Aliases[39]=(command="switchweapon 4 | switchweapon 3 |switchweapon 7 | switchweapon 8 | switchweapon 6",Alias="rubattle")
End=rubattle
This alias is a simple best weapon script. Yes I know the game has a best weapon facility already but it does it with ALL weapons in the order of how you have them set. My script does it with a few weapons I like to use in battles. I have three keys with various settings which suit different maps. I also have a few for situations like taking out a raptor, shooting vehicles and so on.

Naut

Terror
20 Jan 2006, 17:33
Hey Naut

Howsit mate

I have been struggling with something. I see you posted that there is an alias called "ZOOM" which switches FOV.

Can you please paste the correct user.ini alias command here for me for the following combo.

I want to have it so that when I switch to my LGun it goes to FOV 80 and when I change to another gun it goes to 105 again.