UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Weapon Switching Fix With Scroll Wheel Help

broken avatar :(
Created 10 years ago
by jbird
0 Members and 1 Guest are viewing this topic.
2,661 views
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
×
jbird's Groups
I am working on a "fix" for using the scroll wheel to switch weapons. This was inspired by Overwatch. In Overwatch when you switch weapons with the scroll wheel, there is some short amount of delay before you can switch weapons again which allows to be able to use the entire scroll wheel without worrying about switching back to the same weapon.

Here is my implementation so far but it is not working properly yet.

Code Snippet
Plaintext
weapon_switch_fix()
{
self endon("disconnect");
wep = undefined;
while(1)
{
if(self isSwitchingWeapons())
{
while(wep == self GetCurrentWeapon() && self isSwitchingWeapons())
{
if(wep != self GetCurrentWeapon())
break;
weps = self GetWeaponsList();
for(i=0; i<weps.size; i++)
{
if(wep != weps[i] && !is_player_placeable_mine(weps[i]))
{
self switchToWeapon(weps[i]);
}
}
wait .05;
}
self DisableWeaponCycling();
wait .5;
self EnableWeaponCycling();
}
wait .05;
wep = self GetCurrentWeapon();
}
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
Signature
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
You could try something similar but use the weapon_change and weapon_change_complete notifes?

Something like:

Code Snippet
Plaintext
weapon_switch_fix(){
while(1){
self waittill("weapon_change");
self DisableWeaponCycling();
self waittill("weapon_change_complete");
self EnableWeaponCycling(  );
}
}
Last Edit: September 14, 2016, 12:32:23 pm by MakeCents
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 13 May 2014
Last active: 5 days ago
Posts
167
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
×
jbird's Groups
You could try something similar but use the weapon_change and weapon_change_complete notifes?

Something like:

Code Snippet
Plaintext
weapon_switch_fix(){
while(1){
self waittill("weapon_change");
self DisableWeaponCycling();
self waittill("weapon_change_complete");
self EnableWeaponCycling(  );
}
}

It still doesn't work. The problem seems to be it doesn't catch that I have switched weapons the exact frame that I do start switching weapons, so I am still able to switch weapons for a few frames. I don't know if there is any way to fix that.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 14 September 2013
Last active: 6 years ago
Posts
1,895
Respect
Forum Rank
Zombie Destroyer
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
BE ORIGINAL
×
MakeCents's Groups
Mapper Has released one or more maps to the UGX-Mods community.
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
what about replacing the waittill weapon change with a while(self getcurrentweapon() == weapon) initialize the weapon var, then update it after each enable.... with a .05 wait?

edit: maybe add a && !isswitching to the while loop. If that don't catch it, I'm not sure what will
Last Edit: September 14, 2016, 07:23:05 pm by MakeCents

 
Loading ...