Weaponswitch Script
Virushunter
Join Date: 2004-04-11 Member: 27845Members
<div class="IPBDescription">I know Q3 but no HL</div> Hi,
I tried to make a weapon switching script tat allowed me to leap to someone and switch to bite with the same button. I am familliar with Q3 engine scripting and i noticed it is pretty much the same as the HL engine i thought it would work:
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
set d1 "slot1; bind ctrl vstr d2"
set d2 "slot3; bind ctrl vstr d1"
bind n "vstr d1"
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
But on execing it it tells me it doesn't recognise the set command.
Does anyone know how to fix this?
I tried to make a weapon switching script tat allowed me to leap to someone and switch to bite with the same button. I am familliar with Q3 engine scripting and i noticed it is pretty much the same as the HL engine i thought it would work:
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
set d1 "slot1; bind ctrl vstr d2"
set d2 "slot3; bind ctrl vstr d1"
bind n "vstr d1"
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
But on execing it it tells me it doesn't recognise the set command.
Does anyone know how to fix this?
Comments
set d2 "slot3; bind ctrl vstr d1"
bind n "vstr d1"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
should be
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->alias d1 "slot1; bind ctrl d2"
alias d2 "slot; bind ctrl d1"
bind n "d1"<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
try that <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->
lamer.
<!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
alias d1 "weapon_leap; alias d3 d2"
alias d2 "weapon_bitegun; alias d3 d1"
alias d3 "d1"
//bind <key> d3
<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
Also the use of the third alias will let you bind it to any key without having to change the aliases.
lamer. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
no, what you are saying there is impossible with HL scripting. he just wants a cyclic weapon switch script, which is easy. i don't think the one i posted does that exactly (or at least not in any useful way i can see) but i'm showing him how to catch a fish, i'm not catching it for him <!--emo&;)--><img src='http://www.unknownworlds.com/forums/html//emoticons/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif' /><!--endemo-->
lamer. <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
And no, it doesn't automaticly switch; he still has to press the button. It's pretty much the same as using lastinv.
no one questions what models you use. thats potentially the same thing. we dont ask "Why dont you jsut use the defaults?"
Guess what, weaponcycle doesnt work...
Work's when i tested it. :/
alias +leap2 "slot3; wait; +attack"
alias -leap2 "-attack; slot1"
bind q +leap2
(hud_fastswitch must be 1)
That is what I use <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->
Its not that hard to find a scripting tutorial, why can't people just learn themselves instead of asking everyone else <!--emo&:angry:--><img src='http://www.unknownworlds.com/forums/html//emoticons/mad.gif' border='0' style='vertical-align:middle' alt='mad.gif' /><!--endemo-->
Erm, Urd ur sig, the [NSA] part....is that a clan?
Oh well. Spritz your script is useless, suppose i jump over someone, i don't want to bite then, especially if i got focus.
Does anyone know what are the weapon commands for Swipe and Blink? The keys to switch between these are too remote from my controls to quickly switch, so a similar bind would be nice.
Thanks in advance.
Well said <!--emo&???--><img src='http://www.unknownworlds.com/forums/html//emoticons/confused.gif' border='0' style='vertical-align:middle' alt='confused.gif' /><!--endemo-->
Does anyone know what are the weapon commands for Swipe and Blink? The keys to switch between these are too remote from my controls to quickly switch, so a similar bind would be nice.
Thanks in advance. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
weapon_blink and weapon_swipe I think. I'm pretty sure that's right. By the way, I wrote a tutorial on scripting here which explains the basics of Half-Life scripting: <a href='http://www.unknownworlds.com/forums/index.php?showtopic=74222' target='_blank'>http://www.unknownworlds.com/forums/in...showtopic=74222</a>