Advertisement
emsixteen

alias/bind grouping

Aug 11th, 2010
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.55 KB | None | 0 0
  1. the idea of the example is to change the crosshair only while lg is being actually fired (could just as easily add in fov / sens changes to the alias as well)
  2.  
  3. //---------- eg 1 -------------------------
  4.  
  5. seta _GL "weapon 4;vstr _zFireOff"
  6. seta _RL "weapon 5;;vstr _zFireOff"
  7. seta _LG "weapon 6;vstr _zFireOn"
  8. seta _RG "weapon 7;vstr _zFireOff"
  9.  
  10. alias +zfire "+attack;vstr _x5" //sets crosshair style (_x5).
  11. alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
  12.  
  13. seta _zFireOn "bind mouse1 +zfire"
  14. seta _zFireOff "bind mouse1 +attack"
  15. //*********** the above works, BUT if you swap weapons as u hold fire -zfire doesn't trigger so you get stuck with the _cx5 crosshair
  16.  
  17.  
  18. //------------ eg 2----------------------
  19.  
  20.  
  21.  
  22. seta _GL "weapon 4;vstr _zFireOff"
  23. seta _RL "weapon 5;;vstr _zFireOff"
  24. seta _LG "weapon 6;vstr _zFireOn"
  25. seta _RG "weapon 7;vstr _zFireOff"
  26.  
  27. alias +zfire "+attack;vstr _x5" //sets crosshair style (_x5).
  28. alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
  29.  
  30. seta _zFireOn "bind mouse1 +zfire"
  31. seta _zFireOff "-zfire;bind mouse1 +attack"
  32.  
  33. //********the above version solves that problem, but now if you hold fire on lg, then change to another weapon (gaunt) then that will not fire until you let go of fire then press it again, as -zfire contains -attack which is being called as soon as you switch
  34.  
  35. //----------- eg 3 --------------------
  36. bind MOUSE1 "+zfire"
  37.  
  38. seta _GL "weapon 4;vstr _zFireOff"
  39. seta _RL "weapon 5;;vstr _zFireOff"
  40. seta _LG "weapon 6;vstr _zFireOn"
  41. seta _RG "weapon 7;vstr _zFireOff"
  42.  
  43. alias +zfire "+attack;vstr _x5" //sets crosshair style (_x5).
  44. alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
  45.  
  46. alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
  47.  
  48. seta _zFireOn "alias +zfire "+attack;vstr _x5" // THIS LINE DOES NOT WORK AS U THINK
  49. seta _zFireOff "alias +zfire +attack"
  50.  
  51.  
  52. //************* in the above version mouse1 is ONLY ever bound o +zfire
  53. The theory is when you change weapons now , the contents of +zfire will change, but it will never get confused changign weapons, as it will always do -zfire when u let go now, insted of mising that out and doing -atack instead as the mouse was rebound to +attack
  54.  
  55. but it fails to perform the desired crosshair change as _zFireOn only actually sets the alias +zfire to "+attack" then vstr _x5 runs a single time afterwards, not as part of an alias. as there is no grouping
  56.  
  57. //------------- eg 4------------------
  58.  
  59.  
  60. seta _GL "weapon 4;vstr _zFireOff"
  61. seta _RL "weapon 5;;vstr _zFireOff"
  62. seta _LG "weapon 6;vstr _zFireOn"
  63. seta _RG "weapon 7;vstr _zFireOff"
  64.  
  65. alias +zfire "+attack;vstr _x5" //sets crosshair style (_x5).
  66. alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
  67.  
  68. alias -zfire "-attack;vstr _cxStyle" //changes back to current default crosshair (_cxStyle).
  69.  
  70. seta _zFireOn "cl_noprint 1;exec zfire.cfg;cl_noprint 0"
  71. seta _zFireOff "alias +zfire +attack"
  72.  
  73. //******** this final version works but only because we have a seperate .cfg file called zfire.cfg that contains only
  74.  
  75. alias +zfire "+attack;vstr _x5"
  76.  
  77. this seperate file method is the only way to either bind to more than one thing in a script, or script to chnge an alias to do more than one thing in a sript.
  78.  
  79. if we had a way of doing grouping like ( ) or ' ' being different to " " or soemhting then everything could be nicely done in one file, with no hit on IO.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement