intended behaviour or game bug ?


(senator) #1

I have a script to toggle between weaponbank 2 and 3 which works flawless in most cases but sometimes produces strange results for rifle nades and the silenced covops pistol. The problem: sometimes when I attach a rifle nade instead of switching to the pistol the rifle nade is removed from the rifle or the silenced pistol unsilenced. I can safely reproduce this behaviour, usualy every third or forth time when I try to switch from rifle with nade loaded to pistol it wont change the weapon and than the next time I press space the nade is removed from the rifle.

The same can be reproduced without my scipt by simply loading the rifle with a nade and than presssing ‘3’ two times… and the rifle nade is again removed form the rifle.

This is pretty annoying if I want to switch to my pistol because I dont have the necessary energy to fire the rifle nade but instead have to watch the rifle-nade-removal-animation… which is usually followed by the you-are-dead animation ;(

OK, here is my script:

set wpn2 "set nextwpn23 vstr wpn3; set curwpn vstr wpn2; weaponbank 2"
set wpn3 "set nextwpn23 vstr wpn2; set curwpn vstr wpn3; weaponbank 3"
set nextwpn23 "vstr wpn2"
set curwpn "vstr wpn3"
bind SPACE "vstr nextwpn23"
 

As we now know ordering ‘weaponbank3’ two times while holding a loaded rifle will remove the nade so sometimes the SET commands in my script have to fail in alternating between weaponbakn2 and 3 to reproduce the ‘remove nade’ effect. The only way I can imagine this to happen is if for some reason (for example if I press SPACE during the weapon-cycle animation) the content of my variables is changed but the following weaponbank order ignored. Is there any way to ensure that the variable content is only changed if the weaponbank order can be executed (I already tried to place weaponbank at the beginning of my wpn2 and wpn3 var)? Or can at least the ‘pressing-3-two-times-will-remove-rifle-nade’ thingy be removed (Shrub/ETPro?)?
That would really help a lot :slight_smile:


(pgh) #2

Confused

Rifle Nades with Silenced Pistol?

set wpn2 "weaponbank 2;set wpn vstr wpn3" 
set wpn3 "weaponbank 3;set wpn vstr wpn2" 
set wpn "vstr wpn2"
bind x "vstr wpn"

Might do?


(senator) #3

No, not rifle nades WITH silenced pistoles but the bug applies to both, because both are ‘activated’ with the secondary fire mode, so you hit sec. fire to attach the rifle nade or to remove the silencers, sec. fire again to remove the rifle nade or reattach the silencer. but it’s at least an undocumented ‘feature’ that you can also trigger this (removing the rifle nade or the silencer) by pressing the key for this weaponbank (3 for the rifle, 2 for the pistol) again. And if it was intended it’s certainly inconsistent that the rifle nades or the silencer can’t be reattached this way, that can only be done using the sec. fire mode again.

I think a perfect solution would be if the only way to remove the rifle nade or the silencers would be the use of the sec. fire mode.

And the set curwpn in my script is needed so that I can return from any weaponbank directly to my last used primary weapon (SMG or pistol), it shouldn’t be part of the problem :slight_smile:


(Kendle) #4

I think the problem may be that ET won’t let you swap out a weapon that’s in it’s “alternate” weapon mode (i.e. Pistol with Silencer fitted, Rifle with 'Nade fitted, etc.). However, as I don’t play either role I can’t say I’ve noticed.

This might therefore work, in that it does a weapalt prior to switching weapons, but only if you’re in alternate weapon mode already. If not it just switches weapon as normal. To make this work it needs to know when you’re in alternate weapon mode, so you need to replace x in the script below with whatever key you currently use for weapalt.


set wb-2 "set wb-t vstr wb-3; vstr w-alt; weaponbank 2"
set wb-3 "set wb-t vstr wb-2; vstr w-alt; weaponbank 3"
set wb-t "vstr wb-2"
bind SPACE "vstr wb-t"

set alt-on ""
set alt-of "weapalt"
set w-alt "vstr alt-on"

set w-alt-on "set w-alt-t vstr w-alt-of; weapalt; set w-alt vstr alt-of"
set w-alt-of "set w-alt-t vstr w-alt-on; weapalt; set w-alt vstr alt-on"
set w-alt-t "vstr w-alt-on"
bind x "vstr w-alt-t"


(senator) #5

No, the weaponalt stat wont help me because I don’t want to change it! It is no problem to attach a rifle nade and than switch to the pistol and later back to your rifle still with a nade attached.

The problem is: ET ignores orders if it cant execute them immediately, press 2 and 3 really fast to switch between pistol/rifle and you’ll notice that ET discards most of your pressed keys because it wont continue to switch weapons for the next minute, the input therefore isn’t buffered. But in combination with the “double press weaponbank to remove nade” issue you run into problems. Try it, spawn as engineer and attach a nade, that alternate between pistol and rifle slowly by pressing 2 / 3. No problem. Now, do the same but press 2/3 quickly to alternate between pistol/rifel and you’ll get the remove rifle nade animation, ET has probably somewhere inbetween dropped a ‘change to weaponbank 2’ event and is now executing the ‘weaponbank 3’ command while holding a rifle with a nade… and is promptly removing the nade.

Now, the problem is that if ET dropps such a ‘weaponbank’ command it still executes the SET commands in my scipt so my VARS now hold the value that the current weapon is the pistol while infact my current weapon still is the rifle. Therefore the next command in my script will be ‘change to weaponbank 3’ but as I am already at weaponbank 3 the nade will be removed instead.


(Kendle) #6

Clutching at straws here, try adjusting cg_weaponcycledelay in your config. Set this to a high value (>200 - 300) and it should carry out the instruction to switch to weaponbank 2 before attempting to switch to weaponbank 3, and vice versa. Although I think you would still have the same problem if either weapon were out of ammo. ET won’t change to a weapon that has no ammo, not matter how slowly you press the keys.

As this toggle only switches between 2 weapons wouldn’t it just be simpler to have a key bound to each? I’ve long since stopped using scripts like this because they can be more trouble than they’re worth. It’s striaght key binds all the way for me now, with my Class selection script the only one I still use.


(DarkangelUK) #7

Or don’t switch really fast? I mean, i’ve been a few situations, but not running around with my riflenade primed then for some reasons pressed pistol then rifle really quickly. Why would you? Also, your script seems unnecessarily long. Pgh’s seems more right. The reason it could be missing vars is cos there’s too many there, try PGH’s streamlined version.


(DarkangelUK) #8

k i tested Pgh’s script, and it took a fair ole bashing of the button but it eventually did the altweap thingy. I did as kendle suggested and dropped cg_weaponcycledelay to 100 and it worked fine. Only furious button bashing got it to happen. Dropped to 50 and nothing, works a treat.


(senator) #9

It usually happens if you load a nade only to realize that you dont have enough energy to fire it and want to switch to your pistol instead. If you try to swap your weapons (press SPACE in my script) during this animation nothing will happen, ET won’t switch to weaponbank2 after it has finished loading the rifle nade yet my VAR is set to pistol. Than if I try again to swap my weapons, my script tries to swap back to rifle and the described bug(?) results in my removing the nade again.

So all I have to do is control myself not to swap to early to my pistol and wait for the nade loading animation to finish before I swap… easy said but its really hard to control yourself if you are under fire and want your pistol ASAP to defend yourself.

Also, your script seems unnecessarily long.
As I said earlyer: “And the set curwpn in my script is needed so that I can return from any weaponbank directly to my last used primary weapon (SMG or pistol), it shouldn’t be part of the problem”

So pgh’s script will do the trick but hasn’t the additional functionality I need :slight_smile:


(DarkangelUK) #10

Did you try dropping the cg_weaponcycledelay?

w00t 100 posts \o/


(senator) #11

I’ve set “seta cg_weaponcycledelay "50"”, saw no visual difference ingame and the bug still happens :frowning:

I tried weaponcycledelay 200 and 300… the same result.

The really annoying part is that the game finishes its sticking-nade-on-rifle animation (I’ve tried the axis rifle) and the player model holds the rifle as if it finished the procedure yet the block to switch back to the pistol holds on for another 1-2 seconds. So it’s really hard to judge when it’s safe to use my script to switch to the pistol :frowning: