Hello and good day.
I have come across a conundrum with my project.
In my game, there is a shop where players can buy food. Now, these food items--as per my envisioning--provide different kinds of buffs that may aid the player. For instance, a "Boar Soup" can heal a character's HP by 15% and has an added effect of boosting the entire party's defense by 5% for a specific amount of battles.
Now, my question is: How do I implement this in MV? I can make the item, but when it comes to actually having that "for a specific amount of battles" part, I have no idea where to go. I thought about using variables and events, but then wondered how I would count it at specific intervals.
Also, how do I limit it so that the player can only eat these food once then would have to wait until a battle ends before they can eat again?
Thank you (in advance) for any help that may be provided with this.
Each item like this would need to call a common event where you set 2 variables to either win count or battle count(control variables->game data->other) then add to one variable the number of battles you want the effect to last. You can either set these items to only be used in menu or check if one variable is equal to the other then the player gets a message that they can't eat again.
1 is to count the number of battles at the use of the item, 2nd one is for the number of battles to end the effect.
No because the game data battles will count total number of battles for the entire save file.
So, what I would have to do in order would be:
1. Create the Item in the Item Database. Make it a Regular, Consumable Item that can only be used in the Menu Screen.
2. Create the State that would increase the party's parameter by a certain amount/percentage.
3. Create the Common Event that would set the variables for the Current Battle Count (Variable 1) and Battle Count Limit (Variable 2) then count the number of battles by a conditional branch (am I getting this right?) and keeping the state active using this as well.
4. Add the State to the Item itself by choosing under effects "Other" and selecting the Common Event
Is that how it's supposed to go?
The state can be added through the item itself if you want, just make sure the state doesn't have removal conditions. You wouldn't need a conditional branch for each value of the variables, just a check to see if variable 1=variable 2. Everything else looks good though.
If you aren't sure what went wrong, please post screenshots of the items and events you have so far.
Then we can help you checking them.
You need to set variable 2 to battle count + the number of battles you want the effect to last.
Use 2 control variable commands, control variables (2)=battle count
control variables (2)+5
Why do I need to add 5 to the second variable (in this case, End of Battle variable)?
I'm really sorry about this but this has gotten me all confused.
Additionally, you got the parameter mathematics wrong.
Do you see the multiplication sign on the parameter you're using?
Defense * 5%
Defense (and attack, and the other main parameters) have multiplicative traits, not additive (like some others).
That is why they always start with a 100% - multiplying with 100% is no change.
Giving a buff of 5% therefore needs a multiplication with 105% - if you multipy with 5%, you don't give a buff, you reduce the defense to almost nothing (5% of the original value)
And about the battlecount: that count goes continually up, after hours of playing it will be into the hundreds.
You need to store the current number of battles when the item is used, and end the effect when another current count (checked in troop) is five numbers higher.
To that effect, your end variable needs to be five higher than the battlecount at the moment the item is used.
You cannot set the end-variable (decide when to stop the buff) in the same event that checks it.
When the item is used, one event needs to set the end counter to "current number of battles (=completed battles of the past) + five (=number of next battles where it should be active)".
Then you need a different event for checking the (then) current number of battles to compare it with that end number to see if those five battles had already happens.
One way to check that would be in every troop event, but if you're using evented battles it would be better to call that check before the battle processing command.
But anyway, that check cannot be in the same common event that is called by the item, because at that time the additional battles have not yet happened.
you need two commands for that.
1) control variable 2 set to variable 1
2) control variable 2 add constant 5