Hey there,
so i'm fairly new to GML (although i have been messing about with game maker for a little while now) and i'm making a simple top down shooting game. The trick is that as you kill baddies you rack up a score, at certain score milestones you gain a new weapon. You keep your old weapon, so as you go along you build up a collection of weapons, you get the idea.
You press the number keys to choose weapons, it will switch object instance to the next gun with it's own sprite. You press 2 to choose your second weapon you unlock at say 400 points, 1 to go back to starting weapon, then 3 to choose the next weapon you unlock at say 400 points in the next room ect.
At the moment, i have a controller object for each weapon that acts as the ammo counter and HUD, but i just cant seem to get it to actually keep count of the ammo for each gun correctly. As it is the starting weapon works, the ammo controller draws the actual amount on screen and the gun stops firing at 0. I can change weapon too, aslong as i have the required points. However the ammo counter doesn't change on any weapon except the first so i have unlimited ammo for every other gun. It also wont go back to the starting weapon as i want, it keeps the second gun's ammo count. There are odd bugs like this that really are confusing me. This is after trying somebodies advice which changed it to a new system but made new problems.
Ive been researching these issues and how to implement weapon switching into GML but i've found few helpful results, although this forum did come up and is why i'm here
I've started another project to play with this idea and i have had some luck with only 2 weapons but i'm still struggling to get it down so i actually understand how to switch weapons in a game.
So tl:dr..
If anyone has created a weapon changing system in Game Maker before and has any advice for a learner, knows where to find information on the subject or if you know of a good tutorial for this sort of thing please post it for me, it would be greatly appreciated, i'm enjoying making my first proper game but a few issues are holding it back