Need help with some sort of ammo system based on MP?

Hello!

So, in my game, the character has a wide array of firearms available. Right now, for the ammunition, I'm using the char's MP value.

I made it so ammo items give back a certain amount of MP, and also made different "types" of ammo. As in pistol ammo, shotgun ammo, etc...

Now, each weapon has a different max MP value (the magazine size). For example, my Pistol has 10, but my shotgun has 5. I made it so that, when pistol is equipped, max MP changes to 10, when shotgun is equipped, it changes to 5.

Now, my problem here is, even tho' I made the items that give back ammo only compatible with the right firearm, my player would have no problem equipping the pistol, refilling it's ammo using the pistol ammo item, and then equipping the shotgun, that would now have full ammo aswell, despite him not filling it with shotgun ammo, since the now filled up MP points will just carry over.

Is there a way to make it so this doesn't happen? I hope this is not too confusing, but I basically want to make it so the game remembers how much ammo was in each weapon, and prevent the player to "cheat" by filling up his pistol to get free shotgun ammo.

I'm pretty sure I can do this with variables, but my brain is frying right now lol. I could also do a full on ammo system ONLY with variables, I know, but I'd really like to use the char's MP instead, if that's possible at all.

For further clarification, my combat is text based (with some dice rolls variables here and there) and works fully with events, so I won't be using the game's combat system at all.

Thanks a lot!
Hello!

So, in my game, the character has a wide array of firearms available. Right now, for the ammunition, I'm using the char's MP value.

I made it so ammo items give back a certain amount of MP, and also made different "types" of ammo. As in pistol ammo, shotgun ammo, etc...

Now, each weapon has a different max MP value (the magazine size). For example, my Pistol has 10, but my shotgun has 5. I made it so that, when pistol is equipped, max MP changes to 10, when shotgun is equipped, it changes to 5.

Now, my problem here is, even tho' I made the items that give back ammo only compatible with the right firearm, my player would have no problem equipping the pistol, refilling it's ammo using the pistol ammo item, and then equipping the shotgun, that would now have full ammo aswell, despite him not filling it with shotgun ammo, since the now filled up MP points will just carry over.

Is there a way to make it so this doesn't happen? I hope this is not too confusing, but I basically want to make it so the game remembers how much ammo was in each weapon, and prevent the player to "cheat" by filling up his pistol to get free shotgun ammo.

I'm pretty sure I can do this with variables, but my brain is frying right now lol. I could also do a full on ammo system ONLY with variables, I know, but I'd really like to use the char's MP instead, if that's possible at all.

For further clarification, my combat is text based (with some dice rolls variables here and there) and works fully with events, so I won't be using the game's combat system at all.

Thanks a lot!
If you want different kinds of ammo for different weapons, and for those weapons to only use that type of ammo, just using MP isn't going to cut it, I'm afraid. That's a single resource with no other defining features, so as you said there's no difference between a pistol and a shotgun using MP, it's coming from the same pool.

You could use a plugin that allows for on-equip effects that sets MP to a saved value, but at that point you're as well just using variables.
while it is theoretically possible to handle this by eventing (especially since your combat is also evented), that would get extremely tedious and headache-inducing the more different types of ammo you use - because the MP was never designed that way.

I strongly suggest you look for an ammo-type plugin (or more general a skill-cost-type plugin) where you can declare items to be the cost of the skill, and then use different bullet items for this.

That might require you to learn some javascript but it would still be easier than the alternative.
https://sirlegna.itch.io/sir-legnas-plugin-generator SirLegna has an ammo data plugin.
Indeed I think I'll have to work with variables after all... It's just so annoying to set up 😛

Right now this is what my "battle" event with a first type of enemy looks like. As you can see, the only "attack" is the "Tir" option (it means shoot). When he selects shoot, and he has MP available, it plays the pétoire event, that basically is just a 0-10 random variable, do determine how many damage he'll do.

1708859578464.png


Now the reason why I think it'll be a hassle with variables, is because the main battle window shows his ammo (Variable 2, ammo = Viktor's MP)

Correct me if I'm wrong, but if I want to make this ammo shenanigan fully variable based, I would have to make as many conditionnal branches as I have weapons, depending on wich one is equipped, and show this stat window in each one, yes?
in such a case you should not use MP at all.
use a variable directly, or make the bullets into items of different type.

you don't have to use MP if you're using variables that way.
Yeah, I guess I'll have to go with Variables... And in my combat event, just have a conditional for each weapon.

But how do I make it so that the player doesn't go over the magazine limit when he reloads?

Should I make a conditional for each amount of bullet left? For exemple, his first gun has a 7 bullet magazine. The item to refill this, is a magazine, that refills 7 bullets immediately. But now, suppose he wants to reload when he still has one bullet left? Or two?

I'll have to make a condi/variable for each right? As in " if bullet left = 1, then fill 6, if bullet left = 2, fill 5" etc? Or is there a more handy way I don't know about?
But how do I make it so that the player doesn't go over the magazine limit when he reloads?
that is why I suggested to go with items.

have different magazines that on use call a specific event that creates a number of bullets up to the magazine maximum, and you don't need to check the limit in your combat at all but only in the common events that creatwe the bullets.
that is why I suggested to go with items.

have different magazines that on use call a specific event that creates a number of bullets up to the magazine maximum, and you don't need to check the limit in your combat at all but only in the common events that creatwe the bullets.
Mhh... I'm having trouble understanding what you're trying to say...

So let's say the Weapon "Glock" uses pistol ammo. It has max 12 bullets. And let's say the weapon "pump action" uses shotgun ammo, and has max 5 rounds.

What items would you create here? 1 Glock magazine with a max of 12? How would I set a max? And so, everytime the player shoots, -1 item?

And how would it work if the player finds bullets in the map, that he could add to the magazine when he wants to?
Mhh... I'm having trouble understanding what you're trying to say...

So let's say the Weapon "Glock" uses pistol ammo. It has max 12 bullets. And let's say the weapon "pump action" uses shotgun ammo, and has max 5 rounds.

What items would you create here? 1 Glock magazine with a max of 12? How would I set a max? And so, everytime the player shoots, -1 item?

And how would it work if the player finds bullets in the map, that he could add to the magazine when he wants to?
So are you saying that you could have weapons that use the same ammo type but have different magazine sizes?
So are you saying that you could have weapons that use the same ammo type but have different magazine sizes?
Yes...? ;-;

For exemple, I have (atm) 2 pistols, one with a 7 bullet magazine, and one with 12. Then I was planning of adding a shotgun (that would use shotgun ammo), and also a magnum.
You'd probably want to use a meta tag for that on the weapon, then, like <magsize:7> and then reference that in the event that reloads them.
Is this doable with just the base game?

I'm startin' to feel discouraged and I'm just gonna stick to one weapon type lol
It would be doable with the base engine, yes. Though it would need some "script" commands.
the meta command is described in MV's helpfile as part of the plugin specifications, but it can be used without any plugin in the script box of an event (common event for example)

and then you just set the number of bullet items to that number when using reload
the meta command is described in MV's helpfile as part of the plugin specifications, but it can be used without any plugin in the script box of an event (common event for example)

and then you just set the number of bullet items to that number when using reload
I'm using MZ boss! You had me scared, I thought I posted on the wrong section, but no...

I did a control+F search for "Meta" in the helpfiles, but found nothing...

I think I'm going to resort to using only one type of ammo, and go with MP, because all the rest seems overly complicated for my smoll brain :')

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-some-sort-of-ammo-system-based-on-mp.166146/