I have attempted a few different methods for about 5 hours to figure out how to correctly switch weapons using the mouse wheel up or down, and nothing seems to be working correctly. Here is what I have done so far using variables that has worked the best, but still is messed up:
I have a global variable named "Current Weapon". I have 6 different weapon types for my player. Each weapon is essentially tied to 0 through 5 on the "Current Weapon" variable. Each weapon type has global variables as well for ammo on each weapon.
I have one event that does - on mouse wheel up AND Current Weapon less than or equal to 4 - add 1 to Current Weapon
Another event does - on mouse wheel down AND Current Weapon greater or equal to 1 - subtract 1 from Current Weapon
Other events tie the text on screen to which weapon you have scrolled to as long as there is ammo still for that particular weapon. I have a text box used to display what weapon you have scrolled to, and switches as you scroll on the mouse. When you run out of ammo, the text will no longer display with that weapon anymore. But there is still a placeholder or empty slot now when you scroll up or down on the mouse wheel for that weapon and what I have not been able to figure out is how to get the system to only allow me to scroll to those weapons that still have ammo.
This all works and everything as long as I don't run out of bullets for each type, but as soon as I run out the system is essentially scrolling to an empty slot. Practically this jacks up the gameplay since when you are scrolling fast on the mouse wheel trying to get to the next gun and you scroll past the weapon with ammo.
Can someone maybe redirect me to a different method because I cannot see how variables will work correctly for what I am trying to do? It is quite difficult to explain this all in words, but hopefully someone can get the gist of what I am trying to explain.
FYI, recently moved so I don't have internet access on my home PC yet or I would upload some screenshots.