For instance, the Link Gun in UT has an alt fire of a beam.
If you are creating a Custom weapon you can access this functionality quite easily.
Note that there are other ways to do this (such as creating your own exec function for the "DefaultInput.ini" file to refer to). This allows you to access alt-fire without modifying anything other than your own Custom Weapon Class.
You will need to work with:
- Your Weapon script
- PlayerController.uc
- Pawn.uc
- Weapon.uc
- DefaultInput.ini
TL;DR
You will go to your weapon and overwrite the function:
- simulated function StartFire(byte FireModeNum)
So you can have functionality execute or not execute depending on the 0 or 1 value.
SOME EXPLINATION
If you check out the UDK\UDKGame\Config\DefaultInput.ini, you can scroll around until you find the player input for alt fire:
- .Bindings=(Name="GBA_AltFire",Command="StartAltFire | OnRelease StopAltFire")
This means in the PlayerController script this function get's called.
When we check out the script ourselves we see that it then calls:
- Pawn.StartFire( FireModeNum );
- Weapon.StartFire(FireModeNum);
...which is what we took advantage of.
Do you see? By tracing the desired info from the input we were able to find the scripts related to our result and utilize the fuck out of the necessary functions.
This can be a good way to debug your UDK designs (that is, to find out what is going on this huge system).